helics  3.5.2
Functions
helicsCore.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

const char * helicsGetVersion (void)
 
const char * helicsGetBuildFlags (void)
 
const char * helicsGetCompilerVersion (void)
 
const char * helicsGetSystemInfo (void)
 
HelicsError helicsErrorInitialize (void)
 
void helicsErrorClear (HelicsError *err)
 
void helicsLoadSignalHandler ()
 
void helicsLoadThreadedSignalHandler ()
 
void helicsClearSignalHandler ()
 
void helicsLoadSignalHandlerCallback (HelicsBool(*handler)(int), HelicsBool useSeparateThread)
 
void helicsLoadSignalHandlerCallbackNoExit (HelicsBool(*handler)(int), HelicsBool useSeparateThread)
 
void helicsAbort (int errorCode, const char *errorString)
 
HelicsBool helicsIsCoreTypeAvailable (const char *type)
 
HelicsCore helicsCreateCore (const char *type, const char *name, const char *initString, HelicsError *err)
 
HelicsCore helicsCreateCoreFromArgs (const char *type, const char *name, int argc, const char *const *argv, HelicsError *err)
 
HelicsCore helicsCoreClone (HelicsCore core, HelicsError *err)
 
HelicsBool helicsCoreIsValid (HelicsCore core)
 
HelicsBroker helicsCreateBroker (const char *type, const char *name, const char *initString, HelicsError *err)
 
HelicsBroker helicsCreateBrokerFromArgs (const char *type, const char *name, int argc, const char *const *argv, HelicsError *err)
 
HelicsBroker helicsBrokerClone (HelicsBroker broker, HelicsError *err)
 
HelicsBool helicsBrokerIsValid (HelicsBroker broker)
 
HelicsBool helicsBrokerIsConnected (HelicsBroker broker)
 
void helicsBrokerDataLink (HelicsBroker broker, const char *source, const char *target, HelicsError *err)
 
void helicsBrokerAddSourceFilterToEndpoint (HelicsBroker broker, const char *filter, const char *endpoint, HelicsError *err)
 
void helicsBrokerAddDestinationFilterToEndpoint (HelicsBroker broker, const char *filter, const char *endpoint, HelicsError *err)
 
void helicsBrokerMakeConnections (HelicsBroker broker, const char *file, HelicsError *err)
 
HelicsBool helicsCoreWaitForDisconnect (HelicsCore core, int msToWait, HelicsError *err)
 
HelicsBool helicsBrokerWaitForDisconnect (HelicsBroker broker, int msToWait, HelicsError *err)
 
HelicsBool helicsCoreIsConnected (HelicsCore core)
 
void helicsCoreDataLink (HelicsCore core, const char *source, const char *target, HelicsError *err)
 
void helicsCoreAddSourceFilterToEndpoint (HelicsCore core, const char *filter, const char *endpoint, HelicsError *err)
 
void helicsCoreAddDestinationFilterToEndpoint (HelicsCore core, const char *filter, const char *endpoint, HelicsError *err)
 
void helicsCoreMakeConnections (HelicsCore core, const char *file, HelicsError *err)
 
const char * helicsBrokerGetIdentifier (HelicsBroker broker)
 
const char * helicsCoreGetIdentifier (HelicsCore core)
 
const char * helicsBrokerGetAddress (HelicsBroker broker)
 
const char * helicsCoreGetAddress (HelicsCore core)
 
void helicsCoreSetReadyToInit (HelicsCore core, HelicsError *err)
 
HelicsBool helicsCoreConnect (HelicsCore core, HelicsError *err)
 
void helicsCoreDisconnect (HelicsCore core, HelicsError *err)
 
HelicsFederate helicsGetFederateByName (const char *fedName, HelicsError *err)
 
void helicsBrokerDisconnect (HelicsBroker broker, HelicsError *err)
 
void helicsFederateDestroy (HelicsFederate fed)
 
void helicsBrokerDestroy (HelicsBroker broker)
 
void helicsCoreDestroy (HelicsCore core)
 
void helicsCoreFree (HelicsCore core)
 
void helicsBrokerFree (HelicsBroker broker)
 
HelicsFederate helicsCreateValueFederate (const char *fedName, HelicsFederateInfo fedInfo, HelicsError *err)
 
HelicsFederate helicsCreateValueFederateFromConfig (const char *configFile, HelicsError *err)
 
HelicsFederate helicsCreateMessageFederate (const char *fedName, HelicsFederateInfo fedInfo, HelicsError *err)
 
HelicsFederate helicsCreateMessageFederateFromConfig (const char *configFile, HelicsError *err)
 
HelicsFederate helicsCreateCombinationFederate (const char *fedName, HelicsFederateInfo fedInfo, HelicsError *err)
 
HelicsFederate helicsCreateCombinationFederateFromConfig (const char *configFile, HelicsError *err)
 
HelicsFederate helicsCreateCallbackFederate (const char *fedName, HelicsFederateInfo fedInfo, HelicsError *err)
 
HelicsFederate helicsCreateCallbackFederateFromConfig (const char *configFile, HelicsError *err)
 
HelicsFederate helicsFederateClone (HelicsFederate fed, HelicsError *err)
 
void helicsFederateProtect (const char *fedName, HelicsError *err)
 
void helicsFederateUnProtect (const char *fedName, HelicsError *err)
 
HelicsBool helicsFederateIsProtected (const char *fedName, HelicsError *err)
 
HelicsFederateInfo helicsCreateFederateInfo (void)
 
HelicsFederateInfo helicsFederateInfoClone (HelicsFederateInfo fedInfo, HelicsError *err)
 
void helicsFederateInfoLoadFromArgs (HelicsFederateInfo fedInfo, int argc, const char *const *argv, HelicsError *err)
 
void helicsFederateInfoLoadFromString (HelicsFederateInfo fedInfo, const char *args, HelicsError *err)
 
void helicsFederateInfoFree (HelicsFederateInfo fedInfo)
 
HelicsBool helicsFederateIsValid (HelicsFederate fed)
 
void helicsFederateInfoSetCoreName (HelicsFederateInfo fedInfo, const char *corename, HelicsError *err)
 
void helicsFederateInfoSetCoreInitString (HelicsFederateInfo fedInfo, const char *coreInit, HelicsError *err)
 
void helicsFederateInfoSetBrokerInitString (HelicsFederateInfo fedInfo, const char *brokerInit, HelicsError *err)
 
void helicsFederateInfoSetCoreType (HelicsFederateInfo fedInfo, int coretype, HelicsError *err)
 
void helicsFederateInfoSetCoreTypeFromString (HelicsFederateInfo fedInfo, const char *coretype, HelicsError *err)
 
void helicsFederateInfoSetBroker (HelicsFederateInfo fedInfo, const char *broker, HelicsError *err)
 
void helicsFederateInfoSetBrokerKey (HelicsFederateInfo fedInfo, const char *brokerkey, HelicsError *err)
 
void helicsFederateInfoSetBrokerPort (HelicsFederateInfo fedInfo, int brokerPort, HelicsError *err)
 
void helicsFederateInfoSetLocalPort (HelicsFederateInfo fedInfo, const char *localPort, HelicsError *err)
 
int helicsGetPropertyIndex (const char *val)
 
int helicsGetFlagIndex (const char *val)
 
int helicsGetOptionIndex (const char *val)
 
int helicsGetOptionValue (const char *val)
 
int helicsGetDataType (const char *val)
 
void helicsFederateInfoSetFlagOption (HelicsFederateInfo fedInfo, int flag, HelicsBool value, HelicsError *err)
 
void helicsFederateInfoSetSeparator (HelicsFederateInfo fedInfo, char separator, HelicsError *err)
 
void helicsFederateInfoSetTimeProperty (HelicsFederateInfo fedInfo, int timeProperty, HelicsTime propertyValue, HelicsError *err)
 
void helicsFederateInfoSetIntegerProperty (HelicsFederateInfo fedInfo, int intProperty, int propertyValue, HelicsError *err)
 
void helicsFederateRegisterInterfaces (HelicsFederate fed, const char *file, HelicsError *err)
 
