![]() |
helics
3.4.0
|
Functions for working with helics message envelopes.
void helicsMessageAppendData | ( | HelicsMessage | message, |
const void * | data, | ||
int | inputDataLength, | ||
HelicsError * | err | ||
) |
Append data to the payload.
message | The message object in question. | |
data | A string containing the message data to append. | |
inputDataLength | The length of the data to input. | |
[in,out] | err | An error object to fill out in case of an error. |
Referenced by helicscpp::Message::append().
void helicsMessageClear | ( | HelicsMessage | message, |
HelicsError * | err | ||
) |
Reset a message to empty state
message | The message object to copy from. |
The message after this function will be empty, with no source or destination
[in,out] | err | An error object to fill out in case of an error. |
void helicsMessageClearFlags | ( | HelicsMessage | message | ) |
Clear the flags of a message.
message | The message object in question |
HelicsMessage helicsMessageClone | ( | HelicsMessage | message, |
HelicsError * | err | ||
) |
Clone a message object.
message | The message object to copy from. | |
[in,out] | err | An error object to fill out in case of an error. |
Referenced by helicscpp::Message::operator=().
void helicsMessageCopy | ( | HelicsMessage | src_message, |
HelicsMessage | dst_message, | ||
HelicsError * | err | ||
) |
Copy a message object.
src_message | The message object to copy from. | |
dst_message | The message object to copy to. | |
[in,out] | err | An error object to fill out in case of an error. |
void helicsMessageFree | ( | HelicsMessage | message | ) |
Free a message object from memory
message | The message object to copy from. |
memory for message is managed so not using this function does not create memory leaks, this is an indication to the system that the memory for this message is done being used and can be reused for a new message. helicsFederateClearMessages() can also be used to clear up all stored messages at once
Referenced by helicscpp::Message::newMessageObject(), helicscpp::Message::operator=(), and helicscpp::Message::~Message().
int helicsMessageGetByteCount | ( | HelicsMessage | message | ) |
Get the size of the data payload in bytes.
message | The message object in question. |
Referenced by helicscpp::Message::size().
void helicsMessageGetBytes | ( | HelicsMessage | message, |
void * | data, | ||
int | maxMessageLength, | ||
int * | actualSize, | ||
HelicsError * | err | ||
) |
Get the raw data for a message object.
message | A message object to get the data for. | |
[out] | data | The memory location of the data. |
maxMessageLength | The maximum size of information that data can hold. | |
[out] | actualSize | The actual length of data copied to data. |
[in,out] | err | A pointer to an error object for catching errors. |
void* helicsMessageGetBytesPointer | ( | HelicsMessage | message | ) |
Get a pointer to the raw data of a message.
message | A message object to get the data for. |
Referenced by helicscpp::Message::data().
const char* helicsMessageGetDestination | ( | HelicsMessage | message | ) |
Get the destination endpoint of a message.
message | The message object in question. |
Referenced by helicscpp::Message::destination().
HelicsBool helicsMessageGetFlagOption | ( | HelicsMessage | message, |
int | flag | ||
) |
Check if a flag is set on a message.
message | The message object in question. |
flag | The flag to check should be between [0,15]. |
Referenced by helicscpp::Message::getFlagOption().
int helicsMessageGetMessageID | ( | HelicsMessage | message | ) |
Get the messageID of a message.
message | The message object in question. |
Referenced by helicscpp::Message::messageID().
const char* helicsMessageGetOriginalDestination | ( | HelicsMessage | message | ) |
Get the original destination endpoint of a message, the destination may have been modified by filters or other actions.
message | The message object in question. |
Referenced by helicscpp::Message::originalDestination().
const char* helicsMessageGetOriginalSource | ( | HelicsMessage | message | ) |
Get the original source endpoint of a message, the source may have been modified by filters or other actions.
message | The message object in question. |
Referenced by helicscpp::Message::originalSource().
const char* helicsMessageGetSource | ( | HelicsMessage | message | ) |
Get the source endpoint of a message.
message | The message object in question. |
Referenced by helicscpp::Message::source().
const char* helicsMessageGetString | ( | HelicsMessage | message | ) |
Get the payload of a message as a string.
message | The message object in question. |
Referenced by helicscpp::Message::c_str().
HelicsTime helicsMessageGetTime | ( | HelicsMessage | message | ) |
Get the helics time associated with a message.
message | The message object in question. |
Referenced by helicscpp::Message::time().
HelicsBool helicsMessageIsValid | ( | HelicsMessage | message | ) |
A check if the message contains a valid payload.
message | The message object in question. |
Referenced by helicscpp::Message::isValid().
void helicsMessageReserve | ( | HelicsMessage | message, |
int | reserveSize, | ||
HelicsError * | err | ||
) |
Reserve space in a buffer but don't actually resize.
The message data buffer will be reserved but not resized.
message | The message object in question. | |
reserveSize | The number of bytes to reserve in the message object. | |
[in,out] | err | An error object to fill out in case of an error. |
Referenced by helicscpp::Message::reserve().
void helicsMessageResize | ( | HelicsMessage | message, |
int | newSize, | ||
HelicsError * | err | ||
) |
Resize the data buffer for a message.
The message data buffer will be resized. There are no guarantees on what is in the buffer in newly allocated space. If the allocated space is not sufficient new allocations will occur.
message | The message object in question. | |
newSize | The new size in bytes of the buffer. | |
[in,out] | err | An error object to fill out in case of an error. |
Referenced by helicscpp::Message::resize().
void helicsMessageSetData | ( | HelicsMessage | message, |
const void * | data, | ||
int | inputDataLength, | ||
HelicsError * | err | ||
) |
Set the data payload of a message as raw data.
message | The message object in question. | |
data | A string containing the message data. | |
inputDataLength | The length of the data to input. | |
[in,out] | err | An error object to fill out in case of an error. |
Referenced by helicscpp::Message::data().
void helicsMessageSetDestination | ( | HelicsMessage | message, |
const char * | dst, | ||
HelicsError * | err | ||
) |
Set the destination of a message.
message | The message object in question. | |
dst | A string containing the new destination. | |
[in,out] | err | An error object to fill out in case of an error. |
Referenced by helicscpp::Message::destination().
void helicsMessageSetFlagOption | ( | HelicsMessage | message, |
int | flag, | ||
HelicsBool | flagValue, | ||
HelicsError * | err | ||
) |
Set a flag on a message.
message | The message object in question. | |
flag | An index of a flag to set on the message. | |
flagValue | The desired value of the flag. | |
[in,out] | err | An error object to fill out in case of an error. |
Referenced by helicscpp::Message::setFlag().
void helicsMessageSetMessageID | ( | HelicsMessage | message, |
int32_t | messageID, | ||
HelicsError * | err | ||
) |
Set the message ID for the message.
Normally this is not needed and the core of HELICS will adjust as needed.
message | The message object in question. | |
messageID | A new message ID. | |
[in,out] | err | An error object to fill out in case of an error. |
Referenced by helicscpp::Message::messageID().
void helicsMessageSetOriginalDestination | ( | HelicsMessage | message, |
const char * | dst, | ||
HelicsError * | err | ||
) |
Set the original destination of a message.
message | The message object in question. | |
dst | A string containing the new original source. | |
[in,out] | err | An error object to fill out in case of an error. |
Referenced by helicscpp::Message::originalDestination().
void helicsMessageSetOriginalSource | ( | HelicsMessage | message, |
const char * | src, | ||
HelicsError * | err | ||
) |
Set the original source of a message.
message | The message object in question. | |
src | A string containing the new original source. | |
[in,out] | err | An error object to fill out in case of an error. |
Referenced by helicscpp::Message::originalSource().
void helicsMessageSetSource | ( | HelicsMessage | message, |
const char * | src, | ||
HelicsError * | err | ||
) |
Set the source of a message.
message | The message object in question. | |
src | A string containing the source. | |
[in,out] | err | An error object to fill out in case of an error. |
Referenced by helicscpp::Message::source().
void helicsMessageSetString | ( | HelicsMessage | message, |
const char * | data, | ||
HelicsError * | err | ||
) |
Set the data payload of a message as a string.
message | The message object in question. | |
data | A null terminated string containing the message data. | |
[in,out] | err | An error object to fill out in case of an error. |
Referenced by helicscpp::Message::data().
void helicsMessageSetTime | ( | HelicsMessage | message, |
HelicsTime | time, | ||
HelicsError * | err | ||
) |
Set the delivery time for a message.
message | The message object in question. | |
time | The time the message should be delivered. | |
[in,out] | err | An error object to fill out in case of an error. |
Referenced by helicscpp::Message::time().