helics
2.8.1
|
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 helicsBrokerAddDestinationFilterToEndpoint | ( | helics_broker | broker, |
const char * | filter, | ||
const char * | endpoint, | ||
helics_error * | 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). @forcpponly | |
[in,out] | err | A helics_error object, can be NULL if the errors are to be ignored. @endforcpponly |
References helics_error_invalid_argument.
Referenced by helicscpp::Broker::addDestinationFilterToEndpoint().
void helicsBrokerAddSourceFilterToEndpoint | ( | helics_broker | broker, |
const char * | filter, | ||
const char * | endpoint, | ||
helics_error * | 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). @forcpponly | |
[in,out] | err | A helics_error object, can be NULL if the errors are to be ignored. @endforcpponly |
References helics_error_invalid_argument.
Referenced by helicscpp::Broker::addSourceFilterToEndpoint().
void helicsBrokerClearTimeBarrier | ( | helics_broker | broker | ) |
Clear any time barrier on a broker.
broker | The broker to clear the barriers on. |
helics_broker helicsBrokerClone | ( | helics_broker | broker, |
helics_error * | 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 helics_broker. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
References helics::getBrokerObject().
Referenced by helicscpp::Broker::Broker(), and helicscpp::Broker::operator=().
void helicsBrokerDataLink | ( | helics_broker | broker, |
const char * | source, | ||
const char * | target, | ||
helics_error * | 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). @forcpponly | |
[in,out] | err | A helics_error object, can be NULL if the errors are to be ignored. @endforcpponly |
References helics_error_invalid_argument.
Referenced by helicscpp::Broker::dataLink().
void helicsBrokerDestroy | ( | helics_broker | broker | ) |
Disconnect and free a broker.
References helicsBrokerDisconnect(), and helicsBrokerFree().
void helicsBrokerDisconnect | ( | helics_broker | broker, |
helics_error * | err | ||
) |
Disconnect a broker.
broker | The broker to disconnect. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Broker::disconnect(), and helicsBrokerDestroy().
void helicsBrokerFree | ( | helics_broker | 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 | ( | helics_broker | broker | ) |
Get the network address associated with a broker.
broker | The broker to query. |
Referenced by helicscpp::Broker::getAddress().
const char* helicsBrokerGetIdentifier | ( | helics_broker | broker | ) |
Get an identifier for the broker.
broker | The broker to query. |
Referenced by helicscpp::Broker::getIdentifier().
void helicsBrokerGlobalError | ( | helics_broker | broker, |
int | errorCode, | ||
const char * | errorString, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
helics_bool helicsBrokerIsConnected | ( | helics_broker | 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().
helics_bool helicsBrokerIsValid | ( | helics_broker | broker | ) |
Check if a broker object is a valid object.
broker | The helics_broker object to test. |
References helics::getBrokerObject(), helics_false, and helics_true.
void helicsBrokerMakeConnections | ( | helics_broker | broker, |
const char * | file, | ||
helics_error * | err | ||
) |
Load a file containing connection information.
broker | The broker to generate the connections from. | |
file | A JSON or TOML file containing connection information. @forcpponly | |
[in,out] | err | A helics_error object, can be NULL if the errors are to be ignored. @endforcpponly |
void helicsBrokerSetGlobal | ( | helics_broker | broker, |
const char * | valueName, | ||
const char * | value, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
References helics_error_invalid_argument.
Referenced by helicscpp::Broker::setGlobal().
void helicsBrokerSetLogFile | ( | helics_broker | broker, |
const char * | logFileName, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
void helicsBrokerSetTimeBarrier | ( | helics_broker | broker, |
helics_time | barrierTime, | ||
helics_error * | err | ||
) |
Set a broker time barrier.
broker | The broker to set the time barrier for. | |
barrierTime | The time to set the barrier at. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
helics_bool helicsBrokerWaitForDisconnect | ( | helics_broker | broker, |
int | msToWait, | ||
helics_error * | err | ||
) |
Wait for the broker to disconnect.
broker | The broker to wait for. | |
msToWait | The time out in millisecond (<0 for infinite timeout). @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
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(), and helics::CoreFactory::cleanUpCores().
Referenced by helicscpp::closeLibrary().
void helicsCoreAddDestinationFilterToEndpoint | ( | helics_core | core, |
const char * | filter, | ||
const char * | endpoint, | ||
helics_error * | 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). @forcpponly | |
[in,out] | err | A helics_error object, can be NULL if the errors are to be ignored. @endforcpponly |
References helics_error_invalid_argument.
void helicsCoreAddSourceFilterToEndpoint | ( | helics_core | core, |
const char * | filter, | ||
const char * | endpoint, | ||
helics_error * | 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). @forcpponly | |
[in,out] | err | A helics_error object, can be NULL if the errors are to be ignored. @endforcpponly |
References helics_error_invalid_argument.
helics_core helicsCoreClone | ( | helics_core | core, |
helics_error * | 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 helics_core. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
References helics::getCoreObject().
Referenced by helicscpp::Core::Core(), and helicscpp::Core::operator=().
helics_bool helicsCoreConnect | ( | helics_core | core, |
helics_error * | err | ||
) |
Connect a core to the federate based on current configuration.
core | The core to connect. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
References helics_false, and helics_true.
void helicsCoreDataLink | ( | helics_core | core, |
const char * | source, | ||
const char * | target, | ||
helics_error * | 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). @forcpponly | |
[in,out] | err | A helics_error object, can be NULL if the errors are to be ignored. @endforcpponly |
References helics_error_invalid_argument.
void helicsCoreDestroy | ( | helics_core | core | ) |
Disconnect and free a core.
References helicsCoreDisconnect(), and helicsCoreFree().
void helicsCoreDisconnect | ( | helics_core | core, |
helics_error * | err | ||
) |
Disconnect a core from the federation.
core | The core to query. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Core::disconnect(), and helicsCoreDestroy().
void helicsCoreFree | ( | helics_core | 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 | ( | helics_core | core | ) |
Get the network address associated with a core.
core | The core to query. |
Referenced by helicscpp::Core::getAddress().
const char* helicsCoreGetIdentifier | ( | helics_core | core | ) |
Get an identifier for the core.
core | The core to query. |
Referenced by helicscpp::Core::getIdentifier().
void helicsCoreGlobalError | ( | helics_core | core, |
int | errorCode, | ||
const char * | errorString, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
References helics::local_core_id().
helics_bool helicsCoreIsConnected | ( | helics_core | 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().
helics_bool helicsCoreIsValid | ( | helics_core | core | ) |
Check if a core object is a valid object.
core | The helics_core object to test. |
References helics::getCoreObject(), helics_false, and helics_true.
void helicsCoreMakeConnections | ( | helics_core | core, |
const char * | file, | ||
helics_error * | err | ||
) |
Load a file containing connection information.
core | The core to generate the connections from. | |
file | A JSON or TOML file containing connection information. @forcpponly | |
[in,out] | err | A helics_error object, can be NULL if the errors are to be ignored. @endforcpponly |
void helicsCoreSetGlobal | ( | helics_core | core, |
const char * | valueName, | ||
const char * | value, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
References helics_error_invalid_argument.
Referenced by helicscpp::Core::setGlobal().
void helicsCoreSetLogFile | ( | helics_core | core, |
const char * | logFileName, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
void helicsCoreSetReadyToInit | ( | helics_core | core, |
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Core::setReadyToInit().
helics_bool helicsCoreWaitForDisconnect | ( | helics_core | core, |
int | msToWait, | ||
helics_error * | err | ||
) |
Wait for the core to disconnect.
core | The core to wait for. | |
msToWait | The time out in millisecond (<0 for infinite timeout). @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
References helics_false, and helics_true.
Referenced by helicscpp::Core::waitForDisconnect().
helics_broker helicsCreateBroker | ( | const char * | type, |
const char * | name, | ||
const char * | initString, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
References helics::BrokerFactory::create(), helics::DEFAULT, helics_error::error_code, helics_error_invalid_argument, helics_error::message, and helics::UNRECOGNIZED.
Referenced by helicscpp::Broker::Broker().
helics_broker helicsCreateBrokerFromArgs | ( | const char * | type, |
const char * | name, | ||
int | argc, | ||
const char *const * | argv, | ||
helics_error * | 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. @forcpponly | |
argc | The number of arguments. @endforcpponly | |
argv | The list of string values from a command line. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
References helics::BrokerFactory::create(), helics::DEFAULT, helics_error::error_code, helics_error_invalid_argument, helics_error::message, and helics::UNRECOGNIZED.
Referenced by helicscpp::Broker::Broker().
helics_federate helicsCreateCombinationFederate | ( | const char * | fedName, |
helics_federate_info | fi, | ||
helics_error * | 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 helics_federate, helics_message_federate or helics_federate 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::CombinationFederate::CombinationFederate().
helics_federate helicsCreateCombinationFederateFromConfig | ( | const char * | configFile, |
helics_error * | 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 helics_federate, helics_message_federate or helics_federate object as an argument
configFile | A JSON file or a JSON string or TOML file that contains setup and configuration information. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::CombinationFederate::CombinationFederate().
helics_core helicsCreateCore | ( | const char * | type, |
const char * | name, | ||
const char * | initString, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
References helics::DEFAULT, helics_error::error_code, helics::CoreFactory::FindOrCreate(), helics_error_invalid_argument, helics_error::message, and helics::UNRECOGNIZED.
Referenced by helicscpp::Core::Core().
helics_core helicsCreateCoreFromArgs | ( | const char * | type, |
const char * | name, | ||
int | argc, | ||
const char *const * | argv, | ||
helics_error * | 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. @forcpponly | |
argc | The number of arguments. @endforcpponly | |
argv | The list of string values from a command line. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
References helics::DEFAULT, helics_error::error_code, helics::CoreFactory::FindOrCreate(), helics_error_invalid_argument, helics_error::message, and helics::UNRECOGNIZED.
Referenced by helicscpp::Core::Core().
helics_federate_info helicsCreateFederateInfo | ( | void | ) |
Create a federate info object for specifying federate information when constructing a federate.
Referenced by helicscpp::FederateInfo::FederateInfo().
helics_federate helicsCreateMessageFederate | ( | const char * | fedName, |
helics_federate_info | fi, | ||
helics_error * | 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 helics_federate object as an argument.
fedName | The name of the federate to create. | |
fi | The federate info object that contains details on the federate. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::MessageFederate::MessageFederate().
helics_federate helicsCreateMessageFederateFromConfig | ( | const char * | configFile, |
helics_error * | 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 helics_federate object as an argument.
configFile | A Config(JSON,TOML) file or a JSON string that contains setup and configuration information. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::MessageFederate::MessageFederate().
helics_query 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().
helics_federate helicsCreateValueFederate | ( | const char * | fedName, |
helics_federate_info | fi, | ||
helics_error * | err | ||
) |
Create a value federate from a federate info object.
helics_federate objects can be used in all functions that take a helics_federate or helics_federate 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::ValueFederate::ValueFederate().
helics_federate helicsCreateValueFederateFromConfig | ( | const char * | configFile, |
helics_error * | err | ||
) |
Create a value federate from a JSON file, JSON string, or TOML file.
helics_federate objects can be used in all functions that take a helics_federate or helics_federate object as an argument.
configFile | A JSON file or a JSON string or TOML file that contains setup and configuration information. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::ValueFederate::ValueFederate().
void helicsErrorClear | ( | helics_error * | err | ) |
Clear an error object.
clear an error object
References helics_error::error_code, and helics_error::message.
helics_error helicsErrorInitialize | ( | void | ) |
Return an initialized error object.
References helics_error::error_code, and helics_error::message.
void helicsFederateAddDependency | ( | helics_federate | fed, |
const char * | fedName, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
Referenced by helicscpp::Federate::addDependency().
helics_federate helicsFederateClone | ( | helics_federate | fed, |
helics_error * | err | ||
) |
Create a new reference to an existing federate.
This will create a new helics_federate object that references the existing federate. The new object must be freed as well.
fed | An existing helics_federate. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::Federate(), helicscpp::FederateInfo::FederateInfo(), helicsGetFederateByName(), helicscpp::FederateInfo::operator=(), and helicscpp::Federate::operator=().
void helicsFederateDestroy | ( | helics_federate | fed | ) |
Disconnect and free a federate.
References fed, helicsFederateFinalize(), and helicsFederateFree().
void helicsFederateDisconnect | ( | helics_federate | fed, |
helics_error * | 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 | ( | helics_federate | fed, |
helics_error * | err | ||
) |
Disconnect/finalize the federate in an async call. This call is identical to helicsFederateFinalizeAsync.
void helicsFederateDisconnectComplete | ( | helics_federate | fed, |
helics_error * | err | ||
) |
Complete the asynchronous disconnect/finalize call. This call is identical to helicsFederateFinalizeComplete.
void helicsFederateEnterExecutingMode | ( | helics_federate | fed, |
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::enterExecutingMode().
void helicsFederateEnterExecutingModeAsync | ( | helics_federate | fed, |
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::enterExecutingModeAsync().
void helicsFederateEnterExecutingModeComplete | ( | helics_federate | fed, |
helics_error * | err | ||
) |
Complete the call to /ref helicsFederateEnterExecutingModeAsync.
fed | The federate object to complete the call. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::enterExecutingModeComplete().
helics_iteration_result helicsFederateEnterExecutingModeIterative | ( | helics_federate | fed, |
helics_iteration_request | iterate, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::enterExecutingMode().
void helicsFederateEnterExecutingModeIterativeAsync | ( | helics_federate | fed, |
helics_iteration_request | iterate, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::enterExecutingModeAsync().
helics_iteration_result helicsFederateEnterExecutingModeIterativeComplete | ( | helics_federate | fed, |
helics_error * | err | ||
) |
Complete the asynchronous iterative call into ExecutionMode.
fed | The federate to make the request of. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::enterExecutingModeComplete().
void helicsFederateEnterInitializingMode | ( | helics_federate | fed, |
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::enterInitializingMode().
void helicsFederateEnterInitializingModeAsync | ( | helics_federate | fed, |
helics_error * | err | ||
) |
Non blocking alternative to helicsFederateEnterInitializingMode.
The function helicsFederateEnterInitializationModeFinalize must be called to finish the operation.
fed | The federate to operate on. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::enterInitializingModeAsync().
void helicsFederateEnterInitializingModeComplete | ( | helics_federate | fed, |
helics_error * | err | ||
) |
Finalize the entry to initialize mode that was initiated with /ref heliceEnterInitializingModeAsync.
fed | The federate desiring to complete the initialization step. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::enterInitializingModeComplete().
void helicsFederateFinalize | ( | helics_federate | fed, |
helics_error * | err | ||
) |
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 | ( | helics_federate | fed, |
helics_error * | err | ||
) |
Finalize the federate in an async call.
Referenced by helicscpp::Federate::finalizeAsync().
void helicsFederateFinalizeComplete | ( | helics_federate | fed, |
helics_error * | err | ||
) |
Complete the asynchronous finalize call.
Referenced by helicscpp::Federate::finalizeComplete().
void helicsFederateFree | ( | helics_federate | fed | ) |
Release the memory associated with a federate.
References helics::CoreFactory::cleanUpCores(), fed, and helics::getFedObject().
Referenced by helicsFederateDestroy(), and helicscpp::Federate::~Federate().
helics_core helicsFederateGetCoreObject | ( | helics_federate | fed, |
helics_error * | err | ||
) |
Get the core object associated with a federate.
fed | A federate object. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::getCore().
helics_time helicsFederateGetCurrentTime | ( | helics_federate | fed, |
helics_error * | err | ||
) |
Get the current time of the federate.
fed | The federate object to query. @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
Referenced by helicscpp::Federate::getCurrentTime().
helics_bool helicsFederateGetFlagOption | ( | helics_federate | fed, |
int | flag, | ||
helics_error * | err | ||
) |
Get a flag value for a federate.
fed | The federate to get the flag for. | |
flag | The flag to query. @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
Referenced by helicscpp::Federate::getFlagOption().
int helicsFederateGetIntegerProperty | ( | helics_federate | fed, |
int | intProperty, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
Referenced by helicscpp::Federate::getIntegerProperty().
const char* helicsFederateGetName | ( | helics_federate | fed | ) |
Get the name of the federate.
fed | The federate object to query. |
Referenced by helicscpp::Federate::getName().
helics_federate_state helicsFederateGetState | ( | helics_federate | fed, |
helics_error * | err | ||
) |
Get the current state of a federate.
fed | The federate to query. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::getCurrentMode().
helics_time helicsFederateGetTimeProperty | ( | helics_federate | fed, |
int | timeProperty, | ||
helics_error * | err | ||
) |
Get the current value of a time based property in a federate.
fed | The federate query. | |
timeProperty | The property to query. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::getTimeProperty().
void helicsFederateGlobalError | ( | helics_federate | fed, |
int | errorCode, | ||
const char * | errorString | ||
) |
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. |
Referenced by helicscpp::Federate::globalError().
helics_federate_info helicsFederateInfoClone | ( | helics_federate_info | fi, |
helics_error * | err | ||
) |
Create a federate info object from an existing one and clone the information.
fi | A federateInfo object to duplicate. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
void helicsFederateInfoFree | ( | helics_federate_info | fi | ) |
Delete the memory associated with a federate info object.
Referenced by helicscpp::FederateInfo::operator=(), and helicscpp::FederateInfo::~FederateInfo().
void helicsFederateInfoLoadFromArgs | ( | helics_federate_info | fi, |
int | argc, | ||
const char *const * | argv, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
void helicsFederateInfoSetBroker | ( | helics_federate_info | fi, |
const char * | broker, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::FederateInfo::setBroker().
void helicsFederateInfoSetBrokerInitString | ( | helics_federate_info | fi, |
const char * | brokerInit, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::FederateInfo::setBrokerInit().
void helicsFederateInfoSetBrokerKey | ( | helics_federate_info | fi, |
const char * | brokerkey, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::FederateInfo::setBrokerKey().
void helicsFederateInfoSetBrokerPort | ( | helics_federate_info | fi, |
int | brokerPort, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
void helicsFederateInfoSetCoreInitString | ( | helics_federate_info | fi, |
const char * | coreInit, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::FederateInfo::setCoreInit().
void helicsFederateInfoSetCoreName | ( | helics_federate_info | fi, |
const char * | corename, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::FederateInfo::setCoreName().
void helicsFederateInfoSetCoreType | ( | helics_federate_info | fi, |
int | coretype, | ||
helics_error * | 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_core_type. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::FederateInfo::FederateInfo(), and helicscpp::FederateInfo::setCoreType().
void helicsFederateInfoSetCoreTypeFromString | ( | helics_federate_info | fi, |
const char * | coretype, | ||
helics_error * | err | ||
) |
Set the core type from a string.
fi | The federate info object to alter. | |
coretype | A string naming a core type. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::FederateInfo::FederateInfo(), and helicscpp::FederateInfo::setCoreType().
void helicsFederateInfoSetFlagOption | ( | helics_federate_info | fi, |
int | flag, | ||
helics_bool | value, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::FederateInfo::setFlagOption().
void helicsFederateInfoSetIntegerProperty | ( | helics_federate_info | fi, |
int | intProperty, | ||
int | propertyValue, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::FederateInfo::setProperty().
void helicsFederateInfoSetLocalPort | ( | helics_federate_info | fi, |
const char * | localPort, | ||
helics_error * | 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". @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
void helicsFederateInfoSetSeparator | ( | helics_federate_info | fi, |
char | separator, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::FederateInfo::setSeparator().
void helicsFederateInfoSetTimeProperty | ( | helics_federate_info | fi, |
int | timeProperty, | ||
helics_time | propertyValue, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::FederateInfo::setProperty().
helics_bool helicsFederateIsAsyncOperationCompleted | ( | helics_federate | fed, |
helics_error * | err | ||
) |
Check if the current Asynchronous operation has completed.
fed | The federate to operate on. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::isAsyncOperationCompleted().
helics_bool helicsFederateIsValid | ( | helics_federate | fed | ) |
Check if a federate_object is valid.
void helicsFederateLocalError | ( | helics_federate | fed, |
int | errorCode, | ||
const char * | errorString | ||
) |
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. |
Referenced by helicscpp::Federate::localError().
void helicsFederateLogDebugMessage | ( | helics_federate | fed, |
const char * | logmessage, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
Referenced by helicscpp::Federate::logDebugMessage().
void helicsFederateLogErrorMessage | ( | helics_federate | fed, |
const char * | logmessage, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
Referenced by helicscpp::Federate::logErrorMessage().
void helicsFederateLogInfoMessage | ( | helics_federate | fed, |
const char * | logmessage, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
Referenced by helicscpp::Federate::logInfoMessage().
void helicsFederateLogLevelMessage | ( | helics_federate | fed, |
int | loglevel, | ||
const char * | logmessage, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
Referenced by helicscpp::Federate::logMessage().
void helicsFederateLogWarningMessage | ( | helics_federate | fed, |
const char * | logmessage, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
Referenced by helicscpp::Federate::logWarningMessage().
void helicsFederateRegisterInterfaces | ( | helics_federate | fed, |
const char * | file, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::registerInterfaces().
helics_time helicsFederateRequestNextStep | ( | helics_federate | fed, |
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::requestNextStep().
helics_time helicsFederateRequestTime | ( | helics_federate | fed, |
helics_time | requestTime, | ||
helics_error * | err | ||
) |
Request the next time for federate execution.
fed | The federate to make the request of. | |
requestTime | The next requested time. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::requestTime().
helics_time helicsFederateRequestTimeAdvance | ( | helics_federate | fed, |
helics_time | timeDelta, | ||
helics_error * | err | ||
) |
Request the next time for federate execution.
fed | The federate to make the request of. | |
timeDelta | The requested amount of time to advance. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::requestTimeAdvance().
void helicsFederateRequestTimeAsync | ( | helics_federate | fed, |
helics_time | requestTime, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::requestTimeAsync().
helics_time helicsFederateRequestTimeComplete | ( | helics_federate | fed, |
helics_error * | err | ||
) |
Complete an asynchronous requestTime call.
fed | The federate to make the request of. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::requestTimeComplete().
helics_time helicsFederateRequestTimeIterative | ( | helics_federate | fed, |
helics_time | requestTime, | ||
helics_iteration_request | iterate, | ||
helics_iteration_result * | outIteration, | ||
helics_error * | 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. @forcpponly | |
[out] | outIteration | The iteration specification of the result. @endforcpponly @forcpponly |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::requestTimeIterative().
void helicsFederateRequestTimeIterativeAsync | ( | helics_federate | fed, |
helics_time | requestTime, | ||
helics_iteration_request | iterate, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::requestTimeIterativeAsync().
helics_time helicsFederateRequestTimeIterativeComplete | ( | helics_federate | fed, |
helics_iteration_result * | outIterate, | ||
helics_error * | err | ||
) |
Complete an iterative time request asynchronous call.
fed | The federate to make the request of. @forcpponly | |
[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. @endforcpponly |
Referenced by helicscpp::Federate::requestTimeIterativeComplete().
void helicsFederateSetFlagOption | ( | helics_federate | fed, |
int | flag, | ||
helics_bool | flagValue, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::setFlagOption().
void helicsFederateSetGlobal | ( | helics_federate | fed, |
const char * | valueName, | ||
const char * | value, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
Referenced by helicscpp::Federate::setGlobal().
void helicsFederateSetIntegerProperty | ( | helics_federate | fed, |
int | intProperty, | ||
int | propertyVal, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::setProperty().
void helicsFederateSetLogFile | ( | helics_federate | fed, |
const char * | logFile, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
void helicsFederateSetSeparator | ( | helics_federate | fed, |
char | separator, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::setSeparator().
void helicsFederateSetTimeProperty | ( | helics_federate | fed, |
int | timeProperty, | ||
helics_time | time, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::setProperty().
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().
helics_federate helicsGetFederateByName | ( | const char * | fedName, |
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
References helics_error::error_code, fed, helics_error_invalid_argument, helicsFederateClone(), and helics_error::message.
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* helicsGetVersion | ( | void | ) |
Get a version string for HELICS.
References helics::versionString.
Referenced by helicscpp::getHelicsVersionString(), and helicscpp::version().
helics_bool 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 | ( | helics_bool(*)(int) | handler | ) |
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 helics_bool(*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.
References helicsLoadSignalHandler().
const char* helicsQueryBrokerExecute | ( | helics_query | query, |
helics_broker | broker, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Broker::query().
const char* helicsQueryCoreExecute | ( | helics_query | query, |
helics_core | core, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Core::query().
const char* helicsQueryExecute | ( | helics_query | query, |
helics_federate | fed, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Federate::query().
void helicsQueryExecuteAsync | ( | helics_query | query, |
helics_federate | fed, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
const char* helicsQueryExecuteComplete | ( | helics_query | query, |
helics_error * | 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. @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
void helicsQueryFree | ( | helics_query | query | ) |
Free the memory associated with a query object.
Referenced by helicscpp::Core::query(), helicscpp::Broker::query(), and helicscpp::Federate::query().
helics_bool helicsQueryIsCompleted | ( | helics_query | 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 | ( | helics_query | query, |
int32_t | mode, | ||
helics_error * | 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 |
@forcpponly
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
Referenced by helicscpp::Core::query(), helicscpp::Broker::query(), and helicscpp::Federate::query().
void helicsQuerySetQueryString | ( | helics_query | query, |
const char * | queryString, | ||
helics_error * | err | ||
) |
Update the queryString of a query.
query | The query object to change the target of. | |
queryString | the new queryString @forcpponly | |
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |
void helicsQuerySetTarget | ( | helics_query | query, |
const char * | target, | ||
helics_error * | err | ||
) |
Update the target of a query.
query | The query object to change the target of. |
target | the name of the target to query |
@forcpponly
[in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function. @endforcpponly |