helics  2.5.2
Functions
helics.h File Reference

Common functions for the HELICS C api. More...

#include "api-data.h"
#include "helics_export.h"
#include <stdlib.h>

Go to the source code of this file.

Functions

HELICS_EXPORT const char * helicsGetVersion (void)
 
HELICS_EXPORT const char * helicsGetBuildFlags (void)
 
HELICS_EXPORT const char * helicsGetCompilerVersion (void)
 
HELICS_EXPORT helics_error helicsErrorInitialize (void)
 
HELICS_EXPORT void helicsErrorClear (helics_error *err)
 
HELICS_EXPORT helics_bool helicsIsCoreTypeAvailable (const char *type)
 
HELICS_EXPORT helics_core helicsCreateCore (const char *type, const char *name, const char *initString, helics_error *err)
 
HELICS_EXPORT helics_core helicsCreateCoreFromArgs (const char *type, const char *name, int argc, const char *const *argv, helics_error *err)
 
HELICS_EXPORT helics_core helicsCoreClone (helics_core core, helics_error *err)
 
HELICS_EXPORT helics_bool helicsCoreIsValid (helics_core core)
 
HELICS_EXPORT helics_broker helicsCreateBroker (const char *type, const char *name, const char *initString, helics_error *err)
 
HELICS_EXPORT helics_broker helicsCreateBrokerFromArgs (const char *type, const char *name, int argc, const char *const *argv, helics_error *err)
 
HELICS_EXPORT helics_broker helicsBrokerClone (helics_broker broker, helics_error *err)
 
HELICS_EXPORT helics_bool helicsBrokerIsValid (helics_broker broker)
 
HELICS_EXPORT helics_bool helicsBrokerIsConnected (helics_broker broker)
 
HELICS_EXPORT void helicsBrokerDataLink (helics_broker broker, const char *source, const char *target, helics_error *err)
 
HELICS_EXPORT void helicsBrokerAddSourceFilterToEndpoint (helics_broker broker, const char *filter, const char *endpoint, helics_error *err)
 
HELICS_EXPORT void helicsBrokerAddDestinationFilterToEndpoint (helics_broker broker, const char *filter, const char *endpoint, helics_error *err)
 
HELICS_EXPORT void helicsBrokerMakeConnections (helics_broker broker, const char *file, helics_error *err)
 
HELICS_EXPORT helics_bool helicsCoreWaitForDisconnect (helics_core core, int msToWait, helics_error *err)
 
HELICS_EXPORT helics_bool helicsBrokerWaitForDisconnect (helics_broker broker, int msToWait, helics_error *err)
 
HELICS_EXPORT helics_bool helicsCoreIsConnected (helics_core core)
 
HELICS_EXPORT void helicsCoreDataLink (helics_core core, const char *source, const char *target, helics_error *err)
 
HELICS_EXPORT void helicsCoreAddSourceFilterToEndpoint (helics_core core, const char *filter, const char *endpoint, helics_error *err)
 
HELICS_EXPORT void helicsCoreAddDestinationFilterToEndpoint (helics_core core, const char *filter, const char *endpoint, helics_error *err)
 
HELICS_EXPORT void helicsCoreMakeConnections (helics_core core, const char *file, helics_error *err)
 
HELICS_EXPORT const char * helicsBrokerGetIdentifier (helics_broker broker)
 
HELICS_EXPORT const char * helicsCoreGetIdentifier (helics_core core)
 
HELICS_EXPORT const char * helicsBrokerGetAddress (helics_broker broker)
 
HELICS_EXPORT const char * helicsCoreGetAddress (helics_core core)
 
HELICS_EXPORT void helicsCoreSetReadyToInit (helics_core core, helics_error *err)
 
HELICS_EXPORT helics_bool helicsCoreConnect (helics_core core, helics_error *err)
 
HELICS_EXPORT void helicsCoreDisconnect (helics_core core, helics_error *err)
 
HELICS_EXPORT helics_federate helicsGetFederateByName (const char *fedName, helics_error *err)
 
HELICS_EXPORT void helicsBrokerDisconnect (helics_broker broker, helics_error *err)
 
HELICS_EXPORT void helicsFederateDestroy (helics_federate fed)
 
HELICS_EXPORT void helicsBrokerDestroy (helics_broker broker)
 
HELICS_EXPORT void helicsCoreDestroy (helics_core core)
 
HELICS_EXPORT void helicsCoreFree (helics_core core)
 
HELICS_EXPORT void helicsBrokerFree (helics_broker broker)
 
HELICS_EXPORT helics_federate helicsCreateValueFederate (const char *fedName, helics_federate_info fi, helics_error *err)
 
HELICS_EXPORT helics_federate helicsCreateValueFederateFromConfig (const char *configFile, helics_error *err)
 
HELICS_EXPORT helics_federate helicsCreateMessageFederate (const char *fedName, helics_federate_info fi, helics_error *err)
 
HELICS_EXPORT helics_federate helicsCreateMessageFederateFromConfig (const char *configFile, helics_error *err)
 
HELICS_EXPORT helics_federate helicsCreateCombinationFederate (const char *fedName, helics_federate_info fi, helics_error *err)
 
HELICS_EXPORT helics_federate helicsCreateCombinationFederateFromConfig (const char *configFile, helics_error *err)
 
HELICS_EXPORT helics_federate helicsFederateClone (helics_federate fed, helics_error *err)
 
HELICS_EXPORT helics_federate_info helicsCreateFederateInfo (void)
 
HELICS_EXPORT helics_federate_info helicsFederateInfoClone (helics_federate_info fi, helics_error *err)
 
HELICS_EXPORT void helicsFederateInfoLoadFromArgs (helics_federate_info fi, int argc, const char *const *argv, helics_error *err)
 
HELICS_EXPORT void helicsFederateInfoFree (helics_federate_info fi)
 
HELICS_EXPORT helics_bool helicsFederateIsValid (helics_federate fed)
 
HELICS_EXPORT void helicsFederateInfoSetCoreName (helics_federate_info fi, const char *corename, helics_error *err)
 
HELICS_EXPORT void helicsFederateInfoSetCoreInitString (helics_federate_info fi, const char *coreInit, helics_error *err)
 
HELICS_EXPORT void helicsFederateInfoSetBrokerInitString (helics_federate_info fi, const char *brokerInit, helics_error *err)
 
HELICS_EXPORT void helicsFederateInfoSetCoreType (helics_federate_info fi, int coretype, helics_error *err)
 
HELICS_EXPORT void helicsFederateInfoSetCoreTypeFromString (helics_federate_info fi, const char *coretype, helics_error *err)
 
HELICS_EXPORT void helicsFederateInfoSetBroker (helics_federate_info fi, const char *broker, helics_error *err)
 
HELICS_EXPORT void helicsFederateInfoSetBrokerKey (helics_federate_info fi, const char *brokerkey, helics_error *err)
 
