helics
3.5.2
|
Functions related to message translators for the C api. More...
#include "helicsCore.h"
Go to the source code of this file.
Functions related to message translators for the C api.
HelicsTranslator helicsCoreRegisterTranslator | ( | HelicsCore | core, |
HelicsTranslatorTypes | type, | ||
const char * | name, | ||
HelicsError * | err | ||
) |
Create a Translator on the specified core.
Translators can be created through a federate or a core. Linking through a federate allows a few extra features of name matching to function on the federate interface but otherwise have equivalent behavior.
core | The core to register through. | |
type | The type of translator to create /ref HelicsTranslatorTypes. | |
name | The name of the translator (can be NULL). | |
[in,out] | err | A pointer to an error object for catching errors. |
References HELICS_TRANSLATOR_TYPE_CUSTOM.
HelicsTranslator helicsFederateGetTranslator | ( | HelicsFederate | fed, |
const char * | name, | ||
HelicsError * | err | ||
) |
Get a translator by its name, typically already created via registerInterfaces file or something of that nature.
fed | The federate object to use to get the translator. | |
name | The name of the translator. | |
[in,out] | err | The error object to complete if there is an error. |
References HelicsError::error_code, HELICS_ERROR_INVALID_ARGUMENT, and HelicsError::message.
HelicsTranslator helicsFederateGetTranslatorByIndex | ( | HelicsFederate | fed, |
int | index, | ||
HelicsError * | err | ||
) |
Get a translator 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 translator to get. | |
[in,out] | err | A pointer to an error object for catching errors. |
References HelicsError::error_code, HELICS_ERROR_INVALID_ARGUMENT, and HelicsError::message.
int helicsFederateGetTranslatorCount | ( | HelicsFederate | fed | ) |
Get the number of translators registered through a federate.
fed | The federate object to use to get the translator. |
HelicsTranslator helicsFederateRegisterGlobalTranslator | ( | HelicsFederate | fed, |
HelicsTranslatorTypes | type, | ||
const char * | name, | ||
HelicsError * | err | ||
) |
Create a global translator through a federate.
Translators can be created through a federate or a core. Linking through a federate allows a few extra features of name matching to function on the federate interface but otherwise have equivalent behavior.
fed | The federate to register through. | |
type | The type of translator to create /ref HelicsTranslatorTypes. | |
name | The name of the translator (can be NULL). | |
[in,out] | err | A pointer to an error object for catching errors. |
References HELICS_TRANSLATOR_TYPE_CUSTOM.
HelicsTranslator helicsFederateRegisterTranslator | ( | HelicsFederate | fed, |
HelicsTranslatorTypes | type, | ||
const char * | name, | ||
HelicsError * | err | ||
) |
Create a Translator on the specified federate.
Translators can be created through a federate or a core. Linking through a federate allows a few extra features of name matching to function on the federate interface but otherwise have equivalent behavior.
fed | The federate to register through. | |
type | The type of translator to create /ref HelicsTranslatorTypes. | |
name | The name of the translator (can be NULL). | |
[in,out] | err | A pointer to an error object for catching errors. |
References HELICS_TRANSLATOR_TYPE_CUSTOM.
void helicsTranslatorAddDestinationEndpoint | ( | HelicsTranslator | trans, |
const char * | ept, | ||
HelicsError * | err | ||
) |
Add a destination target endpoint to a translator.
The translator will "translate" all message sent to it. This method adds an endpoint which will receive data published to the translator.
trans | The given translator. | |
ept | The name of the endpoint the translator sends data to. | |
[in,out] | err | A pointer to an error object for catching errors. |
Referenced by helicscpp::Translator::addDestinationEndpoint().
void helicsTranslatorAddInputTarget | ( | HelicsTranslator | trans, |
const char * | input, | ||
HelicsError * | err | ||
) |
Add an input to send a translator output.
All messages sent to a translator endpoint get translated and published to the translators target inputs. This method adds an input to a translators which will receive translated messages.
trans | The given translator to add a destination target to. | |
input | The name of the input which will be receiving translated messages | |
[in,out] | err | A pointer to an error object for catching errors. |
Referenced by helicscpp::Translator::addDestinationInput().
void helicsTranslatorAddPublicationTarget | ( | HelicsTranslator | trans, |
const char * | pub, | ||
HelicsError * | err | ||
) |
Add a source publication target to a translator.
When a publication publishes data the translator will receive it and convert it to a message sent to a translators destination endpoints. This method adds a publication which publishes data the translator receives and sends to its destination endpoints.
trans | The given translator. | |
pub | The name of the publication to subscribe. | |
[in,out] | err | A pointer to an error object for catching errors. |
Referenced by helicscpp::Translator::addSourcePublication().
void helicsTranslatorAddSourceEndpoint | ( | HelicsTranslator | trans, |
const char * | ept, | ||
HelicsError * | err | ||
) |
Add a source endpoint target to a translator.
The translator will "translate" all message sent to it. This method adds an endpoint which can send the translator data.
trans | The given translator. | |
ept | The name of the endpoint which will send the endpoint data | |
[in,out] | err | A pointer to an error object for catching errors. |
Referenced by helicscpp::Translator::addSourceEndpoint().
const char* helicsTranslatorGetName | ( | HelicsTranslator | trans | ) |
Get the name of the translator and store in the given string.
trans | The given translator. |
get the name of the translator
References helics::Interface::getName().
Referenced by helicscpp::Translator::getName().
HelicsBool helicsTranslatorIsValid | ( | HelicsTranslator | trans | ) |
Check if a translator is valid.
trans | The translator object to check. |
References HELICS_FALSE, HELICS_TRUE, and helics::Interface::isValid().
Referenced by helicscpp::Translator::isValid().
void helicsTranslatorSet | ( | HelicsTranslator | trans, |
const char * | prop, | ||
double | val, | ||
HelicsError * | err | ||
) |
Set a property on a translator.
trans | The translator to modify. | |
prop | A string containing the property to set. | |
val | A numerical value for the property. | |
[in,out] | err | A pointer to an error object for catching errors. |
References helics::Translator::set().
Referenced by helicscpp::Translator::set().
void helicsTranslatorSetString | ( | HelicsTranslator | trans, |
const char * | prop, | ||
const char * | val, | ||
HelicsError * | err | ||
) |
Set a string property on a translator.
trans | The translator to modify. | |
prop | A string containing the property to set. | |
val | A string containing the new value. | |
[in,out] | err | A pointer to an error object for catching errors. |
References helics::Translator::setString().
Referenced by helicscpp::Translator::setString().