helics
3.5.3
|
Functions related to value federates for the C api. More...
#include "helicsCore.h"
Go to the source code of this file.
Functions related to value federates for the C api.
void helicsFederateClearUpdates | ( | HelicsFederate | fed | ) |
Clear all the update flags from a federates inputs.
fed | The value federate object for which to clear update flags. |
Referenced by helicscpp::ValueFederate::clearUpdates().
HelicsInput helicsFederateGetInput | ( | HelicsFederate | fed, |
const char * | key, | ||
HelicsError * | err | ||
) |
Get an input object from a key.
fed | The value federate object to use to get the publication. | |
key | The name of the input. | |
[in,out] | err | The error object to complete if there is an error. |
References HELICS_ERROR_INVALID_ARGUMENT.
Referenced by helicscpp::ValueFederate::getInput().
HelicsInput helicsFederateGetInputByIndex | ( | HelicsFederate | fed, |
int | index, | ||
HelicsError * | err | ||
) |
Get an input by its index, typically already created via registerInterfaces file or something of that nature.
fed | The federate object in which to create a publication. | |
index | The index of the publication to get. | |
[in,out] | err | A pointer to an error object for catching errors. |
References HELICS_ERROR_INVALID_ARGUMENT.
Referenced by helicscpp::ValueFederate::getInput().
HelicsInput helicsFederateGetInputByTarget | ( | HelicsFederate | fed, |
const char * | target, | ||
HelicsError * | err | ||
) |
Get an input object from a target.
fed | The value federate object to use to get the input. | |
target | The name of the publication that an input is targeting. | |
[in,out] | err | The error object to complete if there is an error. |
References HELICS_ERROR_INVALID_ARGUMENT.
Referenced by helicscpp::ValueFederate::getInputByTarget(), and helicsFederateGetSubscription().
int helicsFederateGetInputCount | ( | HelicsFederate | fed | ) |
Get the number of inputs in a federate.
Referenced by helicscpp::ValueFederate::getInputCount().
HelicsPublication helicsFederateGetPublication | ( | HelicsFederate | fed, |
const char * | key, | ||
HelicsError * | err | ||
) |
Get a publication object from a key.
fed | The value federate object to use to get the publication. | |
key | The name of the publication. | |
[in,out] | err | The error object to complete if there is an error. |
References HELICS_ERROR_INVALID_ARGUMENT, and helics::Interface::isValid().
Referenced by helicscpp::ValueFederate::getPublication().
HelicsPublication helicsFederateGetPublicationByIndex | ( | HelicsFederate | fed, |
int | index, | ||
HelicsError * | err | ||
) |
Get a publication by its index, typically already created via registerInterfaces file or something of that nature.
fed | The federate object in which to create a publication. | |
index | The index of the publication to get. | |
[in,out] | err | A pointer to an error object for catching errors. |
References HELICS_ERROR_INVALID_ARGUMENT, and helics::Interface::isValid().
Referenced by helicscpp::ValueFederate::getPublication().
int helicsFederateGetPublicationCount | ( | HelicsFederate | fed | ) |
Get the number of publications in a federate.
Referenced by helicscpp::ValueFederate::getPublicationCount().
HELICS_DEPRECATED HelicsInput helicsFederateGetSubscription | ( | HelicsFederate | fed, |
const char * | key, | ||
HelicsError * | err | ||
) |
Get an input object from a subscription target. DEPRECATED: use helicsFederateGetInputByTarget instead
fed | The value federate object to use to get the publication. | |
key | The name of the publication that a subscription is targeting. | |
[in,out] | err | The error object to complete if there is an error. |
References helicsFederateGetInputByTarget().
void helicsFederatePublishJSON | ( | HelicsFederate | fed, |
const char * | json, | ||
HelicsError * | err | ||
) |
Publish data contained in a JSON file or string.
fed | The value federate object through which to publish the data. | |
json | The publication file name or literal JSON data string. | |
[in,out] | err | The error object to complete if there is an error. |
Referenced by helicscpp::ValueFederate::publishJSON().
void helicsFederateRegisterFromPublicationJSON | ( | HelicsFederate | fed, |
const char * | json, | ||
HelicsError * | err | ||
) |
Register the publications via JSON publication string.
fed | The value federate object to use to register the publications. | |
json | The JSON publication string. | |
[in,out] | err | The error object to complete if there is an error. |
This would be the same JSON that would be used to publish data.
Referenced by helicscpp::ValueFederate::registerFromPublicationJSON().
HelicsPublication helicsFederateRegisterGlobalInput | ( | HelicsFederate | fed, |
const char * | key, | ||
HelicsDataTypes | type, | ||
const char * | units, | ||
HelicsError * | err | ||
) |
Register a global named input.
The publication becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for inputs and publications.
fed | The federate object in which to create a publication. | |
key | The identifier for the input (may be NULL). | |
type | A code identifying the type of the input see /ref HelicsDataTypes for available options. | |
units | A string listing the units of the input (may be NULL). | |
[in,out] | err | A pointer to an error object for catching errors. |
References HELICS_DATA_TYPE_ANY, HELICS_DATA_TYPE_CHAR, HELICS_DATA_TYPE_JSON, HELICS_DATA_TYPE_RAW, HELICS_DATA_TYPE_STRING, HELICS_ERROR_INVALID_ARGUMENT, helicsFederateRegisterGlobalTypeInput(), and helics::typeNameStringRef().
Referenced by helicscpp::ValueFederate::registerGlobalInput().
HelicsPublication helicsFederateRegisterGlobalPublication | ( | HelicsFederate | fed, |
const char * | key, | ||
HelicsDataTypes | type, | ||
const char * | units, | ||
HelicsError * | err | ||
) |
Register a global named publication with an arbitrary type.
The publication becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for inputs and publications.
fed | The federate object in which to create a publication. | |
key | The identifier for the publication (may be NULL). | |
type | A code identifying the type of the input see /ref HelicsDataTypes for available options. | |
units | A string listing the units of the publication (may be NULL). | |
[in,out] | err | A pointer to an error object for catching errors. |
References HELICS_DATA_TYPE_RAW, HELICS_DATA_TYPE_TIME, HELICS_ERROR_INVALID_ARGUMENT, helicsFederateRegisterGlobalTypePublication(), and helics::typeNameStringRef().
Referenced by helicscpp::ValueFederate::registerGlobalPublication().
HelicsPublication helicsFederateRegisterGlobalTypeInput | ( | HelicsFederate | fed, |
const char * | key, | ||
const char * | type, | ||
const char * | units, | ||
HelicsError * | err | ||
) |
Register an input with an arbitrary type.
The input becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for interfaces.
fed | The federate object in which to create an input. | |
key | The identifier for the input (may be NULL). | |
type | A string defining the type of the input (may be NULL). | |
units | A string listing the units of the input (may be NULL). | |
[in,out] | err | A pointer to an error object for catching errors. |
Referenced by helicsFederateRegisterGlobalInput(), and helicscpp::ValueFederate::registerGlobalInput().
HelicsPublication helicsFederateRegisterGlobalTypePublication | ( | HelicsFederate | fed, |
const char * | key, | ||
const char * | type, | ||
const char * | units, | ||
HelicsError * | err | ||
) |
Register a global publication with a defined type.
The publication becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for inputs and publications.
fed | The federate object in which to create a publication. | |
key | The identifier for the publication (may be NULL). | |
type | A string describing the expected type of the publication (may be NULL). | |
units | A string listing the units of the publication (may be NULL). | |
[in,out] | err | A pointer to an error object for catching errors. |
Referenced by helicsFederateRegisterGlobalPublication(), and helicscpp::ValueFederate::registerGlobalPublication().
HelicsInput helicsFederateRegisterInput | ( | HelicsFederate | fed, |
const char * | key, | ||
HelicsDataTypes | type, | ||
const char * | units, | ||
HelicsError * | err | ||
) |
Register a named input.
The input becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for inputs, and publications.
fed | The federate object in which to create an input. | |
key | The identifier for the publication the global input key will be prepended with the federate name (may be NULL). | |
type | A code identifying the type of the input see /ref HelicsDataTypes for available options. | |
units | A string listing the units of the input (may be NULL). | |
[in,out] | err | A pointer to an error object for catching errors. |
References HELICS_DATA_TYPE_ANY, HELICS_DATA_TYPE_CHAR, HELICS_DATA_TYPE_JSON, HELICS_DATA_TYPE_RAW, HELICS_DATA_TYPE_STRING, HELICS_ERROR_INVALID_ARGUMENT, helicsFederateRegisterTypeInput(), and helics::typeNameStringRef().
HelicsPublication helicsFederateRegisterPublication | ( | HelicsFederate | fed, |
const char * | key, | ||
HelicsDataTypes | type, | ||
const char * | units, | ||
HelicsError * | err | ||
) |
Register a publication with a known type.
The publication becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for inputs and publications.
fed | The federate object in which to create a publication. | |
key | The identifier for the publication the global publication key will be prepended with the federate name (may be NULL). | |
type | A code identifying the type of the input see /ref HelicsDataTypes for available options. | |
units | A string listing the units of the publication (may be NULL). | |
[in,out] | err | A pointer to an error object for catching errors. |
References HELICS_DATA_TYPE_CHAR, HELICS_DATA_TYPE_JSON, HELICS_DATA_TYPE_RAW, HELICS_DATA_TYPE_STRING, HELICS_ERROR_INVALID_ARGUMENT, helicsFederateRegisterTypePublication(), and helics::typeNameStringRef().
Referenced by helicscpp::ValueFederate::registerInput(), and helicscpp::ValueFederate::registerPublication().
HelicsInput helicsFederateRegisterSubscription | ( | HelicsFederate | fed, |
const char * | key, | ||
const char * | units, | ||
HelicsError * | err | ||
) |
input/publication registration Create an input and add a publication target.
this method is a wrapper method to create and unnamed input and add a publication target to it
fed | The federate object in which to create an input, must have been created with /ref helicsCreateValueFederate or /ref helicsCreateCombinationFederate. | |
key | The identifier matching a publication to add as an input target. | |
units | A string listing the units of the input (may be NULL). | |
[in,out] | err | A pointer to an error object for catching errors. |
Referenced by helicscpp::ValueFederate::registerSubscription().
HelicsInput helicsFederateRegisterTypeInput | ( | HelicsFederate | fed, |
const char * | key, | ||
const char * | type, | ||
const char * | units, | ||
HelicsError * | err | ||
) |
Register an input with a defined type.
The input becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for inputs, and publications.
fed | The federate object in which to create an input. | |
key | The identifier for the input (may be NULL). | |
type | A string describing the expected type of the input (may be NULL). | |
units | A string listing the units of the input maybe NULL. | |
[in,out] | err | A pointer to an error object for catching errors. |
Referenced by helicsFederateRegisterInput(), and helicscpp::ValueFederate::registerInput().
HelicsPublication helicsFederateRegisterTypePublication | ( | HelicsFederate | fed, |
const char * | key, | ||
const char * | type, | ||
const char * | units, | ||
HelicsError * | err | ||
) |
Register a publication with a defined type.
The publication becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for inputs and publications.
fed | The federate object in which to create a publication. | |
key | The identifier for the publication (may be NULL). | |
type | A string labeling the type of the publication (may be NULL). | |
units | A string listing the units of the publication (may be NULL). | |
[in,out] | err | A pointer to an error object for catching errors. |
Referenced by helicsFederateRegisterPublication(), and helicscpp::ValueFederate::registerPublication().
void helicsInputClearUpdate | ( | HelicsInput | ipt | ) |
Clear the updated flag from an input.
Referenced by helicscpp::Input::clearUpdate().
HelicsBool helicsInputIsUpdated | ( | HelicsInput | ipt | ) |
Check if a particular input was updated.
References HELICS_FALSE, and HELICS_TRUE.
Referenced by helicscpp::Input::isUpdated().
HelicsTime helicsInputLastUpdateTime | ( | HelicsInput | ipt | ) |
Get the last time a input was updated.
References HELICS_TIME_INVALID.
Referenced by helicscpp::Input::getLastUpdateTime().