HELICS_EXPORT void helicsFederateInfoSetBrokerPort (helics_federate_info fi, int brokerPort, helics_error *err)
 
HELICS_EXPORT void helicsFederateInfoSetLocalPort (helics_federate_info fi, const char *localPort, helics_error *err)
 
HELICS_EXPORT int helicsGetPropertyIndex (const char *val)
 
HELICS_EXPORT int helicsGetFlagIndex (const char *val)
 
HELICS_EXPORT int helicsGetOptionIndex (const char *val)
 
HELICS_EXPORT int helicsGetOptionValue (const char *val)
 
HELICS_EXPORT void helicsFederateInfoSetFlagOption (helics_federate_info fi, int flag, helics_bool value, helics_error *err)
 
HELICS_EXPORT void helicsFederateInfoSetSeparator (helics_federate_info fi, char separator, helics_error *err)
 
HELICS_EXPORT void helicsFederateInfoSetTimeProperty (helics_federate_info fi, int timeProperty, helics_time propertyValue, helics_error *err)
 
HELICS_EXPORT void helicsFederateInfoSetIntegerProperty (helics_federate_info fi, int intProperty, int propertyValue, helics_error *err)
 
HELICS_EXPORT void helicsFederateRegisterInterfaces (helics_federate fed, const char *file, helics_error *err)
 
HELICS_EXPORT void helicsFederateGlobalError (helics_federate fed, int error_code, const char *error_string)
 
HELICS_EXPORT void helicsFederateLocalError (helics_federate fed, int error_code, const char *error_string)
 
HELICS_EXPORT void helicsFederateFinalize (helics_federate fed, helics_error *err)
 
HELICS_EXPORT void helicsFederateFinalizeAsync (helics_federate fed, helics_error *err)
 
HELICS_EXPORT void helicsFederateFinalizeComplete (helics_federate fed, helics_error *err)
 
HELICS_EXPORT void helicsFederateFree (helics_federate fed)
 
HELICS_EXPORT void helicsCloseLibrary (void)
 
HELICS_EXPORT void helicsFederateEnterInitializingMode (helics_federate fed, helics_error *err)
 
HELICS_EXPORT void helicsFederateEnterInitializingModeAsync (helics_federate fed, helics_error *err)
 
HELICS_EXPORT helics_bool helicsFederateIsAsyncOperationCompleted (helics_federate fed, helics_error *err)
 
HELICS_EXPORT void helicsFederateEnterInitializingModeComplete (helics_federate fed, helics_error *err)
 
HELICS_EXPORT void helicsFederateEnterExecutingMode (helics_federate fed, helics_error *err)
 
HELICS_EXPORT void helicsFederateEnterExecutingModeAsync (helics_federate fed, helics_error *err)
 
HELICS_EXPORT void helicsFederateEnterExecutingModeComplete (helics_federate fed, helics_error *err)
 
HELICS_EXPORT helics_iteration_result helicsFederateEnterExecutingModeIterative (helics_federate fed, helics_iteration_request iterate, helics_error *err)
 
HELICS_EXPORT void helicsFederateEnterExecutingModeIterativeAsync (helics_federate fed, helics_iteration_request iterate, helics_error *err)
 
HELICS_EXPORT helics_iteration_result helicsFederateEnterExecutingModeIterativeComplete (helics_federate fed, helics_error *err)
 
HELICS_EXPORT helics_federate_state helicsFederateGetState (helics_federate fed, helics_error *err)
 
HELICS_EXPORT helics_core helicsFederateGetCoreObject (helics_federate fed, helics_error *err)
 
HELICS_EXPORT helics_time helicsFederateRequestTime (helics_federate fed, helics_time requestTime, helics_error *err)
 
HELICS_EXPORT helics_time helicsFederateRequestTimeAdvance (helics_federate fed, helics_time timeDelta, helics_error *err)
 
HELICS_EXPORT helics_time helicsFederateRequestNextStep (helics_federate fed, helics_error *err)
 
HELICS_EXPORT helics_time helicsFederateRequestTimeIterative (helics_federate fed, helics_time requestTime, helics_iteration_request iterate, helics_iteration_result *outIteration, helics_error *err)
 
HELICS_EXPORT void helicsFederateRequestTimeAsync (helics_federate fed, helics_time requestTime, helics_error *err)
 
HELICS_EXPORT helics_time helicsFederateRequestTimeComplete (helics_federate fed, helics_error *err)
 
HELICS_EXPORT void helicsFederateRequestTimeIterativeAsync (helics_federate fed, helics_time requestTime, helics_iteration_request iterate, helics_error *err)
 
HELICS_EXPORT helics_time helicsFederateRequestTimeIterativeComplete (helics_federate fed, helics_iteration_result *outIterate, helics_error *err)
 
HELICS_EXPORT const char * helicsFederateGetName (helics_federate fed)
 
HELICS_EXPORT void helicsFederateSetTimeProperty (helics_federate fed, int timeProperty, helics_time time, helics_error *err)
 
HELICS_EXPORT void helicsFederateSetFlagOption (helics_federate fed, int flag, helics_bool flagValue, helics_error *err)
 
HELICS_EXPORT void helicsFederateSetSeparator (helics_federate fed, char separator, helics_error *err)
 
HELICS_EXPORT void helicsFederateSetIntegerProperty (helics_federate fed, int intProperty, int propertyVal, helics_error *err)
 
HELICS_EXPORT helics_time helicsFederateGetTimeProperty (helics_federate fed, int timeProperty, helics_error *err)
 
HELICS_EXPORT helics_bool helicsFederateGetFlagOption (helics_federate fed, int flag, helics_error *err)
 
HELICS_EXPORT int helicsFederateGetIntegerProperty (helics_federate fed, int intProperty, helics_error *err)
 
HELICS_EXPORT helics_time helicsFederateGetCurrentTime (helics_federate fed, helics_error *err)
 
HELICS_EXPORT void helicsFederateSetGlobal (helics_federate fed, const char *valueName, const char *value, helics_error *err)
 
HELICS_EXPORT void helicsFederateAddDependency (helics_federate fed, const char *fedName, helics_error *err)
 
HELICS_EXPORT void helicsFederateSetLogFile (helics_federate fed, const char *logFile, helics_error *err)
 
HELICS_EXPORT void helicsFederateLogErrorMessage (helics_federate fed, const char *logmessage, helics_error *err)
 
HELICS_EXPORT void helicsFederateLogWarningMessage (helics_federate fed, const char *logmessage, helics_error *err)
 
HELICS_EXPORT void helicsFederateLogInfoMessage (helics_federate fed, const char *logmessage, helics_error *err)
 
HELICS_EXPORT void helicsFederateLogDebugMessage (helics_federate fed, const char *logmessage, helics_error *err)
 
HELICS_EXPORT void helicsFederateLogLevelMessage (helics_federate fed, int loglevel, const char *logmessage, helics_error *err)
 
HELICS_EXPORT void helicsCoreSetGlobal (helics_core core, const char *valueName, const char *value, helics_error *err)
 
