Description
SynMessage is the base class for all messages Basically wraps the FlatBuffer methods to better handle the SynChrono message passing system Will be inherited from to create new message types.
#include <SynMessage.h>
Public Member Functions | |
virtual | ~SynMessage () |
Destroy the SynMessage object. | |
virtual void | ConvertFromFlatBuffers (const SynFlatBuffers::Message *message)=0 |
Converts a received flatbuffer message to a SynMessage. More... | |
virtual FlatBufferMessage | ConvertToFlatBuffers (flatbuffers::FlatBufferBuilder &builder)=0 |
Converts this object to a flatbuffer message. More... | |
unsigned int | GetSourceID () |
Get the id of the source of this message. More... | |
void | SetSourceID (unsigned int source_id) |
Set the id of the source of this message. More... | |
unsigned int | GetDestinationID () |
Get the id of the destination for this message. More... | |
SynFlatBuffers::Type | GetMessageType () |
void | SetMessageType (SynFlatBuffers::Type msg_type) |
Public Attributes | |
double | time |
simulation time | |
Protected Member Functions | |
SynMessage (unsigned int source_id, unsigned int destination_id) | |
Constructor. More... | |
Protected Attributes | |
unsigned int | m_source_id |
id for the source which sent this message | |
unsigned int | m_destination_id |
id for the destination of this message | |
SynFlatBuffers::Type | m_msg_type |
Type of message that we contain. | |
Constructor & Destructor Documentation
◆ SynMessage()
|
inlineprotected |
Constructor.
- Parameters
-
source_id the id of the source to which the message is sent from destination_id the id of the destination to which the message is sent to
Member Function Documentation
◆ ConvertFromFlatBuffers()
|
pure virtual |
Converts a received flatbuffer message to a SynMessage.
- Parameters
-
message the flatbuffer message to convert to a SynMessage
Implemented in chrono::synchrono::SynTrackedVehicleDescriptionMessage, chrono::synchrono::SynWheeledVehicleDescriptionMessage, chrono::synchrono::SynSPATMessage, chrono::synchrono::SynApproachMessage, chrono::synchrono::SynEnvironmentMessage, chrono::synchrono::SynMAPMessage, chrono::synchrono::SynTrackedVehicleStateMessage, chrono::synchrono::SynWheeledVehicleStateMessage, chrono::synchrono::SynSCMMessage, and chrono::synchrono::SynSimulationMessage.
◆ ConvertToFlatBuffers()
|
pure virtual |
Converts this object to a flatbuffer message.
- Parameters
-
builder a flatbuffer builder to construct the message with
- Returns
- FlatBufferMessage the constructed flatbuffer message
Implemented in chrono::synchrono::SynTrackedVehicleDescriptionMessage, chrono::synchrono::SynWheeledVehicleDescriptionMessage, chrono::synchrono::SynSPATMessage, chrono::synchrono::SynApproachMessage, chrono::synchrono::SynEnvironmentMessage, chrono::synchrono::SynMAPMessage, chrono::synchrono::SynTrackedVehicleStateMessage, chrono::synchrono::SynWheeledVehicleStateMessage, chrono::synchrono::SynSCMMessage, and chrono::synchrono::SynSimulationMessage.
◆ GetDestinationID()
|
inline |
Get the id of the destination for this message.
- Returns
- unsigned int the destination id
◆ GetSourceID()
|
inline |
Get the id of the source of this message.
- Returns
- unsigned int the source id
◆ SetSourceID()
|
inline |
Set the id of the source of this message.
- Parameters
-
source_id unsigned int the source id
The documentation for this class was generated from the following file:
- /builds/uwsbel/chrono/src/chrono_synchrono/flatbuffer/message/SynMessage.h