helics 3.7.0
Loading...
Searching...
No Matches
Functions
MessageFederate.h File Reference

Functions related to message federates for the C api. More...

#include "helicsCore.h"

Go to the source code of this file.

Functions

HelicsEndpoint helicsFederateRegisterEndpoint (HelicsFederate fed, const char *name, const char *type, HelicsError *err)
 
HelicsEndpoint helicsFederateRegisterGlobalEndpoint (HelicsFederate fed, const char *name, const char *type, HelicsError *err)
 
HelicsEndpoint helicsFederateRegisterTargetedEndpoint (HelicsFederate fed, const char *name, const char *type, HelicsError *err)
 
HelicsEndpoint helicsFederateRegisterGlobalTargetedEndpoint (HelicsFederate fed, const char *name, const char *type, HelicsError *err)
 
HelicsEndpoint helicsFederateGetEndpoint (HelicsFederate fed, const char *name, HelicsError *err)
 
HelicsEndpoint helicsFederateGetEndpointByIndex (HelicsFederate fed, int index, HelicsError *err)
 
HelicsBool helicsEndpointIsValid (HelicsEndpoint endpoint)
 
void helicsEndpointSetDefaultDestination (HelicsEndpoint endpoint, const char *dst, HelicsError *err)
 
const char * helicsEndpointGetDefaultDestination (HelicsEndpoint endpoint)
 
void helicsEndpointSendString (HelicsEndpoint endpoint, const char *message, HelicsError *err)
 
void helicsEndpointSendStringTo (HelicsEndpoint endpoint, const char *message, const char *dst, HelicsError *err)
 
void helicsEndpointSendStringToAt (HelicsEndpoint endpoint, const char *message, const char *dst, HelicsTime time, HelicsError *err)
 
void helicsEndpointSendStringAt (HelicsEndpoint endpoint, const char *message, HelicsTime time, HelicsError *err)
 
void helicsEndpointSendBytes (HelicsEndpoint endpoint, const void *data, int inputDataLength, HelicsError *err)
 
void helicsEndpointSendBytesTo (HelicsEndpoint endpoint, const void *data, int inputDataLength, const char *dst, HelicsError *err)
 
void helicsEndpointSendBytesToAt (HelicsEndpoint endpoint, const void *data, int inputDataLength, const char *dst, HelicsTime time, HelicsError *err)
 
void helicsEndpointSendBytesAt (HelicsEndpoint endpoint, const void *data, int inputDataLength, HelicsTime time, HelicsError *err)
 
void helicsEndpointSendMessage (HelicsEndpoint endpoint, HelicsMessage message, HelicsError *err)
 
void helicsEndpointSendMessageZeroCopy (HelicsEndpoint endpoint, HelicsMessage message, HelicsError *err)
 
void helicsEndpointSubscribe (HelicsEndpoint endpoint, const char *key, HelicsError *err)
 
HelicsBool helicsFederateHasMessage (HelicsFederate fed)
 
HelicsBool helicsEndpointHasMessage (HelicsEndpoint endpoint)
 
int helicsFederatePendingMessageCount (HelicsFederate fed)
 
int helicsEndpointPendingMessageCount (HelicsEndpoint endpoint)
 
HelicsMessage helicsEndpointGetMessage (HelicsEndpoint endpoint)
 
HelicsMessage helicsEndpointCreateMessage (HelicsEndpoint endpoint, HelicsError *err)
 
void helicsEndpointClearMessages (HelicsEndpoint endpoint)
 
HelicsMessage helicsFederateGetMessage (HelicsFederate fed)
 
HelicsMessage helicsFederateCreateMessage (HelicsFederate fed, HelicsError *err)
 
void helicsFederateClearMessages (HelicsFederate fed)
 
const char * helicsEndpointGetType (HelicsEndpoint endpoint)
 
const char * helicsEndpointGetName (HelicsEndpoint endpoint)
 
int helicsFederateGetEndpointCount (HelicsFederate fed)
 
const char * helicsEndpointGetInfo (HelicsEndpoint end)
 