HELICS_EXPORT void helicsBrokerSetGlobal (helics_broker broker, const char *valueName, const char *value, helics_error *err)
 
HELICS_EXPORT void helicsCoreSetLogFile (helics_core core, const char *logFileName, helics_error *err)
 
HELICS_EXPORT void helicsBrokerSetLogFile (helics_broker broker, const char *logFileName, helics_error *err)
 
HELICS_EXPORT helics_query helicsCreateQuery (const char *target, const char *query)
 
HELICS_EXPORT const char * helicsQueryExecute (helics_query query, helics_federate fed, helics_error *err)
 
HELICS_EXPORT const char * helicsQueryCoreExecute (helics_query query, helics_core core, helics_error *err)
 
HELICS_EXPORT const char * helicsQueryBrokerExecute (helics_query query, helics_broker broker, helics_error *err)
 
HELICS_EXPORT void helicsQueryExecuteAsync (helics_query query, helics_federate fed, helics_error *err)
 
HELICS_EXPORT const char * helicsQueryExecuteComplete (helics_query query, helics_error *err)
 
HELICS_EXPORT helics_bool helicsQueryIsCompleted (helics_query query)
 
HELICS_EXPORT void helicsQuerySetTarget (helics_query query, const char *target, helics_error *err)
 
HELICS_EXPORT void helicsQuerySetQueryString (helics_query query, const char *queryString, helics_error *err)
 
HELICS_EXPORT void helicsQueryFree (helics_query query)
 
HELICS_EXPORT void helicsCleanupLibrary (void)
 

Detailed Description

Common functions for the HELICS C api.

Function Documentation

◆ helicsBrokerAddDestinationFilterToEndpoint()

HELICS_EXPORT void helicsBrokerAddDestinationFilterToEndpoint ( helics_broker  broker,
const char *  filter,
const char *  endpoint,
helics_error err 
)

Link a named filter to a destination endpoint.

Parameters
brokerThe broker to generate the connection from.
filterThe name of the filter (cannot be NULL).
endpointThe name of the endpoint to filter the data going to (cannot be NULL).
[in,out]errA helics_error object, can be NULL if the errors are to be ignored.

References helics_error_invalid_argument.

Referenced by helicscpp::Broker::addDestinationFilterToEndpoint().

◆ helicsBrokerAddSourceFilterToEndpoint()

HELICS_EXPORT void helicsBrokerAddSourceFilterToEndpoint ( helics_broker  broker,
const char *  filter,
const char *  endpoint,
helics_error err 
)

Link a named filter to a source endpoint.

Parameters
brokerThe broker to generate the connection from.
filterThe name of the filter (cannot be NULL).
endpointThe name of the endpoint to filter the data from (cannot be NULL).
[in,out]errA helics_error object, can be NULL if the errors are to be ignored.

References helics_error_invalid_argument.

Referenced by helicscpp::Broker::addSourceFilterToEndpoint().

◆ helicsBrokerClone()

HELICS_EXPORT 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.

Parameters
brokerAn existing helics_broker.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
A new reference to the same broker.

References helics::getBrokerObject().

Referenced by helicscpp::Broker::Broker(), and helicscpp::Broker::operator=().

◆ helicsBrokerDataLink()

HELICS_EXPORT void helicsBrokerDataLink ( helics_broker  broker,
const char *  source,
const char *  target,
helics_error err 
)

Link a named publication and named input using a broker.

Parameters
brokerThe broker to generate the connection from.
sourceThe name of the publication (cannot be NULL).
targetThe name of the target to send the publication data (cannot be NULL).
[in,out]errA helics_error object, can be NULL if the errors are to be ignored.

References helics_error_invalid_argument.

Referenced by helicscpp::Broker::dataLink().

◆ helicsBrokerDestroy()

HELICS_EXPORT void helicsBrokerDestroy ( helics_broker  broker)

Disconnect and free a broker.

References helicsBrokerDisconnect(), and helicsBrokerFree().

◆ helicsBrokerDisconnect()

HELICS_EXPORT void helicsBrokerDisconnect ( helics_broker  broker,
helics_error err 
)

Disconnect a broker.

Parameters
brokerThe broker to disconnect.
[in,out]errAn 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().

◆ helicsBrokerFree()

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

◆ helicsBrokerGetAddress()

HELICS_EXPORT const char* helicsBrokerGetAddress ( helics_broker  broker)

Get the network address associated with a broker.

Parameters
brokerThe broker to query.
Returns
A string with the network address of the broker.

Referenced by helicscpp::Broker::getAddress().

◆ helicsBrokerGetIdentifier()

HELICS_EXPORT const char* helicsBrokerGetIdentifier ( helics_broker  broker)

Get an identifier for the broker.

Parameters
brokerThe broker to query.
Returns
A string containing the identifier for the broker.

Referenced by helicscpp::Broker::getIdentifier().

◆ helicsBrokerIsConnected()

HELICS_EXPORT 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.

Returns
helics_false if not connected.

References helics_false, and helics_true.

Referenced by helicscpp::Broker::Broker(), and helicscpp::Broker::isConnected().

◆ helicsBrokerIsValid()

HELICS_EXPORT helics_bool helicsBrokerIsValid ( helics_broker  broker)

Check if a broker object is a valid object.

Parameters
brokerThe helics_broker object to test.

References helics::getBrokerObject(), helics_false, and helics_true.

◆ helicsBrokerMakeConnections()

HELICS_EXPORT void helicsBrokerMakeConnections ( helics_broker  broker,
const char *  file,
helics_error err 
)

Load a file containing connection information.

Parameters
brokerThe broker to generate the connections from.
fileA JSON or TOML file containing connection information.
[in,out]errA helics_error object, can be NULL if the errors are to be ignored.

◆ helicsBrokerSetGlobal()

HELICS_EXPORT 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.

Parameters
brokerThe broker to set the global through.
valueNameThe name of the global to set.
valueThe value of the global.
[in,out]errAn 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().

◆ helicsBrokerSetLogFile()

HELICS_EXPORT void helicsBrokerSetLogFile ( helics_broker  broker,
const char *  logFileName,
helics_error err 
)

Set the log file on a broker.

Parameters
brokerThe broker to set the log file for.
logFileNameThe name of the file to log to.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.

◆ helicsBrokerWaitForDisconnect()

HELICS_EXPORT helics_bool helicsBrokerWaitForDisconnect ( helics_broker  broker,
int  msToWait,
helics_error err 
)

Wait for the broker to disconnect.

Parameters
brokerThe broker to wait for.
msToWaitThe time out in millisecond (<0 for infinite timeout).
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
helics_true if the disconnect was successful, helics_false if there was a timeout.

References helics_false, and helics_true.

Referenced by helicscpp::Broker::waitForDisconnect().

◆ helicsCleanupLibrary()

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

◆ helicsCloseLibrary()

HELICS_EXPORT 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::LoggerManager::closeLogger().

