chrono::synchrono::SynAgentMessage Class Referenceabstract

Description

Class handling the conversion from agent flatbuffer messages into C++ objects.

#include <SynAgentMessage.h>

Inheritance diagram for chrono::synchrono::SynAgentMessage:
Collaboration diagram for chrono::synchrono::SynAgentMessage:

Public Member Functions

 SynAgentMessage (int rank, SynMessageType type, std::string json="")
 Construct a new SynAgentMessage object. More...
 
virtual void StateFromMessage (const SynFlatBuffers::Message *message) override
 Generates and sets the state of this message from flatbuffer message. More...
 
virtual void DescriptionFromMessage (const SynFlatBuffers::Message *message)
 Generates and sets the description of the agent from flatbuffer message. More...
 
virtual FlatBufferMessage MessageFromDescription (flatbuffers::FlatBufferBuilder &builder)=0
 Generates a SynFlatBuffers::Message from the agent description. More...
 
std::shared_ptr< SynAgentDescriptionGetDescription ()
 Get the SynAgentDescription object. More...
 
void SetJSON (const std::string &json)
 
- Public Member Functions inherited from chrono::synchrono::SynMessage
 SynMessage (int rank, SynMessageType type)
 Construct a new SynMessage object. More...
 
virtual ~SynMessage ()
 Destroy the SynMessage object.
 
virtual FlatBufferMessage MessageFromState (flatbuffers::FlatBufferBuilder &builder)=0
 Generates a SynFlatBuffers::Message from the message state. More...
 
SynMessageType GetType ()
 Get the SynMessageType object. More...
 
unsigned int GetRank ()
 Get the rank from which this message originates. More...
 
virtual std::shared_ptr< SynMessageStateGetState ()=0
 Get the SynMessageState object. More...
 

Protected Attributes

std::shared_ptr< SynAgentDescriptionm_description
 handle to the agent description
 
- Protected Attributes inherited from chrono::synchrono::SynMessage
int m_rank
 rank of which sent or maintains this message
 
SynMessageType m_type
 type of which this message is
 

Constructor & Destructor Documentation

◆ SynAgentMessage()

chrono::synchrono::SynAgentMessage::SynAgentMessage ( int  rank,
SynMessageType  type,
std::string  json = "" 
)

Construct a new SynAgentMessage object.

Parameters
rankthe rank of this message

Member Function Documentation

◆ DescriptionFromMessage()

void chrono::synchrono::SynAgentMessage::DescriptionFromMessage ( const SynFlatBuffers::Message *  message)
virtual

Generates and sets the description of the agent from flatbuffer message.

Generate agent description from FlatBuffers message.

Parameters
messagethe flatbuffer message to convert to a SynAgentDescription object

Cast from SynFlatBuffers::Message to SynFlatBuffers::Agent::Description

Reimplemented in chrono::synchrono::SynTrackedVehicleMessage, chrono::synchrono::SynWheeledVehicleMessage, and chrono::synchrono::SynEnvironmentMessage.

◆ GetDescription()

std::shared_ptr<SynAgentDescription> chrono::synchrono::SynAgentMessage::GetDescription ( )
inline

Get the SynAgentDescription object.

Returns
std::shared_ptr<SynAgentDescription> the description associated with this message

◆ MessageFromDescription()

virtual FlatBufferMessage chrono::synchrono::SynAgentMessage::MessageFromDescription ( flatbuffers::FlatBufferBuilder &  builder)
pure virtual

Generates a SynFlatBuffers::Message from the agent description.

Parameters
builderthe flatbuffer builder used to construct messages
Returns
flatbuffers::Offset<SynFlatBuffers::Message> the generated message

Implemented in chrono::synchrono::SynTrackedVehicleMessage, chrono::synchrono::SynWheeledVehicleMessage, and chrono::synchrono::SynEnvironmentMessage.

◆ StateFromMessage()

void chrono::synchrono::SynAgentMessage::StateFromMessage ( const SynFlatBuffers::Message *  message)
overridevirtual

Generates and sets the state of this message from flatbuffer message.

Parameters
messagethe flatbuffer message to convert to a MessageState object

Implements chrono::synchrono::SynMessage.

Reimplemented in chrono::synchrono::SynTrackedVehicleMessage, chrono::synchrono::SynWheeledVehicleMessage, and chrono::synchrono::SynEnvironmentMessage.


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono_synchrono/flatbuffer/message/SynAgentMessage.h
  • /builds/uwsbel/chrono/src/chrono_synchrono/flatbuffer/message/SynAgentMessage.cpp