chrono::synchrono::SynMessage Class Referenceabstract

Description

SynMessage is the base class for all messages Basically wraps the FlatBuffer methods to better handle the SynChrono message passing system Uses a state struct and info struct to store data associated with the message passing Will be inherited from to create new message types.

#include <SynMessage.h>

Inheritance diagram for chrono::synchrono::SynMessage:

Public Member Functions

 SynMessage (int rank, SynMessageType type)
 Construct a new SynMessage object. More...
 
virtual ~SynMessage ()
 Destroy the SynMessage object.
 
virtual void StateFromMessage (const SynFlatBuffers::Message *message)=0
 Generates and sets the state of this message from flatbuffer message. More...
 
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

int m_rank
 rank of which sent or maintains this message
 
SynMessageType m_type
 type of which this message is
 

Constructor & Destructor Documentation

◆ SynMessage()

chrono::synchrono::SynMessage::SynMessage ( int  rank,
SynMessageType  type 
)
inline

Construct a new SynMessage object.

Parameters
typethe kind of message this object represents
rankthe rank of which the message was sent from

Member Function Documentation

◆ GetRank()

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

Get the rank from which this message originates.

Returns
unsigned int the rank from which this message originates

◆ GetState()

◆ GetType()

SynMessageType chrono::synchrono::SynMessage::GetType ( )
inline

Get the SynMessageType object.

Returns
Type the type of this message

◆ MessageFromState()

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

Generates a SynFlatBuffers::Message from the message state.

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

Implemented in chrono::synchrono::SynTrackedVehicleMessage, chrono::synchrono::SynSensorMessage, chrono::synchrono::SynWheeledVehicleMessage, chrono::synchrono::SynMAPMessage, chrono::synchrono::SynSPATMessage, chrono::synchrono::SynApproachMessage, chrono::synchrono::SynSCMMessage, and chrono::synchrono::SynEnvironmentMessage.

◆ StateFromMessage()

virtual void chrono::synchrono::SynMessage::StateFromMessage ( const SynFlatBuffers::Message *  message)
pure virtual

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