◆ helicsCoreAddDestinationFilterToEndpoint()

HELICS_EXPORT void helicsCoreAddDestinationFilterToEndpoint ( helics_core  core,
const char *  filter,
const char *  endpoint,
helics_error err 
)

Link a named filter to a destination endpoint.

Parameters
coreThe core to generate the connection from.
filterThe name of the filter (cannot be NULL).
endpointThe name of the endpoint to filter the data going to (cannot be NULL).
[in,out]errA helics_error object, can be NULL if the errors are to be ignored.

References helics_error_invalid_argument.

◆ helicsCoreAddSourceFilterToEndpoint()

HELICS_EXPORT void helicsCoreAddSourceFilterToEndpoint ( helics_core  core,
const char *  filter,
const char *  endpoint,
helics_error err 
)

Link a named filter to a source endpoint.

Parameters
coreThe core to generate the connection from.
filterThe name of the filter (cannot be NULL).
endpointThe name of the endpoint to filter the data from (cannot be NULL).
[in,out]errA helics_error object, can be NULL if the errors are to be ignored.

References helics_error_invalid_argument.

◆ helicsCoreClone()

HELICS_EXPORT 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.

Parameters
coreAn existing helics_core.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
A new reference to the same broker.

References helics::getCoreObject().

Referenced by helicscpp::Core::Core(), and helicscpp::Core::operator=().

◆ helicsCoreConnect()

HELICS_EXPORT helics_bool helicsCoreConnect ( helics_core  core,
helics_error err 
)

Connect a core to the federate based on current configuration.

Parameters
coreThe core to connect.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
helics_false if not connected, helics_true if it is connected.

References helics_false, and helics_true.

◆ helicsCoreDataLink()

HELICS_EXPORT void helicsCoreDataLink ( helics_core  core,
const char *  source,
const char *  target,
helics_error err 
)

Link a named publication and named input using a core.

Parameters
coreThe core to generate the connection from.
sourceThe name of the publication (cannot be NULL).
targetThe name of the target to send the publication data (cannot be NULL).
[in,out]errA helics_error object, can be NULL if the errors are to be ignored.

References helics_error_invalid_argument.

◆ helicsCoreDestroy()

HELICS_EXPORT void helicsCoreDestroy ( helics_core  core)

Disconnect and free a core.

References helicsCoreDisconnect(), and helicsCoreFree().

◆ helicsCoreDisconnect()

HELICS_EXPORT void helicsCoreDisconnect ( helics_core  core,
helics_error err 
)

Disconnect a core from the federation.

Parameters
coreThe core to query.
[in,out]errAn 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().

◆ helicsCoreFree()

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

◆ helicsCoreGetAddress()

HELICS_EXPORT const char* helicsCoreGetAddress ( helics_core  core)

Get the network address associated with a core.

Parameters
coreThe core to query.
Returns
A string with the network address of the broker.

Referenced by helicscpp::Core::getAddress().

◆ helicsCoreGetIdentifier()

HELICS_EXPORT const char* helicsCoreGetIdentifier ( helics_core  core)

Get an identifier for the core.

Parameters
coreThe core to query.
Returns
A string with the identifier of the core.

Referenced by helicscpp::Core::getIdentifier().

◆ helicsCoreIsConnected()

HELICS_EXPORT 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

Returns
helics_false if not connected, helics_true if it is connected.

References helics_false, and helics_true.

Referenced by helicscpp::Core::isConnected().

◆ helicsCoreIsValid()

HELICS_EXPORT helics_bool helicsCoreIsValid ( helics_core  core)

Check if a core object is a valid object.

Parameters
coreThe helics_core object to test.

References helics::getCoreObject(), helics_false, and helics_true.

◆ helicsCoreMakeConnections()

HELICS_EXPORT void helicsCoreMakeConnections ( helics_core  core,
const char *  file,
helics_error err 
)

Load a file containing connection information.

Parameters
coreThe core to generate the connections from.
fileA JSON or TOML file containing connection information.
[in,out]errA helics_error object, can be NULL if the errors are to be ignored.

◆ helicsCoreSetGlobal()

HELICS_EXPORT 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.

Parameters
coreThe core to set the global through.
valueNameThe name of the global to set.
valueThe value of the global.
[in,out]errAn 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().

◆ helicsCoreSetLogFile()

HELICS_EXPORT void helicsCoreSetLogFile ( helics_core  core,
const char *  logFileName,
helics_error err 
)

Set the log file on a core.

Parameters
coreThe core to set the log file for.
logFileNameThe name of the file to log to.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.

◆ helicsCoreSetReadyToInit()

HELICS_EXPORT 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.

Parameters
coreThe core object to enable init values for.
[in,out]errAn 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().

◆ helicsCoreWaitForDisconnect()

HELICS_EXPORT helics_bool helicsCoreWaitForDisconnect ( helics_core  core,
int  msToWait,
helics_error err 
)

Wait for the core to disconnect.

Parameters
coreThe core to wait for.
msToWaitThe time out in millisecond (<0 for infinite timeout).
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
helics_true if the disconnect was successful, helics_false if there was a timeout.

References helics_false, and helics_true.

Referenced by helicscpp::Core::waitForDisconnect().

◆ helicsCreateBroker()

HELICS_EXPORT helics_broker helicsCreateBroker ( const char *  type,
const char *  name,
const char *  initString,
helics_error err 
)

Create a broker object.

Parameters
typeThe type of the broker to create.
nameThe name of the broker. It can be a nullptr or empty string to have a name automatically assigned.
initStringAn 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]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
A helics_broker object. It will be NULL if there was an error indicated in the err object.

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

◆ helicsCreateBrokerFromArgs()

HELICS_EXPORT 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.

Parameters
typeThe type of the core to create.
nameThe name of the core. It can be a nullptr or empty string to have a name automatically assigned.
argcThe number of arguments.
argvThe list of string values from a command line.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
A helics_core object.

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

◆ helicsCreateCombinationFederate()

HELICS_EXPORT 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

Parameters
fedNameA string with the name of the federate, can be NULL or an empty string to pull the default name from fi.
fiThe federate info object that contains details on the federate.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
An opaque value federate object nullptr if the object creation failed.

Referenced by helicscpp::CombinationFederate::CombinationFederate().

◆ helicsCreateCombinationFederateFromConfig()

HELICS_EXPORT 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

Parameters
configFileA JSON file or a JSON string or TOML file that contains setup and configuration information.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
An opaque combination federate object.

Referenced by helicscpp::CombinationFederate::CombinationFederate().

◆ helicsCreateCore()

HELICS_EXPORT helics_core helicsCreateCore ( const char *  type,
const char *  name,
const char *  initString,
helics_error err 
)

Create a core object.

Parameters
typeThe type of the core to create.
nameThe name of the core. It can be a nullptr or empty string to have a name automatically assigned.
initStringAn 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]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
A helics_core object. If the core is invalid, err will contain the corresponding error message and the returned object will be NULL.

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

