![]() |
helics 3.7.0
|
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. |
References helicsFederateClearUpdates().
Referenced by helicscpp::ValueFederate::clearUpdates(), and helicsFederateClearUpdates().
| 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, helicsFederateGetInput(), and helics::Interface::isValid().
Referenced by helicscpp::ValueFederate::getInput(), and helicsFederateGetInput().
| 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, helicsFederateGetInputByIndex(), and helics::Interface::isValid().
Referenced by helicscpp::ValueFederate::getInput(), and helicsFederateGetInputByIndex().
| 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, helicsFederateGetInputByTarget(), and helics::Interface::isValid().
Referenced by helicscpp::ValueFederate::getInputByTarget(), helicsFederateGetInputByTarget(), and helicsFederateGetSubscription().
| int helicsFederateGetInputCount | ( | HelicsFederate | fed | ) |
Get the number of inputs in a federate.
References helicsFederateGetInputCount().
Referenced by helicscpp::ValueFederate::getInputCount(), and helicsFederateGetInputCount().
| 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, helicsFederateGetPublication(), and helics::Interface::isValid().
Referenced by helicscpp::ValueFederate::getPublication(), and helicsFederateGetPublication().
| 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, helicsFederateGetPublicationByIndex(), and helics::Interface::isValid().
Referenced by helicscpp::ValueFederate::getPublication(), and helicsFederateGetPublicationByIndex().
| int helicsFederateGetPublicationCount | ( | HelicsFederate | fed | ) |
Get the number of publications in a federate.
References helicsFederateGetPublicationCount().
Referenced by helicscpp::ValueFederate::getPublicationCount(), and helicsFederateGetPublicationCount().
| 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(), and helicsFederateGetSubscription().
Referenced by helicsFederateGetSubscription().
| 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. |
References helicsFederatePublishJSON().
Referenced by helicsFederatePublishJSON(), and 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.
References helicsFederateRegisterFromPublicationJSON().
Referenced by helicsFederateRegisterFromPublicationJSON(), and helicscpp::ValueFederate::registerFromPublicationJSON().
| HelicsInput helicsFederateRegisterGlobalInput | ( | HelicsFederate | fed, |
| const char * | key, | ||
| HelicsDataTypes | type, | ||
| const char * | units, | ||
| HelicsError * | err | ||
| ) |
Register a global 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 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, helicsFederateRegisterGlobalInput(), helicsFederateRegisterGlobalTypeInput(), and helics::typeNameStringRef().
Referenced by helicsFederateRegisterGlobalInput(), and 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, helicsFederateRegisterGlobalPublication(), helicsFederateRegisterGlobalTypePublication(), and helics::typeNameStringRef().
Referenced by helicsFederateRegisterGlobalPublication(), and helicscpp::ValueFederate::registerGlobalPublication().
| HelicsInput 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. |
References helicsFederateRegisterGlobalTypeInput().
Referenced by helicsFederateRegisterGlobalInput(), helicsFederateRegisterGlobalTypeInput(), 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. |
References helicsFederateRegisterGlobalTypePublication().
Referenced by helicsFederateRegisterGlobalPublication(), helicsFederateRegisterGlobalTypePublication(), 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, helicsFederateRegisterInput(), helicsFederateRegisterTypeInput(), and helics::typeNameStringRef().
Referenced by helicsFederateRegisterInput().
| 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, helicsFederateRegisterPublication(), helicsFederateRegisterTypePublication(), and helics::typeNameStringRef().
Referenced by helicsFederateRegisterPublication(), 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. |
References helicsFederateRegisterSubscription().
Referenced by helicsFederateRegisterSubscription(), and 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. |
References helicsFederateRegisterTypeInput().
Referenced by helicsFederateRegisterInput(), helicsFederateRegisterTypeInput(), 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. |
References helicsFederateRegisterTypePublication().
Referenced by helicsFederateRegisterPublication(), helicsFederateRegisterTypePublication(), and helicscpp::ValueFederate::registerPublication().
| void helicsInputClearUpdate | ( | HelicsInput | ipt | ) |
Clear the updated flag from an input.
References helicsInputClearUpdate().
Referenced by helicscpp::Input::clearUpdate(), and helicsInputClearUpdate().
| HelicsBool helicsInputIsUpdated | ( | HelicsInput | ipt | ) |
Check if a particular input was updated.
References HELICS_FALSE, HELICS_TRUE, and helicsInputIsUpdated().
Referenced by helicsInputIsUpdated(), and helicscpp::Input::isUpdated().
| HelicsTime helicsInputLastUpdateTime | ( | HelicsInput | ipt | ) |
Get the last time a input was updated.
References HELICS_TIME_INVALID, and helicsInputLastUpdateTime().
Referenced by helicscpp::Input::getLastUpdateTime(), and helicsInputLastUpdateTime().