![]() |
helics
2.8.1
|
#include <ValueFederate.hpp>
Inheritance diagram for helics::ValueFederate:Public Member Functions | |
| ValueFederate (const std::string &fedName, const FederateInfo &fi) | |
| ValueFederate (const std::string &fedName, const std::shared_ptr< Core > &core, const FederateInfo &fi=FederateInfo{}) | |
| ValueFederate (const std::string &fedName, CoreApp &core, const FederateInfo &fi=FederateInfo{}) | |
| ValueFederate (const std::string &configString) | |
| ValueFederate (const std::string &fedName, const std::string &configString) | |
| ValueFederate () | |
| ValueFederate (bool res) | |
| ValueFederate (const char *configString) | |
| ValueFederate (const ValueFederate &fed)=delete | |
| ValueFederate (ValueFederate &&fed) noexcept | |
| virtual | ~ValueFederate () |
| ValueFederate & | operator= (ValueFederate &&fed) noexcept |
| ValueFederate & | operator= (const ValueFederate &fed)=delete |
| Publication & | registerPublication (const std::string &key, const std::string &type, const std::string &units=std::string()) |
| template<typename X > | |
| Publication & | registerPublication (const std::string &key, const std::string &units=std::string()) |
| Publication & | registerGlobalPublication (const std::string &key, const std::string &type, const std::string &units=std::string()) |
| template<typename X > | |
| Publication & | registerGlobalPublication (const std::string &key, const std::string &units=std::string()) |
| template<typename X > | |
| Publication & | registerIndexedPublication (const std::string &key, int index1, const std::string &units=std::string()) |
| template<typename X > | |
| Publication & | registerIndexedPublication (const std::string &key, int index1, int index2, const std::string &units=std::string()) |
| template<typename X > | |
| Publication & | registerPublicationIndexed (const std::string &key, int index1, const std::string &units=std::string()) |
| template<typename X > | |
| Publication & | registerPublicationIndexed (const std::string &key, int index1, int index2, const std::string &units=std::string()) |
| Input & | registerInput (const std::string &key, const std::string &type, const std::string &units=std::string()) |
| Input & | registerGlobalInput (const std::string &key, const std::string &type, const std::string &units=std::string()) |
| template<typename X > | |
| Input & | registerInput (const std::string &key, const std::string &units=std::string()) |
| template<typename X > | |
| Input & | registerGlobalInput (const std::string &key, const std::string &units=std::string()) |
| template<typename X > | |
| Input & | registerIndexedInput (const std::string &key, int index1, const std::string &units=std::string()) |
| template<typename X > | |
| Input & | registerIndexedInput (const std::string &key, int index1, int index2, const std::string &units=std::string()) |
| template<typename X > | |
| Input & | registerInputIndexed (const std::string &key, int index1, const std::string &units=std::string()) |
| template<typename X > | |
| Input & | registerInputIndexed (const std::string &key, int index1, int index2, const std::string &units=std::string()) |
| Input & | registerSubscription (const std::string &target, const std::string &units=std::string()) |
| Input & | registerIndexedSubscription (const std::string &target, int index1, const std::string &units=std::string()) |
| Input & | registerIndexedSubscription (const std::string &target, int index1, int index2, const std::string &units=std::string()) |
| Input & | registerSubscriptionIndexed (const std::string &target, int index1, const std::string &units=std::string()) |
| Input & | registerSubscriptionIndexed (const std::string &target, int index1, int index2, const std::string &units=std::string()) |
| void | addAlias (const Input &inp, const std::string &shortcutName) |
| void | addAlias (const Publication &pub, const std::string &shortcutName) |
| virtual void | setFlagOption (int flag, bool flagValue=true) override |
| void | setDefaultValue (const Input &inp, data_view block) |
| virtual void | registerInterfaces (const std::string &configString) override |
| void | registerValueInterfaces (const std::string &configString) |
| data_view | getValueRaw (const Input &inp) |
| void | publishRaw (const Publication &pub, data_view block) |
| void | publishRaw (const Publication &pub, const char *data, size_t data_size) |
| void | registerFromPublicationJSON (const std::string &jsonString) |
| void | publishJSON (const std::string &jsonString) |
| void | addTarget (const Publication &pub, const std::string &target) |
| void | addTarget (const Input &inp, const std::string &target) |
| void | removeTarget (const Publication &pub, const std::string &target) |
| void | removeTarget (const Input &inp, const std::string &target) |
| template<class iType > | |
| void | addIndexedTarget (const iType &iObject, const std::string &target, int index1) |
| template<class iType > | |
| void | addIndexedTarget (const iType &iObject, const std::string &target, int index1, int index2) |
| bool | isUpdated (const Input &inp) const |
| Time | getLastUpdateTime (const Input &inp) const |
| virtual void | disconnect () override |
| void | clearUpdates () |
| void | clearUpdate (const Input &inp) |
| std::vector< int > | queryUpdates () |
| const std::string & | getTarget (const Input &inp) const |
| const Input & | getInput (const std::string &key) const |
| Input & | getInput (const std::string &key) |
| const Input & | getInput (int index) const |
| Input & | getInput (int index) |
| const Input & | getInput (const std::string &key, int index1) const |
| const Input & | getInput (const std::string &key, int index1, int index2) const |
| const Input & | getSubscription (const std::string &target) const |
| Input & | getSubscription (const std::string &target) |
| Publication & | getPublication (const std::string &key) |
| const Publication & | getPublication (const std::string &key) const |
| Publication & | getPublication (int index) |
| const Publication & | getPublication (int index) const |
| const Publication & | getPublication (const std::string &key, int index1) const |
| const Publication & | getPublication (const std::string &key, int index1, int index2) const |
| void | setInputNotificationCallback (std::function< void(Input &, Time)> callback) |
| void | setInputNotificationCallback (Input &inp, std::function< void(Input &, Time)> callback) |
| int | getPublicationCount () const |
| int | getInputCount () const |
Public Member Functions inherited from helics::Federate | |
| Federate (const std::string &fedname, const FederateInfo &fi) | |
| Federate (const std::string &fedname, const std::shared_ptr< Core > &core, const FederateInfo &fi=FederateInfo{}) | |
| Federate (const std::string &fedname, CoreApp &core, const FederateInfo &fi=FederateInfo{}) | |
| Federate (const std::string &configString) | |
| Federate (const std::string &fedname, const std::string &configString) | |
| Federate () noexcept | |
| Federate (Federate &&fed) noexcept | |
| Federate (const Federate &fed)=delete | |
| virtual | ~Federate () |
| Federate & | operator= (Federate &&fed) noexcept |
| Federate & | operator= (const Federate &fed)=delete |
| void | enterInitializingMode () |
| void | enterInitializingModeAsync () |
| bool | isAsyncOperationCompleted () const |
| void | enterInitializingModeComplete () |
| iteration_result | enterExecutingMode (iteration_request iterate=iteration_request::no_iterations) |
| void | enterExecutingModeAsync (iteration_request iterate=iteration_request::no_iterations) |
| iteration_result | enterExecutingModeComplete () |
| void | finalize () |
| void | finalizeAsync () |
| void | finalizeComplete () |
| void | error (int errorcode) |
| void | error (int errorcode, const std::string &message) |
| void | localError (int errorcode, const std::string &message) |
| void | globalError (int errorcode, const std::string &message) |
| void | localError (int errorcode) |
| void | globalError (int errorcode) |
| void | setSeparator (char separator) |
| Time | requestTime (Time nextInternalTimeStep) |
| Time | requestNextStep () |
| Time | requestTimeAdvance (Time timeDelta) |
| iteration_time | requestTimeIterative (Time nextInternalTimeStep, iteration_request iterate) |
| void | requestTimeAsync (Time nextInternalTimeStep) |
| void | requestTimeIterativeAsync (Time nextInternalTimeStep, iteration_request iterate) |
| Time | requestTimeComplete () |
| iteration_time | requestTimeIterativeComplete () |
| void | setProperty (int32_t option, double timeValue) |
| void | setProperty (int32_t option, Time timeValue) |
| void | setProperty (int32_t option, int32_t optionValue) |
| Time | getTimeProperty (int32_t option) const |
| virtual bool | getFlagOption (int flag) const |
| int | getIntegerProperty (int32_t option) const |
| void | setLoggingCallback (const std::function< void(int, const std::string &, const std::string &)> &logFunction) |
| std::string | query (const std::string &target, const std::string &queryStr, helics_sequencing_mode mode=helics_sequencing_mode_fast) |
| std::string | query (const std::string &queryStr, helics_sequencing_mode mode=helics_sequencing_mode_fast) |
| query_id_t | queryAsync (const std::string &target, const std::string &queryStr, helics_sequencing_mode mode=helics_sequencing_mode_fast) |
| query_id_t | queryAsync (const std::string &queryStr, helics_sequencing_mode mode=helics_sequencing_mode_fast) |
| std::string | queryComplete (query_id_t queryIndex) |
| bool | isQueryCompleted (query_id_t queryIndex) const |
| void | setQueryCallback (const std::function< std::string(const std::string &)> &queryFunction) |
| void | setGlobal (const std::string &valueName, const std::string &value) |
| void | addDependency (const std::string &fedName) |
| Filter & | registerGlobalFilter (const std::string &filterName, const std::string &inputType=std::string(), const std::string &outputType=std::string()) |
| CloningFilter & | registerGlobalCloningFilter (const std::string &filterName, const std::string &inputType=std::string(), const std::string &outputType=std::string()) |
| Filter & | registerFilter (const std::string &filterName, const std::string &inputType=std::string(), const std::string &outputType=std::string()) |
| CloningFilter & | registerCloningFilter (const std::string &filterName, const std::string &inputType=std::string(), const std::string &outputType=std::string()) |
| Filter & | registerFilter () |
| CloningFilter & | registerCloningFilter () |
| void | addSourceTarget (const Filter &filt, const std::string &targetEndpoint) |
| void | addDestinationTarget (const Filter &filt, const std::string &targetEndpoint) |
| const std::string & | getInterfaceName (interface_handle handle) const |
| const Filter & | getFilter (const std::string &filterName) const |
| const Filter & | getFilter (int index) const |
| Filter & | getFilter (const std::string &filterName) |
| Filter & | getFilter (int index) |
| void | setFilterOperator (const Filter &filt, std::shared_ptr< FilterOperator > op) |
| register a operator for the specified filter More... | |
| int | getFilterCount () const |
| void | registerFilterInterfaces (const std::string &configString) |
| void | closeInterface (interface_handle handle) |
| auto | getID () const noexcept |
| modes | getCurrentMode () const |
| Time | getCurrentTime () const |
| const std::string & | getName () const |
| const std::shared_ptr< Core > & | getCorePointer () |
| int | filterCount () const |
| void | setInfo (interface_handle handle, const std::string &info) |
| const std::string & | getInfo (interface_handle handle) |
| void | setInterfaceOption (interface_handle handle, int32_t option, int32_t option_value=1) |
| int32_t | getInterfaceOption (interface_handle handle, int32_t option) |
| const std::string & | getInjectionType (interface_handle handle) const |
| const std::string & | getExtractionType (interface_handle handle) const |
| const std::string & | getInjectionUnits (interface_handle handle) const |
| const std::string & | getExtractionUnits (interface_handle handle) const |
| const std::string & | getInterfaceUnits (interface_handle handle) const |
| void | logMessage (int level, const std::string &message) const |
| void | logErrorMessage (const std::string &message) const |
| void | logWarningMessage (const std::string &message) const |
| void | logInfoMessage (const std::string &message) const |
| void | logDebugMessage (const std::string &message) const |
| void | completeOperation () |
Static Public Member Functions | |
| static double | getDouble (Input &inp) |
| static const std::string & | getString (Input &inp) |
| static void | publish (Publication &pub, const std::string &str) |
| static void | publish (Publication &pub, double val) |
Protected Member Functions | |
| virtual void | updateTime (Time newTime, Time oldTime) override |
| virtual void | startupToInitializeStateTransition () override |
| virtual void | initializeToExecuteStateTransition (iteration_result result) override |
| virtual std::string | localQuery (const std::string &queryStr) const override |
Additional Inherited Members | |
Public Types inherited from helics::Federate | |
| enum | modes : char { modes::startup = 0, modes::initializing = 1, modes::executing = 2, modes::finalize, modes::error = 4, modes::pending_init = 5, modes::pending_exec = 6, modes::pending_time = 7, modes::pending_iterative_time, modes::pending_finalize = 9, modes::finished = 10 } |
Protected Attributes inherited from helics::Federate | |
| std::atomic< modes > | currentMode {modes::startup} |
| the current state of the simulation | |
| char | nameSegmentSeparator = '/' |
| the separator between automatically prependend names | |
| bool | strictConfigChecking {true} |
| bool | useJsonSerialization {false} |
| std::shared_ptr< Core > | coreObject |
| reference to the core simulation API | |
| Time | currentTime = Time::minVal() |
| the current simulation time | |
class defining the value based interface
| helics::ValueFederate::ValueFederate | ( | const std::string & | fedName, |
| const FederateInfo & | fi | ||
| ) |
constructor taking a federate information structure and using the default core
| fedName | the name of the federate, can be empty to use the name from fi or an auto generated one |
| fi | a federate information structure |
constructor taking a core engine and federate info structure
References helics::Federate::coreObject, helics::Federate::getID(), and helics::FederateInfo::useJsonSerialization.
| helics::ValueFederate::ValueFederate | ( | const std::string & | fedName, |
| const std::shared_ptr< Core > & | core, | ||
| const FederateInfo & | fi = FederateInfo{} |
||
| ) |
constructor taking a core and a federate information structure, core information in fi is ignored
| fedName | the name of the federate, can be empty to use the name from fi or an auto generated one |
| core | a shared ptr to a core to join |
| fi | a federate information structure |
References helics::Federate::coreObject, helics::Federate::getID(), and helics::FederateInfo::useJsonSerialization.
| helics::ValueFederate::ValueFederate | ( | const std::string & | fedName, |
| CoreApp & | core, | ||
| const FederateInfo & | fi = FederateInfo{} |
||
| ) |
constructor taking a CoreApp and a federate information structure
| fedName | the name of the federate can be empty to use a name from the federateInfo |
| core | a CoreApp with the core to connect to. |
| fi | a federate information structure |
References helics::Federate::coreObject, helics::Federate::getID(), and helics::FederateInfo::useJsonSerialization.
|
explicit |
constructor taking a string with the required information
| configString | can be either a JSON file a TOML file (with extension TOML) or a string containing JSON code |
| helics::ValueFederate::ValueFederate | ( | const std::string & | fedName, |
| const std::string & | configString | ||
| ) |
constructor taking a name and a string with the required information
| fedName | the name of the federate, can be empty to use the name from the configString |
| configString | can be either a JSON file a TOML file (with extension TOML) or a string containing JSON code or a string with command line arguments |
References helics::Federate::coreObject, helics::Federate::getID(), registerInterfaces(), and helics::Federate::useJsonSerialization.
|
explicitdefault |
default constructor
|
explicit |
special constructor called by child class to initialize the class vs the default constructor
References helics::Federate::coreObject, helics::Federate::getID(), and helics::Federate::useJsonSerialization.
|
explicit |
this is an overload for the string operation top deconflict with the bool version
|
delete |
federate is not copyable
|
defaultnoexcept |
default move constructor
|
virtualdefault |
destructor
| void helics::ValueFederate::addAlias | ( | const Input & | inp, |
| const std::string & | shortcutName | ||
| ) |
add a shortcut for locating an input
primarily for use in looking up an id from a different location creates a local shortcut for referring to a input which may not have another name
| inp | the input object |
| shortcutName | the name of the shortcut |
| void helics::ValueFederate::addAlias | ( | const Publication & | pub, |
| const std::string & | shortcutName | ||
| ) |
add a shortcut for locating a publication
primarily for use in looking up an id from a different location creates a local shortcut for referring to a publication which may not have another name
| pub | the publication object |
| shortcutName | the name of the shortcut |
|
inline |
add a 1-d Indexed target to an interface
call is only valid in startup mode, register an optional subscription for a 1D array of values
| iObject | an interface object to add the target to |
| target | the name of the target |
| index1 | the index into a 1 dimensional array of values |
|
inline |
add an indexed target to an interface
call is only valid in startup mode
| iObject | an interface object such as a publication, filter or input |
| target | the name of the target |
| index1 | the first index of a 2-D value structure |
| index2 | the 2nd index of a 2-D value structure |
| void helics::ValueFederate::addTarget | ( | const Input & | inp, |
| const std::string & | target | ||
| ) |
add a source target to an input/subscription
| inp | the input object to add a named publication |
| target | the name of the publication to get data from |
| void helics::ValueFederate::addTarget | ( | const Publication & | pub, |
| const std::string & | target | ||
| ) |
add a destination target to a publication
| pub | the publication object to add a target to |
| target | the name of the input to send the data to |
| void helics::ValueFederate::clearUpdate | ( | const Input & | inp | ) |
clear all the update for a specific federate
after this call isUpdated on the input will return false
Referenced by helics::Input::clearUpdate().
| void helics::ValueFederate::clearUpdates | ( | ) |
clear all the updates
after this call isUpdated on all the internal objects will return false
|
overridevirtual |
disconnect a simulation from the core (will also call finalize before disconnecting if necessary)
Reimplemented from helics::Federate.
Reimplemented in helics::CombinationFederate.
References helics::Federate::disconnect().
Referenced by helics::CombinationFederate::disconnect().
|
static |
get a double value
References helics::Input::getValue().
| Input & helics::ValueFederate::getInput | ( | const std::string & | key | ) |
get the id of a subscription
References helics::Federate::getName(), and helics::Federate::nameSegmentSeparator.
| const Input & helics::ValueFederate::getInput | ( | const std::string & | key | ) | const |
get the id of a subscription
References helics::Federate::getName(), and helics::Federate::nameSegmentSeparator.
| const Input & helics::ValueFederate::getInput | ( | const std::string & | key, |
| int | index1 | ||
| ) | const |
get the id of a subscription from a vector of subscriptions
| const Input & helics::ValueFederate::getInput | ( | const std::string & | key, |
| int | index1, | ||
| int | index2 | ||
| ) | const |
get an input object from a 2-d vector of inputs
| Input & helics::ValueFederate::getInput | ( | int | index | ) |
get the id of a subscription
| const Input & helics::ValueFederate::getInput | ( | int | index | ) | const |
get the id of a subscription
| int helics::ValueFederate::getInputCount | ( | ) | const |
get a count of the number subscriptions registered
get the time of the last update
| Publication & helics::ValueFederate::getPublication | ( | const std::string & | key | ) |
get a publication from its name
| key | the name of the publication |
References helics::Federate::getName(), and helics::Federate::nameSegmentSeparator.
Referenced by helics::Publication::Publication(), and publishJSON().
| const Publication & helics::ValueFederate::getPublication | ( | const std::string & | key | ) | const |
get a publication from its key
| key | the name of the publication |
References helics::Federate::getName(), and helics::Federate::nameSegmentSeparator.
| const Publication & helics::ValueFederate::getPublication | ( | const std::string & | key, |
| int | index1 | ||
| ) | const |
get a publication from its name
| key | the name of the publication |
| index1 | the index into a vector of publications |
| const Publication & helics::ValueFederate::getPublication | ( | const std::string & | key, |
| int | index1, | ||
| int | index2 | ||
| ) | const |
get a publication from a 2-d array of publications
| key | the name of the publication |
| index1 | the first index of 2d array |
| index2 | the second index of a 2d array of publications |
| Publication & helics::ValueFederate::getPublication | ( | int | index | ) |
get a publication from its index
| index | the 0 based index of the publication to retrieve |
| const Publication & helics::ValueFederate::getPublication | ( | int | index | ) | const |
get a publication from its index
| index | the 0 based index of the publication to retrieve |
| int helics::ValueFederate::getPublicationCount | ( | ) | const |
get a count of the number publications registered
|
static |
get a string value
| Input & helics::ValueFederate::getSubscription | ( | const std::string & | target | ) |
get an input based on target
this will only get the first subscription with a specific target
| const Input & helics::ValueFederate::getSubscription | ( | const std::string & | target | ) | const |
get the input id based on target
| const std::string & helics::ValueFederate::getTarget | ( | const Input & | inp | ) | const |
get the name of the first target for an input
get a value as raw data block from the system
| inp | an input object to get the data from |
| std::invalid_argument | if id is invalid |
Referenced by helics::Input::checkUpdate(), helics::Input::getRawSize(), and helics::Input::getRawValue().
|
overrideprotectedvirtual |
function to deal with any operations that need to occur on the transition from startup to initialize
Reimplemented from helics::Federate.
Reimplemented in helics::CombinationFederate.
Referenced by helics::CombinationFederate::initializeToExecuteStateTransition().
| bool helics::ValueFederate::isUpdated | ( | const Input & | inp | ) | const |
check if a given subscription has an update
Referenced by helics::Input::checkUpdate().
|
overrideprotectedvirtual |
function to generate results for a local Query
should return an empty string if the query is not recognized
Reimplemented from helics::Federate.
Reimplemented in helics::CombinationFederate.
Referenced by helics::CombinationFederate::localQuery().
|
delete |
delete copy assignment
|
noexcept |
default move assignment
References fed, and helics::Federate::operator=().
|
static |
direct publish a string
| pub | the publication to use |
| str | a string to publish |
| invalid_argument | if the publication id is invalid |
References helics::Publication::publish().
|
static |
direct publish a double
| pub | the publication identifier |
| val | the value to publish |
| invalid_argument | if the publication is invalid |
References helics::Publication::publish().
| void helics::ValueFederate::publishJSON | ( | const std::string & | jsonString | ) |
publish a set of values in json format
| jsonString | a json string containing the data to publish |
References getPublication(), loadJson(), and helics::Federate::nameSegmentSeparator.
|
inline |
publish data
| pub | the publication identifier |
| data | a const char pointer to raw data |
| data_size | the length of the data |
| invalid_argument | if the publication id is invalid |
References data.
| void helics::ValueFederate::publishRaw | ( | const Publication & | pub, |
| data_view | block | ||
| ) |
publish a value
| pub | the publication identifier |
| block | a data block containing the data |
| invalid_argument | if the publication id is invalid |
References helics::Federate::currentMode, helics::Federate::executing, and helics::Federate::initializing.
Referenced by helics::Publication::publish().
| std::vector< int > helics::ValueFederate::queryUpdates | ( | ) |
get a list of all the indices of all inputs that have been updated since the last call
| void helics::ValueFederate::registerFromPublicationJSON | ( | const std::string & | jsonString | ) |
register a set of publications based on a publication JSON
| jsonString | a json string containing the data to publish and establish publications from |
References loadJson(), and helics::Federate::nameSegmentSeparator.
| Input & helics::ValueFederate::registerGlobalInput | ( | const std::string & | key, |
| const std::string & | type, | ||
| const std::string & | units = std::string() |
||
| ) |
register a globally named input
call is only valid in startup mode
| key | the name of the input(can be blank in which case it is the same as a subscription |
| type | a string defining the type of the input |
| units | a string defining the units of the input [optional] |
|
inline |
register a global named input
| Publication & helics::ValueFederate::registerGlobalPublication | ( | const std::string & | key, |
| const std::string & | type, | ||
| const std::string & | units = std::string() |
||
| ) |
register a publication
call is only valid in startup mode
| key | the name of the publication |
| type | a string defining the type of the publication |
| units | a string defining the units of the publication [optional] |
|
inline |
register a publication
call is only valid in startup mode by default prepends the name with the federate name
| key | the name of the publication |
| units | the optional units of the publication |
|
inline |
register a required subscription
call is only valid in startup mode, register an optional subscription for a 1D array of values
| key | the name of the subscription |
| index1 | the index into a 1 dimensional array of values |
| units | the optional units on the subscription |
|
inline |
register a publication as part of a 2 dimensional indexed structure
call is only valid in startup mode by default prepends the name with the federate name the name is registered as a global structure with the indices appended
| key | the name of the publication |
| index1 | an index associated with the publication |
| index2 | a second index |
| units | the optional units of the publication |
|
inline |
register a publication as part of an indexed structure
call is only valid in startup mode by default prepends the name with the federate name the name is registered as a global structure with the index appended
| key | the name of the publication |
| index1 | an index associated with the publication |
| units | the optional units of the publication |
|
inline |
register a publication as part of a 2 dimensional indexed structure
call is only valid in startup mode by default prepends the name with the federate name the name is registered as a global structure with the indices appended
| key | the name of the publication |
| index1 | an index associated with the publication |
| index2 | a second index |
| units | the optional units of the publication |
|
inline |
register a subscription
register a subscription for a 1D array of values
| target | the name of the publication to target |
| index1 | the index into a 1 dimensional array of values |
| units | the optional units on the subscription |
|
inline |
register a subscription for an index of a 2-D array of values
call is only valid in startup mode
| target | the name of the publication to subscribe to |
| index1 | the first index of a 2-D value structure |
| index2 | the 2nd index of a 2-D value structure |
| units | the optional units on the subscription |
| Input & helics::ValueFederate::registerInput | ( | const std::string & | key, |
| const std::string & | type, | ||
| const std::string & | units = std::string() |
||
| ) |
register an input
call is only valid in startup mode register a subscription with name type and units
| key | the name of the publication to subscribe to |
| type | a string describing the type of the publication |
| units | a string describing the units on the publication |
References helics::Federate::getName(), and helics::Federate::nameSegmentSeparator.
|
inline |
register a named input
|
inline |
register a required subscription
call is only valid in startup mode, register an optional subscription for a 1D array of values
| key | the name of the subscription |
| index1 | the index into a 1 dimensional array of values |
| units | the optional units on the subscription |
|
inline |
register a publication as part of a 2 dimensional indexed structure
call is only valid in startup mode by default prepends the name with the federate name the name is registered as a global structure with the indices appended
| key | the name of the publication |
| index1 | an index associated with the publication |
| index2 | a second index |
| units | the optional units of the publication |
|
overridevirtual |
register a set of interfaces defined in a file
call is only valid in startup mode to add an TOML files must have extension .toml or .TOML
| configString | the location of the file(JSON or TOML) or JSON String to load to generate the interfaces |
Reimplemented from helics::Federate.
Reimplemented in helics::CombinationFederate.
References helics::Federate::registerInterfaces(), and registerValueInterfaces().
Referenced by ValueFederate().
| Publication & helics::ValueFederate::registerPublication | ( | const std::string & | key, |
| const std::string & | type, | ||
| const std::string & | units = std::string() |
||
| ) |
register a publication
call is only valid in startup mode
| key | the name of the publication |
| type | a string defining the type of the publication |
| units | a string defining the units of the publication [optional] |
References helics::Federate::getName(), and helics::Federate::nameSegmentSeparator.
Referenced by helics::Publication::Publication().
|
inline |
register a publication
call is only valid in startup mode by default prepends the name with the federate name
| key | the name of the publication |
| units | the optional units of the publication |
|
inline |
register a publication as part of an indexed structure
call is only valid in startup mode by default prepends the name with the federate name the name is registered as a global structure with the index appended
| key | the name of the publication |
| index1 | an index associated with the publication |
| units | the optional units of the publication |
|
inline |
register a publication as part of a 2 dimensional indexed structure
call is only valid in startup mode by default prepends the name with the federate name the name is registered as a global structure with the indices appended
| key | the name of the publication |
| index1 | an index associated with the publication |
| index2 | a second index |
| units | the optional units of the publication |
| Input & helics::ValueFederate::registerSubscription | ( | const std::string & | target, |
| const std::string & | units = std::string() |
||
| ) |
register a subscription
| target | the name of the publication to subscribe to |
| units | the units associated with the desired output |
Referenced by helics::make_subscription().
|
inline |
register a subscription
register a subscription for a 1D array of values
| target | the name of the publication to target |
| index1 | the index into a 1 dimensional array of values |
| units | the optional units on the subscription |
|
inline |
register a subscription for an index of a 2-D array of values
call is only valid in startup mode
| target | the name of the publication to subscribe to |
| index1 | the first index of a 2-D value structure |
| index2 | the 2nd index of a 2-D value structure |
| units | the optional units on the subscription |
| void helics::ValueFederate::registerValueInterfaces | ( | const std::string & | configString | ) |
register a set of value interfaces (publications and subscriptions)
call is only valid in startup mode it is a protected call to add an TOML files must have extension .toml or .TOML
| configString | the location of the file(JSON or TOML) or JSON String to load to generate the interfaces |
Referenced by helics::CombinationFederate::registerInterfaces(), and registerInterfaces().
| void helics::ValueFederate::removeTarget | ( | const Input & | inp, |
| const std::string & | target | ||
| ) |
remove a publication from an input/subscription
| inp | the input object to add a named publication |
| target | the name of the publication to remove |
| void helics::ValueFederate::removeTarget | ( | const Publication & | pub, |
| const std::string & | target | ||
| ) |
remove a destination target from a publication
| pub | the publication object to add a target to |
| target | the name of the input to remove |
set the default value for a subscription
this is the value returned prior to any publications
| inp | the subscription identifier |
| block | the data view representing the default value |
| std::invalid_argument | if id is invalid |
|
overridevirtual |
set a flag for the federate
| flag | an index into the flag /ref flag-definitions.h |
| flagValue | the value of the flag defaults to true |
Reimplemented from helics::Federate.
Reimplemented in helics::CombinationFederate.
References helics_flag_use_json_serialization, helics::Federate::setFlagOption(), and helics::Federate::useJsonSerialization.
Referenced by helics::CombinationFederate::setFlagOption().
| void helics::ValueFederate::setInputNotificationCallback | ( | Input & | inp, |
| std::function< void(Input &, Time)> | callback | ||
| ) |
register a callback function to call when the specified subscription is updated
| inp | an input to set the notification callback for |
| callback | the function to call |
| void helics::ValueFederate::setInputNotificationCallback | ( | std::function< void(Input &, Time)> | callback | ) |
register a callback function to call when any subscribed value is updated
there can only be one generic callback
| callback | the function to call signature void(input_id_t, Time) |
Referenced by helics::InputT< X >::setInputNotificationCallback().
|
overrideprotectedvirtual |
function to deal with any operations that need to occur on the transition from startup to initialize
Reimplemented from helics::Federate.
Reimplemented in helics::CombinationFederate.
Referenced by helics::CombinationFederate::startupToInitializeStateTransition().
function to deal with any operations that need to occur on a time update
Reimplemented from helics::Federate.
Reimplemented in helics::CombinationFederate.
Referenced by helics::CombinationFederate::updateTime().
1.8.17