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

Functions related to using helics apps. More...

#include "helicsCore.h"

Go to the source code of this file.

Functions

HelicsBool helicsAppEnabled ()
 
HelicsApp helicsCreateApp (const char *appName, const char *appType, const char *configFile, HelicsFederateInfo fedInfo, HelicsError *err)
 
HelicsFederate helicsAppGetFederate (HelicsApp app, HelicsError *err)
 
void helicsAppLoadFile (HelicsApp app, const char *configFile, HelicsError *err)
 
void helicsAppInitialize (HelicsApp app, HelicsError *err)
 
void helicsAppRun (HelicsApp app, HelicsError *err)
 
void helicsAppRunTo (HelicsApp app, HelicsTime stopTime, HelicsError *err)
 
void helicsAppFinalize (HelicsApp app, HelicsError *err)
 
void helicsAppFree (HelicsApp app)
 
void helicsAppDestroy (HelicsApp app)
 
HelicsBool helicsAppIsActive (HelicsApp app)
 

Detailed Description

Functions related to using helics apps.

Function Documentation

◆ helicsAppDestroy()

void helicsAppDestroy ( HelicsApp  app)

Disconnect and free a HelicsApp.

Parameters
appThe app to destroy.

References helicsAppDestroy(), helicsAppFinalize(), and helicsAppFree().

Referenced by helicsAppDestroy().

◆ helicsAppEnabled()

HelicsBool helicsAppEnabled ( )

HELICS_TRUE if the app library is enabled

References HELICS_TRUE, and helicsAppEnabled().

Referenced by helicsAppEnabled().

◆ helicsAppFinalize()

void helicsAppFinalize ( HelicsApp  app,
HelicsError err 
)

Finalize the HelicsApp.

Parameters
appThe app to finalize.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.

References helicsAppFinalize().

Referenced by helicsAppDestroy(), and helicsAppFinalize().

◆ helicsAppFree()

void helicsAppFree ( HelicsApp  app)

Free the HelicsApp object.

Parameters
appThe app to free.

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

Referenced by helicsAppDestroy(), and helicsAppFree().

◆ helicsAppGetFederate()

HelicsFederate helicsAppGetFederate ( HelicsApp  app,
HelicsError err 
)

Run the HelicsApp.

Execute the HelicsApp to completion

Parameters
appThe app to execute.
[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 that can be used in any of the federate methods, not recommended to use this object to advance time, the app will not likely function normally; other query, information calls, or modification calls on the federate are fine.

References helicsAppGetFederate().

Referenced by helicsAppGetFederate().

◆ helicsAppInitialize()

void helicsAppInitialize ( HelicsApp  app,
HelicsError err 
)

Initialize the HelicsApp federate.

Generate all the interfaces and load data for the application.

Parameters
appThe app to initialize.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.

References helicsAppInitialize().

Referenced by helicsAppInitialize().

◆ helicsAppIsActive()

HelicsBool helicsAppIsActive ( HelicsApp  app)

Check if the HelicsApp is active and ready to run.

Parameters
appThe app to check.
Returns
True if the app is active, otherwise false.

References HELICS_FALSE, HELICS_TRUE, and helicsAppIsActive().

Referenced by helicsAppIsActive().

◆ helicsAppLoadFile()

void helicsAppLoadFile ( HelicsApp  app,
const char *  configFile,
HelicsError err 
)

Load a file to an App.

Loads a configuration file for an app.

Parameters
appThe app to load a file.
configFileConfiguration file or string to pass into the app, can be NULL or empty.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.

References helicsAppLoadFile().

Referenced by helicsAppLoadFile().

◆ helicsAppRun()

void helicsAppRun ( HelicsApp  app,
HelicsError err 
)

Run the HelicsApp.

Execute the app to completion.

Parameters
appThe app to execute.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.

References helicsAppRun().

Referenced by helicsAppRun().

◆ helicsAppRunTo()

void helicsAppRunTo ( HelicsApp  app,
HelicsTime  stopTime,
HelicsError err 
)

Run a HelicsApp to a specified stop time.

It is possible to call this method repeatedly with different times.

Parameters
appThe app to run.
stopTimeThe desired stop time.
[in,out]errAn error object that will contain an error code and string if any error occurred during the execution of the function.

References helicsAppRunTo().

Referenced by helicsAppRunTo().

◆ helicsCreateApp()

HelicsApp helicsCreateApp ( const char *  appName,
const char *  appType,
const char *  configFile,
HelicsFederateInfo  fedInfo,
HelicsError err 
)

Create a HelicsApp object.

Create a HelicsApp object.

Parameters
appNameA string with the name of the app, can be NULL or an empty string to pull the default name from fedInfo or the config file.
appTypeThe type of app to create.
configFileConfiguration file or string to pass into the app, can be NULL or empty.
fedInfoThe federate information to pass into the app, can be NULL.
[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 app object, or nullptr if the object creation failed.

References HelicsError::error_code, HELICS_ERROR_INVALID_ARGUMENT, helicsCreateApp(), and helics::loadFederateInfo().

Referenced by helicsCreateApp().