helics  2.8.1
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 (helics_message_object hmo) HELICS_NOTHROW
 
 Message (const Message &mess) HELICS_NOTHROW
 
Messageoperator= (const Message &mess) HELICS_NOTHROW
 
 ~Message ()
 
 operator helics_message_object () 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 *raw, int size)
 
Messagedata (const std::string &str)
 
Messagedata (const char *str)
 
Messageappend (const void *raw, int size)
 
Messageappend (const std::string &str)
 
const char * c_str () const
 
helics_time time () const
 
Messagetime (helics_time val)
 
MessagesetFlag (int flag, bool val)
 
bool checkFlag (int flag) const
 
int messageID () const
 
MessagemessageID (int newId)
 
helics_message_object release ()
 
void clear ()
 
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 ( helics_message_object  hmo)
inlineexplicit

construct from a helics_message 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 *  raw,
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().

◆ checkFlag()

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

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

References helics_true, and helicsMessageCheckFlag().

◆ data() [1/4]

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

get a pointer to the raw data field

References helicsMessageGetRawDataPointer().

◆ data() [2/4]

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

set the data from a c string pointer assume null terminated

References helicsMessageSetString().

◆ data() [3/4]

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

set the data from a string

References helicsMessageSetString().

◆ data() [4/4]

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

set the message data from a raw pointer and size

References helicsMessageSetData(), and size().

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

◆ 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(), helicsEndpointCreateMessageObject(), and helicsMessageFree().

◆ newMessageObject() [2/2]

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

generate a new message in a federate

References fed, helicsFederateCreateMessageObject(), and helicsMessageFree().

◆ operator helics_message_object()

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

cast to a helics_message 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()

helics_message_object 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 helicsMessageGetRawDataSize().

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]

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

get the time of the message

References helicsMessageGetTime().

◆ time() [2/2]

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

set the time the message should be scheduled for

References helicsMessageSetTime().


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