void helicsEndpointSetInfo (HelicsEndpoint endpoint, const char *info, HelicsError *err)
 
const char * helicsEndpointGetTag (HelicsEndpoint endpoint, const char *tagname)
 
void helicsEndpointSetTag (HelicsEndpoint endpoint, const char *tagname, const char *tagvalue, HelicsError *err)
 
void helicsEndpointSetOption (HelicsEndpoint endpoint, int option, int value, HelicsError *err)
 
int helicsEndpointGetOption (HelicsEndpoint endpoint, int option)
 
void helicsEndpointAddSourceTarget (HelicsEndpoint endpoint, const char *targetEndpoint, HelicsError *err)
 
void helicsEndpointAddDestinationTarget (HelicsEndpoint endpoint, const char *targetEndpoint, HelicsError *err)
 
void helicsEndpointRemoveTarget (HelicsEndpoint endpoint, const char *targetEndpoint, HelicsError *err)
 
void helicsEndpointAddSourceFilter (HelicsEndpoint endpoint, const char *filterName, HelicsError *err)
 
void helicsEndpointAddDestinationFilter (HelicsEndpoint endpoint, const char *filterName, HelicsError *err)
 
const char * helicsMessageGetSource (HelicsMessage message)
 
const char * helicsMessageGetDestination (HelicsMessage message)
 
const char * helicsMessageGetOriginalSource (HelicsMessage message)
 
const char * helicsMessageGetOriginalDestination (HelicsMessage message)
 
HelicsTime helicsMessageGetTime (HelicsMessage message)
 
const char * helicsMessageGetString (HelicsMessage message)
 
int helicsMessageGetMessageID (HelicsMessage message)
 
HelicsBool helicsMessageGetFlagOption (HelicsMessage message, int flag)
 
int helicsMessageGetByteCount (HelicsMessage message)
 
void helicsMessageGetBytes (HelicsMessage message, void *data, int maxMessageLength, int *actualSize, HelicsError *err)
 
void * helicsMessageGetBytesPointer (HelicsMessage message)
 
HelicsDataBuffer helicsMessageDataBuffer (HelicsMessage message, HelicsError *err)
 
HelicsBool helicsMessageIsValid (HelicsMessage message)
 
void helicsMessageSetSource (HelicsMessage message, const char *src, HelicsError *err)
 
void helicsMessageSetDestination (HelicsMessage message, const char *dst, HelicsError *err)
 
void helicsMessageSetOriginalSource (HelicsMessage message, const char *src, HelicsError *err)
 
void helicsMessageSetOriginalDestination (HelicsMessage message, const char *dst, HelicsError *err)
 
void helicsMessageSetTime (HelicsMessage message, HelicsTime time, HelicsError *err)
 
void helicsMessageResize (HelicsMessage message, int newSize, HelicsError *err)
 
void helicsMessageReserve (HelicsMessage message, int reserveSize, HelicsError *err)
 
void helicsMessageSetMessageID (HelicsMessage message, int32_t messageID, HelicsError *err)
 
void helicsMessageClearFlags (HelicsMessage message)
 
void helicsMessageSetFlagOption (HelicsMessage message, int flag, HelicsBool flagValue, HelicsError *err)
 
void helicsMessageSetString (HelicsMessage message, const char *data, HelicsError *err)
 
void helicsMessageSetData (HelicsMessage message, const void *data, int inputDataLength, HelicsError *err)
 
void helicsMessageSetDataBuffer (HelicsMessage message, HelicsDataBuffer data, HelicsError *err)
 
void helicsMessageAppendData (HelicsMessage message, const void *data, int inputDataLength, HelicsError *err)
 
void helicsMessageCopy (HelicsMessage src_message, HelicsMessage dst_message, HelicsError *err)
 
HelicsMessage helicsMessageClone (HelicsMessage message, HelicsError *err)
 
void helicsMessageFree (HelicsMessage message)
 
void helicsMessageClear (HelicsMessage message, HelicsError *err)
 

Detailed Description

Functions related to message federates for the C api.

Function Documentation

◆ helicsEndpointAddDestinationFilter()

