helics  3.5.2
Public Member Functions | List of all members
helicscpp::Message Class Reference

Public Member Functions

 Message () HELICS_NOTHROW
 
 Message (const Federate &fed)
 
 Message (const Endpoint &ept)
 
 Message (HelicsMessage hmo) HELICS_NOTHROW
 
 Message (const Message &mess) HELICS_NOTHROW
 
Messageoperator= (const Message &mess) HELICS_NOTHROW
 
 ~Message ()
 
 operator HelicsMessage () const
 
bool isValid () const
 
const char * source () const
 
Messagesource (const std::string &src)
 
Messagesource (const char *src)
 
const char * destination () const
 
Messagedestination (const std::string &dest)
 
Messagedestination (const char *dest)
 
const char * originalSource () const
 
MessageoriginalSource (const std::string &osrc)
 
const char * originalDestination () const
 
MessageoriginalDestination (const std::string &odest)
 
int size () const
 
void resize (int newSize)
 
void reserve (int newSize)
 
void * data () const
 
Messagedata (const void *ptr, int size)
 
Messagedata (const std::string &str)
 
Messagedata (const char *str)
 
Messagedata (DataBuffer buffer)
 
Messageappend (const void *ptr, int size)
 
Messageappend (const std::string &str)
 
const char * c_str () const
 
HelicsTime time () const
 
Messagetime (HelicsTime val)
 
MessagesetFlag (int flag, bool val)
 
bool getFlagOption (int flag) const
 
int messageID () const
 
MessagemessageID (int newId)
 
HelicsMessage release ()
 
void clear ()
 
DataBuffer dataBuffer ()
 
MessagenewMessageObject (const Federate &fed)
 
MessagenewMessageObject (const Endpoint &ept)
 

Constructor & Destructor Documentation

◆ Message() [1/5]

helicscpp::Message::Message ( )
inline

default constructor

◆ Message() [2/5]

helicscpp::Message::Message ( const Federate fed)
inlineexplicit

create a message associated with a federate

◆ Message() [3/5]

helicscpp::Message::Message ( const Endpoint ept)
inlineexplicit

create a message associated with an endpoint

◆ Message() [4/5]

helicscpp::Message::Message ( HelicsMessage  hmo)
inlineexplicit

construct from a HelicsMessage object

◆ Message() [5/5]

helicscpp::Message::Message ( const Message mess)
inline

copy constructor

◆ ~Message()

helicscpp::Message::~Message ( )
inline

destructor

References helicsMessageFree().

Member Function Documentation

◆ append() [1/2]

Message& helicscpp::Message::append ( const std::string &  str)
inline

append a string to a message data field

References helicsMessageAppendData().

◆ append() [2/2]

Message& helicscpp::Message::append ( const void *  ptr,
int  size 
)
inline

append data to the message data field

References helicsMessageAppendData(), and size().

◆ c_str()

const char* helicscpp::Message::c_str ( ) const
inline

get a the data as a null terminated C string

References helicsMessageGetString().

◆ data() [1/5]

void* helicscpp::Message::data ( ) const
inline

get a pointer to the data field

References helicsMessageGetBytesPointer().

◆ data() [2/5]

Message& helicscpp::Message::data ( const char *  str)
inline

set the data from a c string pointer assume null terminated

References helicsMessageSetString().

◆ data() [3/5]

Message& helicscpp::Message::data ( const std::string &  str)
inline

set the data from a string

References helicsMessageSetString().

◆ data() [4/5]

Message& helicscpp::Message::data ( const void *  ptr,
int  size 
)
inline

set the message data from a pointer and size

References helicsMessageSetData(), and size().

◆ data() [5/5]

Message& helicscpp::Message::data ( DataBuffer  buffer)
inline

set the data a data buffer object

References helicscpp::DataBuffer::getHelicsDataBuffer(), and helicsMessageSetDataBuffer().

◆ dataBuffer()

DataBuffer helicscpp::Message::dataBuffer ( )
inline

get the data buffer from the message

References helicsMessageDataBuffer().

◆ destination() [1/3]

const char* helicscpp::Message::destination ( ) const
inline

get the message destination

References helicsMessageGetDestination().

