![]() |
helics
2.8.1
|
Functions related to message federates for the C api. More...
#include "helics.h"
Go to the source code of this file.
Functions related to message federates for the C api.
HELICS_DEPRECATED_EXPORT void helicsEndpointClearMessages | ( | helics_endpoint | endpoint | ) |
Clear all message from an endpoint.
endpoint | The endpoint object to operate on. |
helics_message_object helicsEndpointCreateMessageObject | ( | helics_endpoint | endpoint, |
helics_error * | err | ||
) |
Create a new empty message object.
The message is empty and isValid will return false since there is no data associated with the message yet.
endpoint | The endpoint object to associate the message with. @forcpponly | |
[in,out] | err | An error object to fill out in case of an error. @endforcpponly |
Referenced by helicscpp::Endpoint::createMessage(), and helicscpp::Message::newMessageObject().
const char* helicsEndpointGetDefaultDestination | ( | helics_endpoint | endpoint | ) |
Get the default destination for an endpoint.
endpoint | The endpoint to set the destination for. |
Referenced by helicscpp::Endpoint::getDefaultDestination().
const char* helicsEndpointGetInfo | ( | helics_endpoint | end | ) |
Get the data in the info field of a filter.
end | The filter to query. |
Referenced by helicscpp::Endpoint::getInfo().
HELICS_DEPRECATED_EXPORT helics_message helicsEndpointGetMessage | ( | helics_endpoint | endpoint | ) |
Receive a packet from a particular endpoint.
[in] | endpoint | The identifier for the endpoint. |
helics_message_object helicsEndpointGetMessageObject | ( | helics_endpoint | endpoint | ) |
Receive a packet from a particular endpoint.
[in] | endpoint | The identifier for the endpoint. |
Referenced by helicscpp::Endpoint::getMessage().
const char* helicsEndpointGetName | ( | helics_endpoint | endpoint | ) |
Get the name of an endpoint.
endpoint | The endpoint object in question. |
Referenced by helicscpp::Endpoint::getName().
int helicsEndpointGetOption | ( | helics_endpoint | endpoint, |
int | option | ||
) |
Set a handle option on an endpoint.
endpoint | The endpoint to modify. |
option | Integer code for the option to set /ref helics_handle_options. |
const char* helicsEndpointGetType | ( | helics_endpoint | endpoint | ) |
Get the type specified for an endpoint.
endpoint | The endpoint object in question. |
Referenced by helicscpp::Endpoint::getType().
helics_bool helicsEndpointHasMessage | ( | helics_endpoint | endpoint | ) |
Check if a given endpoint has any unread messages.
endpoint | The endpoint to check. |
helics_bool helicsEndpointIsValid | ( | helics_endpoint | endpoint | ) |
Check if an endpoint is valid.
endpoint | The endpoint object to check. |
Referenced by helicscpp::Endpoint::isValid().
int helicsEndpointPendingMessageCount | ( | helics_endpoint | endpoint | ) |
Returns the number of pending receives for all endpoints of a particular federate.
endpoint | The endpoint to query. |
Referenced by helicscpp::Endpoint::pendingMessages().
HELICS_DEPRECATED_EXPORT int helicsEndpointPendingMessages | ( | helics_endpoint | endpoint | ) |
Deprecated, please use helicsEndpointPendingMessageCount instead. Returns the number of pending receives for all endpoints of a particular federate.
endpoint | The endpoint to query. |
void helicsEndpointSendEventRaw | ( | helics_endpoint | endpoint, |
const char * | dst, | ||
const void * | data, | ||
int | inputDataLength, | ||
helics_time | time, | ||
helics_error * | err | ||
) |
Send a message at a specific time to the specified destination.
endpoint | The endpoint to send the data from. | |
dst | The target destination. @forcpponly nullptr to use the default destination. @endforcpponly @beginpythononly "" to use the default destination. @endpythononly | |
data | The data to send. @forcpponly | |
inputDataLength | The length of the data to send. @endforcpponly | |
time | The time the message should be sent. @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
Referenced by helicscpp::Endpoint::sendMessage().
HELICS_DEPRECATED_EXPORT void helicsEndpointSendMessage | ( | helics_endpoint | endpoint, |
helics_message * | message, | ||
helics_error * | err | ||
) |
Send a message object from a specific endpoint.
endpoint | The endpoint to send the data from. | |
message | The actual message to send. @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
void helicsEndpointSendMessageObject | ( | helics_endpoint | endpoint, |
helics_message_object | message, | ||
helics_error * | err | ||
) |
Send a message object from a specific endpoint.
endpoint | The endpoint to send the data from. | |
message | The actual message to send which will be copied. @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
Referenced by helicscpp::Endpoint::sendMessage().
void helicsEndpointSendMessageObjectZeroCopy | ( | helics_endpoint | endpoint, |
helics_message_object | message, | ||
helics_error * | err | ||
) |
Send a message object from a specific endpoint, the message will not be copied and the message object will no longer be valid after the call.
endpoint | The endpoint to send the data from. | |
message | The actual message to send which will be copied. @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
Referenced by helicscpp::Endpoint::sendMessageZeroCopy().
void helicsEndpointSendMessageRaw | ( | helics_endpoint | endpoint, |
const char * | dst, | ||
const void * | data, | ||
int | inputDataLength, | ||
helics_error * | err | ||
) |
Send a message to the specified destination.
endpoint | The endpoint to send the data from. | |
dst | The target destination. @forcpponly nullptr to use the default destination. @endforcpponly @beginpythononly "" to use the default destination. @endpythononly | |
data | The data to send. @forcpponly | |
inputDataLength | The length of the data to send. | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
Referenced by helicscpp::Endpoint::sendMessage().
void helicsEndpointSetDefaultDestination | ( | helics_endpoint | endpoint, |
const char * | dst, | ||
helics_error * | err | ||
) |
Set the default destination for an endpoint if no other endpoint is given.
endpoint | The endpoint to set the destination for. | |
dst | A string naming the desired default endpoint. @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
Referenced by helicscpp::Endpoint::setDefaultDestination().
void helicsEndpointSetInfo | ( | helics_endpoint | endpoint, |
const char * | info, | ||
helics_error * | err | ||
) |
Set the data in the info field for a filter.
endpoint | The endpoint to query. | |
info | The string to set. @forcpponly | |
[in,out] | err | An error object to fill out in case of an error. @endforcpponly |
Referenced by helicscpp::Endpoint::setInfo().
void helicsEndpointSetOption | ( | helics_endpoint | endpoint, |
int | option, | ||
int | value, | ||
helics_error * | err | ||
) |
Set a handle option on an endpoint.
endpoint | The endpoint to modify. | |
option | Integer code for the option to set /ref helics_handle_options. | |
value | The value to set the option to. @forcpponly | |
[in,out] | err | An error object to fill out in case of an error. @endforcpponly |
void helicsEndpointSubscribe | ( | helics_endpoint | endpoint, |
const char * | key, | ||
helics_error * | err | ||
) |
Subscribe an endpoint to a publication.
endpoint | The endpoint to use. | |
key | The name of the publication. @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
void helicsFederateClearMessages | ( | helics_federate | fed | ) |
Clear all stored messages from a federate.
This clears messages retrieved through helicsFederateGetMessage or helicsFederateGetMessageObject
fed | The federate to clear the message for. |
helics_message_object helicsFederateCreateMessageObject | ( | helics_federate | fed, |
helics_error * | err | ||
) |
Create a new empty message object.
The message is empty and isValid will return false since there is no data associated with the message yet.
fed | the federate object to associate the message with @forcpponly | |
[in,out] | err | An error object to fill out in case of an error. @endforcpponly |
Referenced by helicscpp::MessageFederate::createMessage(), and helicscpp::Message::newMessageObject().
helics_endpoint helicsFederateGetEndpoint | ( | helics_federate | fed, |
const char * | name, | ||
helics_error * | err | ||
) |
Get an endpoint object from a name.
fed | The message federate object to use to get the endpoint. | |
name | The name of the endpoint. @forcpponly | |
[in,out] | err | The error object to complete if there is an error. @endforcpponly |
Referenced by helicscpp::MessageFederate::getEndpoint().
helics_endpoint helicsFederateGetEndpointByIndex | ( | helics_federate | fed, |
int | index, | ||
helics_error * | err | ||
) |
Get an endpoint by its index, typically already created via registerInterfaces file or something of that nature.
fed | The federate object in which to create a publication. | |
index | The index of the publication to get. @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
Referenced by helicscpp::MessageFederate::getEndpoint().
int helicsFederateGetEndpointCount | ( | helics_federate | fed | ) |
Get the number of endpoints in a federate.
fed | The message federate to query. |
Referenced by helicscpp::MessageFederate::getEndpointCount().
HELICS_DEPRECATED_EXPORT helics_message helicsFederateGetMessage | ( | helics_federate | fed | ) |
Receive a communication message for any endpoint in the federate.
The return order will be in order of endpoint creation. So all messages that are available for the first endpoint, then all for the second, and so on. Within a single endpoint, the messages are ordered by time, then source_id, then order of arrival.
helics_message_object helicsFederateGetMessageObject | ( | helics_federate | fed | ) |
Receive a communication message for any endpoint in the federate.
The return order will be in order of endpoint creation. So all messages that are available for the first endpoint, then all for the second, and so on. Within a single endpoint, the messages are ordered by time, then source_id, then order of arrival.
Referenced by helicscpp::MessageFederate::getMessage().
helics_bool helicsFederateHasMessage | ( | helics_federate | fed | ) |
Check if the federate has any outstanding messages.
fed | The federate to check. |
Referenced by helicscpp::MessageFederate::hasMessage().
int helicsFederatePendingMessageCount | ( | helics_federate | fed | ) |
Returns the number of pending receives for the specified destination endpoint.
fed | The federate to get the number of waiting messages from. |
Referenced by helicscpp::MessageFederate::pendingMessages().
HELICS_DEPRECATED_EXPORT int helicsFederatePendingMessages | ( | helics_federate | fed | ) |
Deprecated, please use helicsFederatePendingMessageCount instead. Returns the number of pending receives for the specified destination endpoint.
fed | The federate to get the number of waiting messages from. |
helics_endpoint helicsFederateRegisterEndpoint | ( | helics_federate | fed, |
const char * | name, | ||
const char * | type, | ||
helics_error * | err | ||
) |
Create an endpoint.
The endpoint becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for endpoints.
fed | The federate object in which to create an endpoint must have been created with helicsCreateMessageFederate or helicsCreateCombinationFederate. | |
name | The identifier for the endpoint. This will be prepended with the federate name for the global identifier. | |
type | A string describing the expected type of the publication (may be NULL). @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
Referenced by helicscpp::MessageFederate::registerEndpoint().
helics_endpoint helicsFederateRegisterGlobalEndpoint | ( | helics_federate | fed, |
const char * | name, | ||
const char * | type, | ||
helics_error * | err | ||
) |
Create an endpoint.
The endpoint becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for endpoints.
fed | The federate object in which to create an endpoint must have been created with helicsCreateMessageFederate or helicsCreateCombinationFederate. | |
name | The identifier for the endpoint, the given name is the global identifier. | |
type | A string describing the expected type of the publication (may be NULL). @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
Referenced by helicscpp::MessageFederate::registerGlobalEndpoint().