void helicsEndpointAddDestinationFilter ( HelicsEndpoint  endpoint,
const char *  filterName,
HelicsError err 
)

add a destination filter to an endpoint

Parameters
endpointThe endpoint to modify.
filterNameThe name of the filter to add.
[in,out]errAn error object to fill out in case of an error.

References helicsEndpointAddDestinationFilter().

Referenced by helicsEndpointAddDestinationFilter().

◆ helicsEndpointAddDestinationTarget()

void helicsEndpointAddDestinationTarget ( HelicsEndpoint  endpoint,
const char *  targetEndpoint,
HelicsError err 
)

add a destination target to an endpoint, Specifying an endpoint to send undirected messages to

Parameters
endpointThe endpoint to modify.
targetEndpointthe name of the endpoint to send messages to
[in,out]errAn error object to fill out in case of an error.

References helicsEndpointAddDestinationTarget().

Referenced by helicsEndpointAddDestinationTarget().

◆ helicsEndpointAddSourceFilter()

void helicsEndpointAddSourceFilter ( HelicsEndpoint  endpoint,
const char *  filterName,
HelicsError err 
)

add a source Filter to an endpoint

Parameters
endpointThe endpoint to modify.
filterNamethe name of the filter to add
[in,out]errAn error object to fill out in case of an error.

References helicsEndpointAddSourceFilter().

Referenced by helicsEndpointAddSourceFilter().

◆ helicsEndpointAddSourceTarget()

void helicsEndpointAddSourceTarget ( HelicsEndpoint  endpoint,
const char *  targetEndpoint,
HelicsError err 
)

add a source target to an endpoint, Specifying an endpoint to receive undirected messages from

Parameters
endpointThe endpoint to modify.
targetEndpointthe endpoint to get messages from
[in,out]errAn error object to fill out in case of an error.

References helicsEndpointAddSourceTarget().

Referenced by helicsEndpointAddSourceTarget().

◆ helicsEndpointClearMessages()

void helicsEndpointClearMessages ( HelicsEndpoint  endpoint)

Clear all stored messages stored from an endpoint.

This clears messages retrieved through helicsEndpointGetMessage or helicsEndpointCreateMessage

Parameters
endpointThe endpoint to clear the message for.

References helicsEndpointClearMessages().

Referenced by helicsEndpointClearMessages().

◆ helicsEndpointCreateMessage()

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.

Parameters
endpointThe endpoint object to associate the message with.
[in,out]errAn error object to fill out in case of an error.
Returns
A new HelicsMessage.

References helicsEndpointCreateMessage().

Referenced by helicscpp::Endpoint::createMessage(), helicsEndpointCreateMessage(), and helicscpp::Message::newMessageObject().

◆ helicsEndpointGetDefaultDestination()

const char * helicsEndpointGetDefaultDestination ( HelicsEndpoint  endpoint)

Get the default destination for an endpoint.

Parameters
endpointThe endpoint to set the destination for.
Returns
A string with the default destination.

References helicsEndpointGetDefaultDestination().

Referenced by helicscpp::Endpoint::getDefaultDestination(), and helicsEndpointGetDefaultDestination().

◆ helicsEndpointGetInfo()

const char * helicsEndpointGetInfo ( HelicsEndpoint  end)

Get the local information field of an endpoint.

Parameters
endThe endpoint to query.
Returns
A string with the info field string.

References helicsEndpointGetInfo().

Referenced by helicscpp::Endpoint::getInfo(), and helicsEndpointGetInfo().

◆ helicsEndpointGetMessage()

HelicsMessage helicsEndpointGetMessage ( HelicsEndpoint  endpoint)

Receive a packet from a particular endpoint.

Parameters
[in]endpointThe identifier for the endpoint.
Returns
A message object.

References helicsEndpointGetMessage().

Referenced by helicscpp::Endpoint::getMessage(), and helicsEndpointGetMessage().

◆ helicsEndpointGetName()

const char * helicsEndpointGetName ( HelicsEndpoint  endpoint)

Get the name of an endpoint.

Parameters
endpointThe endpoint object in question.
Returns
The name of the endpoint.