void helicsFederateGlobalError (HelicsFederate fed, int errorCode, const char *errorString, HelicsError *err)
 
void helicsFederateLocalError (HelicsFederate fed, int errorCode, const char *errorString, HelicsError *err)
 
void helicsFederateFinalize (HelicsFederate fed, HelicsError *err)
 
void helicsFederateFinalizeAsync (HelicsFederate fed, HelicsError *err)
 
void helicsFederateFinalizeComplete (HelicsFederate fed, HelicsError *err)
 
void helicsFederateDisconnect (HelicsFederate fed, HelicsError *err)
 
void helicsFederateDisconnectAsync (HelicsFederate fed, HelicsError *err)
 
void helicsFederateDisconnectComplete (HelicsFederate fed, HelicsError *err)
 
void helicsFederateFree (HelicsFederate fed)
 
void helicsCloseLibrary (void)
 
void helicsFederateEnterInitializingMode (HelicsFederate fed, HelicsError *err)
 
void helicsFederateEnterInitializingModeAsync (HelicsFederate fed, HelicsError *err)
 
void helicsFederateEnterInitializingModeComplete (HelicsFederate fed, HelicsError *err)
 
void helicsFederateEnterInitializingModeIterative (HelicsFederate fed, HelicsError *err)
 
void helicsFederateEnterInitializingModeIterativeAsync (HelicsFederate fed, HelicsError *err)
 
void helicsFederateEnterInitializingModeIterativeComplete (HelicsFederate fed, HelicsError *err)
 
HelicsBool helicsFederateIsAsyncOperationCompleted (HelicsFederate fed, HelicsError *err)
 
void helicsFederateEnterExecutingMode (HelicsFederate fed, HelicsError *err)
 
void helicsFederateEnterExecutingModeAsync (HelicsFederate fed, HelicsError *err)
 
void helicsFederateEnterExecutingModeComplete (HelicsFederate fed, HelicsError *err)
 
HelicsIterationResult helicsFederateEnterExecutingModeIterative (HelicsFederate fed, HelicsIterationRequest iterate, HelicsError *err)
 
void helicsFederateEnterExecutingModeIterativeAsync (HelicsFederate fed, HelicsIterationRequest iterate, HelicsError *err)
 
HelicsIterationResult helicsFederateEnterExecutingModeIterativeComplete (HelicsFederate fed, HelicsError *err)
 
HelicsFederateState helicsFederateGetState (HelicsFederate fed, HelicsError *err)
 
HelicsCore helicsFederateGetCore (HelicsFederate fed, HelicsError *err)
 
HelicsTime helicsFederateRequestTime (HelicsFederate fed, HelicsTime requestTime, HelicsError *err)
 
HelicsTime helicsFederateRequestTimeAdvance (HelicsFederate fed, HelicsTime timeDelta, HelicsError *err)
 
HelicsTime helicsFederateRequestNextStep (HelicsFederate fed, HelicsError *err)
 
HelicsTime helicsFederateRequestTimeIterative (HelicsFederate fed, HelicsTime requestTime, HelicsIterationRequest iterate, HelicsIterationResult *outIteration, HelicsError *err)
 
void helicsFederateRequestTimeAsync (HelicsFederate fed, HelicsTime requestTime, HelicsError *err)
 
HelicsTime helicsFederateRequestTimeComplete (HelicsFederate fed, HelicsError *err)
 
void helicsFederateRequestTimeIterativeAsync (HelicsFederate fed, HelicsTime requestTime, HelicsIterationRequest iterate, HelicsError *err)
 
HelicsTime helicsFederateRequestTimeIterativeComplete (HelicsFederate fed, HelicsIterationResult *outIterate, HelicsError *err)
 
void helicsFederateProcessCommunications (HelicsFederate fed, HelicsTime period, HelicsError *err)
 
const char * helicsFederateGetName (HelicsFederate fed)
 
void helicsFederateSetTimeProperty (HelicsFederate fed, int timeProperty, HelicsTime time, HelicsError *err)
 
void helicsFederateSetFlagOption (HelicsFederate fed, int flag, HelicsBool flagValue, HelicsError *err)
 
void helicsFederateSetSeparator (HelicsFederate fed, char separator, HelicsError *err)
 
void helicsFederateSetIntegerProperty (HelicsFederate fed, int intProperty, int propertyVal, HelicsError *err)
 
HelicsTime helicsFederateGetTimeProperty (HelicsFederate fed, int timeProperty, HelicsError *err)
 
HelicsBool helicsFederateGetFlagOption (HelicsFederate fed, int flag, HelicsError *err)
 
int helicsFederateGetIntegerProperty (HelicsFederate fed, int intProperty, HelicsError *err)
 
HelicsTime helicsFederateGetCurrentTime (HelicsFederate fed, HelicsError *err)
 
void helicsFederateAddAlias (HelicsFederate fed, const char *interfaceName, const char *alias, HelicsError *err)
 
void helicsFederateSetGlobal (HelicsFederate fed, const char *valueName, const char *value, HelicsError *err)
 
void helicsFederateSetTag (HelicsFederate fed, const char *tagName, const char *value, HelicsError *err)
 
const char * helicsFederateGetTag (HelicsFederate fed, const char *tagName, HelicsError *err)
 
void helicsFederateAddDependency (HelicsFederate fed, const char *fedName, HelicsError *err)
 
void helicsFederateSetLogFile (HelicsFederate fed, const char *logFile, HelicsError *err)
 
void helicsFederateLogErrorMessage (HelicsFederate fed, const char *logmessage, HelicsError *err)
 
void helicsFederateLogWarningMessage (HelicsFederate fed, const char *logmessage, HelicsError *err)
 
void helicsFederateLogInfoMessage (HelicsFederate fed, const char *logmessage, HelicsError *err)
 
void helicsFederateLogDebugMessage (HelicsFederate fed, const char *logmessage, HelicsError *err)
 
void helicsFederateLogLevelMessage (HelicsFederate fed, int loglevel, const char *logmessage, HelicsError *err)
 
void helicsFederateSendCommand (HelicsFederate fed, const char *target, const char *command, HelicsError *err)
 
const char * helicsFederateGetCommand (HelicsFederate fed, HelicsError *err)
 
const char * helicsFederateGetCommandSource (HelicsFederate fed, HelicsError *err)
 
const char * helicsFederateWaitCommand (HelicsFederate fed, HelicsError *err)
 
void helicsCoreSetGlobal (HelicsCore core, const char *valueName, const char *value, HelicsError *err)
 
void helicsBrokerSetGlobal (HelicsBroker broker, const char *valueName, const char *value, HelicsError *err)
 
void helicsCoreAddAlias (HelicsCore core, const char *interfaceName, const char *alias, HelicsError *err)
 
void helicsBrokerAddAlias (HelicsBroker broker, const char *interfaceName, const char *alias, HelicsError *err)
 
void helicsCoreSendCommand (HelicsCore core, const char *target, const char *command, HelicsError *err)
 
void helicsCoreSendOrderedCommand (HelicsCore core, const char *target, const char *command, HelicsError *err)
 
void helicsBrokerSendCommand (HelicsBroker broker, const char *target, const char *command, HelicsError *err)
 
void helicsBrokerSendOrderedCommand (HelicsBroker broker, const char *target, const char *command, HelicsError *err)
 
void helicsCoreSetLogFile (HelicsCore core, const char *logFileName, HelicsError *err)
 
void helicsBrokerSetLogFile (HelicsBroker broker, const char *logFileName, HelicsError *err)
 
void helicsBrokerSetTimeBarrier (HelicsBroker broker, HelicsTime barrierTime, HelicsError *err)
 
void helicsBrokerClearTimeBarrier (HelicsBroker broker)
 
void helicsBrokerGlobalError (HelicsBroker broker, int errorCode, const char *errorString, HelicsError *err)
 
void helicsCoreGlobalError (HelicsCore core, int errorCode, const char *errorString, HelicsError *err)
 
HelicsQuery helicsCreateQuery (const char *target, const char *query)
 
