| helics 3.6.1

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

  app | The app to destroy.

References helicsAppFinalize(), and helicsAppFree().

## ◆ helicsAppEnabled()

HelicsBool helicsAppEnabled | ( |  | ) |

HELICS_TRUE if the app library is enabled

References HELICS_TRUE.

## ◆ helicsAppFinalize()

void helicsAppFinalize | ( | HelicsApp | app,
|  | HelicsError * | err
| ) |  |

Finalize the HelicsApp.

Parameters

  | app | The app to finalize.
  [in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function.

Referenced by helicsAppDestroy().

## ◆ helicsAppFree()

void helicsAppFree | ( | HelicsApp | app | ) |

Free the HelicsApp object.

Parameters

  app | The app to free.

References helics::CoreFactory::cleanUpCores().

Referenced by helicsAppDestroy().

## ◆ helicsAppGetFederate()

HelicsFederate helicsAppGetFederate | ( | HelicsApp | app,
|  | HelicsError * | err
| ) |  |

Run the HelicsApp.

Execute the HelicsApp to completion

Parameters

  | app | The app to execute.
  [in,out] | err | An 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.

## ◆ helicsAppInitialize()

void helicsAppInitialize | ( | HelicsApp | app,
|  | HelicsError * | err
| ) |  |

Initialize the HelicsApp federate.

Generate all the interfaces and load data for the application.

Parameters

  | app | The app to initialize.
  [in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function.

## ◆ helicsAppIsActive()

HelicsBool helicsAppIsActive | ( | HelicsApp | app | ) |

Check if the HelicsApp is active and ready to run.

Parameters

  app | The app to check.

Returns
  True if the app is active, otherwise false.

References HELICS_FALSE, and HELICS_TRUE.

## ◆ helicsAppLoadFile()

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

Load a file to an App.

Loads a configuration file for an app.

Parameters

  | app | The app to load a file.
  | configFile | Configuration file or string to pass into the app, can be NULL or empty.
  [in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function.

## ◆ helicsAppRun()

void helicsAppRun | ( | HelicsApp | app,
|  | HelicsError * | err
| ) |  |

Run the HelicsApp.

Execute the app to completion.

Parameters

  | app | The app to execute.
  [in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function.

## ◆ 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

  | app | The app to run.
  | stopTime | The desired stop time.
  [in,out] | err | An error object that will contain an error code and string if any error occurred during the execution of the function.

## ◆ 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

  | appName | A 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.
  | appType | The type of app to create.
  | configFile | Configuration file or string to pass into the app, can be NULL or empty.
  | fedInfo | The federate information to pass into the app, can be NULL.
  [in,out] | err | An 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, and helics::loadFederateInfo().