References helicsEndpointGetName().

Referenced by helicscpp::Endpoint::getName(), and helicsEndpointGetName().

◆ helicsEndpointGetOption()

int helicsEndpointGetOption ( HelicsEndpoint  endpoint,
int  option 
)

Set a handle option on an endpoint.

Parameters
endpointThe endpoint to modify.
optionInteger code for the option to set /ref helics_handle_options.
Returns
the value of the option, for boolean options will be 0 or 1

References HELICS_FALSE, and helicsEndpointGetOption().

Referenced by helicsEndpointGetOption().

◆ helicsEndpointGetTag()

const char * helicsEndpointGetTag ( HelicsEndpoint  endpoint,
const char *  tagname 
)

Get the data in a specified tag of an endpoint

Parameters
endpointThe endpoint to query.
tagnameThe name of the tag to query.
Returns
A string with the tag data.

References helicsEndpointGetTag().

Referenced by helicsEndpointGetTag().

◆ helicsEndpointGetType()

const char * helicsEndpointGetType ( HelicsEndpoint  endpoint)

Get the type specified for an endpoint.

Parameters
endpointThe endpoint object in question.
Returns
The defined type of the endpoint.

References helicsEndpointGetType().

Referenced by helicscpp::Endpoint::getType(), and helicsEndpointGetType().

◆ helicsEndpointHasMessage()

HelicsBool helicsEndpointHasMessage ( HelicsEndpoint  endpoint)

Check if a given endpoint has any unread messages.

Parameters
endpointThe endpoint to check.
Returns
HELICS_TRUE if the endpoint has a message, HELICS_FALSE otherwise.

References HELICS_FALSE, HELICS_TRUE, and helicsEndpointHasMessage().

Referenced by helicsEndpointHasMessage().

◆ helicsEndpointIsValid()

HelicsBool helicsEndpointIsValid ( HelicsEndpoint  endpoint)

Check if an endpoint is valid.

Parameters
endpointThe endpoint object to check.
Returns
HELICS_TRUE if the Endpoint object represents a valid endpoint.

References HELICS_FALSE, HELICS_TRUE, and helicsEndpointIsValid().

Referenced by helicsEndpointIsValid(), and helicscpp::Endpoint::isValid().

◆ helicsEndpointPendingMessageCount()

int helicsEndpointPendingMessageCount ( HelicsEndpoint  endpoint)

Returns the number of pending receives for all endpoints of a particular federate.

Parameters
endpointThe endpoint to query.

References helicsEndpointPendingMessageCount().

Referenced by helicsEndpointPendingMessageCount(), and helicscpp::Endpoint::pendingMessageCount().

◆ helicsEndpointRemoveTarget()

void helicsEndpointRemoveTarget ( HelicsEndpoint  endpoint,
const char *  targetEndpoint,
HelicsError err 
)

remove an endpoint from being targeted

Parameters
endpointThe endpoint to modify.
targetEndpointthe name of the endpoint to send messages to
[in,out]errAn error object to fill out in case of an error.

References helicsEndpointRemoveTarget().

Referenced by helicsEndpointRemoveTarget().

◆ helicsEndpointSendBytes()

void helicsEndpointSendBytes ( HelicsEndpoint  endpoint,
const void *  data,
int  inputDataLength,
HelicsError err 
)

Send a message to the targeted destination.

Parameters
endpointThe endpoint to send the data from.
dataThe data to send.
inputDataLengthThe length of the data to send.
[in,out]errA pointer to an error object for catching errors.

References helicsEndpointSendBytes().

Referenced by helicsEndpointSendBytes(), helicscpp::Endpoint::send(), helicscpp::Endpoint::send(), and helicscpp::Endpoint::send().

◆ helicsEndpointSendBytesAt()

void helicsEndpointSendBytesAt ( HelicsEndpoint  endpoint,
const void *  data,
int  inputDataLength,
HelicsTime  time,
HelicsError err 
)

Send a message at a specific time to the targeted destinations