const char * helicsQueryExecute (HelicsQuery query, HelicsFederate fed, HelicsError *err)
 
const char * helicsQueryCoreExecute (HelicsQuery query, HelicsCore core, HelicsError *err)
 
const char * helicsQueryBrokerExecute (HelicsQuery query, HelicsBroker broker, HelicsError *err)
 
void helicsQueryExecuteAsync (HelicsQuery query, HelicsFederate fed, HelicsError *err)
 
const char * helicsQueryExecuteComplete (HelicsQuery query, HelicsError *err)
 
HelicsBool helicsQueryIsCompleted (HelicsQuery query)
 
void helicsQuerySetTarget (HelicsQuery query, const char *target, HelicsError *err)
 
void helicsQuerySetQueryString (HelicsQuery query, const char *queryString, HelicsError *err)
 
void helicsQuerySetOrdering (HelicsQuery query, int32_t mode, HelicsError *err)
 
void helicsQueryFree (HelicsQuery query)
 
void helicsCleanupLibrary (void)
 

Detailed Description

Common functions for the HELICS C api.

Function Documentation

◆ helicsAbort()

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.

◆ helicsBrokerAddAlias()

void helicsBrokerAddAlias ( HelicsBroker  broker,
const char *  interfaceName,
const char *  alias,
HelicsError err 
)

Create an alias for an interface.

Parameters
brokerThe broker to use to set the alias.
interfaceNameThe current name of an interface.
aliasThe additional name to use for the given interface.
[in,out]errA pointer to an error object for catching errors.

References HELICS_ERROR_INVALID_ARGUMENT.

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

◆ helicsBrokerAddDestinationFilterToEndpoint()