◆ helicsCreateCoreFromArgs()

HELICS_EXPORT 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.

Parameters
typeThe type of the core to create.
nameThe name of the core. It can be a nullptr or empty string to have a name automatically assigned.
argcThe number of arguments.
argvThe list of string values from a command line.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
A helics_core object.

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

◆ helicsCreateFederateInfo()

HELICS_EXPORT helics_federate_info helicsCreateFederateInfo ( void  )

Create a federate info object for specifying federate information when constructing a federate.

Returns
A helics_federate_info object which is a reference to the created object.

Referenced by helicscpp::FederateInfo::FederateInfo().

◆ helicsCreateMessageFederate()

HELICS_EXPORT 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.

Parameters
fedNameThe name of the federate to create.
fiThe federate info object that contains details on the federate.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
An opaque message federate object.

Referenced by helicscpp::MessageFederate::MessageFederate().

◆ helicsCreateMessageFederateFromConfig()

HELICS_EXPORT 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.

Parameters
configFileA Config(JSON,TOML) file or a JSON string that contains setup and configuration information.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
An opaque message federate object.

Referenced by helicscpp::MessageFederate::MessageFederate().

◆ helicsCreateQuery()

HELICS_EXPORT helics_query helicsCreateQuery ( const char *  target,
const char *  query 
)

Create a query object.

A query object consists of a target and query string.

Parameters
targetThe name of the target to query.
queryThe query to make of the target.

Referenced by helicscpp::Core::query(), helicscpp::Broker::query(), and helicscpp::Federate::query().

◆ helicsCreateValueFederate()

HELICS_EXPORT 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.

Parameters
fedNameThe name of the federate to create, can NULL or an empty string to use the default name from fi or an assigned name.
fiThe federate info object that contains details on the federate.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
An opaque value federate object.

Referenced by helicscpp::ValueFederate::ValueFederate().

◆ helicsCreateValueFederateFromConfig()

HELICS_EXPORT 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.

Parameters
configFileA JSON file or a JSON string or TOML file that contains setup and configuration information.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
An opaque value federate object.

Referenced by helicscpp::ValueFederate::ValueFederate().

◆ helicsErrorClear()

HELICS_EXPORT void helicsErrorClear ( helics_error err)

Clear an error object.

clear an error object

References helics_error::error_code, and helics_error::message.

◆ helicsErrorInitialize()

HELICS_EXPORT helics_error helicsErrorInitialize ( void  )

Return an initialized error object.

References helics_error::error_code, and helics_error::message.

◆ helicsFederateAddDependency()

HELICS_EXPORT 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.

Parameters
fedThe federate to add the dependency for.
fedNameThe name of the federate to depend on.
[in,out]errA pointer to an error object for catching errors.

Referenced by helicscpp::Federate::addDependency().

◆ helicsFederateClone()

HELICS_EXPORT 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.

Parameters
fedAn existing helics_federate.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
A new reference to the same federate.

Referenced by helicscpp::Federate::Federate(), helicscpp::FederateInfo::FederateInfo(), helicsGetFederateByName(), helicscpp::FederateInfo::operator=(), and helicscpp::Federate::operator=().

◆ helicsFederateDestroy()

HELICS_EXPORT void helicsFederateDestroy ( helics_federate  fed)

Disconnect and free a federate.

References helicsFederateFinalize(), and helicsFederateFree().

◆ helicsFederateEnterExecutingMode()

HELICS_EXPORT 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.

Parameters
fedA federate to change modes.
[in,out]errAn 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().

◆ helicsFederateEnterExecutingModeAsync()

HELICS_EXPORT 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.

Parameters
fedThe federate object to complete the call.
[in,out]errAn 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().

◆ helicsFederateEnterExecutingModeComplete()

HELICS_EXPORT void helicsFederateEnterExecutingModeComplete ( helics_federate  fed,
helics_error err 
)

Complete the call to /ref helicsFederateEnterExecutingModeAsync.

Parameters
fedThe federate object to complete the call.
[in,out]errAn 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().

◆ helicsFederateEnterExecutingModeIterative()

HELICS_EXPORT 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.

Parameters
fedThe federate to make the request of.
iterateThe requested iteration mode.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
An iteration structure with field containing the time and iteration status.

Referenced by helicscpp::Federate::enterExecutingMode().

◆ helicsFederateEnterExecutingModeIterativeAsync()

HELICS_EXPORT 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

Parameters
fedThe federate to make the request of.
iterateThe requested iteration mode.
[in,out]errAn 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().

◆ helicsFederateEnterExecutingModeIterativeComplete()

HELICS_EXPORT helics_iteration_result helicsFederateEnterExecutingModeIterativeComplete ( helics_federate  fed,
helics_error err 
)

Complete the asynchronous iterative call into ExecutionMode.

Parameters
fedThe federate to make the request of.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
An iteration object containing the iteration time and iteration_status.

Referenced by helicscpp::Federate::enterExecutingModeComplete().

◆ helicsFederateEnterInitializingMode()

HELICS_EXPORT 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.

Parameters
fedThe federate to operate on.
[in,out]errAn 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().

◆ helicsFederateEnterInitializingModeAsync()

HELICS_EXPORT void helicsFederateEnterInitializingModeAsync ( helics_federate  fed,
helics_error err 
)

Non blocking alternative to helicsFederateEnterInitializingMode.

The function helicsFederateEnterInitializationModeFinalize must be called to finish the operation.

Parameters
fedThe federate to operate on.
[in,out]errAn 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().

◆ helicsFederateEnterInitializingModeComplete()

HELICS_EXPORT void helicsFederateEnterInitializingModeComplete ( helics_federate  fed,
helics_error err 
)

Finalize the entry to initialize mode that was initiated with /ref heliceEnterInitializingModeAsync.

Parameters
fedThe federate desiring to complete the initialization step.
[in,out]errAn 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().

◆ helicsFederateFinalize()

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

◆ helicsFederateFinalizeAsync()

HELICS_EXPORT void helicsFederateFinalizeAsync ( helics_federate  fed,
helics_error err 
)

Finalize the federate in an async call.

Referenced by helicscpp::Federate::finalizeAsync().

◆ helicsFederateFinalizeComplete()

HELICS_EXPORT void helicsFederateFinalizeComplete ( helics_federate  fed,
helics_error err 
)

Complete the asynchronous finalize call.

Referenced by helicscpp::Federate::finalizeComplete().

◆ helicsFederateFree()

HELICS_EXPORT void helicsFederateFree ( helics_federate  fed)

Release the memory associated with a federate.

References helics::CoreFactory::cleanUpCores(), and helics::getFedObject().

Referenced by helicsFederateDestroy(), and helicscpp::Federate::~Federate().

◆ helicsFederateGetCoreObject()

HELICS_EXPORT helics_core helicsFederateGetCoreObject ( helics_federate  fed,
helics_error err 
)

Get the core object associated with a federate.