Parameters
endpointThe endpoint to send the data from.
dataThe data to send.
inputDataLengthThe length of the data to send.
timeThe time the message should be sent.
[in,out]errA pointer to an error object for catching errors.

References helicsEndpointSendBytesAt().

Referenced by helicsEndpointSendBytesAt(), helicscpp::Endpoint::sendAt(), helicscpp::Endpoint::sendAt(), and helicscpp::Endpoint::sendAt().

◆ helicsEndpointSendBytesTo()

void helicsEndpointSendBytesTo ( HelicsEndpoint  endpoint,
const void *  data,
int  inputDataLength,
const char *  dst,
HelicsError err 
)

Send a message to the specified destination.

Parameters
endpointThe endpoint to send the data from.
dataThe data to send.
inputDataLengthThe length of the data to send.
dstThe target destination. Use nullptr to send to the default destination.
[in,out]errA pointer to an error object for catching errors.

References helicsEndpointSendBytesTo().

Referenced by helicsEndpointSendBytesTo(), helicscpp::Endpoint::sendTo(), helicscpp::Endpoint::sendTo(), and helicscpp::Endpoint::sendTo().

◆ helicsEndpointSendBytesToAt()

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.

Parameters
endpointThe endpoint to send the data from.
dataThe data to send.
inputDataLengthThe length of the data to send.
dstThe target destination. Use nullptr to send to the default destination.
timeThe time the message should be sent.
[in,out]errA pointer to an error object for catching errors.

References helicsEndpointSendBytesToAt().

Referenced by helicsEndpointSendBytesToAt(), helicscpp::Endpoint::sendToAt(), helicscpp::Endpoint::sendToAt(), and helicscpp::Endpoint::sendToAt().

◆ helicsEndpointSendMessage()

void helicsEndpointSendMessage ( HelicsEndpoint  endpoint,
HelicsMessage  message,
HelicsError err 
)

Send a message object from a specific endpoint.

Parameters
endpointThe endpoint to send the data from.
messageThe actual message to send which will be copied.
[in,out]errA pointer to an error object for catching errors.

References helicsEndpointSendMessage().

Referenced by helicsEndpointSendMessage(), and helicscpp::Endpoint::sendMessage().

◆ helicsEndpointSendMessageZeroCopy()

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.

Parameters
endpointThe endpoint to send the data from.
messageThe actual message to send which will be copied.
[in,out]errA pointer to an error object for catching errors.

References helicsEndpointSendMessageZeroCopy().

Referenced by helicsEndpointSendMessageZeroCopy(), and helicscpp::Endpoint::sendMessageZeroCopy().

◆ helicsEndpointSendString()

void helicsEndpointSendString ( HelicsEndpoint  endpoint,
const char *  message,
HelicsError err 
)

Send a message to the targeted destination.

Parameters
endpointThe endpoint to send the data from.
messageThe string to send.
[in,out]errA pointer to an error object for catching errors.

References helicsEndpointSendString().

Referenced by helicsEndpointSendString().

◆ helicsEndpointSendStringAt()

void helicsEndpointSendStringAt ( HelicsEndpoint  endpoint,
const char *  message,
HelicsTime  time,
HelicsError err 
)

Send a message at a specific time to the targeted destinations.

Parameters
endpointThe endpoint to send the data from.
messageThe data to send.
timeThe time the message should be sent.
[in,out]errA pointer to an error object for catching errors.

References helicsEndpointSendStringAt().

Referenced by helicsEndpointSendStringAt().

◆ helicsEndpointSendStringTo()

void helicsEndpointSendStringTo ( HelicsEndpoint  endpoint,
const char *  message,
const char *  dst,
HelicsError err 
)

Send a message to the specified destination.

Parameters
endpointThe endpoint to send the data from.
messageThe string to send.
dstThe target destination. Use nullptr to send to the default destination.
[in,out]errA pointer to an error object for catching errors.

References helicsEndpointSendStringTo().

Referenced by helicsEndpointSendStringTo().

◆ helicsEndpointSendStringToAt()

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.