void helicsBrokerAddDestinationFilterToEndpoint ( HelicsBroker  broker,
const char *  filter,
const char *  endpoint,
HelicsError 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 HelicsError object, can be NULL if the errors are to be ignored.

References HELICS_ERROR_INVALID_ARGUMENT.

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

◆ helicsBrokerAddSourceFilterToEndpoint()

void helicsBrokerAddSourceFilterToEndpoint ( HelicsBroker  broker,
const char *  filter,
const char *  endpoint,
HelicsError 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 HelicsError object, can be NULL if the errors are to be ignored.

References HELICS_ERROR_INVALID_ARGUMENT.

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

◆ helicsBrokerClearTimeBarrier()

void helicsBrokerClearTimeBarrier ( HelicsBroker  broker)

Clear any time barrier on a broker.

Parameters
brokerThe broker to clear the barriers on.

◆ helicsBrokerClone()

HelicsBroker helicsBrokerClone ( HelicsBroker  broker,
HelicsError err 
)

Create a new reference to an existing broker.

This will create a new broker object that references the existing broker it must be freed as well.

Parameters
brokerAn existing HelicsBroker.
[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()

void helicsBrokerDataLink ( HelicsBroker  broker,
const char *  source,
const char *  target,
HelicsError 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 HelicsError object, can be NULL if the errors are to be ignored.

References HELICS_ERROR_INVALID_ARGUMENT.

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

◆ helicsBrokerDestroy()

void helicsBrokerDestroy ( HelicsBroker  broker)

Disconnect and free a broker.

References helicsBrokerDisconnect(), and helicsBrokerFree().

◆ helicsBrokerDisconnect()

void helicsBrokerDisconnect ( HelicsBroker  broker,
HelicsError 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()

void helicsBrokerFree ( HelicsBroker  broker)

Release the memory associated with a broker.

References helics::BrokerFactory::cleanUpBrokers(), and helics::getBrokerObject().

Referenced by helicsBrokerDestroy(), and helicscpp::Broker::~Broker().

◆ helicsBrokerGetAddress()

const char* helicsBrokerGetAddress ( HelicsBroker  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()

const char* helicsBrokerGetIdentifier ( HelicsBroker  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().

◆ helicsBrokerGlobalError()

void helicsBrokerGlobalError ( HelicsBroker  broker,
int  errorCode,
const char *  errorString,
HelicsError err 
)

Generate a global error through a broker. This will terminate the federation.

Parameters
brokerThe broker to generate the global error on.
errorCodeThe error code to associate with the global error.
errorStringAn error message to associate with the global error.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.

◆ helicsBrokerIsConnected()

HelicsBool helicsBrokerIsConnected ( HelicsBroker  broker)

Check if a broker is connected.

A connected broker implies it is attached to cores or cores could reach out to communicate.

Returns
HELICS_FALSE if not connected.

References HELICS_FALSE, and HELICS_TRUE.

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

◆ helicsBrokerIsValid()

HelicsBool helicsBrokerIsValid ( HelicsBroker  broker)

Check if a broker object is a valid object.

Parameters
brokerThe HelicsBroker object to test.

References helics::getBrokerObject(), HELICS_FALSE, and HELICS_TRUE.

◆ helicsBrokerMakeConnections()

void helicsBrokerMakeConnections ( HelicsBroker  broker,
const char *  file,
HelicsError 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 HelicsError object, can be NULL if the errors are to be ignored.

◆ helicsBrokerSendCommand()

void helicsBrokerSendCommand ( HelicsBroker  broker,
const char *  target,
const char *  command,
HelicsError err 
)

Send a command to another helics object through a broker using asynchronous(fast) messages.

Parameters
brokerThe broker to send the command through.
targetThe name of the object to send the command to.
commandThe command to send.
[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_SEQUENCING_MODE_FAST.

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

◆ helicsBrokerSendOrderedCommand()

void helicsBrokerSendOrderedCommand ( HelicsBroker  broker,
const char *  target,
const char *  command,
HelicsError err 
)

Send a command to another helics object through a broker using ordered sequencing.

Parameters
brokerThe broker to send the command through.
targetThe name of the object to send the command to.
commandThe command to send.
[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_SEQUENCING_MODE_ORDERED.

◆ helicsBrokerSetGlobal()

void helicsBrokerSetGlobal ( HelicsBroker  broker,
const char *  valueName,
const char *  value,
HelicsError err 
)

Set a federation global value.

This overwrites any previous value for this name.

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

void helicsBrokerSetLogFile ( HelicsBroker  broker,
const char *  logFileName,
HelicsError 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.

◆ helicsBrokerSetTimeBarrier()

void helicsBrokerSetTimeBarrier ( HelicsBroker  broker,
HelicsTime  barrierTime,
HelicsError err 
)

Set a broker time barrier.

Parameters
brokerThe broker to set the time barrier for.
barrierTimeThe time to set the barrier at.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.

◆ helicsBrokerWaitForDisconnect()

HelicsBool helicsBrokerWaitForDisconnect ( HelicsBroker  broker,
int  msToWait,
HelicsError 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()

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.

References helics::cleanupHelicsLibrary().

Referenced by helicscpp::cleanupHelicsLibrary().

◆ helicsClearSignalHandler()

void helicsClearSignalHandler ( )

Clear HELICS based signal handlers.

◆ helicsCloseLibrary()

void helicsCloseLibrary ( void  )

Call when done using the helics library. This function will ensure the threads are closed properly. If possible this should be the last call before exiting.

References helics::BrokerFactory::cleanUpBrokers(), helics::CoreFactory::cleanUpCores(), and helics::cleanupHelicsLibrary().

Referenced by helicscpp::closeLibrary().

◆ helicsCoreAddAlias()

void helicsCoreAddAlias ( HelicsCore  core,
const char *  interfaceName,
const char *  alias,
HelicsError err 
)

Create an alias for an interface.

Parameters
coreThe core to use to set the alias.
interfaceNameThe current name of an interface.
aliasThe additional name to use for the given interface.
[in,out]errA pointer to an error object for catching errors.

References HELICS_ERROR_INVALID_ARGUMENT.

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

◆ helicsCoreAddDestinationFilterToEndpoint()

void helicsCoreAddDestinationFilterToEndpoint ( HelicsCore  core,
const char *  filter,
const char *  endpoint,
HelicsError 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 HelicsError object, can be NULL if the errors are to be ignored.

References HELICS_ERROR_INVALID_ARGUMENT.

◆ helicsCoreAddSourceFilterToEndpoint()

void helicsCoreAddSourceFilterToEndpoint ( HelicsCore  core,
const char *  filter,
const char *  endpoint,
HelicsError 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 HelicsError object, can be NULL if the errors are to be ignored.

References HELICS_ERROR_INVALID_ARGUMENT.

◆ helicsCoreClone()

HelicsCore helicsCoreClone ( HelicsCore  core,
HelicsError err 
)

Create a new reference to an existing core.

This will create a new broker object that references the existing broker. The new broker object must be freed as well.

Parameters
coreAn existing HelicsCore.
[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()

HelicsBool helicsCoreConnect ( HelicsCore  core,
HelicsError 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()

void helicsCoreDataLink ( HelicsCore  core,
const char *  source,
const char *  target,
HelicsError 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 HelicsError object, can be NULL if the errors are to be ignored.

References HELICS_ERROR_INVALID_ARGUMENT.

◆ helicsCoreDestroy()

void helicsCoreDestroy ( HelicsCore  core)

Disconnect and free a core.

References helicsCoreDisconnect(), and helicsCoreFree().

◆ helicsCoreDisconnect()

void helicsCoreDisconnect ( HelicsCore  core,
HelicsError 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()

void helicsCoreFree ( HelicsCore  core)

Release the memory associated with a core.

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

Referenced by helicsCoreDestroy(), and helicscpp::Core::~Core().

◆ helicsCoreGetAddress()

const char* helicsCoreGetAddress ( HelicsCore  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()

const char* helicsCoreGetIdentifier ( HelicsCore  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().

◆ helicsCoreGlobalError()

void helicsCoreGlobalError ( HelicsCore  core,
int  errorCode,
const char *  errorString,
HelicsError err 
)

Generate a global error through a broker. This will terminate the federation.

Parameters
coreThe core to generate the global error.
errorCodeThe error code to associate with the global error.
errorStringAn error message to associate with the global error.
[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::gLocalCoreId().

◆ helicsCoreIsConnected()

HelicsBool helicsCoreIsConnected ( HelicsCore  core)

Check if a core is connected.

A connected core implies it is attached to federates or federates could be attached to it

Returns
HELICS_FALSE if not connected, HELICS_TRUE if it is connected.

References HELICS_FALSE, and HELICS_TRUE.

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

◆ helicsCoreIsValid()

HelicsBool helicsCoreIsValid ( HelicsCore  core)

Check if a core object is a valid object.

Parameters
coreThe HelicsCore object to test.

References helics::getCoreObject(), HELICS_FALSE, and HELICS_TRUE.

◆ helicsCoreMakeConnections()

void helicsCoreMakeConnections ( HelicsCore  core,
const char *  file,
HelicsError 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 HelicsError object, can be NULL if the errors are to be ignored.

◆ helicsCoreSendCommand()

void helicsCoreSendCommand ( HelicsCore  core,
const char *  target,
const char *  command,
HelicsError err 
)

Send a command to another helics object though a core using asynchronous(fast) operations.

Parameters
coreThe core to send the command through.
targetThe name of the object to send the command to.
commandThe command to send.
[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_SEQUENCING_MODE_FAST.

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

◆ helicsCoreSendOrderedCommand()

void helicsCoreSendOrderedCommand ( HelicsCore  core,
const char *  target,
const char *  command,
HelicsError err 
)

Send a command to another helics object though a core using ordered operations.

Parameters
coreThe core to send the command through.
targetThe name of the object to send the command to.
commandThe command to send.
[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_SEQUENCING_MODE_ORDERED.

◆ helicsCoreSetGlobal()

void helicsCoreSetGlobal ( HelicsCore  core,
const char *  valueName,
const char *  value,
HelicsError err 
)

Set a global value in a core.

This overwrites any previous value for this name.

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

void helicsCoreSetLogFile ( HelicsCore  core,
const char *  logFileName,
HelicsError 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()

void helicsCoreSetReadyToInit ( HelicsCore  core,
HelicsError err 
)

Set the core to ready for init.

This function is used for cores that have filters but no federates so there needs to be a direct signal to the core to trigger the federation initialization.

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

HelicsBool helicsCoreWaitForDisconnect ( HelicsCore  core,
int  msToWait,
HelicsError 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()

HelicsBroker helicsCreateBroker ( const char *  type,
const char *  name,
const char *  initString,
HelicsError 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 HelicsBroker object.

It will be NULL if there was an error indicated in the err object.

References helics::BrokerFactory::create(), helics::DEFAULT, HelicsError::error_code, HELICS_ERROR_INVALID_ARGUMENT, HelicsError::message, and helics::UNRECOGNIZED.

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

◆ helicsCreateBrokerFromArgs()

HelicsBroker helicsCreateBrokerFromArgs ( const char *  type,
const char *  name,
int  argc,
const char *const *  argv,
HelicsError err 
)

Create a core object by passing command line arguments.

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 HelicsCore object.

References helics::BrokerFactory::create(), helics::DEFAULT, HelicsError::error_code, HELICS_ERROR_INVALID_ARGUMENT, HelicsError::message, and helics::UNRECOGNIZED.

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

◆ helicsCreateCallbackFederate()

HelicsFederate helicsCreateCallbackFederate ( const char *  fedName,
HelicsFederateInfo  fedInfo,
HelicsError err 
)

Create a callback federate from a federate info object.

Callback federates are combination federates that run a series of callback for execution in a completely automated fashion.

Parameters
fedNameA string with the name of the federate, can be NULL or an empty string to pull the default name from fedInfo.
fedInfoThe 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.

◆ helicsCreateCallbackFederateFromConfig()

HelicsFederate helicsCreateCallbackFederateFromConfig ( const char *  configFile,
HelicsError err 
)

Create a callback federate from a JSON file or JSON string or TOML file.

Callback federates are combination federates that run a series of callbacks for execution in a completely automated fashion. The enterInitializingMode call transfers complete control of the federate to the Core and no further user interaction is expected.

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.

◆ helicsCreateCombinationFederate()

HelicsFederate helicsCreateCombinationFederate ( const char *  fedName,
HelicsFederateInfo  fedInfo,
HelicsError err 
)

Create a combination federate from a federate info object.

Combination federates are both value federates and message federates, objects can be used in all functions that take a HelicsFederate, helics_message_federate or HelicsFederate object as an argument

Parameters
fedNameA string with the name of the federate, can be NULL or an empty string to pull the default name from fedInfo.
fedInfoThe 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()

HelicsFederate helicsCreateCombinationFederateFromConfig ( const char *  configFile,
HelicsError err 
)

Create a combination federate from a JSON file or JSON string or TOML file.

Combination federates are both value federates and message federates, objects can be used in all functions that take a HelicsFederate, helics_message_federate or HelicsFederate object as an argument

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

HelicsCore helicsCreateCore ( const char *  type,
const char *  name,
const char *  initString,
HelicsError 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 HelicsCore object.

If the core is invalid, err will contain the corresponding error message and the returned object will be NULL.

References helics::DEFAULT, HelicsError::error_code, helics::CoreFactory::FindOrCreate(), HELICS_ERROR_INVALID_ARGUMENT, HelicsError::message, and helics::UNRECOGNIZED.

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

◆ helicsCreateCoreFromArgs()

HelicsCore helicsCreateCoreFromArgs ( const char *  type,
const char *  name,
int  argc,
const char *const *  argv,
HelicsError err 
)

Create a core object by passing command line arguments.

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 HelicsCore object.

References helics::DEFAULT, HelicsError::error_code, helics::CoreFactory::FindOrCreate(), HELICS_ERROR_INVALID_ARGUMENT, HelicsError::message, and helics::UNRECOGNIZED.

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

◆ helicsCreateFederateInfo()

HelicsFederateInfo helicsCreateFederateInfo ( void  )

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

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

References helics::FederateInfo::uniqueKey.

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

◆ helicsCreateMessageFederate()

HelicsFederate helicsCreateMessageFederate ( const char *  fedName,
HelicsFederateInfo  fedInfo,
HelicsError err 
)

Create a message federate from a federate info object.

helics_message_federate objects can be used in all functions that take a helics_message_federate or HelicsFederate object as an argument.

Parameters
fedNameThe name of the federate to create.
fedInfoThe 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()

HelicsFederate helicsCreateMessageFederateFromConfig ( const char *  configFile,
HelicsError err 
)

Create a message federate from a JSON file or JSON string or TOML file.

helics_message_federate objects can be used in all functions that take a helics_message_federate or HelicsFederate object as an argument.

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

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

References helics::QueryObject::query.

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

◆ helicsCreateValueFederate()

HelicsFederate helicsCreateValueFederate ( const char *  fedName,
HelicsFederateInfo  fedInfo,
HelicsError err 
)

Create a value federate from a federate info object.

HelicsFederate objects can be used in all functions that take a HelicsFederate or HelicsFederate object as an argument.

Parameters
fedNameThe name of the federate to create, can NULL or an empty string to use the default name from fedInfo or an assigned name.
fedInfoThe 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()

HelicsFederate helicsCreateValueFederateFromConfig ( const char *  configFile,
HelicsError err 
)

Create a value federate from a JSON file, JSON string, or TOML file.

HelicsFederate objects can be used in all functions that take a HelicsFederate or HelicsFederate object as an argument.

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

void helicsErrorClear ( HelicsError err)

Clear an error object.

clear an error object

References HelicsError::error_code, and HelicsError::message.

◆ helicsErrorInitialize()

HelicsError helicsErrorInitialize ( void  )

Return an initialized error object.

References HelicsError::error_code, and HelicsError::message.

◆ helicsFederateAddAlias()

void helicsFederateAddAlias ( HelicsFederate  fed,
const char *  interfaceName,
const char *  alias,
HelicsError err 
)

Create an alias for an interface.

Parameters
fedThe federate to use to set the alias.
interfaceNameThe current name of an interface.
aliasThe additional name to use for the given interface.
[in,out]errA pointer to an error object for catching errors.

References HELICS_ERROR_INVALID_ARGUMENT.

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

◆ helicsFederateAddDependency()

void helicsFederateAddDependency ( HelicsFederate  fed,
const char *  fedName,
HelicsError err 
)

Add a time dependency for a federate. The federate will depend on the given named federate for time synchronization.

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.

References HELICS_ERROR_INVALID_ARGUMENT.

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

◆ helicsFederateClone()

HelicsFederate helicsFederateClone ( HelicsFederate  fed,
HelicsError err 
)

Create a new reference to an existing federate.

This will create a new HelicsFederate object that references the existing federate. The new object must be freed as well.

Parameters
fedAn existing HelicsFederate.
[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.

References helics::getFedObject().

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

◆ helicsFederateDestroy()

void helicsFederateDestroy ( HelicsFederate  fed)

Disconnect and free a federate.

References helicsFederateFinalize(), and helicsFederateFree().

◆ helicsFederateDisconnect()

void helicsFederateDisconnect ( HelicsFederate  fed,
HelicsError err 
)

Disconnect/finalize the federate. This function halts all communication in the federate and disconnects it from the core. This call is identical to helicsFederateFinalize.

Referenced by helicsFederateFinalize().

◆ helicsFederateDisconnectAsync()

void helicsFederateDisconnectAsync ( HelicsFederate  fed,
HelicsError err 
)

Disconnect/finalize the federate in an async call. This call is identical to helicsFederateFinalizeAsync.

Referenced by helicsFederateFinalizeAsync().

◆ helicsFederateDisconnectComplete()

void helicsFederateDisconnectComplete ( HelicsFederate  fed,
HelicsError err 
)

Complete the asynchronous disconnect/finalize call. This call is identical to helicsFederateFinalizeComplete

Referenced by helicsFederateFinalizeComplete().

◆ helicsFederateEnterExecutingMode()

void helicsFederateEnterExecutingMode ( HelicsFederate  fed,
HelicsError err 
)

Request that the federate enter the Execution mode.

This call is blocking until granted entry by the core object. On return from this call the federate will be at time 0. For an asynchronous alternative call see /ref helicsFederateEnterExecutingModeAsync.

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

void helicsFederateEnterExecutingModeAsync ( HelicsFederate  fed,
HelicsError err 
)

Request that the federate enter the Execution mode.

This call is non-blocking and will return immediately. Call /ref helicsFederateEnterExecutingModeComplete to finish the call sequence.

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

void helicsFederateEnterExecutingModeComplete ( HelicsFederate  fed,
HelicsError 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()

HelicsIterationResult helicsFederateEnterExecutingModeIterative ( HelicsFederate  fed,
HelicsIterationRequest  iterate,
HelicsError err 
)

Request an iterative time.

This call allows for finer grain control of the iterative process than /ref helicsFederateRequestTime. It takes a time and iteration request, and returns a time and iteration status.

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.

References HELICS_ITERATION_RESULT_ERROR.

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

◆ helicsFederateEnterExecutingModeIterativeAsync()

void helicsFederateEnterExecutingModeIterativeAsync ( HelicsFederate  fed,
HelicsIterationRequest  iterate,
HelicsError err 
)

Request an iterative entry to the execution mode.

This call allows for finer grain control of the iterative process than /ref helicsFederateRequestTime. It takes a time and iteration request, and returns a time and iteration status

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

HelicsIterationResult helicsFederateEnterExecutingModeIterativeComplete ( HelicsFederate  fed,
HelicsError 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.

References HELICS_ITERATION_RESULT_ERROR.

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

◆ helicsFederateEnterInitializingMode()

void helicsFederateEnterInitializingMode ( HelicsFederate  fed,
HelicsError err 
)

Enter the initialization state of a federate.

The initialization state allows initial values to be set and received if the iteration is requested on entry to the execution state. This is a blocking call and will block until the core allows it to proceed.

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

void helicsFederateEnterInitializingModeAsync ( HelicsFederate  fed,
HelicsError err 
)

Non blocking alternative to helicsFederateEnterInitializingMode.

The function helicsFederateEnterInitializationModeComplete 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()

void helicsFederateEnterInitializingModeComplete ( HelicsFederate  fed,
HelicsError err 
)

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

◆ helicsFederateEnterInitializingModeIterative()

void helicsFederateEnterInitializingModeIterative ( HelicsFederate  fed,
HelicsError err 
)

Trigger a blocking call and return to created state after all federates have either triggered an iteration or are waiting to enter initializing mode.

This call will return the federate to the created state to allow additional setup to occur with federates either iterating in the mode or waiting.

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

◆ helicsFederateEnterInitializingModeIterativeAsync()

void helicsFederateEnterInitializingModeIterativeAsync ( HelicsFederate  fed,
HelicsError err 
)

Non blocking alternative to helicsFederateEnterInitializingModeIterative.

The function helicsFederateEnterInitializationModeIterativeComplete 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::enterInitializingModeIterativeAsync().

◆ helicsFederateEnterInitializingModeIterativeComplete()

void helicsFederateEnterInitializingModeIterativeComplete ( HelicsFederate  fed,
HelicsError err 
)

Complete the call to enter initializing mode Iterative that was initiated with /ref heliceEnterInitializingModeIterativeAsync. The federate will be in created or error mode on return

Parameters
fedThe federate used in the corresponding async 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::enterInitializingModeIterativeComplete().

◆ helicsFederateFinalize()

void helicsFederateFinalize ( HelicsFederate  fed,
HelicsError err 
)

Disconnect/finalize the federate. This function halts all communication in the federate and disconnects it from the core.

References helicsFederateDisconnect().

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

◆ helicsFederateFinalizeAsync()

void helicsFederateFinalizeAsync ( HelicsFederate  fed,
HelicsError err 
)

Disconnect/finalize the federate in an async call.

References helicsFederateDisconnectAsync().

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

◆ helicsFederateFinalizeComplete()

void helicsFederateFinalizeComplete ( HelicsFederate  fed,
HelicsError err 
)

Complete the asynchronous disconnect/finalize call.

References helicsFederateDisconnectComplete().

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

◆ helicsFederateFree()

void helicsFederateFree ( HelicsFederate  fed)

Release the memory associated with a federate.

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

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

◆ helicsFederateGetCommand()

const char* helicsFederateGetCommand ( HelicsFederate  fed,
HelicsError err 
)

Get a command sent to the federate.

Parameters
fedThe federate to get the command for.
[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 string with the command for the federate, if the string is empty no command is available.

References helics::getFedObject().

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

◆ helicsFederateGetCommandSource()

const char* helicsFederateGetCommandSource ( HelicsFederate  fed,
HelicsError err 
)

Get the source of the most recently retrieved command sent to the federate.

Parameters
fedThe federate to get the command for.
[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 string with the command for the federate, if the string is empty no command is available.

References helics::getFedObject().

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

◆ helicsFederateGetCore()

HelicsCore helicsFederateGetCore ( HelicsFederate  fed,
HelicsError 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()

HelicsTime helicsFederateGetCurrentTime ( HelicsFederate  fed,
HelicsError 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.

References HELICS_TIME_INVALID, and HELICS_TIME_MAXTIME.

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

◆ helicsFederateGetFlagOption()

HelicsBool helicsFederateGetFlagOption ( HelicsFederate  fed,
int  flag,
HelicsError 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.

References HELICS_FALSE, and HELICS_TRUE.

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

◆ helicsFederateGetIntegerProperty()

int helicsFederateGetIntegerProperty ( HelicsFederate  fed,
int  intProperty,
HelicsError 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()

const char* helicsFederateGetName ( HelicsFederate  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(), helicscpp::Federate::protect(), and helicscpp::Federate::unProtect().

◆ helicsFederateGetState()

HelicsFederateState helicsFederateGetState ( HelicsFederate  fed,
HelicsError 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. The err object will be removed in a future release as it is not necessary for use the function will not error, invalid federate return HELICS_STATE_UNKOWN
Returns
State the resulting state if the federate is invalid will return HELICS_STATE_UNKNOWN

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

◆ helicsFederateGetTag()

const char* helicsFederateGetTag ( HelicsFederate  fed,
const char *  tagName,
HelicsError err 
)

Get a federate tag value.

Parameters
fedThe federate to get the tag for.
tagNameThe name of the tag to query.
[in,out]errA pointer to an error object for catching errors.

References HELICS_ERROR_INVALID_ARGUMENT.

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

◆ helicsFederateGetTimeProperty()

HelicsTime helicsFederateGetTimeProperty ( HelicsFederate  fed,
int  timeProperty,
HelicsError 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.

References HELICS_TIME_INVALID, and HELICS_TIME_MAXTIME.

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

◆ helicsFederateGlobalError()

void helicsFederateGlobalError ( HelicsFederate  fed,
int  errorCode,
const char *  errorString,
HelicsError err 
)

Generate a global error from a federate.

A global error halts the co-simulation completely.

Parameters
fedThe federate to create an error in.
errorCodeThe integer code for the error.
errorStringA string describing the error.
[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::globalError().

◆ helicsFederateInfoClone()

HelicsFederateInfo helicsFederateInfoClone ( HelicsFederateInfo  fedInfo,
HelicsError err 
)

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

Parameters
fedInfoA 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 HelicsFederateInfo object which is a reference to the created object.

◆ helicsFederateInfoFree()

void helicsFederateInfoFree ( HelicsFederateInfo  fedInfo)

Delete the memory associated with a federate info object.

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

◆ helicsFederateInfoLoadFromArgs()

void helicsFederateInfoLoadFromArgs ( HelicsFederateInfo  fedInfo,
int  argc,
const char *const *  argv,
HelicsError err 
)

Load federate info from command line arguments.

Parameters
fedInfoA 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.

◆ helicsFederateInfoLoadFromString()

void helicsFederateInfoLoadFromString ( HelicsFederateInfo  fedInfo,
const char *  args,
HelicsError err 
)

Load federate info from command line arguments contained in a string.

Parameters
fedInfoA federateInfo object.
argsCommand line arguments specified in a string.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.

◆ helicsFederateInfoSetBroker()

void helicsFederateInfoSetBroker ( HelicsFederateInfo  fedInfo,
const char *  broker,
HelicsError err 
)

Set the name or connection information for a broker.

This is only used if the core is automatically created, the broker information will be transferred to the core for connection.

Parameters
fedInfoThe 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()

void helicsFederateInfoSetBrokerInitString ( HelicsFederateInfo  fedInfo,
const char *  brokerInit,
HelicsError err 
)

Set the initialization string that a core will pass to a generated broker usually in the form of command line arguments.

Parameters
fedInfoThe 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()

void helicsFederateInfoSetBrokerKey ( HelicsFederateInfo  fedInfo,
const char *  brokerkey,
HelicsError err 
)

Set the key for a broker connection.

This is only used if the core is automatically created, the broker information will be transferred to the core for connection.

Parameters
fedInfoThe 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()

void helicsFederateInfoSetBrokerPort ( HelicsFederateInfo  fedInfo,
int  brokerPort,
HelicsError err 
)

Set the port to use for the broker.

This is only used if the core is automatically created, the broker information will be transferred to the core for connection. This will only be useful for network broker connections.

Parameters
fedInfoThe 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()

void helicsFederateInfoSetCoreInitString ( HelicsFederateInfo  fedInfo,
const char *  coreInit,
HelicsError err 
)

Set the initialization string for the core usually in the form of command line arguments.

Parameters
fedInfoThe 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()

void helicsFederateInfoSetCoreName ( HelicsFederateInfo  fedInfo,
const char *  corename,
HelicsError err 
)

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

Parameters
fedInfoThe 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()

void helicsFederateInfoSetCoreType ( HelicsFederateInfo  fedInfo,
int  coretype,
HelicsError err 
)

Set the core type by integer code.

Valid values available by definitions in api-data.h.

Parameters
fedInfoThe federate info object to alter.
coretypeAn numerical code for a core type see /ref helics_CoreType.
[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()

void helicsFederateInfoSetCoreTypeFromString ( HelicsFederateInfo  fedInfo,
const char *  coretype,
HelicsError err 
)

Set the core type from a string.

Parameters
fedInfoThe 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.

References helics::DEFAULT, HelicsError::error_code, HELICS_ERROR_INVALID_ARGUMENT, HelicsError::message, and helics::UNRECOGNIZED.

Referenced by helicscpp::FederateInfo::FederateInfo(), and helicscpp::FederateInfo::setCoreType().

◆ helicsFederateInfoSetFlagOption()

void helicsFederateInfoSetFlagOption ( HelicsFederateInfo  fedInfo,
int  flag,
HelicsBool  value,
HelicsError err 
)

Set a flag in the info structure.

Valid flags are available /ref helics_federate_flags.

Parameters
fedInfoThe 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.

References HELICS_FALSE, HELICS_FLAG_DEBUGGING, HELICS_FLAG_OBSERVER, and HELICS_FLAG_USE_JSON_SERIALIZATION.

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

◆ helicsFederateInfoSetIntegerProperty()

void helicsFederateInfoSetIntegerProperty ( HelicsFederateInfo  fedInfo,
int  intProperty,
int  propertyValue,
HelicsError err 
)

Set an integer property for a federate.

Set known properties.

Parameters
fedInfoThe 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()

void helicsFederateInfoSetLocalPort ( HelicsFederateInfo  fedInfo,
const char *  localPort,
HelicsError err 
)

Set the local port to use.

This is only used if the core is automatically created, the port information will be transferred to the core for connection.

Parameters
fedInfoThe 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()

void helicsFederateInfoSetSeparator ( HelicsFederateInfo  fedInfo,
char  separator,
HelicsError err 
)

Set the separator character in the info structure.

The separator character is the separation character for local publications/endpoints in creating their global name. For example if the separator character is '/' then a local endpoint would have a globally reachable name of fedName/localName.

Parameters
fedInfoThe 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()

void helicsFederateInfoSetTimeProperty ( HelicsFederateInfo  fedInfo,
int  timeProperty,
HelicsTime  propertyValue,
HelicsError err 
)

Set the output delay for a federate.

Parameters
fedInfoThe 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()

HelicsBool helicsFederateIsAsyncOperationCompleted ( HelicsFederate  fed,
HelicsError 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.

References HELICS_FALSE, and HELICS_TRUE.

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

◆ helicsFederateIsProtected()

HelicsBool helicsFederateIsProtected ( const char *  fedName,
HelicsError err 
)

checks if an existing federate is protected

Parameters
fedNamethe name of an existing federate to check the protection status
[in,out]errAn error object that will contain an error code and string if the federate was not found.

References HelicsError::error_code, HELICS_ERROR_INVALID_OBJECT, HELICS_FALSE, HELICS_TRUE, and HelicsError::message.

◆ helicsFederateIsValid()

HelicsBool helicsFederateIsValid ( HelicsFederate  fed)

Check if a federate_object is valid.

Returns
HELICS_TRUE if the federate is a valid active federate, HELICS_FALSE otherwise

References HELICS_FALSE, and HELICS_TRUE.

◆ helicsFederateLocalError()

void helicsFederateLocalError ( HelicsFederate  fed,
int  errorCode,
const char *  errorString,
HelicsError err 
)

Generate a local error in a federate.

This will propagate through the co-simulation but not necessarily halt the co-simulation, it has a similar effect to finalize but does allow some interaction with a core for a brief time.

Parameters
fedThe federate to create an error in.
errorCodeThe integer code for the error.
errorStringA string describing the error.
[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::localError().

◆ helicsFederateLogDebugMessage()

void helicsFederateLogDebugMessage ( HelicsFederate  fed,
const char *  logmessage,
HelicsError 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.

References HELICS_LOG_LEVEL_DEBUG, and helicsFederateLogLevelMessage().

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

◆ helicsFederateLogErrorMessage()

void helicsFederateLogErrorMessage ( HelicsFederate  fed,
const char *  logmessage,
HelicsError 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.

References HELICS_LOG_LEVEL_ERROR, and helicsFederateLogLevelMessage().

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

◆ helicsFederateLogInfoMessage()

void helicsFederateLogInfoMessage ( HelicsFederate  fed,
const char *  logmessage,
HelicsError 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.

References HELICS_LOG_LEVEL_SUMMARY, and helicsFederateLogLevelMessage().

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

◆ helicsFederateLogLevelMessage()

void helicsFederateLogLevelMessage ( HelicsFederate  fed,
int  loglevel,
const char *  logmessage,
HelicsError 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 helicsFederateLogDebugMessage(), helicsFederateLogErrorMessage(), helicsFederateLogInfoMessage(), helicsFederateLogWarningMessage(), and helicscpp::Federate::logMessage().

◆ helicsFederateLogWarningMessage()

void helicsFederateLogWarningMessage ( HelicsFederate  fed,
const char *  logmessage,
HelicsError 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.

References HELICS_LOG_LEVEL_WARNING, and helicsFederateLogLevelMessage().

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

◆ helicsFederateProcessCommunications()

void helicsFederateProcessCommunications ( HelicsFederate  fed,
HelicsTime  period,
HelicsError err 
)

Tell helics to process internal communications for a period of time.

Parameters
fedThe federate to tell to process.
periodThe length of time to process communications and then return control.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.

◆ helicsFederateProtect()

void helicsFederateProtect ( const char *  fedName,
HelicsError err 
)

Protect a federate from finalizing and closing if all references go out of scope

this function allows a federate to be retrieved on demand, it must be explicitly close later otherwise it will be destroyed when the library is closed

Parameters
fedNameThe name of an existing HelicsFederate.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function, in particular if no federate with the given name exists

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

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

◆ helicsFederateRegisterInterfaces()

void helicsFederateRegisterInterfaces ( HelicsFederate  fed,
const char *  file,
HelicsError 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.

References HELICS_ERROR_INVALID_ARGUMENT.

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

◆ helicsFederateRequestNextStep()

HelicsTime helicsFederateRequestNextStep ( HelicsFederate  fed,
HelicsError err 
)

Request the next time step for federate execution.

Feds should have setup the period or minDelta for this to work well but it will request the next time step which is the current time plus the minimum time step.

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

References HELICS_TIME_INVALID, and HELICS_TIME_MAXTIME.

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

◆ helicsFederateRequestTime()

HelicsTime helicsFederateRequestTime ( HelicsFederate  fed,
HelicsTime  requestTime,
HelicsError 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.

References HELICS_TIME_INVALID, and HELICS_TIME_MAXTIME.

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

◆ helicsFederateRequestTimeAdvance()

HelicsTime helicsFederateRequestTimeAdvance ( HelicsFederate  fed,
HelicsTime  timeDelta,
HelicsError 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

References HELICS_TIME_INVALID, and HELICS_TIME_MAXTIME.

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

◆ helicsFederateRequestTimeAsync()

void helicsFederateRequestTimeAsync ( HelicsFederate  fed,
HelicsTime  requestTime,
HelicsError err 
)

Request the next time for federate execution in an asynchronous call.

Call /ref helicsFederateRequestTimeComplete to finish the call.

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

HelicsTime helicsFederateRequestTimeComplete ( HelicsFederate  fed,
HelicsError 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.

References HELICS_TIME_INVALID, and HELICS_TIME_MAXTIME.

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

◆ helicsFederateRequestTimeIterative()

HelicsTime helicsFederateRequestTimeIterative ( HelicsFederate  fed,
HelicsTime  requestTime,
HelicsIterationRequest  iterate,
HelicsIterationResult outIteration,
HelicsError err 
)

Request an iterative time.

This call allows for finer grain control of the iterative process than /ref helicsFederateRequestTime. It takes a time and and iteration request, and returns a time and iteration status.

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.

References HELICS_ITERATION_RESULT_ERROR, HELICS_TIME_INVALID, and HELICS_TIME_MAXTIME.

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

◆ helicsFederateRequestTimeIterativeAsync()

void helicsFederateRequestTimeIterativeAsync ( HelicsFederate  fed,
HelicsTime  requestTime,
HelicsIterationRequest  iterate,
HelicsError err 
)

Request an iterative time through an asynchronous call.

This call allows for finer grain control of the iterative process than /ref helicsFederateRequestTime. It takes a time and iteration request, and returns a time and iteration status. Call /ref helicsFederateRequestTimeIterativeComplete to finish the process.

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

HelicsTime helicsFederateRequestTimeIterativeComplete ( HelicsFederate  fed,
HelicsIterationResult outIterate,
HelicsError 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.

References HELICS_ITERATION_RESULT_ERROR, HELICS_TIME_INVALID, and HELICS_TIME_MAXTIME.

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

◆ helicsFederateSendCommand()

void helicsFederateSendCommand ( HelicsFederate  fed,
const char *  target,
const char *  command,
HelicsError err 
)

Send a command to another helics object through a federate.

Parameters
fedThe federate to send the command through.
targetThe name of the object to send the command to.
commandThe command to send.
[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::sendCommand().

◆ helicsFederateSetFlagOption()

void helicsFederateSetFlagOption ( HelicsFederate  fed,
int  flag,
HelicsBool  flagValue,
HelicsError 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.

References HELICS_FALSE.

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

◆ helicsFederateSetGlobal()

void helicsFederateSetGlobal ( HelicsFederate  fed,
const char *  valueName,
const char *  value,
HelicsError err 
)

Set a federation global value through a federate.

This overwrites any previous value for this name.

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.

References HELICS_ERROR_INVALID_ARGUMENT.

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

◆ helicsFederateSetIntegerProperty()

void helicsFederateSetIntegerProperty ( HelicsFederate  fed,
int  intProperty,
int  propertyVal,
HelicsError 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()

void helicsFederateSetLogFile ( HelicsFederate  fed,
const char *  logFile,
HelicsError 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.

References HELICS_ERROR_INVALID_FUNCTION_CALL.

◆ helicsFederateSetSeparator()

void helicsFederateSetSeparator ( HelicsFederate  fed,
char  separator,
HelicsError err 
)

Set the separator character in a federate.

The separator character is the separation character for local publications/endpoints in creating their global name. For example if the separator character is '/' then a local endpoint would have a globally reachable name of fedName/localName.

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

◆ helicsFederateSetTag()

void helicsFederateSetTag ( HelicsFederate  fed,
const char *  tagName,
const char *  value,
HelicsError err 
)

Set a federate tag value.

This overwrites any previous value for this tag.

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

References HELICS_ERROR_INVALID_ARGUMENT.

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

◆ helicsFederateSetTimeProperty()

void helicsFederateSetTimeProperty ( HelicsFederate  fed,
int  timeProperty,
HelicsTime  time,
HelicsError 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().

◆ helicsFederateUnProtect()

void helicsFederateUnProtect ( const char *  fedName,
HelicsError err 
)

remove the protection of an existing federate

this function allows a federate to be retrieved on demand, it must be explicitly close later otherwise it will be destroyed when the library is closed

Parameters
fedNamethe name of an existing federate that should not be protected
[in,out]errAn error object that will contain an error code and string if the federate was not found.

References HelicsError::error_code, HELICS_ERROR_INVALID_OBJECT, and HelicsError::message.

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

◆ helicsFederateWaitCommand()

const char* helicsFederateWaitCommand ( HelicsFederate  fed,
HelicsError err 
)

Get a command sent to the federate. Blocks until a command is received.

Parameters
fedThe federate to get the command for.
[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 string with the command for the federate, if the string is empty no command is available.

References helics::getFedObject().

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

◆ helicsGetBuildFlags()

const char* helicsGetBuildFlags ( void  )

Get the build flags used to compile HELICS.

References helics::buildFlags.

Referenced by helicscpp::buildFlags().

◆ helicsGetCompilerVersion()

const char* helicsGetCompilerVersion ( void  )

Get the compiler version used to compile HELICS.

References helics::compiler.

Referenced by helicscpp::compilerVersion().

◆ helicsGetDataType()

int helicsGetDataType ( const char *  val)

Get the data type for use in /ref helicsFederateRegisterPublication, /ref helicsFederateRegisterInput, /ref helicsFilterSetOption.

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

References helics::getTypeFromString().

Referenced by helicsInputGetPublicationDataType().

◆ helicsGetFederateByName()

HelicsFederate helicsGetFederateByName ( const char *  fedName,
HelicsError err 
)

Get an existing federate object from a core by name.

The federate must have been created by one of the other functions and at least one of the objects referencing the created federate must still be active in the process.

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 HelicsFederate with that name.

References HelicsError::error_code, HELICS_ERROR_INVALID_ARGUMENT, and HelicsError::message.

Referenced by helicsFederateProtect().

◆ helicsGetFlagIndex()

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.

References helics::getFlagIndex().

◆ helicsGetOptionIndex()

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.

References helics::getOptionIndex().

◆ helicsGetOptionValue()

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.

References helics::getOptionValue().

◆ helicsGetPropertyIndex()

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.

References helics::getPropertyIndex().

◆ helicsGetSystemInfo()

const char* helicsGetSystemInfo ( void  )

Get a json formatted system information string, containing version info. The string contains fields with system information like cpu, core count, operating system, and memory, as well as information about the HELICS build. Used for debugging reports and gathering other information.

Referenced by helicscpp::systemInfo().

◆ helicsGetVersion()

const char* helicsGetVersion ( void  )

Get a version string for HELICS.

References helics::versionString.

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

◆ helicsIsCoreTypeAvailable()

HelicsBool 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_FALSE, and HELICS_TRUE.

◆ helicsLoadSignalHandler()

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

◆ helicsLoadSignalHandlerCallback()

void helicsLoadSignalHandlerCallback ( HelicsBool(*)(int)  handler,
HelicsBool  useSeparateThread 
)

Load a custom signal handler to execute prior to the abort signal handler.

This function is not 100% reliable it will most likely work but uses some functions and techniques that are not 100% guaranteed to work in a signal handler and in worst case it could deadlock. That is somewhat unlikely given usage patterns but it is possible. The callback has signature HelicsBool(*handler)(int) and it will take the SIG_INT as an argument and return a boolean. If the boolean return value is HELICS_TRUE (or the callback is null) the default signal handler is run after the callback finishes; if it is HELICS_FALSE the default callback is not run and the default signal handler is executed. If the second argument is set to HELICS_TRUE the default signal handler will execute in a separate thread(this may be a bad idea).

References HELICS_FALSE, helicsLoadSignalHandler(), and helicsLoadThreadedSignalHandler().

◆ helicsLoadSignalHandlerCallbackNoExit()

void helicsLoadSignalHandlerCallbackNoExit ( HelicsBool(*)(int)  handler,
HelicsBool  useSeparateThread 
)

Load a custom signal handler to execute prior to the abort signal handler. The signal handler does not call exit.

This function is not 100% reliable. It will most likely work but uses some functions and techniques that are not 100% guaranteed to work in a signal handler and in worst case it could deadlock. That is somewhat unlikely given usage patterns but it is possible. The callback has signature HelicsBool(*handler)(int) and it will take the SIG_INT as an argument and return a boolean. If the boolean return value is HELICS_TRUE (or the callback is null) the no exit signal handler is run after the callback finishes; if it is HELICS_FALSE the default callback is not run and the default signal handler is executed. If the second argument is set to HELICS_TRUE the default signal handler will execute in a separate thread (this may be a bad idea).

References HELICS_FALSE.

◆ helicsLoadThreadedSignalHandler()

void helicsLoadThreadedSignalHandler ( )

Load a signal handler that handles Ctrl-C and shuts down all HELICS brokers, cores, and federates then exits the process. This operation will execute in a newly created and detached thread returning control back to the calling program before completing operations.

Referenced by helicsLoadSignalHandlerCallback().

◆ helicsQueryBrokerExecute()

const char* helicsQueryBrokerExecute ( HelicsQuery  query,
HelicsBroker  broker,
HelicsError err 
)

Execute a query directly on a broker.

The call will block until the query finishes which may require communication or other delays.

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

const char* helicsQueryCoreExecute ( HelicsQuery  query,
HelicsCore  core,
HelicsError err 
)

Execute a query directly on a core.

The call will block until the query finishes which may require communication or other delays.

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

const char* helicsQueryExecute ( HelicsQuery  query,
HelicsFederate  fed,
HelicsError err 
)

Execute a query.

The call will block until the query finishes which may require communication or other delays.

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

void helicsQueryExecuteAsync ( HelicsQuery  query,
HelicsFederate  fed,
HelicsError 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()

const char* helicsQueryExecuteComplete ( HelicsQuery  query,
HelicsError err 
)

Complete the return from a query called with /ref helicsExecuteQueryAsync.

The function will block until the query completes /ref isQueryComplete can be called to determine if a query has completed or not.

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

void helicsQueryFree ( HelicsQuery  query)

Free the memory associated with a query object.

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

◆ helicsQueryIsCompleted()

HelicsBool helicsQueryIsCompleted ( HelicsQuery  query)

Check if an asynchronously executed query has completed.

This function should usually be called after a QueryExecuteAsync function has been called.

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

References HELICS_FALSE, and HELICS_TRUE.

◆ helicsQuerySetOrdering()

void helicsQuerySetOrdering ( HelicsQuery  query,
int32_t  mode,
HelicsError err 
)

Update the ordering mode of the query, fast runs on priority channels, ordered goes on normal channels but goes in sequence

Parameters
queryThe query object to change the order for.
mode0 for fast, 1 for ordered
[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_SEQUENCING_MODE_FAST, and HELICS_SEQUENCING_MODE_ORDERED.

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

◆ helicsQuerySetQueryString()

void helicsQuerySetQueryString ( HelicsQuery  query,
const char *  queryString,
HelicsError 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()

void helicsQuerySetTarget ( HelicsQuery  query,
const char *  target,
HelicsError 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.