![]() |
helics
2.8.1
|
Functions related to value federates for the C api. More...
#include "helics.h"
Go to the source code of this file.
Functions related to value federates for the C api.
void helicsFederateClearUpdates | ( | helics_federate | fed | ) |
Clear all the update flags from a federates inputs.
fed | The value federate object for which to clear update flags. |
References fed.
Referenced by helicscpp::ValueFederate::clearUpdates().
helics_input helicsFederateGetInput | ( | helics_federate | fed, |
const char * | key, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | The error object to complete if there is an error. @endforcpponly |
References fed, and helics_error_invalid_argument.
Referenced by helicscpp::ValueFederate::getInput().
helics_input helicsFederateGetInputByIndex | ( | helics_federate | fed, |
int | index, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
References fed, and helics_error_invalid_argument.
Referenced by helicscpp::ValueFederate::getSubscription().
int helicsFederateGetInputCount | ( | helics_federate | fed | ) |
Get the number of subscriptions in a federate.
References fed.
Referenced by helicscpp::ValueFederate::getInputCount().
helics_publication helicsFederateGetPublication | ( | helics_federate | fed, |
const char * | key, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | The error object to complete if there is an error. @endforcpponly |
References fed, and helics_error_invalid_argument.
Referenced by helicscpp::ValueFederate::getPublication().
helics_publication helicsFederateGetPublicationByIndex | ( | helics_federate | fed, |
int | index, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
References fed, and helics_error_invalid_argument.
Referenced by helicscpp::ValueFederate::getPublication().
int helicsFederateGetPublicationCount | ( | helics_federate | fed | ) |
Get the number of publications in a federate.
References fed.
Referenced by helicscpp::ValueFederate::getPublicationCount().
helics_input helicsFederateGetSubscription | ( | helics_federate | fed, |
const char * | key, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | The error object to complete if there is an error. @endforcpponly |
References fed, and helics_error_invalid_argument.
void helicsFederatePublishJSON | ( | helics_federate | fed, |
const char * | json, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | The error object to complete if there is an error. @endforcpponly |
References fed.
Referenced by helicscpp::ValueFederate::publishJSON().
void helicsFederateRegisterFromPublicationJSON | ( | helics_federate | fed, |
const char * | json, | ||
helics_error * | err | ||
) |
Register the publications via JSON publication string.
fed | The value federate object to use to register the publications. | |
json | The JSON publication string. @forcpponly | |
[in,out] | err | The error object to complete if there is an error. @endforcpponly |
This would be the same JSON that would be used to publish data.
References fed.
Referenced by helicscpp::ValueFederate::registerFromPublicationJSON().
helics_publication helicsFederateRegisterGlobalInput | ( | helics_federate | fed, |
const char * | key, | ||
helics_data_type | type, | ||
const char * | units, | ||
helics_error * | 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 helics_data_type for available options. | |
units | A string listing the units of the subscription maybe NULL. @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
References fed, helics_data_type_any, helics_data_type_raw, helics_data_type_string, helics_data_type_time, helics_error_invalid_argument, helicsFederateRegisterGlobalTypeInput(), and helics::typeNameStringRef().
Referenced by helicscpp::ValueFederate::registerGlobalInput().
helics_publication helicsFederateRegisterGlobalPublication | ( | helics_federate | fed, |
const char * | key, | ||
helics_data_type | type, | ||
const char * | units, | ||
helics_error * | 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 helics_data_type for available options. | |
units | A string listing the units of the subscription (may be NULL). @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
References fed, helics_data_type_raw, helics_data_type_time, helics_error_invalid_argument, helicsFederateRegisterGlobalTypePublication(), and helics::typeNameStringRef().
Referenced by helicscpp::ValueFederate::registerGlobalPublication().
helics_publication helicsFederateRegisterGlobalTypeInput | ( | helics_federate | fed, |
const char * | key, | ||
const char * | type, | ||
const char * | units, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
References fed.
Referenced by helicsFederateRegisterGlobalInput(), and helicscpp::ValueFederate::registerGlobalInput().
helics_publication helicsFederateRegisterGlobalTypePublication | ( | helics_federate | fed, |
const char * | key, | ||
const char * | type, | ||
const char * | units, | ||
helics_error * | 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). @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
References fed.
Referenced by helicsFederateRegisterGlobalPublication(), and helicscpp::ValueFederate::registerGlobalPublication().
helics_input helicsFederateRegisterInput | ( | helics_federate | fed, |
const char * | key, | ||
helics_data_type | type, | ||
const char * | units, | ||
helics_error * | 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 helics_data_type for available options. | |
units | A string listing the units of the input (may be NULL). @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
References fed, helics_data_type_any, helics_data_type_raw, helics_data_type_string, helics_data_type_time, helics_error_invalid_argument, helicsFederateRegisterTypeInput(), and helics::typeNameStringRef().
helics_publication helicsFederateRegisterPublication | ( | helics_federate | fed, |
const char * | key, | ||
helics_data_type | type, | ||
const char * | units, | ||
helics_error * | 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 helics_data_type for available options. | |
units | A string listing the units of the subscription (may be NULL). @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
References fed, helics_data_type_raw, helics_data_type_string, helics_data_type_time, helics_error_invalid_argument, helicsFederateRegisterTypePublication(), and helics::typeNameStringRef().
Referenced by helicscpp::ValueFederate::registerInput(), and helicscpp::ValueFederate::registerPublication().
helics_input helicsFederateRegisterSubscription | ( | helics_federate | fed, |
const char * | key, | ||
const char * | units, | ||
helics_error * | 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). @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
References fed.
Referenced by helicscpp::ValueFederate::registerSubscription().
helics_input helicsFederateRegisterTypeInput | ( | helics_federate | fed, |
const char * | key, | ||
const char * | type, | ||
const char * | units, | ||
helics_error * | 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. @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
References fed.
Referenced by helicsFederateRegisterInput(), and helicscpp::ValueFederate::registerInput().
helics_publication helicsFederateRegisterTypePublication | ( | helics_federate | fed, |
const char * | key, | ||
const char * | type, | ||
const char * | units, | ||
helics_error * | 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). @forcpponly | |
[in,out] | err | A pointer to an error object for catching errors. @endforcpponly |
References fed.
Referenced by helicsFederateRegisterPublication(), and helicscpp::ValueFederate::registerPublication().
void helicsInputClearUpdate | ( | helics_input | ipt | ) |
Clear the updated flag from an input.
Referenced by helicscpp::Input::clearUpdate().
helics_bool helicsInputIsUpdated | ( | helics_input | ipt | ) |
Check if a particular subscription was updated.
References helics_false, and helics_true.
Referenced by helicscpp::Input::isUpdated().
helics_time helicsInputLastUpdateTime | ( | helics_input | ipt | ) |
Get the last time a subscription was updated.
References helics_time_invalid.
Referenced by helicscpp::Input::getLastUpdateTime().