Parameters
fedA federate object.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
A core object, nullptr if invalid.

Referenced by helicscpp::Federate::getCore().

◆ helicsFederateGetCurrentTime()

HELICS_EXPORT helics_time helicsFederateGetCurrentTime ( helics_federate  fed,
helics_error err 
)

Get the current time of the federate.

Parameters
fedThe federate object to query.
[in,out]errA pointer to an error object for catching errors.
Returns
The current time of the federate.

◆ helicsFederateGetFlagOption()

HELICS_EXPORT helics_bool helicsFederateGetFlagOption ( helics_federate  fed,
int  flag,
helics_error err 
)

Get a flag value for a federate.

Parameters
fedThe federate to get the flag for.
flagThe flag to query.
[in,out]errA pointer to an error object for catching errors.
Returns
The value of the flag.

Referenced by helicscpp::Federate::getFlagOption().

◆ helicsFederateGetIntegerProperty()

HELICS_EXPORT int helicsFederateGetIntegerProperty ( helics_federate  fed,
int  intProperty,
helics_error err 
)

Get the current value of an integer property (such as a logging level).

Parameters
fedThe federate to get the flag for.
intPropertyA code for the property to set /ref helics_handle_options.
[in,out]errA pointer to an error object for catching errors.
Returns
The value of the property.

Referenced by helicscpp::Federate::getIntegerProperty().

◆ helicsFederateGetName()

HELICS_EXPORT const char* helicsFederateGetName ( helics_federate  fed)

Get the name of the federate.

Parameters
fedThe federate object to query.
Returns
A pointer to a string with the name.

Referenced by helicscpp::Federate::getName().

◆ helicsFederateGetState()

HELICS_EXPORT helics_federate_state helicsFederateGetState ( helics_federate  fed,
helics_error err 
)

Get the current state of a federate.

Parameters
fedThe federate to query.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
State the resulting state if void return helics_ok.

Referenced by helicscpp::Federate::getCurrentMode().

◆ helicsFederateGetTimeProperty()

HELICS_EXPORT helics_time helicsFederateGetTimeProperty ( helics_federate  fed,
int  timeProperty,
helics_error err 
)

Get the current value of a time based property in a federate.

Parameters
fedThe federate query.
timePropertyThe property to query.
[in,out]errAn 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().

◆ helicsFederateGlobalError()

HELICS_EXPORT void helicsFederateGlobalError ( helics_federate  fed,
int  error_code,
const char *  error_string 
)

Generate a global error from a federate.

A global error halts the co-simulation completely.

Parameters
fedThe federate to create an error in.
error_codeThe integer code for the error.
error_stringA string describing the error.

Referenced by helicscpp::Federate::globalError().

◆ helicsFederateInfoClone()

HELICS_EXPORT helics_federate_info helicsFederateInfoClone ( helics_federate_info  fi,
helics_error err 
)

Create a federate info object from an existing one and clone the information.

Parameters
fiA federateInfo object to duplicate.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
A helics_federate_info object which is a reference to the created object.

◆ helicsFederateInfoFree()

HELICS_EXPORT void helicsFederateInfoFree ( helics_federate_info  fi)

Delete the memory associated with a federate info object.

Referenced by helicscpp::FederateInfo::operator=(), and helicscpp::FederateInfo::~FederateInfo().

◆ helicsFederateInfoLoadFromArgs()

HELICS_EXPORT void helicsFederateInfoLoadFromArgs ( helics_federate_info  fi,
int  argc,
const char *const *  argv,
helics_error err 
)

Load federate info from command line arguments.

Parameters
fiA federateInfo object.
argcThe number of command line arguments.
argvAn array of strings from the command line.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.

◆ helicsFederateInfoSetBroker()

HELICS_EXPORT 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.

Parameters
fiThe federate info object to alter.
brokerA string which defines the connection information for a broker either a name or an address.
[in,out]errAn 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().

◆ helicsFederateInfoSetBrokerInitString()

HELICS_EXPORT 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.

Parameters
fiThe federate info object to alter.
brokerInitA string with command line arguments for a generated broker.
[in,out]errAn 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().

◆ helicsFederateInfoSetBrokerKey()

HELICS_EXPORT 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.

Parameters
fiThe federate info object to alter.
brokerkeyA string containing a key for the broker to connect.
[in,out]errAn 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().

◆ helicsFederateInfoSetBrokerPort()

HELICS_EXPORT 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.

Parameters
fiThe federate info object to alter.
brokerPortThe integer port number to use for connection with a broker.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.

◆ helicsFederateInfoSetCoreInitString()

HELICS_EXPORT 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.

Parameters
fiThe federate info object to alter.
coreInitA string containing command line arguments to be passed to the core.
[in,out]errAn 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().

◆ helicsFederateInfoSetCoreName()

HELICS_EXPORT void helicsFederateInfoSetCoreName ( helics_federate_info  fi,
const char *  corename,
helics_error err 
)

Set the name of the core to link to for a federate.

Parameters
fiThe federate info object to alter.
corenameThe identifier for a core to link to.
[in,out]errAn 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().

◆ helicsFederateInfoSetCoreType()

HELICS_EXPORT 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.

Parameters
fiThe federate info object to alter.
coretypeAn numerical code for a core type see /ref helics_core_type.
[in,out]errAn 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().

◆ helicsFederateInfoSetCoreTypeFromString()

HELICS_EXPORT void helicsFederateInfoSetCoreTypeFromString ( helics_federate_info  fi,
const char *  coretype,
helics_error err 
)

Set the core type from a string.

Parameters
fiThe federate info object to alter.
coretypeA string naming a core type.
[in,out]errAn 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().

◆ helicsFederateInfoSetFlagOption()

HELICS_EXPORT 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.

Parameters
fiThe federate info object to alter.
flagA numerical index for a flag.
valueThe desired value of the flag helics_true or helics_false.
[in,out]errAn 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().

◆ helicsFederateInfoSetIntegerProperty()

HELICS_EXPORT void helicsFederateInfoSetIntegerProperty ( helics_federate_info  fi,
int  intProperty,
int  propertyValue,
helics_error err 
)

Set an integer property for a federate.

Set known properties.

Parameters
fiThe federateInfo object to alter.
intPropertyAn int identifying the property.
propertyValueThe value to set the property to.
[in,out]errAn 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().

◆ helicsFederateInfoSetLocalPort()

HELICS_EXPORT 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.

Parameters
fiThe federate info object to alter.
localPortA string with the port information to use as the local server port can be a number or "auto" or "os_local".
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.

◆ helicsFederateInfoSetSeparator()

HELICS_EXPORT 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.

Parameters
fiThe federate info object to alter.
separatorThe character to use as a separator.
[in,out]errAn 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().

◆ helicsFederateInfoSetTimeProperty()

HELICS_EXPORT void helicsFederateInfoSetTimeProperty ( helics_federate_info  fi,
int  timeProperty,
helics_time  propertyValue,
helics_error err 
)

