![]() |
helics 3.7.0
|
Functions related to message federates for the C api. More...
#include "helicsCore.h"Go to the source code of this file.
Functions related to message federates for the C api.
| void helicsEndpointAddDestinationFilter | ( | HelicsEndpoint | endpoint, |
| const char * | filterName, | ||
| HelicsError * | err | ||
| ) |
add a destination filter to an endpoint
| endpoint | The endpoint to modify. | |
| filterName | The name of the filter to add. | |
| [in,out] | err | An error object to fill out in case of an error. |
References helicsEndpointAddDestinationFilter().
Referenced by helicsEndpointAddDestinationFilter().
| void helicsEndpointAddDestinationTarget | ( | HelicsEndpoint | endpoint, |
| const char * | targetEndpoint, | ||
| HelicsError * | err | ||
| ) |
add a destination target to an endpoint, Specifying an endpoint to send undirected messages to
| endpoint | The endpoint to modify. | |
| targetEndpoint | the name of the endpoint to send messages to | |
| [in,out] | err | An error object to fill out in case of an error. |
References helicsEndpointAddDestinationTarget().
Referenced by helicsEndpointAddDestinationTarget().
| void helicsEndpointAddSourceFilter | ( | HelicsEndpoint | endpoint, |
| const char * | filterName, | ||
| HelicsError * | err | ||
| ) |
add a source Filter to an endpoint
| endpoint | The endpoint to modify. | |
| filterName | the name of the filter to add | |
| [in,out] | err | An error object to fill out in case of an error. |
References helicsEndpointAddSourceFilter().
Referenced by helicsEndpointAddSourceFilter().
| void helicsEndpointAddSourceTarget | ( | HelicsEndpoint | endpoint, |
| const char * | targetEndpoint, | ||
| HelicsError * | err | ||
| ) |
add a source target to an endpoint, Specifying an endpoint to receive undirected messages from
| endpoint | The endpoint to modify. | |
| targetEndpoint | the endpoint to get messages from | |
| [in,out] | err | An error object to fill out in case of an error. |
References helicsEndpointAddSourceTarget().
Referenced by helicsEndpointAddSourceTarget().
| void helicsEndpointClearMessages | ( | HelicsEndpoint | endpoint | ) |
Clear all stored messages stored from an endpoint.
This clears messages retrieved through helicsEndpointGetMessage or helicsEndpointCreateMessage
| endpoint | The endpoint to clear the message for. |
References helicsEndpointClearMessages().
Referenced by helicsEndpointClearMessages().
| HelicsMessage helicsEndpointCreateMessage | ( | HelicsEndpoint | endpoint, |
| HelicsError * | 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. | |
| [in,out] | err | An error object to fill out in case of an error. |
References helicsEndpointCreateMessage().
Referenced by helicscpp::Endpoint::createMessage(), helicsEndpointCreateMessage(), and helicscpp::Message::newMessageObject().
| const char * helicsEndpointGetDefaultDestination | ( | HelicsEndpoint | endpoint | ) |
Get the default destination for an endpoint.
| endpoint | The endpoint to set the destination for. |
References helicsEndpointGetDefaultDestination().
Referenced by helicscpp::Endpoint::getDefaultDestination(), and helicsEndpointGetDefaultDestination().
| const char * helicsEndpointGetInfo | ( | HelicsEndpoint | end | ) |
Get the local information field of an endpoint.
| end | The endpoint to query. |
References helicsEndpointGetInfo().
Referenced by helicscpp::Endpoint::getInfo(), and helicsEndpointGetInfo().
| HelicsMessage helicsEndpointGetMessage | ( | HelicsEndpoint | endpoint | ) |
Receive a packet from a particular endpoint.
| [in] | endpoint | The identifier for the endpoint. |
References helicsEndpointGetMessage().
Referenced by helicscpp::Endpoint::getMessage(), and helicsEndpointGetMessage().
| const char * helicsEndpointGetName | ( | HelicsEndpoint | endpoint | ) |
Get the name of an endpoint.
| endpoint | The endpoint object in question. |
References helicsEndpointGetName().
Referenced by helicscpp::Endpoint::getName(), and helicsEndpointGetName().
| int helicsEndpointGetOption | ( | HelicsEndpoint | 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. |
References HELICS_FALSE, and helicsEndpointGetOption().
Referenced by helicsEndpointGetOption().
| const char * helicsEndpointGetTag | ( | HelicsEndpoint | endpoint, |
| const char * | tagname | ||
| ) |
Get the data in a specified tag of an endpoint
| endpoint | The endpoint to query. |
| tagname | The name of the tag to query. |
References helicsEndpointGetTag().
Referenced by helicsEndpointGetTag().
| const char * helicsEndpointGetType | ( | HelicsEndpoint | endpoint | ) |
Get the type specified for an endpoint.
| endpoint | The endpoint object in question. |
References helicsEndpointGetType().
Referenced by helicscpp::Endpoint::getType(), and helicsEndpointGetType().
| HelicsBool helicsEndpointHasMessage | ( | HelicsEndpoint | endpoint | ) |
Check if a given endpoint has any unread messages.
| endpoint | The endpoint to check. |
References HELICS_FALSE, HELICS_TRUE, and helicsEndpointHasMessage().
Referenced by helicsEndpointHasMessage().
| HelicsBool helicsEndpointIsValid | ( | HelicsEndpoint | endpoint | ) |
Check if an endpoint is valid.
| endpoint | The endpoint object to check. |
References HELICS_FALSE, HELICS_TRUE, and helicsEndpointIsValid().
Referenced by helicsEndpointIsValid(), and helicscpp::Endpoint::isValid().
| int helicsEndpointPendingMessageCount | ( | HelicsEndpoint | endpoint | ) |
Returns the number of pending receives for all endpoints of a particular federate.
| endpoint | The endpoint to query. |
References helicsEndpointPendingMessageCount().
Referenced by helicsEndpointPendingMessageCount(), and helicscpp::Endpoint::pendingMessageCount().
| void helicsEndpointRemoveTarget | ( | HelicsEndpoint | endpoint, |
| const char * | targetEndpoint, | ||
| HelicsError * | err | ||
| ) |
remove an endpoint from being targeted
| endpoint | The endpoint to modify. | |
| targetEndpoint | the name of the endpoint to send messages to | |
| [in,out] | err | An error object to fill out in case of an error. |
References helicsEndpointRemoveTarget().
Referenced by helicsEndpointRemoveTarget().
| void helicsEndpointSendBytes | ( | HelicsEndpoint | endpoint, |
| const void * | data, | ||
| int | inputDataLength, | ||
| HelicsError * | err | ||
| ) |
Send a message to the targeted destination.
| endpoint | The endpoint to send the data from. | |
| data | The data to send. | |
| inputDataLength | The length of the data to send. | |
| [in,out] | err | A pointer to an error object for catching errors. |
References helicsEndpointSendBytes().
Referenced by helicsEndpointSendBytes(), helicscpp::Endpoint::send(), helicscpp::Endpoint::send(), and helicscpp::Endpoint::send().
| void helicsEndpointSendBytesAt | ( | HelicsEndpoint | endpoint, |
| const void * | data, | ||
| int | inputDataLength, | ||
| HelicsTime | time, | ||
| HelicsError * | err | ||
| ) |
Send a message at a specific time to the targeted destinations
| endpoint | The endpoint to send the data from. | |
| data | The data to send. | |
| inputDataLength | The length of the data to send. | |
| time | The time the message should be sent. | |
| [in,out] | err | A pointer to an error object for catching errors. |
References helicsEndpointSendBytesAt().
Referenced by helicsEndpointSendBytesAt(), helicscpp::Endpoint::sendAt(), helicscpp::Endpoint::sendAt(), and helicscpp::Endpoint::sendAt().
| void helicsEndpointSendBytesTo | ( | HelicsEndpoint | endpoint, |
| const void * | data, | ||
| int | inputDataLength, | ||
| const char * | dst, | ||
| HelicsError * | err | ||
| ) |
Send a message to the specified destination.
| endpoint | The endpoint to send the data from. | |
| data | The data to send. | |
| inputDataLength | The length of the data to send. | |
| dst | The target destination. Use nullptr to send to the default destination. | |
| [in,out] | err | A pointer to an error object for catching errors. |
References helicsEndpointSendBytesTo().
Referenced by helicsEndpointSendBytesTo(), helicscpp::Endpoint::sendTo(), helicscpp::Endpoint::sendTo(), and helicscpp::Endpoint::sendTo().
| void helicsEndpointSendBytesToAt | ( | HelicsEndpoint | endpoint, |
| const void * | data, | ||
| int | inputDataLength, | ||
| const char * | dst, | ||
| HelicsTime | time, | ||
| HelicsError * | err | ||
| ) |
Send a message to the specified destination at a specific time.
| endpoint | The endpoint to send the data from. | |
| data | The data to send. | |
| inputDataLength | The length of the data to send. | |
| dst | The target destination. Use nullptr to send to the default destination. | |
| time | The time the message should be sent. | |
| [in,out] | err | A pointer to an error object for catching errors. |
References helicsEndpointSendBytesToAt().
Referenced by helicsEndpointSendBytesToAt(), helicscpp::Endpoint::sendToAt(), helicscpp::Endpoint::sendToAt(), and helicscpp::Endpoint::sendToAt().
| void helicsEndpointSendMessage | ( | HelicsEndpoint | endpoint, |
| HelicsMessage | message, | ||
| HelicsError * | 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. | |
| [in,out] | err | A pointer to an error object for catching errors. |
References helicsEndpointSendMessage().
Referenced by helicsEndpointSendMessage(), and helicscpp::Endpoint::sendMessage().
| void helicsEndpointSendMessageZeroCopy | ( | HelicsEndpoint | endpoint, |
| HelicsMessage | message, | ||
| HelicsError * | 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. | |
| [in,out] | err | A pointer to an error object for catching errors. |
References helicsEndpointSendMessageZeroCopy().
Referenced by helicsEndpointSendMessageZeroCopy(), and helicscpp::Endpoint::sendMessageZeroCopy().
| void helicsEndpointSendString | ( | HelicsEndpoint | endpoint, |
| const char * | message, | ||
| HelicsError * | err | ||
| ) |
Send a message to the targeted destination.
| endpoint | The endpoint to send the data from. | |
| message | The string to send. | |
| [in,out] | err | A pointer to an error object for catching errors. |
References helicsEndpointSendString().
Referenced by helicsEndpointSendString().
| void helicsEndpointSendStringAt | ( | HelicsEndpoint | endpoint, |
| const char * | message, | ||
| HelicsTime | time, | ||
| HelicsError * | err | ||
| ) |
Send a message at a specific time to the targeted destinations.
| endpoint | The endpoint to send the data from. | |
| message | The data to send. | |
| time | The time the message should be sent. | |
| [in,out] | err | A pointer to an error object for catching errors. |
References helicsEndpointSendStringAt().
Referenced by helicsEndpointSendStringAt().
| void helicsEndpointSendStringTo | ( | HelicsEndpoint | endpoint, |
| const char * | message, | ||
| const char * | dst, | ||
| HelicsError * | err | ||
| ) |
Send a message to the specified destination.
| endpoint | The endpoint to send the data from. | |
| message | The string to send. | |
| dst | The target destination. Use nullptr to send to the default destination. | |
| [in,out] | err | A pointer to an error object for catching errors. |
References helicsEndpointSendStringTo().
Referenced by helicsEndpointSendStringTo().
| void helicsEndpointSendStringToAt | ( | HelicsEndpoint | endpoint, |
| const char * | message, | ||
| const char * | dst, | ||
| HelicsTime | time, | ||
| HelicsError * | err | ||
| ) |
Send a message to the specified destination at a specific time.
| endpoint | The endpoint to send the data from. | |
| message | The data to send. | |
| dst | The target destination. Use nullptr to send to the default destination. | |
| time | The time the message should be sent. | |
| [in,out] | err | A pointer to an error object for catching errors. |
References helicsEndpointSendStringToAt().
Referenced by helicsEndpointSendStringToAt().
| void helicsEndpointSetDefaultDestination | ( | HelicsEndpoint | endpoint, |
| const char * | dst, | ||
| HelicsError * | 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. | |
| [in,out] | err | A pointer to an error object for catching errors. |
References helicsEndpointSetDefaultDestination().
Referenced by helicsEndpointSetDefaultDestination(), and helicscpp::Endpoint::setDefaultDestination().
| void helicsEndpointSetInfo | ( | HelicsEndpoint | endpoint, |
| const char * | info, | ||
| HelicsError * | err | ||
| ) |
Set the data in the interface information field for an endpoint.
| endpoint | The endpoint to set the information for | |
| info | The string to store in the field | |
| [in,out] | err | An error object to fill out in case of an error. |
References helicsEndpointSetInfo().
Referenced by helicsEndpointSetInfo(), and helicscpp::Endpoint::setInfo().
| void helicsEndpointSetOption | ( | HelicsEndpoint | endpoint, |
| int | option, | ||
| int | value, | ||
| HelicsError * | 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. | |
| [in,out] | err | An error object to fill out in case of an error. |
References helicsEndpointSetOption().
Referenced by helicsEndpointSetOption().
| void helicsEndpointSetTag | ( | HelicsEndpoint | endpoint, |
| const char * | tagname, | ||
| const char * | tagvalue, | ||
| HelicsError * | err | ||
| ) |
Set the data in a specific tag for an endpoint.
| endpoint | The endpoint to query. | |
| tagname | The string to set. | |
| tagvalue | The string value to associate with a tag. | |
| [in,out] | err | An error object to fill out in case of an error. |
References helicsEndpointSetTag().
Referenced by helicsEndpointSetTag().
| void helicsEndpointSubscribe | ( | HelicsEndpoint | endpoint, |
| const char * | key, | ||
| HelicsError * | err | ||
| ) |
Subscribe an endpoint to a publication.
| endpoint | The endpoint to use. | |
| key | The name of the publication. | |
| [in,out] | err | A pointer to an error object for catching errors. |
References helicsEndpointSubscribe().
Referenced by helicsEndpointSubscribe().
| void helicsFederateClearMessages | ( | HelicsFederate | fed | ) |
Clear all stored messages from a federate.
This clears messages retrieved through helicsEndpointGetMessage or helicsFederateGetMessage
| fed | The federate to clear the message for. |
References helics::getFedObject(), and helicsFederateClearMessages().
Referenced by helicsFederateClearMessages().
| HelicsMessage helicsFederateCreateMessage | ( | HelicsFederate | fed, |
| HelicsError * | 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 | |
| [in,out] | err | An error object to fill out in case of an error. |
References helics::getFedObject(), and helicsFederateCreateMessage().
Referenced by helicscpp::MessageFederate::createMessage(), helicsFederateCreateMessage(), and helicscpp::Message::newMessageObject().
| HelicsEndpoint helicsFederateGetEndpoint | ( | HelicsFederate | fed, |
| const char * | name, | ||
| HelicsError * | 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. | |
| [in,out] | err | The error object to complete if there is an error. |
The object will not be valid and err will contain an error code if no endpoint with the specified name exists.
References HELICS_ERROR_INVALID_ARGUMENT, and helicsFederateGetEndpoint().
Referenced by helicscpp::MessageFederate::getEndpoint(), and helicsFederateGetEndpoint().
| HelicsEndpoint helicsFederateGetEndpointByIndex | ( | HelicsFederate | fed, |
| int | index, | ||
| HelicsError * | 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. | |
| [in,out] | err | A pointer to an error object for catching errors. |
The HelicsEndpoint returned will be NULL if given an invalid index.
References HELICS_ERROR_INVALID_ARGUMENT, and helicsFederateGetEndpointByIndex().
Referenced by helicscpp::MessageFederate::getEndpoint(), and helicsFederateGetEndpointByIndex().
| int helicsFederateGetEndpointCount | ( | HelicsFederate | fed | ) |
Get the number of endpoints in a federate.
| fed | The message federate to query. |
References helicsFederateGetEndpointCount().
Referenced by helicscpp::MessageFederate::getEndpointCount(), and helicsFederateGetEndpointCount().
| HelicsMessage helicsFederateGetMessage | ( | HelicsFederate | 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.
References helics::getFedObject(), and helicsFederateGetMessage().
Referenced by helicscpp::MessageFederate::getMessage(), and helicsFederateGetMessage().
| HelicsBool helicsFederateHasMessage | ( | HelicsFederate | fed | ) |
Check if the federate has any outstanding messages.
| fed | The federate to check. |
References HELICS_FALSE, HELICS_TRUE, and helicsFederateHasMessage().
Referenced by helicscpp::MessageFederate::hasMessage(), and helicsFederateHasMessage().
| int helicsFederatePendingMessageCount | ( | HelicsFederate | fed | ) |
Returns the number of pending receives for the specified destination endpoint.
| fed | The federate to get the number of waiting messages from. |
References helicsFederatePendingMessageCount().
Referenced by helicsFederatePendingMessageCount(), and helicscpp::MessageFederate::pendingMessageCount().
| HelicsEndpoint helicsFederateRegisterEndpoint | ( | HelicsFederate | fed, |
| const char * | name, | ||
| const char * | type, | ||
| HelicsError * | 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). | |
| [in,out] | err | A pointer to an error object for catching errors. |
References helics::getFedObject(), and helicsFederateRegisterEndpoint().
Referenced by helicsFederateRegisterEndpoint(), and helicscpp::MessageFederate::registerEndpoint().
| HelicsEndpoint helicsFederateRegisterGlobalEndpoint | ( | HelicsFederate | fed, |
| const char * | name, | ||
| const char * | type, | ||
| HelicsError * | 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). | |
| [in,out] | err | A pointer to an error object for catching errors. |
References helics::getFedObject(), and helicsFederateRegisterGlobalEndpoint().
Referenced by helicsFederateRegisterGlobalEndpoint(), and helicscpp::MessageFederate::registerGlobalEndpoint().
| HelicsEndpoint helicsFederateRegisterGlobalTargetedEndpoint | ( | HelicsFederate | fed, |
| const char * | name, | ||
| const char * | type, | ||
| HelicsError * | err | ||
| ) |
Create a global targeted endpoint, Targeted endpoints have specific destinations predefined and do not allow sending messages to other endpoints
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). | |
| [in,out] | err | A pointer to an error object for catching errors. |
References helics::getFedObject(), and helicsFederateRegisterGlobalTargetedEndpoint().
Referenced by helicsFederateRegisterGlobalTargetedEndpoint().
| HelicsEndpoint helicsFederateRegisterTargetedEndpoint | ( | HelicsFederate | fed, |
| const char * | name, | ||
| const char * | type, | ||
| HelicsError * | err | ||
| ) |
Create a targeted endpoint. Targeted endpoints have specific destinations predefined and do not allow sending messages to other endpoints
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). | |
| [in,out] | err | A pointer to an error object for catching errors. |
References helics::getFedObject(), and helicsFederateRegisterTargetedEndpoint().
Referenced by helicsFederateRegisterTargetedEndpoint().