![]() |
helics
3.3.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. |
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::getSubscription().
int helicsFederateGetInputCount | ( | HelicsFederate | fed | ) |
Get the number of subscriptions 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.
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.
Referenced by helicscpp::ValueFederate::getPublication().
int helicsFederateGetPublicationCount | ( | HelicsFederate | fed | ) |
Get the number of publications in a federate.
Referenced by helicscpp::ValueFederate::getPublicationCount().
HelicsInput helicsFederateGetSubscription | ( | HelicsFederate | fed, |
const char * | key, | ||
HelicsError * | err | ||
) |
Get an input object from a subscription target.
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 HELICS_ERROR_INVALID_ARGUMENT.
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 subscriptions and publications.
fed | The federate object in which to create a publication. | |
key | The identifier for the publication. | |
type | A code identifying the type of the input see /ref HelicsDataTypes for available options. | |
units | A string listing the units of the subscription maybe 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 subscriptions and publications.
fed | The federate object in which to create a publication. | |
key | The identifier for the publication. | |
type | A code identifying the type of the input see /ref HelicsDataTypes for available options. | |
units | A string listing the units of the subscription (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 a global 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 subscriptions and publications.
fed | The federate object in which to create a publication. | |
key | The identifier for the publication. | |
type | A string defining the type of the input. | |
units | A string listing the units of the subscription maybe 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 subscriptions and publications.
fed | The federate object in which to create a publication. | |
key | The identifier for the publication. | |
type | A string describing the expected type of the publication. | |
units | A string listing the units of the subscription (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 subscriptions, 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. | |
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 subscriptions 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. | |
type | A code identifying the type of the input see /ref HelicsDataTypes for available options. | |
units | A string listing the units of the subscription (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 | ||
) |
sub/pub registration Create a subscription.
The subscription becomes part of the federate and is destroyed when the federate is freed so there are no separate free functions for subscriptions and publications.
fed | The federate object in which to create a subscription, must have been created with /ref helicsCreateValueFederate or /ref helicsCreateCombinationFederate. | |
key | The identifier matching a publication to get a subscription for. | |
units | A string listing the units of the subscription (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 subscriptions, inputs, and publications.
fed | The federate object in which to create an input. | |
key | The identifier for the input. | |
type | A string describing the expected type of the input. | |
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 subscriptions and publications.
fed | The federate object in which to create a publication. | |
key | The identifier for the publication. | |
type | A string labeling the type of the publication. | |
units | A string listing the units of the subscription (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 subscription was updated.
References HELICS_FALSE, and HELICS_TRUE.
Referenced by helicscpp::Input::isUpdated().
HelicsTime helicsInputLastUpdateTime | ( | HelicsInput | ipt | ) |
Get the last time a subscription was updated.
References HELICS_TIME_INVALID.
Referenced by helicscpp::Input::getLastUpdateTime().