Parameters
endpointThe endpoint to send the data from.
messageThe data to send.
dstThe target destination. Use nullptr to send to the default destination.
timeThe time the message should be sent.
[in,out]errA pointer to an error object for catching errors.

References helicsEndpointSendStringToAt().

Referenced by helicsEndpointSendStringToAt().

◆ helicsEndpointSetDefaultDestination()

void helicsEndpointSetDefaultDestination ( HelicsEndpoint  endpoint,
const char *  dst,
HelicsError err 
)

Set the default destination for an endpoint if no other endpoint is given.

Parameters
endpointThe endpoint to set the destination for.
dstA string naming the desired default endpoint.
[in,out]errA pointer to an error object for catching errors.

References helicsEndpointSetDefaultDestination().

Referenced by helicsEndpointSetDefaultDestination(), and helicscpp::Endpoint::setDefaultDestination().

◆ helicsEndpointSetInfo()

void helicsEndpointSetInfo ( HelicsEndpoint  endpoint,
const char *  info,
HelicsError err 
)

Set the data in the interface information field for an endpoint.

Parameters
endpointThe endpoint to set the information for
infoThe string to store in the field
[in,out]errAn error object to fill out in case of an error.

References helicsEndpointSetInfo().

Referenced by helicsEndpointSetInfo(), and helicscpp::Endpoint::setInfo().

◆ helicsEndpointSetOption()

void helicsEndpointSetOption ( HelicsEndpoint  endpoint,
int  option,
int  value,
HelicsError err 
)

Set a handle option on an endpoint.

Parameters
endpointThe endpoint to modify.
optionInteger code for the option to set /ref helics_handle_options.
valueThe value to set the option to.
[in,out]errAn error object to fill out in case of an error.

References helicsEndpointSetOption().

Referenced by helicsEndpointSetOption().

◆ helicsEndpointSetTag()

void helicsEndpointSetTag ( HelicsEndpoint  endpoint,
const char *  tagname,
const char *  tagvalue,
HelicsError err 
)

Set the data in a specific tag for an endpoint.

Parameters
endpointThe endpoint to query.
tagnameThe string to set.
tagvalueThe string value to associate with a tag.
[in,out]errAn error object to fill out in case of an error.

References helicsEndpointSetTag().

Referenced by helicsEndpointSetTag().

◆ helicsEndpointSubscribe()

void helicsEndpointSubscribe ( HelicsEndpoint  endpoint,
const char *  key,
HelicsError err 
)

Subscribe an endpoint to a publication.

Parameters
endpointThe endpoint to use.
keyThe name of the publication.
[in,out]errA pointer to an error object for catching errors.

References helicsEndpointSubscribe().

Referenced by helicsEndpointSubscribe().

◆ helicsFederateClearMessages()

void helicsFederateClearMessages ( HelicsFederate  fed)

Clear all stored messages from a federate.

This clears messages retrieved through helicsEndpointGetMessage or helicsFederateGetMessage

Parameters
fedThe federate to clear the message for.

References helics::getFedObject(), and helicsFederateClearMessages().

Referenced by helicsFederateClearMessages().

◆ helicsFederateCreateMessage()

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.

Parameters
fedthe federate object to associate the message with
[in,out]errAn error object to fill out in case of an error.
Returns
A HelicsMessage containing the message data.

References helics::getFedObject(), and helicsFederateCreateMessage().

Referenced by helicscpp::MessageFederate::createMessage(), helicsFederateCreateMessage(), and helicscpp::Message::newMessageObject().

◆ helicsFederateGetEndpoint()

HelicsEndpoint helicsFederateGetEndpoint ( HelicsFederate  fed,
const char *  name,
HelicsError err 
)

Get an endpoint object from a name.

Parameters
fedThe message federate object to use to get the endpoint.
nameThe name of the endpoint.
[in,out]errThe error object to complete if there is an error.
Returns
A HelicsEndpoint object.

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

◆ helicsFederateGetEndpointByIndex()

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.

Parameters
fedThe federate object in which to create a publication.
indexThe index of the publication to get.
[in,out]errA pointer to an error object for catching errors.
Returns
A HelicsEndpoint.

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

◆ helicsFederateGetEndpointCount()

int helicsFederateGetEndpointCount ( HelicsFederate  fed)

Get the number of endpoints in a federate.

Parameters
fedThe message federate to query.
Returns
(-1) if fed was not a valid federate, otherwise returns the number of endpoints.

References helicsFederateGetEndpointCount().

Referenced by helicscpp::MessageFederate::getEndpointCount(), and helicsFederateGetEndpointCount().

◆ helicsFederateGetMessage()

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.

Returns
A HelicsMessage which references the data in the message.

References helics::getFedObject(), and helicsFederateGetMessage().

Referenced by helicscpp::MessageFederate::getMessage(), and helicsFederateGetMessage().

◆ helicsFederateHasMessage()

HelicsBool helicsFederateHasMessage ( HelicsFederate  fed)

Check if the federate has any outstanding messages.

Parameters
fedThe federate to check.
Returns
HELICS_TRUE if the federate has a message waiting, HELICS_FALSE otherwise.

References HELICS_FALSE, HELICS_TRUE, and helicsFederateHasMessage().

Referenced by helicscpp::MessageFederate::hasMessage(), and helicsFederateHasMessage().

◆ helicsFederatePendingMessageCount()

int helicsFederatePendingMessageCount ( HelicsFederate  fed)

Returns the number of pending receives for the specified destination endpoint.

Parameters
fedThe federate to get the number of waiting messages from.

References helicsFederatePendingMessageCount().

Referenced by helicsFederatePendingMessageCount(), and helicscpp::MessageFederate::pendingMessageCount().

◆ helicsFederateRegisterEndpoint()

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.

Parameters
fedThe federate object in which to create an endpoint must have been created with helicsCreateMessageFederate or helicsCreateCombinationFederate.
nameThe identifier for the endpoint. This will be prepended with the federate name for the global identifier.
typeA string describing the expected type of the publication (may be NULL).
[in,out]errA pointer to an error object for catching errors.
Returns
An object containing the endpoint, or nullptr on failure.

References helics::getFedObject(), and helicsFederateRegisterEndpoint().

Referenced by helicsFederateRegisterEndpoint(), and helicscpp::MessageFederate::registerEndpoint().

◆ helicsFederateRegisterGlobalEndpoint()

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.

Parameters
fedThe federate object in which to create an endpoint must have been created with helicsCreateMessageFederate or helicsCreateCombinationFederate.
nameThe identifier for the endpoint, the given name is the global identifier.
typeA string describing the expected type of the publication (may be NULL).
[in,out]errA pointer to an error object for catching errors.
Returns
An object containing the endpoint, or nullptr on failure.

References helics::getFedObject(), and helicsFederateRegisterGlobalEndpoint().

Referenced by helicsFederateRegisterGlobalEndpoint(), and helicscpp::MessageFederate::registerGlobalEndpoint().

◆ helicsFederateRegisterGlobalTargetedEndpoint()

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.

Parameters
fedThe federate object in which to create an endpoint must have been created with helicsCreateMessageFederate or helicsCreateCombinationFederate.
nameThe identifier for the endpoint, the given name is the global identifier.
typeA string describing the expected type of the publication (may be NULL).
[in,out]errA pointer to an error object for catching errors.
Returns
An object containing the endpoint, or nullptr on failure.

References helics::getFedObject(), and helicsFederateRegisterGlobalTargetedEndpoint().

Referenced by helicsFederateRegisterGlobalTargetedEndpoint().

◆ helicsFederateRegisterTargetedEndpoint()

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.

Parameters
fedThe federate object in which to create an endpoint must have been created with helicsCreateMessageFederate or helicsCreateCombinationFederate.
nameThe identifier for the endpoint. This will be prepended with the federate name for the global identifier.
typeA string describing the expected type of the publication (may be NULL).
[in,out]errA pointer to an error object for catching errors.
Returns
An object containing the endpoint, or nullptr on failure.

References helics::getFedObject(), and helicsFederateRegisterTargetedEndpoint().

Referenced by helicsFederateRegisterTargetedEndpoint().