Set the output delay for a federate.

Parameters
fiThe federate info object to alter.
timePropertyAn integer representation of the time based property to set see /ref helics_properties.
propertyValueThe value of the property to set the timeProperty to.
[in,out]errAn 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().

◆ helicsFederateIsAsyncOperationCompleted()

HELICS_EXPORT helics_bool helicsFederateIsAsyncOperationCompleted ( helics_federate  fed,
helics_error err 
)

Check if the current Asynchronous operation has completed.

Parameters
fedThe federate to operate on.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
helics_false if not completed, helics_true if completed.

Referenced by helicscpp::Federate::isAsyncOperationCompleted().

◆ helicsFederateIsValid()

HELICS_EXPORT helics_bool helicsFederateIsValid ( helics_federate  fed)

Check if a federate_object is valid.

Returns
helics_true if the federate is a valid active federate, helics_false otherwise

◆ helicsFederateLocalError()

HELICS_EXPORT void helicsFederateLocalError ( helics_federate  fed,
int  error_code,
const char *  error_string 
)

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.

Parameters
fedThe federate to create an error in.
error_codeThe integer code for the error.
error_stringA string describing the error.

Referenced by helicscpp::Federate::localError().

◆ helicsFederateLogDebugMessage()

HELICS_EXPORT void helicsFederateLogDebugMessage ( helics_federate  fed,
const char *  logmessage,
helics_error err 
)

Log a debug message through a federate.

Parameters
fedThe federate to log the debug message through.
logmessageThe message to put in the log.
[in,out]errA pointer to an error object for catching errors.

Referenced by helicscpp::Federate::logDebugMessage().

◆ helicsFederateLogErrorMessage()

HELICS_EXPORT void helicsFederateLogErrorMessage ( helics_federate  fed,
const char *  logmessage,
helics_error err 
)

Log an error message through a federate.

Parameters
fedThe federate to log the error message through.
logmessageThe message to put in the log.
[in,out]errA pointer to an error object for catching errors.

Referenced by helicscpp::Federate::logErrorMessage().

◆ helicsFederateLogInfoMessage()

HELICS_EXPORT void helicsFederateLogInfoMessage ( helics_federate  fed,
const char *  logmessage,
helics_error err 
)

Log an info message through a federate.

Parameters
fedThe federate to log the info message through.
logmessageThe message to put in the log.
[in,out]errA pointer to an error object for catching errors.

Referenced by helicscpp::Federate::logInfoMessage().

◆ helicsFederateLogLevelMessage()

HELICS_EXPORT void helicsFederateLogLevelMessage ( helics_federate  fed,
int  loglevel,
const char *  logmessage,
helics_error err 
)

Log a message through a federate.

Parameters
fedThe federate to log the message through.
loglevelThe level of the message to log see /ref helics_log_levels.
logmessageThe message to put in the log.
[in,out]errA pointer to an error object for catching errors.

Referenced by helicscpp::Federate::logMessage().

◆ helicsFederateLogWarningMessage()

HELICS_EXPORT void helicsFederateLogWarningMessage ( helics_federate  fed,
const char *  logmessage,
helics_error err 
)

Log a warning message through a federate.

Parameters
fedThe federate to log the warning message through.
logmessageThe message to put in the log.
[in,out]errA pointer to an error object for catching errors.

Referenced by helicscpp::Federate::logWarningMessage().

◆ helicsFederateRegisterInterfaces()

HELICS_EXPORT void helicsFederateRegisterInterfaces ( helics_federate  fed,
const char *  file,
helics_error err 
)

Load interfaces from a file.

Parameters
fedThe federate to which to load interfaces.
fileThe name of a file to load the interfaces from either JSON, or TOML.
[in,out]errAn 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().

◆ helicsFederateRequestNextStep()

HELICS_EXPORT 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.

Parameters
fedThe federate to make the request of.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
The time granted to the federate, will return helics_time_maxtime if the simulation has terminated or is invalid

Referenced by helicscpp::Federate::requestNextStep().

◆ helicsFederateRequestTime()

HELICS_EXPORT helics_time helicsFederateRequestTime ( helics_federate  fed,
helics_time  requestTime,
helics_error err 
)

Request the next time for federate execution.

Parameters
fedThe federate to make the request of.
requestTimeThe next requested time.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
The time granted to the federate, will return helics_time_maxtime if the simulation has terminated or is invalid.

Referenced by helicscpp::Federate::requestTime().

◆ helicsFederateRequestTimeAdvance()

HELICS_EXPORT helics_time helicsFederateRequestTimeAdvance ( helics_federate  fed,
helics_time  timeDelta,
helics_error err 
)

Request the next time for federate execution.

Parameters
fedThe federate to make the request of.
timeDeltaThe requested amount of time to advance.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
The time granted to the federate, will return helics_time_maxtime if the simulation has terminated or is invalid

Referenced by helicscpp::Federate::requestTimeAdvance().

◆ helicsFederateRequestTimeAsync()

HELICS_EXPORT 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.

Parameters
fedThe federate to make the request of.
requestTimeThe next requested time.
[in,out]errAn 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().

◆ helicsFederateRequestTimeComplete()

HELICS_EXPORT helics_time helicsFederateRequestTimeComplete ( helics_federate  fed,
helics_error err 
)

Complete an asynchronous requestTime call.

Parameters
fedThe federate to make the request of.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
The time granted to the federate, will return helics_time_maxtime if the simulation has terminated.

Referenced by helicscpp::Federate::requestTimeComplete().

◆ helicsFederateRequestTimeIterative()

HELICS_EXPORT 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.

Parameters
fedThe federate to make the request of.
requestTimeThe next desired time.
iterateThe requested iteration mode.
[out]outIterationThe iteration specification of the result.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
The granted time, will return helics_time_maxtime if the simulation has terminated along with the appropriate iteration result. This function also returns the iteration specification of the result.

Referenced by helicscpp::Federate::requestTimeIterative().

◆ helicsFederateRequestTimeIterativeAsync()

HELICS_EXPORT 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.

Parameters
fedThe federate to make the request of.
requestTimeThe next desired time.
iterateThe requested iteration mode.
[in,out]errAn 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().

◆ helicsFederateRequestTimeIterativeComplete()

HELICS_EXPORT helics_time helicsFederateRequestTimeIterativeComplete ( helics_federate  fed,
helics_iteration_result outIterate,
helics_error err 
)

Complete an iterative time request asynchronous call.

Parameters
fedThe federate to make the request of.
[out]outIterateThe iteration specification of the result.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
The granted time, will return helics_time_maxtime if the simulation has terminated. This function also returns the iteration specification of the result.

Referenced by helicscpp::Federate::requestTimeIterativeComplete().

◆ helicsFederateSetFlagOption()

HELICS_EXPORT void helicsFederateSetFlagOption ( helics_federate  fed,
int  flag,
helics_bool  flagValue,
helics_error err 
)

Set a flag for the federate.

Parameters
fedThe federate to alter a flag for.
flagThe flag to change.
flagValueThe new value of the flag. 0 for false, !=0 for true.
[in,out]errAn 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().

◆ helicsFederateSetGlobal()

HELICS_EXPORT 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.

Parameters
fedThe federate to set the global through.
valueNameThe name of the global to set.
valueThe value of the global.
[in,out]errA pointer to an error object for catching errors.

Referenced by helicscpp::Federate::setGlobal().

◆ helicsFederateSetIntegerProperty()

HELICS_EXPORT void helicsFederateSetIntegerProperty ( helics_federate  fed,
int  intProperty,
int  propertyVal,
helics_error err 
)

Set an integer based property of a federate.

Parameters
fedThe federate to change the property for.
intPropertyThe property to set.
propertyValThe value of the property.
[in,out]errAn 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().

◆ helicsFederateSetLogFile()

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

Parameters
fedThe federate to set the log file for.
logFileThe name of the log file.
[in,out]errA pointer to an error object for catching errors.

◆ helicsFederateSetSeparator()

HELICS_EXPORT 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.

Parameters
fedThe federate info object to alter.
separatorThe character to use as a separator.
[in,out]errAn 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().

◆ helicsFederateSetTimeProperty()

HELICS_EXPORT void helicsFederateSetTimeProperty ( helics_federate  fed,
int  timeProperty,
helics_time  time,
helics_error err 
)

Set a time based property for a federate.

Parameters
fedThe federate object to set the property for.
timePropertyA integer code for a time property.
timeThe requested value of the property.
[in,out]errAn 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().

◆ helicsGetBuildFlags()

HELICS_EXPORT const char* helicsGetBuildFlags ( void  )

Get the build flags used to compile HELICS.

References helics::buildFlags.

Referenced by helicscpp::buildFlags().

◆ helicsGetCompilerVersion()

HELICS_EXPORT const char* helicsGetCompilerVersion ( void  )

Get the compiler version used to compile HELICS.

References helics::compiler.

Referenced by helicscpp::compilerVersion().

◆ helicsGetFederateByName()

HELICS_EXPORT 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.

Parameters
fedNameThe name of the federate to retrieve.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
NULL if no fed is available by that name otherwise a helics_federate with that name.

References helics_error::error_code, helics_error_invalid_argument, helicsFederateClone(), and helics_error::message.

◆ helicsGetFlagIndex()

HELICS_EXPORT int helicsGetFlagIndex ( const char *  val)

Get a property index for use in /ref helicsFederateInfoSetFlagOption, /ref helicsFederateSetFlagOption,

Parameters
valA string with the option name.
Returns
An int with the property code or (-1) if not a valid property.

◆ helicsGetOptionIndex()

HELICS_EXPORT 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.

Parameters
valA string with the option name.
Returns
An int with the option index or (-1) if not a valid property.

◆ helicsGetOptionValue()

HELICS_EXPORT int helicsGetOptionValue ( const char *  val)

Get an option value for use in /ref helicsPublicationSetOption, /ref helicsInputSetOption, /ref helicsEndpointSetOption, /ref helicsFilterSetOption.

Parameters
valA string representing the value.
Returns
An int with the option value or (-1) if not a valid value.

◆ helicsGetPropertyIndex()

HELICS_EXPORT int helicsGetPropertyIndex ( const char *  val)

Get a property index for use in /ref helicsFederateInfoSetFlagOption, /ref helicsFederateInfoSetTimeProperty, or /ref helicsFederateInfoSetIntegerProperty

Parameters
valA string with the property name.
Returns
An int with the property code or (-1) if not a valid property.

◆ helicsGetVersion()

HELICS_EXPORT const char* helicsGetVersion ( void  )

Get a version string for HELICS.

References helics::versionString.

Referenced by helicscpp::getHelicsVersionString(), and helicscpp::version().

◆ helicsIsCoreTypeAvailable()

HELICS_EXPORT helics_bool helicsIsCoreTypeAvailable ( const char *  type)

Returns true if core/broker type specified is available in current compilation.

Parameters
typeA string representing a core type.

Options include "zmq", "udp", "ipc", "interprocess", "tcp", "default", "mpi".

References helics_error::error_code, helics_error_connection_failure, helics_error_external_type, helics_error_invalid_argument, helics_error_invalid_function_call, helics_error_invalid_object, helics_error_other, helics_error_registration_failure, helics_error_system_failure, helics_false, helics_true, and helics_error::message.

◆ helicsQueryBrokerExecute()

HELICS_EXPORT 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.

Parameters
queryThe query object to use in the query.
brokerThe broker to send the query to.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
A pointer to a string. The string will remain valid until the query is freed or executed again. The return will be nullptr if broker or query is an invalid object, the return string will be "#invalid" if the query itself was invalid

Referenced by helicscpp::Broker::query().

◆ helicsQueryCoreExecute()

HELICS_EXPORT 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.

Parameters
queryThe query object to use in the query.
coreThe core to send the query to.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
A pointer to a string. The string will remain valid until the query is freed or executed again. The return will be nullptr if core or query is an invalid object, the return string will be "#invalid" if the query itself was invalid.

Referenced by helicscpp::Core::query().

◆ helicsQueryExecute()

HELICS_EXPORT 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.

Parameters
queryThe query object to use in the query.
fedA federate to send the query through.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
A pointer to a string. The string will remain valid until the query is freed or executed again. The return will be nullptr if fed or query is an invalid object, the return string will be "#invalid" if the query itself was invalid.

Referenced by helicscpp::Federate::query().

◆ helicsQueryExecuteAsync()

HELICS_EXPORT void helicsQueryExecuteAsync ( helics_query  query,
helics_federate  fed,
helics_error err 
)

Execute a query in a non-blocking call.

Parameters
queryThe query object to use in the query.
fedA federate to send the query through.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.

◆ helicsQueryExecuteComplete()

HELICS_EXPORT 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.

Parameters
queryThe query object to complete execution of.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.
Returns
A pointer to a string. The string will remain valid until the query is freed or executed again. The return will be nullptr if query is an invalid object

◆ helicsQueryFree()

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

◆ helicsQueryIsCompleted()

HELICS_EXPORT 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.

Parameters
queryThe query object to check if completed.
Returns
Will return helics_true if an asynchronous query has completed or a regular query call was made with a result, and false if an asynchronous query has not completed or is invalid

◆ helicsQuerySetQueryString()

HELICS_EXPORT void helicsQuerySetQueryString ( helics_query  query,
const char *  queryString,
helics_error err 
)

Update the queryString of a query.

Parameters
queryThe query object to change the target of.
queryStringthe new queryString
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.

◆ helicsQuerySetTarget()

HELICS_EXPORT void helicsQuerySetTarget ( helics_query  query,
const char *  target,
helics_error err 
)

Update the target of a query.

Parameters
queryThe query object to change the target of.
targetthe name of the target to query
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.