Description
Class handling the conversion from agent flatbuffer messages into C++ objects.
#include <SynAgentMessage.h>
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< SynAgentDescription > | GetDescription () |
Get the SynAgentDescription object. More... | |
void | SetJSON (const std::string &json) |
Protected Attributes | |
std::shared_ptr< SynAgentDescription > | m_description |
handle to the agent description | |
Constructor & Destructor Documentation
◆ SynAgentMessage()
chrono::synchrono::SynAgentMessage::SynAgentMessage | ( | int | rank, |
SynMessageType | type, | ||
std::string | json = "" |
||
) |
Construct a new SynAgentMessage object.
- Parameters
-
rank the rank of this message type stored as a member variable of all messages json optionally store a SynAgentDescription encoded as json
Member Function Documentation
◆ DescriptionFromMessage()
|
virtual |
Generates and sets the description of the agent from flatbuffer message.
Generate agent description from FlatBuffers message.
- Parameters
-
message the 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()
|
inline |
Get the SynAgentDescription object.
- Returns
- std::shared_ptr<SynAgentDescription> the description associated with this message
◆ MessageFromDescription()
|
pure virtual |
Generates a SynFlatBuffers::Message from the agent description.
- Parameters
-
builder the 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()
|
overridevirtual |
Generates and sets the state of this message from flatbuffer message.
- Parameters
-
message the 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