◆ destination() [2/3]

Message& helicscpp::Message::destination ( const char *  dest)
inline

set the message destination

References helicsMessageSetDestination().

◆ destination() [3/3]

Message& helicscpp::Message::destination ( const std::string &  dest)
inline

set the message destination

References helicsMessageSetDestination().

◆ getFlagOption()

bool helicscpp::Message::getFlagOption ( int  flag) const
inline

check an indexed flag in the message valid numbers are [0,15]

References HELICS_TRUE, and helicsMessageGetFlagOption().

◆ isValid()

bool helicscpp::Message::isValid ( ) const
inline

check if a message_object is valid

References HELICS_TRUE, and helicsMessageIsValid().

◆ messageID() [1/2]

int helicscpp::Message::messageID ( ) const
inline

get the messageID

References helicsMessageGetMessageID().

◆ messageID() [2/2]

Message& helicscpp::Message::messageID ( int  newId)
inline

set the messageID field of a message object

References helicsMessageSetMessageID().

◆ newMessageObject() [1/2]

Message & helicscpp::Message::newMessageObject ( const Endpoint ept)
inline

generate a new message in a federate

References helicscpp::Endpoint::baseObject(), helicsEndpointCreateMessage(), and helicsMessageFree().

◆ newMessageObject() [2/2]

Message & helicscpp::Message::newMessageObject ( const Federate fed)
inline

generate a new message in a federate

References helicscpp::Federate::getObject(), helicsFederateCreateMessage(), and helicsMessageFree().

◆ operator HelicsMessage()

helicscpp::Message::operator HelicsMessage ( ) const
inline

cast to a HelicsMessage object

◆ operator=()

Message& helicscpp::Message::operator= ( const Message mess)
inline

copy assignment

References helicsMessageClone(), and helicsMessageFree().

◆ originalDestination() [1/2]

const char* helicscpp::Message::originalDestination ( ) const
inline

get the original message destination if a filter altered it

References helicsMessageGetOriginalDestination().

◆ originalDestination() [2/2]

Message& helicscpp::Message::originalDestination ( const std::string &  odest)
inline

set the original destination field

References helicsMessageSetOriginalDestination().

◆ originalSource() [1/2]

const char* helicscpp::Message::originalSource ( ) const
inline

get the original message source which may be different than source if the message was filtered

References helicsMessageGetOriginalSource().

◆ originalSource() [2/2]

Message& helicscpp::Message::originalSource ( const std::string &  osrc)
inline

set the original source field

References helicsMessageSetOriginalSource().

◆ release()

HelicsMessage helicscpp::Message::release ( )
inline

release a C message_object from the structure

for use with the C shared library

Referenced by helicscpp::Endpoint::sendMessageZeroCopy().

◆ reserve()

void helicscpp::Message::reserve ( int  newSize)
inline

reserve a certain amount of size in the message data field which is useful for the append operation

References helicsMessageReserve().

◆ resize()

void helicscpp::Message::resize ( int  newSize)
inline

set the size of the message data field

References helicsMessageResize().

◆ setFlag()

Message& helicscpp::Message::setFlag ( int  flag,
bool  val 
)
inline

set an indexed flag in the message

References HELICS_FALSE, HELICS_TRUE, and helicsMessageSetFlagOption().

◆ size()

int helicscpp::Message::size ( ) const
inline

get the size of the message data field

References helicsMessageGetByteCount().

Referenced by append(), and data().

◆ source() [1/3]

const char* helicscpp::Message::source ( ) const
inline

get the message source endpoint name

References helicsMessageGetSource().

◆ source() [2/3]

Message& helicscpp::Message::source ( const char *  src)
inline

set the message source

References helicsMessageSetSource().

◆ source() [3/3]

Message& helicscpp::Message::source ( const std::string &  src)
inline

set the message source

References helicsMessageSetSource().

◆ time() [1/2]

HelicsTime helicscpp::Message::time ( ) const
inline

get the time of the message

References helicsMessageGetTime().

◆ time() [2/2]

Message& helicscpp::Message::time ( HelicsTime  val)
inline

set the time the message should be scheduled for

References helicsMessageSetTime().


The documentation for this class was generated from the following files: