![]() |
helics
3.4.0
|
Common functions for the HELICS C api. More...
Go to the source code of this file.
Common functions for the HELICS C api.
void helicsAbort | ( | int | errorCode, |
const char * | errorString | ||
) |
Execute a global abort by sending an error code to all cores, brokers, and federates that were created through the current library instance.
void helicsBrokerAddAlias | ( | HelicsBroker | broker, |
const char * | interfaceName, | ||
const char * | alias, | ||
HelicsError * | err | ||
) |
Create an alias for an interface.
broker | The broker to use to set the alias. | |
interfaceName | The current name of an interface. | |
alias | The additional name to use for the given interface. | |
[in,out] | err | A pointer to an error object for catching errors. |
References HELICS_ERROR_INVALID_ARGUMENT.
Referenced by helicscpp::Broker::addAlias().
void helicsBrokerAddDestinationFilterToEndpoint | ( | HelicsBroker | broker, |
const char * | filter, | ||
const char * | endpoint, | ||
HelicsError * | err | ||
) |
Link a named filter to a destination endpoint.
broker | The broker to generate the connection from. | |
filter | The name of the filter (cannot be NULL). | |
endpoint | The name of the endpoint to filter the data going to (cannot be NULL). | |
[in,out] | err | A HelicsError object, can be NULL if the errors are to be ignored. |
References HELICS_ERROR_INVALID_ARGUMENT.
Referenced by helicscpp::Broker::addDestinationFilterToEndpoint().
void helicsBrokerAddSourceFilterToEndpoint | ( | HelicsBroker | broker, |
const char * | filter, | ||
const char * | endpoint, | ||
HelicsError * | err | ||
) |
Link a named filter to a source endpoint.
broker | The broker to generate the connection from. | |
filter | The name of the filter (cannot be NULL). | |
endpoint | The name of the endpoint to filter the data from (cannot be NULL). | |
[in,out] | err | A HelicsError object, can be NULL if the errors are to be ignored. |
References HELICS_ERROR_INVALID_ARGUMENT.
Referenced by helicscpp::Broker::addSourceFilterToEndpoint().
void helicsBrokerClearTimeBarrier | ( | HelicsBroker | broker | ) |
Clear any time barrier on a broker.
broker | The broker to clear the barriers on. |
HelicsBroker helicsBrokerClone | ( | HelicsBroker | broker, |
HelicsError * | err | ||
) |
Create a new reference to an existing broker.
This will create a new broker object that references the existing broker it must be freed as well.
broker | An existing HelicsBroker. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
References helics::getBrokerObject().
Referenced by helicscpp::Broker::Broker(), and helicscpp::Broker::operator=().
void helicsBrokerDataLink | ( | HelicsBroker | broker, |
const char * | source, | ||
const char * | target, | ||
HelicsError * | err | ||
) |
Link a named publication and named input using a broker.
broker | The broker to generate the connection from. | |
source | The name of the publication (cannot be NULL). | |
target | The name of the target to send the publication data (cannot be NULL). | |
[in,out] | err | A HelicsError object, can be NULL if the errors are to be ignored. |
References HELICS_ERROR_INVALID_ARGUMENT.
Referenced by helicscpp::Broker::dataLink().
void helicsBrokerDestroy | ( | HelicsBroker | broker | ) |
Disconnect and free a broker.
References helicsBrokerDisconnect(), and helicsBrokerFree().
void helicsBrokerDisconnect | ( | HelicsBroker | broker, |
HelicsError * | err | ||
) |
Disconnect a broker.
broker | The broker to disconnect. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Broker::disconnect(), and helicsBrokerDestroy().
void helicsBrokerFree | ( | HelicsBroker | broker | ) |
Release the memory associated with a broker.
References helics::BrokerFactory::cleanUpBrokers(), and helics::getBrokerObject().
Referenced by helicsBrokerDestroy(), and helicscpp::Broker::~Broker().
const char* helicsBrokerGetAddress | ( | HelicsBroker | broker | ) |
Get the network address associated with a broker.
broker | The broker to query. |
Referenced by helicscpp::Broker::getAddress().
const char* helicsBrokerGetIdentifier | ( | HelicsBroker | broker | ) |
Get an identifier for the broker.
broker | The broker to query. |
Referenced by helicscpp::Broker::getIdentifier().
void helicsBrokerGlobalError | ( | HelicsBroker | broker, |
int | errorCode, | ||
const char * | errorString, | ||
HelicsError * | err | ||
) |
Generate a global error through a broker. This will terminate the federation.
broker | The broker to generate the global error on. | |
errorCode | The error code to associate with the global error. | |
errorString | An error message to associate with the global error. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
HelicsBool helicsBrokerIsConnected | ( | HelicsBroker | broker | ) |
Check if a broker is connected.
A connected broker implies it is attached to cores or cores could reach out to communicate.
References HELICS_FALSE, and HELICS_TRUE.
Referenced by helicscpp::Broker::Broker(), and helicscpp::Broker::isConnected().
HelicsBool helicsBrokerIsValid | ( | HelicsBroker | broker | ) |
Check if a broker object is a valid object.
broker | The HelicsBroker object to test. |
References helics::getBrokerObject(), HELICS_FALSE, and HELICS_TRUE.
void helicsBrokerMakeConnections | ( | HelicsBroker | broker, |
const char * | file, | ||
HelicsError * | err | ||
) |
Load a file containing connection information.
broker | The broker to generate the connections from. | |
file | A JSON or TOML file containing connection information. | |
[in,out] | err | A HelicsError object, can be NULL if the errors are to be ignored. |
void helicsBrokerSendCommand | ( | HelicsBroker | broker, |
const char * | target, | ||
const char * | command, | ||
HelicsError * | err | ||
) |
Send a command to another helics object through a broker using asynchronous(fast) messages.
broker | The broker to send the command through. | |
target | The name of the object to send the command to. | |
command | The command to send. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
References HELICS_SEQUENCING_MODE_FAST.
Referenced by helicscpp::Broker::sendCommand().
void helicsBrokerSendOrderedCommand | ( | HelicsBroker | broker, |
const char * | target, | ||
const char * | command, | ||
HelicsError * | err | ||
) |
Send a command to another helics object through a broker using ordered sequencing.
broker | The broker to send the command through. | |
target | The name of the object to send the command to. | |
command | The command to send. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
References HELICS_SEQUENCING_MODE_ORDERED.
void helicsBrokerSetGlobal | ( | HelicsBroker | broker, |
const char * | valueName, | ||
const char * | value, | ||
HelicsError * | err | ||
) |
Set a federation global value.
This overwrites any previous value for this name.
broker | The broker to set the global through. | |
valueName | The name of the global to set. | |
value | The value of the global. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
References HELICS_ERROR_INVALID_ARGUMENT.
Referenced by helicscpp::Broker::setGlobal().
void helicsBrokerSetLogFile | ( | HelicsBroker | broker, |
const char * | logFileName, | ||
HelicsError * | err | ||
) |
Set the log file on a broker.
broker | The broker to set the log file for. | |
logFileName | The name of the file to log to. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
void helicsBrokerSetTimeBarrier | ( | HelicsBroker | broker, |
HelicsTime | barrierTime, | ||
HelicsError * | err | ||
) |
Set a broker time barrier.
broker | The broker to set the time barrier for. | |
barrierTime | The time to set the barrier at. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
HelicsBool helicsBrokerWaitForDisconnect | ( | HelicsBroker | broker, |
int | msToWait, | ||
HelicsError * | err | ||
) |
Wait for the broker to disconnect.
broker | The broker to wait for. | |
msToWait | The time out in millisecond (<0 for infinite timeout). | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
References HELICS_FALSE, and HELICS_TRUE.
Referenced by helicscpp::Broker::waitForDisconnect().
void helicsCleanupLibrary | ( | void | ) |
Function to do some housekeeping work.
This runs some cleanup routines and tries to close out any residual thread that haven't been shutdown yet.
Referenced by helicscpp::cleanupHelicsLibrary().
void helicsClearSignalHandler | ( | ) |
Clear HELICS based signal handlers.
void helicsCloseLibrary | ( | void | ) |
Call when done using the helics library. This function will ensure the threads are closed properly. If possible this should be the last call before exiting.
References helics::BrokerFactory::cleanUpBrokers(), helics::CoreFactory::cleanUpCores(), and helics::cleanupHelicsLibrary().
Referenced by helicscpp::closeLibrary().
void helicsCoreAddAlias | ( | HelicsCore | core, |
const char * | interfaceName, | ||
const char * | alias, | ||
HelicsError * | err | ||
) |
Create an alias for an interface.
core | The core to use to set the alias. | |
interfaceName | The current name of an interface. | |
alias | The additional name to use for the given interface. | |
[in,out] | err | A pointer to an error object for catching errors. |
References HELICS_ERROR_INVALID_ARGUMENT.
Referenced by helicscpp::Core::addAlias().
void helicsCoreAddDestinationFilterToEndpoint | ( | HelicsCore | core, |
const char * | filter, | ||
const char * | endpoint, | ||
HelicsError * | err | ||
) |
Link a named filter to a destination endpoint.
core | The core to generate the connection from. | |
filter | The name of the filter (cannot be NULL). | |
endpoint | The name of the endpoint to filter the data going to (cannot be NULL). | |
[in,out] | err | A HelicsError object, can be NULL if the errors are to be ignored. |
References HELICS_ERROR_INVALID_ARGUMENT.
void helicsCoreAddSourceFilterToEndpoint | ( | HelicsCore | core, |
const char * | filter, | ||
const char * | endpoint, | ||
HelicsError * | err | ||
) |
Link a named filter to a source endpoint.
core | The core to generate the connection from. | |
filter | The name of the filter (cannot be NULL). | |
endpoint | The name of the endpoint to filter the data from (cannot be NULL). | |
[in,out] | err | A HelicsError object, can be NULL if the errors are to be ignored. |
References HELICS_ERROR_INVALID_ARGUMENT.
HelicsCore helicsCoreClone | ( | HelicsCore | core, |
HelicsError * | err | ||
) |
Create a new reference to an existing core.
This will create a new broker object that references the existing broker. The new broker object must be freed as well.
core | An existing HelicsCore. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
References helics::getCoreObject().
Referenced by helicscpp::Core::Core(), and helicscpp::Core::operator=().
HelicsBool helicsCoreConnect | ( | HelicsCore | core, |
HelicsError * | err | ||
) |
Connect a core to the federate based on current configuration.
core | The core to connect. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
References HELICS_FALSE, and HELICS_TRUE.
void helicsCoreDataLink | ( | HelicsCore | core, |
const char * | source, | ||
const char * | target, | ||
HelicsError * | err | ||
) |
Link a named publication and named input using a core.
core | The core to generate the connection from. | |
source | The name of the publication (cannot be NULL). | |
target | The name of the target to send the publication data (cannot be NULL). | |
[in,out] | err | A HelicsError object, can be NULL if the errors are to be ignored. |
References HELICS_ERROR_INVALID_ARGUMENT.
void helicsCoreDestroy | ( | HelicsCore | core | ) |
Disconnect and free a core.
References helicsCoreDisconnect(), and helicsCoreFree().
void helicsCoreDisconnect | ( | HelicsCore | core, |
HelicsError * | err | ||
) |
Disconnect a core from the federation.
core | The core to query. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Core::disconnect(), and helicsCoreDestroy().
void helicsCoreFree | ( | HelicsCore | core | ) |
Release the memory associated with a core.
References helics::CoreFactory::cleanUpCores(), and helics::getCoreObject().
Referenced by helicsCoreDestroy(), and helicscpp::Core::~Core().
const char* helicsCoreGetAddress | ( | HelicsCore | core | ) |
Get the network address associated with a core.
core | The core to query. |
Referenced by helicscpp::Core::getAddress().
const char* helicsCoreGetIdentifier | ( | HelicsCore | core | ) |
Get an identifier for the core.
core | The core to query. |
Referenced by helicscpp::Core::getIdentifier().
void helicsCoreGlobalError | ( | HelicsCore | core, |
int | errorCode, | ||
const char * | errorString, | ||
HelicsError * | err | ||
) |
Generate a global error through a broker. This will terminate the federation.
core | The core to generate the global error. | |
errorCode | The error code to associate with the global error. | |
errorString | An error message to associate with the global error. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
References helics::gLocalCoreId().
HelicsBool helicsCoreIsConnected | ( | HelicsCore | core | ) |
Check if a core is connected.
A connected core implies it is attached to federates or federates could be attached to it
References HELICS_FALSE, and HELICS_TRUE.
Referenced by helicscpp::Core::isConnected().
HelicsBool helicsCoreIsValid | ( | HelicsCore | core | ) |
Check if a core object is a valid object.
core | The HelicsCore object to test. |
References helics::getCoreObject(), HELICS_FALSE, and HELICS_TRUE.
void helicsCoreMakeConnections | ( | HelicsCore | core, |
const char * | file, | ||
HelicsError * | err | ||
) |
Load a file containing connection information.
core | The core to generate the connections from. | |
file | A JSON or TOML file containing connection information. | |
[in,out] | err | A HelicsError object, can be NULL if the errors are to be ignored. |
void helicsCoreSendCommand | ( | HelicsCore | core, |
const char * | target, | ||
const char * | command, | ||
HelicsError * | err | ||
) |
Send a command to another helics object though a core using asynchronous(fast) operations.
core | The core to send the command through. | |
target | The name of the object to send the command to. | |
command | The command to send. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
References HELICS_SEQUENCING_MODE_FAST.
Referenced by helicscpp::Core::sendCommand().
void helicsCoreSendOrderedCommand | ( | HelicsCore | core, |
const char * | target, | ||
const char * | command, | ||
HelicsError * | err | ||
) |
Send a command to another helics object though a core using ordered operations.
core | The core to send the command through. | |
target | The name of the object to send the command to. | |
command | The command to send. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
References HELICS_SEQUENCING_MODE_ORDERED.
void helicsCoreSetGlobal | ( | HelicsCore | core, |
const char * | valueName, | ||
const char * | value, | ||
HelicsError * | err | ||
) |
Set a global value in a core.
This overwrites any previous value for this name.
core | The core to set the global through. | |
valueName | The name of the global to set. | |
value | The value of the global. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
References HELICS_ERROR_INVALID_ARGUMENT.
Referenced by helicscpp::Core::setGlobal().
void helicsCoreSetLogFile | ( | HelicsCore | core, |
const char * | logFileName, | ||
HelicsError * | err | ||
) |
Set the log file on a core.
core | The core to set the log file for. | |
logFileName | The name of the file to log to. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
void helicsCoreSetReadyToInit | ( | HelicsCore | core, |
HelicsError * | err | ||
) |
Set the core to ready for init.
This function is used for cores that have filters but no federates so there needs to be a direct signal to the core to trigger the federation initialization.
core | The core object to enable init values for. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Core::setReadyToInit().
HelicsBool helicsCoreWaitForDisconnect | ( | HelicsCore | core, |
int | msToWait, | ||
HelicsError * | err | ||
) |
Wait for the core to disconnect.
core | The core to wait for. | |
msToWait | The time out in millisecond (<0 for infinite timeout). | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
References HELICS_FALSE, and HELICS_TRUE.
Referenced by helicscpp::Core::waitForDisconnect().
HelicsBroker helicsCreateBroker | ( | const char * | type, |
const char * | name, | ||
const char * | initString, | ||
HelicsError * | err | ||
) |
Create a broker object.
type | The type of the broker to create. | |
name | The name of the broker. It can be a nullptr or empty string to have a name automatically assigned. | |
initString | An initialization string to send to the core-the format is similar to command line arguments. Typical options include a broker address such as –broker="XSSAF" if this is a subbroker, or the number of federates, or the address. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
It will be NULL if there was an error indicated in the err object.
References helics::BrokerFactory::create(), helics::DEFAULT, HelicsError::error_code, HELICS_ERROR_INVALID_ARGUMENT, HelicsError::message, and helics::UNRECOGNIZED.
Referenced by helicscpp::Broker::Broker().
HelicsBroker helicsCreateBrokerFromArgs | ( | const char * | type, |
const char * | name, | ||
int | argc, | ||
const char *const * | argv, | ||
HelicsError * | err | ||
) |
Create a core object by passing command line arguments.
type | The type of the core to create. | |
name | The name of the core. It can be a nullptr or empty string to have a name automatically assigned. | |
argc | The number of arguments. | |
argv | The list of string values from a command line. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
References helics::BrokerFactory::create(), helics::DEFAULT, HelicsError::error_code, HELICS_ERROR_INVALID_ARGUMENT, HelicsError::message, and helics::UNRECOGNIZED.
Referenced by helicscpp::Broker::Broker().
HelicsFederate helicsCreateCallbackFederate | ( | const char * | fedName, |
HelicsFederateInfo | fi, | ||
HelicsError * | err | ||
) |
Create a callback federate from a federate info object.
Callback federates are combination federates that run a series of callback for execution in a completely automated fashion.
fedName | A string with the name of the federate, can be NULL or an empty string to pull the default name from fi. | |
fi | The federate info object that contains details on the federate. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
HelicsFederate helicsCreateCallbackFederateFromConfig | ( | const char * | configFile, |
HelicsError * | err | ||
) |
Create a callback federate from a JSON file or JSON string or TOML file.
Callback federates are combination federates that run a series of callbacks for execution in a completely automated fashion. The enterInitializingMode call transfers complete control of the federate to the Core and no further user interaction is expected.
configFile | A JSON file or a JSON string or TOML file that contains setup and configuration information. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
HelicsFederate helicsCreateCombinationFederate | ( | const char * | fedName, |
HelicsFederateInfo | fi, | ||
HelicsError * | err | ||
) |
Create a combination federate from a federate info object.
Combination federates are both value federates and message federates, objects can be used in all functions that take a HelicsFederate, helics_message_federate or HelicsFederate object as an argument
fedName | A string with the name of the federate, can be NULL or an empty string to pull the default name from fi. | |
fi | The federate info object that contains details on the federate. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::CombinationFederate::CombinationFederate().
HelicsFederate helicsCreateCombinationFederateFromConfig | ( | const char * | configFile, |
HelicsError * | err | ||
) |
Create a combination federate from a JSON file or JSON string or TOML file.
Combination federates are both value federates and message federates, objects can be used in all functions that take a HelicsFederate, helics_message_federate or HelicsFederate object as an argument
configFile | A JSON file or a JSON string or TOML file that contains setup and configuration information. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::CombinationFederate::CombinationFederate().
HelicsCore helicsCreateCore | ( | const char * | type, |
const char * | name, | ||
const char * | initString, | ||
HelicsError * | err | ||
) |
Create a core object.
type | The type of the core to create. | |
name | The name of the core. It can be a nullptr or empty string to have a name automatically assigned. | |
initString | An initialization string to send to the core. The format is similar to command line arguments. Typical options include a broker name, the broker address, the number of federates, etc. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
If the core is invalid, err will contain the corresponding error message and the returned object will be NULL.
References helics::DEFAULT, HelicsError::error_code, helics::CoreFactory::FindOrCreate(), HELICS_ERROR_INVALID_ARGUMENT, HelicsError::message, and helics::UNRECOGNIZED.
Referenced by helicscpp::Core::Core().
HelicsCore helicsCreateCoreFromArgs | ( | const char * | type, |
const char * | name, | ||
int | argc, | ||
const char *const * | argv, | ||
HelicsError * | err | ||
) |
Create a core object by passing command line arguments.
type | The type of the core to create. | |
name | The name of the core. It can be a nullptr or empty string to have a name automatically assigned. | |
argc | The number of arguments. | |
argv | The list of string values from a command line. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
References helics::DEFAULT, HelicsError::error_code, helics::CoreFactory::FindOrCreate(), HELICS_ERROR_INVALID_ARGUMENT, HelicsError::message, and helics::UNRECOGNIZED.
Referenced by helicscpp::Core::Core().
HelicsFederateInfo helicsCreateFederateInfo | ( | void | ) |
Create a federate info object for specifying federate information when constructing a federate.
Referenced by helicscpp::FederateInfo::FederateInfo().
HelicsFederate helicsCreateMessageFederate | ( | const char * | fedName, |
HelicsFederateInfo | fi, | ||
HelicsError * | err | ||
) |
Create a message federate from a federate info object.
helics_message_federate objects can be used in all functions that take a helics_message_federate or HelicsFederate object as an argument.
fedName | The name of the federate to create. | |
fi | The federate info object that contains details on the federate. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::MessageFederate::MessageFederate().
HelicsFederate helicsCreateMessageFederateFromConfig | ( | const char * | configFile, |
HelicsError * | err | ||
) |
Create a message federate from a JSON file or JSON string or TOML file.
helics_message_federate objects can be used in all functions that take a helics_message_federate or HelicsFederate object as an argument.
configFile | A Config(JSON,TOML) file or a JSON string that contains setup and configuration information. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::MessageFederate::MessageFederate().
HelicsQuery helicsCreateQuery | ( | const char * | target, |
const char * | query | ||
) |
Create a query object.
A query object consists of a target and query string.
target | The name of the target to query. |
query | The query to make of the target. |
Referenced by helicscpp::Core::query(), helicscpp::Broker::query(), and helicscpp::Federate::query().
HelicsFederate helicsCreateValueFederate | ( | const char * | fedName, |
HelicsFederateInfo | fi, | ||
HelicsError * | err | ||
) |
Create a value federate from a federate info object.
HelicsFederate objects can be used in all functions that take a HelicsFederate or HelicsFederate object as an argument.
fedName | The name of the federate to create, can NULL or an empty string to use the default name from fi or an assigned name. | |
fi | The federate info object that contains details on the federate. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::ValueFederate::ValueFederate().
HelicsFederate helicsCreateValueFederateFromConfig | ( | const char * | configFile, |
HelicsError * | err | ||
) |
Create a value federate from a JSON file, JSON string, or TOML file.
HelicsFederate objects can be used in all functions that take a HelicsFederate or HelicsFederate object as an argument.
configFile | A JSON file or a JSON string or TOML file that contains setup and configuration information. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::ValueFederate::ValueFederate().
void helicsErrorClear | ( | HelicsError * | err | ) |
Clear an error object.
clear an error object
References HelicsError::error_code, and HelicsError::message.
HelicsError helicsErrorInitialize | ( | void | ) |
Return an initialized error object.
References HelicsError::error_code, and HelicsError::message.
void helicsFederateAddAlias | ( | HelicsFederate | fed, |
const char * | interfaceName, | ||
const char * | alias, | ||
HelicsError * | err | ||
) |
Create an alias for an interface.
fed | The federate to use to set the alias. | |
interfaceName | The current name of an interface. | |
alias | The additional name to use for the given interface. | |
[in,out] | err | A pointer to an error object for catching errors. |
Referenced by helicscpp::Federate::addAlias().
void helicsFederateAddDependency | ( | HelicsFederate | fed, |
const char * | fedName, | ||
HelicsError * | err | ||
) |
Add a time dependency for a federate. The federate will depend on the given named federate for time synchronization.
fed | The federate to add the dependency for. | |
fedName | The name of the federate to depend on. | |
[in,out] | err | A pointer to an error object for catching errors. |
Referenced by helicscpp::Federate::addDependency().
HelicsFederate helicsFederateClone | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Create a new reference to an existing federate.
This will create a new HelicsFederate object that references the existing federate. The new object must be freed as well.
fed | An existing HelicsFederate. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::Federate(), helicscpp::FederateInfo::FederateInfo(), helicscpp::FederateInfo::operator=(), and helicscpp::Federate::operator=().
void helicsFederateDestroy | ( | HelicsFederate | fed | ) |
Disconnect and free a federate.
References helicsFederateFinalize(), and helicsFederateFree().
void helicsFederateDisconnect | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Disconnect/finalize the federate. This function halts all communication in the federate and disconnects it from the core. This call is identical to helicsFederateFinalize.
void helicsFederateDisconnectAsync | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Disconnect/finalize the federate in an async call. This call is identical to helicsFederateFinalizeAsync.
void helicsFederateDisconnectComplete | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Complete the asynchronous disconnect/finalize call. This call is identical to helicsFederateFinalizeComplete
void helicsFederateEnterExecutingMode | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Request that the federate enter the Execution mode.
This call is blocking until granted entry by the core object. On return from this call the federate will be at time 0. For an asynchronous alternative call see /ref helicsFederateEnterExecutingModeAsync.
fed | A federate to change modes. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::enterExecutingMode().
void helicsFederateEnterExecutingModeAsync | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Request that the federate enter the Execution mode.
This call is non-blocking and will return immediately. Call /ref helicsFederateEnterExecutingModeComplete to finish the call sequence.
fed | The federate object to complete the call. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::enterExecutingModeAsync().
void helicsFederateEnterExecutingModeComplete | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Complete the call to /ref helicsFederateEnterExecutingModeAsync.
fed | The federate object to complete the call. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::enterExecutingModeComplete().
HelicsIterationResult helicsFederateEnterExecutingModeIterative | ( | HelicsFederate | fed, |
HelicsIterationRequest | iterate, | ||
HelicsError * | err | ||
) |
Request an iterative time.
This call allows for finer grain control of the iterative process than /ref helicsFederateRequestTime. It takes a time and iteration request, and returns a time and iteration status.
fed | The federate to make the request of. | |
iterate | The requested iteration mode. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::enterExecutingMode().
void helicsFederateEnterExecutingModeIterativeAsync | ( | HelicsFederate | fed, |
HelicsIterationRequest | iterate, | ||
HelicsError * | err | ||
) |
Request an iterative entry to the execution mode.
This call allows for finer grain control of the iterative process than /ref helicsFederateRequestTime. It takes a time and iteration request, and returns a time and iteration status
fed | The federate to make the request of. | |
iterate | The requested iteration mode. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::enterExecutingModeAsync().
HelicsIterationResult helicsFederateEnterExecutingModeIterativeComplete | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Complete the asynchronous iterative call into ExecutionMode.
fed | The federate to make the request of. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::enterExecutingModeComplete().
void helicsFederateEnterInitializingMode | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Enter the initialization state of a federate.
The initialization state allows initial values to be set and received if the iteration is requested on entry to the execution state. This is a blocking call and will block until the core allows it to proceed.
fed | The federate to operate on. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::enterInitializingMode().
void helicsFederateEnterInitializingModeAsync | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Non blocking alternative to helicsFederateEnterInitializingMode.
The function helicsFederateEnterInitializationModeComplete must be called to finish the operation.
fed | The federate to operate on. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::enterInitializingModeAsync().
void helicsFederateEnterInitializingModeComplete | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Complete the entry to initialize mode that was initiated with /ref heliceEnterInitializingModeAsync.
fed | The federate desiring to complete the initialization step. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::enterInitializingModeComplete().
void helicsFederateEnterInitializingModeIterative | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Trigger a blocking call and return to created state after all federates have either triggered an iteration or are waiting to enter initializing mode.
This call will return the federate to the created state to allow additional setup to occur with federates either iterating in the mode or waiting.
fed | The federate to operate on. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::enterInitializingModeIterative().
void helicsFederateEnterInitializingModeIterativeAsync | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Non blocking alternative to helicsFederateEnterInitializingModeIterative.
The function helicsFederateEnterInitializationModeIterativeComplete must be called to finish the operation.
fed | The federate to operate on. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::enterInitializingModeIterativeAsync().
void helicsFederateEnterInitializingModeIterativeComplete | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Complete the call to enter initializing mode Iterative that was initiated with /ref heliceEnterInitializingModeIterativeAsync. The federate will be in created or error mode on return
fed | The federate used in the corresponding async call | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::enterInitializingModeIterativeComplete().
void helicsFederateFinalize | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Disconnect/finalize the federate. This function halts all communication in the federate and disconnects it from the core.
Referenced by helicscpp::Federate::finalize(), and helicsFederateDestroy().
void helicsFederateFinalizeAsync | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Disconnect/finalize the federate in an async call.
Referenced by helicscpp::Federate::finalizeAsync().
void helicsFederateFinalizeComplete | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Complete the asynchronous disconnect/finalize call.
Referenced by helicscpp::Federate::finalizeComplete().
void helicsFederateFree | ( | HelicsFederate | fed | ) |
Release the memory associated with a federate.
References helics::CoreFactory::cleanUpCores(), and helics::getFedObject().
Referenced by helicsFederateDestroy(), and helicscpp::Federate::~Federate().
const char* helicsFederateGetCommand | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Get a command sent to the federate.
fed | The federate to get the command for. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::getCommand().
const char* helicsFederateGetCommandSource | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Get the source of the most recently retrieved command sent to the federate.
fed | The federate to get the command for. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::getCommandSource().
HelicsCore helicsFederateGetCore | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Get the core object associated with a federate.
fed | A federate object. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::getCore().
HelicsTime helicsFederateGetCurrentTime | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Get the current time of the federate.
fed | The federate object to query. | |
[in,out] | err | A pointer to an error object for catching errors. |
Referenced by helicscpp::Federate::getCurrentTime().
HelicsBool helicsFederateGetFlagOption | ( | HelicsFederate | fed, |
int | flag, | ||
HelicsError * | err | ||
) |
Get a flag value for a federate.
fed | The federate to get the flag for. | |
flag | The flag to query. | |
[in,out] | err | A pointer to an error object for catching errors. |
Referenced by helicscpp::Federate::getFlagOption().
int helicsFederateGetIntegerProperty | ( | HelicsFederate | fed, |
int | intProperty, | ||
HelicsError * | err | ||
) |
Get the current value of an integer property (such as a logging level).
fed | The federate to get the flag for. | |
intProperty | A code for the property to set /ref helics_handle_options. | |
[in,out] | err | A pointer to an error object for catching errors. |
Referenced by helicscpp::Federate::getIntegerProperty().
const char* helicsFederateGetName | ( | HelicsFederate | fed | ) |
Get the name of the federate.
fed | The federate object to query. |
Referenced by helicscpp::Federate::getName(), helicscpp::Federate::protect(), and helicscpp::Federate::unProtect().
HelicsFederateState helicsFederateGetState | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Get the current state of a federate.
fed | The federate to query. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. The err object will be removed in a future release as it is not necessary for use the function will not error, invalid federate return HELICS_STATE_UNKOWN |
Referenced by helicscpp::Federate::getCurrentMode().
const char* helicsFederateGetTag | ( | HelicsFederate | fed, |
const char * | tagName, | ||
HelicsError * | err | ||
) |
Get a federate tag value.
fed | The federate to get the tag for. | |
tagName | The name of the tag to query. | |
[in,out] | err | A pointer to an error object for catching errors. |
Referenced by helicscpp::Federate::getTag().
HelicsTime helicsFederateGetTimeProperty | ( | HelicsFederate | fed, |
int | timeProperty, | ||
HelicsError * | err | ||
) |
Get the current value of a time based property in a federate.
fed | The federate query. | |
timeProperty | The property to query. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::getTimeProperty().
void helicsFederateGlobalError | ( | HelicsFederate | fed, |
int | errorCode, | ||
const char * | errorString, | ||
HelicsError * | err | ||
) |
Generate a global error from a federate.
A global error halts the co-simulation completely.
fed | The federate to create an error in. | |
errorCode | The integer code for the error. | |
errorString | A string describing the error. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::globalError().
HelicsFederateInfo helicsFederateInfoClone | ( | HelicsFederateInfo | fi, |
HelicsError * | err | ||
) |
Create a federate info object from an existing one and clone the information.
fi | A federateInfo object to duplicate. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
void helicsFederateInfoFree | ( | HelicsFederateInfo | fi | ) |
Delete the memory associated with a federate info object.
Referenced by helicscpp::FederateInfo::operator=(), and helicscpp::FederateInfo::~FederateInfo().
void helicsFederateInfoLoadFromArgs | ( | HelicsFederateInfo | fi, |
int | argc, | ||
const char *const * | argv, | ||
HelicsError * | err | ||
) |
Load federate info from command line arguments.
fi | A federateInfo object. | |
argc | The number of command line arguments. | |
argv | An array of strings from the command line. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
void helicsFederateInfoLoadFromString | ( | HelicsFederateInfo | fi, |
const char * | args, | ||
HelicsError * | err | ||
) |
Load federate info from command line arguments contained in a string.
fi | A federateInfo object. | |
args | Command line arguments specified in a string. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
void helicsFederateInfoSetBroker | ( | HelicsFederateInfo | fi, |
const char * | broker, | ||
HelicsError * | err | ||
) |
Set the name or connection information for a broker.
This is only used if the core is automatically created, the broker information will be transferred to the core for connection.
fi | The federate info object to alter. | |
broker | A string which defines the connection information for a broker either a name or an address. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::FederateInfo::setBroker().
void helicsFederateInfoSetBrokerInitString | ( | HelicsFederateInfo | fi, |
const char * | brokerInit, | ||
HelicsError * | err | ||
) |
Set the initialization string that a core will pass to a generated broker usually in the form of command line arguments.
fi | The federate info object to alter. | |
brokerInit | A string with command line arguments for a generated broker. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::FederateInfo::setBrokerInit().
void helicsFederateInfoSetBrokerKey | ( | HelicsFederateInfo | fi, |
const char * | brokerkey, | ||
HelicsError * | err | ||
) |
Set the key for a broker connection.
This is only used if the core is automatically created, the broker information will be transferred to the core for connection.
fi | The federate info object to alter. | |
brokerkey | A string containing a key for the broker to connect. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::FederateInfo::setBrokerKey().
void helicsFederateInfoSetBrokerPort | ( | HelicsFederateInfo | fi, |
int | brokerPort, | ||
HelicsError * | err | ||
) |
Set the port to use for the broker.
This is only used if the core is automatically created, the broker information will be transferred to the core for connection. This will only be useful for network broker connections.
fi | The federate info object to alter. | |
brokerPort | The integer port number to use for connection with a broker. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
void helicsFederateInfoSetCoreInitString | ( | HelicsFederateInfo | fi, |
const char * | coreInit, | ||
HelicsError * | err | ||
) |
Set the initialization string for the core usually in the form of command line arguments.
fi | The federate info object to alter. | |
coreInit | A string containing command line arguments to be passed to the core. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::FederateInfo::setCoreInit().
void helicsFederateInfoSetCoreName | ( | HelicsFederateInfo | fi, |
const char * | corename, | ||
HelicsError * | err | ||
) |
Set the name of the core to link to for a federate.
fi | The federate info object to alter. | |
corename | The identifier for a core to link to. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::FederateInfo::setCoreName().
void helicsFederateInfoSetCoreType | ( | HelicsFederateInfo | fi, |
int | coretype, | ||
HelicsError * | err | ||
) |
Set the core type by integer code.
Valid values available by definitions in api-data.h.
fi | The federate info object to alter. | |
coretype | An numerical code for a core type see /ref helics_CoreType. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::FederateInfo::FederateInfo(), and helicscpp::FederateInfo::setCoreType().
void helicsFederateInfoSetCoreTypeFromString | ( | HelicsFederateInfo | fi, |
const char * | coretype, | ||
HelicsError * | err | ||
) |
Set the core type from a string.
fi | The federate info object to alter. | |
coretype | A string naming a core type. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::FederateInfo::FederateInfo(), and helicscpp::FederateInfo::setCoreType().
void helicsFederateInfoSetFlagOption | ( | HelicsFederateInfo | fi, |
int | flag, | ||
HelicsBool | value, | ||
HelicsError * | err | ||
) |
Set a flag in the info structure.
Valid flags are available /ref helics_federate_flags.
fi | The federate info object to alter. | |
flag | A numerical index for a flag. | |
value | The desired value of the flag HELICS_TRUE or HELICS_FALSE. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::FederateInfo::setFlagOption().
void helicsFederateInfoSetIntegerProperty | ( | HelicsFederateInfo | fi, |
int | intProperty, | ||
int | propertyValue, | ||
HelicsError * | err | ||
) |
Set an integer property for a federate.
Set known properties.
fi | The federateInfo object to alter. | |
intProperty | An int identifying the property. | |
propertyValue | The value to set the property to. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::FederateInfo::setProperty().
void helicsFederateInfoSetLocalPort | ( | HelicsFederateInfo | fi, |
const char * | localPort, | ||
HelicsError * | err | ||
) |
Set the local port to use.
This is only used if the core is automatically created, the port information will be transferred to the core for connection.
fi | The federate info object to alter. | |
localPort | A string with the port information to use as the local server port can be a number or "auto" or "os_local". | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
void helicsFederateInfoSetSeparator | ( | HelicsFederateInfo | fi, |
char | separator, | ||
HelicsError * | err | ||
) |
Set the separator character in the info structure.
The separator character is the separation character for local publications/endpoints in creating their global name. For example if the separator character is '/' then a local endpoint would have a globally reachable name of fedName/localName.
fi | The federate info object to alter. | |
separator | The character to use as a separator. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::FederateInfo::setSeparator().
void helicsFederateInfoSetTimeProperty | ( | HelicsFederateInfo | fi, |
int | timeProperty, | ||
HelicsTime | propertyValue, | ||
HelicsError * | err | ||
) |
Set the output delay for a federate.
fi | The federate info object to alter. | |
timeProperty | An integer representation of the time based property to set see /ref helics_properties. | |
propertyValue | The value of the property to set the timeProperty to. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::FederateInfo::setProperty().
HelicsBool helicsFederateIsAsyncOperationCompleted | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Check if the current Asynchronous operation has completed.
fed | The federate to operate on. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::isAsyncOperationCompleted().
HelicsBool helicsFederateIsProtected | ( | const char * | fedName, |
HelicsError * | err | ||
) |
checks if an existing federate is protected
fedName | the name of an existing federate to check the protection status | |
[in,out] | err | An error object that will contain an error code and string if the federate was not found. |
HelicsBool helicsFederateIsValid | ( | HelicsFederate | fed | ) |
Check if a federate_object is valid.
void helicsFederateLocalError | ( | HelicsFederate | fed, |
int | errorCode, | ||
const char * | errorString, | ||
HelicsError * | err | ||
) |
Generate a local error in a federate.
This will propagate through the co-simulation but not necessarily halt the co-simulation, it has a similar effect to finalize but does allow some interaction with a core for a brief time.
fed | The federate to create an error in. | |
errorCode | The integer code for the error. | |
errorString | A string describing the error. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::localError().
void helicsFederateLogDebugMessage | ( | HelicsFederate | fed, |
const char * | logmessage, | ||
HelicsError * | err | ||
) |
Log a debug message through a federate.
fed | The federate to log the debug message through. | |
logmessage | The message to put in the log. | |
[in,out] | err | A pointer to an error object for catching errors. |
Referenced by helicscpp::Federate::logDebugMessage().
void helicsFederateLogErrorMessage | ( | HelicsFederate | fed, |
const char * | logmessage, | ||
HelicsError * | err | ||
) |
Log an error message through a federate.
fed | The federate to log the error message through. | |
logmessage | The message to put in the log. | |
[in,out] | err | A pointer to an error object for catching errors. |
Referenced by helicscpp::Federate::logErrorMessage().
void helicsFederateLogInfoMessage | ( | HelicsFederate | fed, |
const char * | logmessage, | ||
HelicsError * | err | ||
) |
Log an info message through a federate.
fed | The federate to log the info message through. | |
logmessage | The message to put in the log. | |
[in,out] | err | A pointer to an error object for catching errors. |
Referenced by helicscpp::Federate::logInfoMessage().
void helicsFederateLogLevelMessage | ( | HelicsFederate | fed, |
int | loglevel, | ||
const char * | logmessage, | ||
HelicsError * | err | ||
) |
Log a message through a federate.
fed | The federate to log the message through. | |
loglevel | The level of the message to log see /ref helics_log_levels. | |
logmessage | The message to put in the log. | |
[in,out] | err | A pointer to an error object for catching errors. |
Referenced by helicscpp::Federate::logMessage().
void helicsFederateLogWarningMessage | ( | HelicsFederate | fed, |
const char * | logmessage, | ||
HelicsError * | err | ||
) |
Log a warning message through a federate.
fed | The federate to log the warning message through. | |
logmessage | The message to put in the log. | |
[in,out] | err | A pointer to an error object for catching errors. |
Referenced by helicscpp::Federate::logWarningMessage().
void helicsFederateProcessCommunications | ( | HelicsFederate | fed, |
HelicsTime | period, | ||
HelicsError * | err | ||
) |
Tell helics to process internal communications for a period of time.
fed | The federate to tell to process. | |
period | The length of time to process communications and then return control. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
void helicsFederateProtect | ( | const char * | fedName, |
HelicsError * | err | ||
) |
Protect a federate from finalizing and closing if all references go out of scope
this function allows a federate to be retrieved on demand, it must be explicitly close later otherwise it will be destroyed when the library is closed
fedName | The name of an existing HelicsFederate. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function, in particular if no federate with the given name exists |
Referenced by helicscpp::Federate::protect().
void helicsFederateRegisterInterfaces | ( | HelicsFederate | fed, |
const char * | file, | ||
HelicsError * | err | ||
) |
Load interfaces from a file.
fed | The federate to which to load interfaces. | |
file | The name of a file to load the interfaces from either JSON, or TOML. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::registerInterfaces().
HelicsTime helicsFederateRequestNextStep | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Request the next time step for federate execution.
Feds should have setup the period or minDelta for this to work well but it will request the next time step which is the current time plus the minimum time step.
fed | The federate to make the request of. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::requestNextStep().
HelicsTime helicsFederateRequestTime | ( | HelicsFederate | fed, |
HelicsTime | requestTime, | ||
HelicsError * | err | ||
) |
Request the next time for federate execution.
fed | The federate to make the request of. | |
requestTime | The next requested time. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::requestTime().
HelicsTime helicsFederateRequestTimeAdvance | ( | HelicsFederate | fed, |
HelicsTime | timeDelta, | ||
HelicsError * | err | ||
) |
Request the next time for federate execution.
fed | The federate to make the request of. | |
timeDelta | The requested amount of time to advance. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::requestTimeAdvance().
void helicsFederateRequestTimeAsync | ( | HelicsFederate | fed, |
HelicsTime | requestTime, | ||
HelicsError * | err | ||
) |
Request the next time for federate execution in an asynchronous call.
Call /ref helicsFederateRequestTimeComplete to finish the call.
fed | The federate to make the request of. | |
requestTime | The next requested time. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::requestTimeAsync().
HelicsTime helicsFederateRequestTimeComplete | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Complete an asynchronous requestTime call.
fed | The federate to make the request of. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::requestTimeComplete().
HelicsTime helicsFederateRequestTimeIterative | ( | HelicsFederate | fed, |
HelicsTime | requestTime, | ||
HelicsIterationRequest | iterate, | ||
HelicsIterationResult * | outIteration, | ||
HelicsError * | err | ||
) |
Request an iterative time.
This call allows for finer grain control of the iterative process than /ref helicsFederateRequestTime. It takes a time and and iteration request, and returns a time and iteration status.
fed | The federate to make the request of. | |
requestTime | The next desired time. | |
iterate | The requested iteration mode. | |
[out] | outIteration | The iteration specification of the result. |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::requestTimeIterative().
void helicsFederateRequestTimeIterativeAsync | ( | HelicsFederate | fed, |
HelicsTime | requestTime, | ||
HelicsIterationRequest | iterate, | ||
HelicsError * | err | ||
) |
Request an iterative time through an asynchronous call.
This call allows for finer grain control of the iterative process than /ref helicsFederateRequestTime. It takes a time and iteration request, and returns a time and iteration status. Call /ref helicsFederateRequestTimeIterativeComplete to finish the process.
fed | The federate to make the request of. | |
requestTime | The next desired time. | |
iterate | The requested iteration mode. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::requestTimeIterativeAsync().
HelicsTime helicsFederateRequestTimeIterativeComplete | ( | HelicsFederate | fed, |
HelicsIterationResult * | outIterate, | ||
HelicsError * | err | ||
) |
Complete an iterative time request asynchronous call.
fed | The federate to make the request of. | |
[out] | outIterate | The iteration specification of the result. |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::requestTimeIterativeComplete().
void helicsFederateSendCommand | ( | HelicsFederate | fed, |
const char * | target, | ||
const char * | command, | ||
HelicsError * | err | ||
) |
Send a command to another helics object through a federate.
fed | The federate to send the command through. | |
target | The name of the object to send the command to. | |
command | The command to send. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::sendCommand().
void helicsFederateSetFlagOption | ( | HelicsFederate | fed, |
int | flag, | ||
HelicsBool | flagValue, | ||
HelicsError * | err | ||
) |
Set a flag for the federate.
fed | The federate to alter a flag for. | |
flag | The flag to change. | |
flagValue | The new value of the flag. 0 for false, !=0 for true. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::setFlagOption().
void helicsFederateSetGlobal | ( | HelicsFederate | fed, |
const char * | valueName, | ||
const char * | value, | ||
HelicsError * | err | ||
) |
Set a federation global value through a federate.
This overwrites any previous value for this name.
fed | The federate to set the global through. | |
valueName | The name of the global to set. | |
value | The value of the global. | |
[in,out] | err | A pointer to an error object for catching errors. |
Referenced by helicscpp::Federate::setGlobal().
void helicsFederateSetIntegerProperty | ( | HelicsFederate | fed, |
int | intProperty, | ||
int | propertyVal, | ||
HelicsError * | err | ||
) |
Set an integer based property of a federate.
fed | The federate to change the property for. | |
intProperty | The property to set. | |
propertyVal | The value of the property. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::setProperty().
void helicsFederateSetLogFile | ( | HelicsFederate | fed, |
const char * | logFile, | ||
HelicsError * | err | ||
) |
Set the logging file for a federate (actually on the core associated with a federate).
fed | The federate to set the log file for. | |
logFile | The name of the log file. | |
[in,out] | err | A pointer to an error object for catching errors. |
void helicsFederateSetSeparator | ( | HelicsFederate | fed, |
char | separator, | ||
HelicsError * | err | ||
) |
Set the separator character in a federate.
The separator character is the separation character for local publications/endpoints in creating their global name. For example if the separator character is '/' then a local endpoint would have a globally reachable name of fedName/localName.
fed | The federate info object to alter. | |
separator | The character to use as a separator. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::setSeparator().
void helicsFederateSetTag | ( | HelicsFederate | fed, |
const char * | tagName, | ||
const char * | value, | ||
HelicsError * | err | ||
) |
Set a federate tag value.
This overwrites any previous value for this tag.
fed | The federate to set the tag for. | |
tagName | The name of the tag to set. | |
value | The value of the tag. | |
[in,out] | err | A pointer to an error object for catching errors. |
Referenced by helicscpp::Federate::setTag().
void helicsFederateSetTimeProperty | ( | HelicsFederate | fed, |
int | timeProperty, | ||
HelicsTime | time, | ||
HelicsError * | err | ||
) |
Set a time based property for a federate.
fed | The federate object to set the property for. | |
timeProperty | A integer code for a time property. | |
time | The requested value of the property. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::setProperty().
void helicsFederateUnProtect | ( | const char * | fedName, |
HelicsError * | err | ||
) |
remove the protection of an existing federate
this function allows a federate to be retrieved on demand, it must be explicitly close later otherwise it will be destroyed when the library is closed
fedName | the name of an existing federate that should not be protected | |
[in,out] | err | An error object that will contain an error code and string if the federate was not found. |
Referenced by helicscpp::Federate::unProtect().
const char* helicsFederateWaitCommand | ( | HelicsFederate | fed, |
HelicsError * | err | ||
) |
Get a command sent to the federate. Blocks until a command is received.
fed | The federate to get the command for. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::waitCommand().
const char* helicsGetBuildFlags | ( | void | ) |
Get the build flags used to compile HELICS.
References helics::buildFlags.
Referenced by helicscpp::buildFlags().
const char* helicsGetCompilerVersion | ( | void | ) |
Get the compiler version used to compile HELICS.
References helics::compiler.
Referenced by helicscpp::compilerVersion().
int helicsGetDataType | ( | const char * | val | ) |
Get the data type for use in /ref helicsFederateRegisterPublication, /ref helicsFederateRegisterInput, /ref helicsFilterSetOption.
val | A string representing a data type. |
Referenced by helicsInputGetPublicationDataType().
HelicsFederate helicsGetFederateByName | ( | const char * | fedName, |
HelicsError * | err | ||
) |
Get an existing federate object from a core by name.
The federate must have been created by one of the other functions and at least one of the objects referencing the created federate must still be active in the process.
fedName | The name of the federate to retrieve. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
int helicsGetFlagIndex | ( | const char * | val | ) |
Get a property index for use in /ref helicsFederateInfoSetFlagOption, /ref helicsFederateSetFlagOption,
val | A string with the option name. |
int helicsGetOptionIndex | ( | const char * | val | ) |
Get an option index for use in /ref helicsPublicationSetOption, /ref helicsInputSetOption, /ref helicsEndpointSetOption, /ref helicsFilterSetOption, and the corresponding get functions.
val | A string with the option name. |
int helicsGetOptionValue | ( | const char * | val | ) |
Get an option value for use in /ref helicsPublicationSetOption, /ref helicsInputSetOption, /ref helicsEndpointSetOption, /ref helicsFilterSetOption.
val | A string representing the value. |
int helicsGetPropertyIndex | ( | const char * | val | ) |
Get a property index for use in /ref helicsFederateInfoSetFlagOption, /ref helicsFederateInfoSetTimeProperty, or /ref helicsFederateInfoSetIntegerProperty
val | A string with the property name. |
const char* helicsGetSystemInfo | ( | void | ) |
Get a json formatted system information string, containing version info. The string contains fields with system information like cpu, core count, operating system, and memory, as well as information about the HELICS build. Used for debugging reports and gathering other information.
References helics::systemInfo().
Referenced by helicscpp::systemInfo().
const char* helicsGetVersion | ( | void | ) |
Get a version string for HELICS.
References helics::versionString.
Referenced by helicscpp::getHelicsVersionString(), and helicscpp::version().
HelicsBool helicsIsCoreTypeAvailable | ( | const char * | type | ) |
Returns true if core/broker type specified is available in current compilation.
type | A string representing a core type. |
Options include "zmq", "udp", "ipc", "interprocess", "tcp", "default", "mpi".
References HELICS_FALSE, and HELICS_TRUE.
void helicsLoadSignalHandler | ( | ) |
Load a signal handler that handles Ctrl-C and shuts down all HELICS brokers, cores, and federates then exits the process.
Referenced by helicsLoadSignalHandlerCallback().
void helicsLoadSignalHandlerCallback | ( | HelicsBool(*)(int) | handler, |
HelicsBool | useSeparateThread | ||
) |
Load a custom signal handler to execute prior to the abort signal handler.
This function is not 100% reliable it will most likely work but uses some functions and techniques that are not 100% guaranteed to work in a signal handler and in worst case it could deadlock. That is somewhat unlikely given usage patterns but it is possible. The callback has signature HelicsBool(*handler)(int) and it will take the SIG_INT as an argument and return a boolean. If the boolean return value is HELICS_TRUE (or the callback is null) the default signal handler is run after the callback finishes; if it is HELICS_FALSE the default callback is not run and the default signal handler is executed. If the second argument is set to HELICS_TRUE the default signal handler will execute in a separate thread(this may be a bad idea).
References HELICS_FALSE, helicsLoadSignalHandler(), and helicsLoadThreadedSignalHandler().
void helicsLoadSignalHandlerCallbackNoExit | ( | HelicsBool(*)(int) | handler, |
HelicsBool | useSeparateThread | ||
) |
Load a custom signal handler to execute prior to the abort signal handler. The signal handler does not call exit.
This function is not 100% reliable. It will most likely work but uses some functions and techniques that are not 100% guaranteed to work in a signal handler and in worst case it could deadlock. That is somewhat unlikely given usage patterns but it is possible. The callback has signature HelicsBool(*handler)(int) and it will take the SIG_INT as an argument and return a boolean. If the boolean return value is HELICS_TRUE (or the callback is null) the no exit signal handler is run after the callback finishes; if it is HELICS_FALSE the default callback is not run and the default signal handler is executed. If the second argument is set to HELICS_TRUE the default signal handler will execute in a separate thread (this may be a bad idea).
References HELICS_FALSE.
void helicsLoadThreadedSignalHandler | ( | ) |
Load a signal handler that handles Ctrl-C and shuts down all HELICS brokers, cores, and federates then exits the process. This operation will execute in a newly created and detached thread returning control back to the calling program before completing operations.
Referenced by helicsLoadSignalHandlerCallback().
const char* helicsQueryBrokerExecute | ( | HelicsQuery | query, |
HelicsBroker | broker, | ||
HelicsError * | err | ||
) |
Execute a query directly on a broker.
The call will block until the query finishes which may require communication or other delays.
query | The query object to use in the query. | |
broker | The broker to send the query to. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Broker::query().
const char* helicsQueryCoreExecute | ( | HelicsQuery | query, |
HelicsCore | core, | ||
HelicsError * | err | ||
) |
Execute a query directly on a core.
The call will block until the query finishes which may require communication or other delays.
query | The query object to use in the query. | |
core | The core to send the query to. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Core::query().
const char* helicsQueryExecute | ( | HelicsQuery | query, |
HelicsFederate | fed, | ||
HelicsError * | err | ||
) |
Execute a query.
The call will block until the query finishes which may require communication or other delays.
query | The query object to use in the query. | |
fed | A federate to send the query through. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Federate::query().
void helicsQueryExecuteAsync | ( | HelicsQuery | query, |
HelicsFederate | fed, | ||
HelicsError * | err | ||
) |
Execute a query in a non-blocking call.
query | The query object to use in the query. | |
fed | A federate to send the query through. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
const char* helicsQueryExecuteComplete | ( | HelicsQuery | query, |
HelicsError * | err | ||
) |
Complete the return from a query called with /ref helicsExecuteQueryAsync.
The function will block until the query completes /ref isQueryComplete can be called to determine if a query has completed or not.
query | The query object to complete execution of. | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
void helicsQueryFree | ( | HelicsQuery | query | ) |
Free the memory associated with a query object.
Referenced by helicscpp::Core::query(), helicscpp::Broker::query(), and helicscpp::Federate::query().
HelicsBool helicsQueryIsCompleted | ( | HelicsQuery | query | ) |
Check if an asynchronously executed query has completed.
This function should usually be called after a QueryExecuteAsync function has been called.
query | The query object to check if completed. |
void helicsQuerySetOrdering | ( | HelicsQuery | query, |
int32_t | mode, | ||
HelicsError * | err | ||
) |
Update the ordering mode of the query, fast runs on priority channels, ordered goes on normal channels but goes in sequence
query | The query object to change the order for. | |
mode | 0 for fast, 1 for ordered | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
Referenced by helicscpp::Core::query(), helicscpp::Broker::query(), and helicscpp::Federate::query().
void helicsQuerySetQueryString | ( | HelicsQuery | query, |
const char * | queryString, | ||
HelicsError * | err | ||
) |
Update the queryString of a query.
query | The query object to change the target of. | |
queryString | the new queryString | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |
void helicsQuerySetTarget | ( | HelicsQuery | query, |
const char * | target, | ||
HelicsError * | err | ||
) |
Update the target of a query.
query | The query object to change the target of. | |
target | the name of the target to query | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. |