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>

Inheritance diagram for chrono::synchrono::SynMessage:

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()

chrono::synchrono::SynMessage::SynMessage ( unsigned int  source_id,
unsigned int  destination_id 
)
inlineprotected

Constructor.

Parameters
source_idthe id of the source to which the message is sent from
destination_idthe id of the destination to which the message is sent to

Member Function Documentation

◆ ConvertFromFlatBuffers()

◆ ConvertToFlatBuffers()

virtual FlatBufferMessage chrono::synchrono::SynMessage::ConvertToFlatBuffers ( flatbuffers::FlatBufferBuilder &  builder)
pure virtual

◆ GetDestinationID()

unsigned int chrono::synchrono::SynMessage::GetDestinationID ( )
inline

Get the id of the destination for this message.

Returns
unsigned int the destination id

◆ GetSourceID()

unsigned int chrono::synchrono::SynMessage::GetSourceID ( )
inline

Get the id of the source of this message.

Returns
unsigned int the source id

◆ SetSourceID()

void chrono::synchrono::SynMessage::SetSourceID ( unsigned int  source_id)
inline

Set the id of the source of this message.

Parameters
source_idunsigned 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