![]() |
helics
3.3.0
|
#include <Federate.hpp>
Public Member Functions | |
Interface (Federate *federate, InterfaceHandle id, std::string_view actName) | |
Interface (Core *core, InterfaceHandle id, std::string_view actName) | |
InterfaceHandle | getHandle () const |
operator InterfaceHandle () const | |
bool | isValid () const |
bool | operator< (const Interface &inp) const |
bool | operator> (const Interface &inp) const |
bool | operator== (const Interface &inp) const |
bool | operator!= (const Interface &inp) const |
const std::string & | getLocalName () const |
const std::string & | getName () const |
const std::string & | getTarget () const |
void | addSourceTarget (std::string_view newTarget, InterfaceType hint=InterfaceType::UNKNOWN) |
void | addDestinationTarget (std::string_view newTarget, InterfaceType hint=InterfaceType::UNKNOWN) |
void | removeTarget (std::string_view targetToRemove) |
void | addAlias (std::string_view alias) |
const std::string & | getInfo () const |
void | setInfo (std::string_view info) |
void | setTag (std::string_view tag, std::string_view value) |
const std::string & | getTag (std::string_view tag) const |
virtual void | setOption (int32_t option, int32_t value=1) |
virtual int32_t | getOption (int32_t option) const |
const std::string & | getInjectionType () const |
const std::string & | getExtractionType () const |
const std::string & | getInjectionUnits () const |
const std::string & | getExtractionUnits () const |
virtual const std::string & | getDisplayName () const =0 |
const std::string & | getSourceTargets () const |
const std::string & | getDestinationTargets () const |
void | close () |
void | disconnectFromCore () |
Protected Attributes | |
Core * | cr {nullptr} |
pointer to the core object | |
InterfaceHandle | handle {} |
the id as generated by the Federate | |
std::string | mName |
the name or key of the interface | |
base class for the interface objects
void helics::Interface::addAlias | ( | std::string_view | alias | ) |
add an alternate global name for an interface
References helics::Core::addAlias(), cr, and getName().
void helics::Interface::addDestinationTarget | ( | std::string_view | newTarget, |
InterfaceType | hint = InterfaceType::UNKNOWN |
||
) |
add destination for data sent via the interface
References helics::Core::addDestinationTarget(), cr, and handle.
Referenced by helics::Endpoint::setDefaultDestination(), and helics::CloningFilter::setString().
void helics::Interface::addSourceTarget | ( | std::string_view | newTarget, |
InterfaceType | hint = InterfaceType::UNKNOWN |
||
) |
add a source of information to an interface
References helics::Core::addSourceTarget(), cr, and handle.
Referenced by helics::CloningFilter::setString().
void helics::Interface::close | ( | ) |
close the interface
References helics::Core::closeHandle(), cr, helics::CoreFactory::getEmptyCorePtr(), and handle.
void helics::Interface::disconnectFromCore | ( | ) |
disconnect the object from the core
References cr, and helics::CoreFactory::getEmptyCorePtr().
const std::string & helics::Interface::getDestinationTargets | ( | ) | const |
get the destination targets for an interface, either the destinations of data for endpoints or publications, or the destination endpoints for a filter
References cr, helics::Core::getDestinationTargets(), and handle.
|
pure virtual |
get the display name for an input
the name is the given local name or if empty the name of the target
Implemented in helics::Input, helics::Publication, helics::Endpoint, helics::Filter, and helics::Translator.
References getTarget(), and mName.
const std::string & helics::Interface::getExtractionType | ( | ) | const |
get the extraction type for an interface, this is the type for data coming out of an interface
for filters this is the output type, for publications this is the specified type, for endpoints this is the specified type and for inputs this is the specified type
References cr, helics::Core::getExtractionType(), and handle.
const std::string & helics::Interface::getExtractionUnits | ( | ) | const |
get the extraction units for an interface, this is the units associated with data coming out of an interface
for publications this is the specified units, for inputs this is the specified type
References cr, helics::Core::getExtractionUnits(), and handle.
|
inline |
get the underlying handle that can be used to make direct calls to the Core API
Referenced by helics::Federate::setFilterOperator(), and helics::Federate::setTranslatorOperator().
const std::string & helics::Interface::getInfo | ( | ) | const |
get the interface information field of the input
References cr, helics::Core::getInterfaceInfo(), and handle.
const std::string & helics::Interface::getInjectionType | ( | ) | const |
get the injection type for an interface, this is the type for data coming into an interface
for filters this is the input type, for publications this is the type used to transmit data, for endpoints this is the specified type and for inputs this is the type of the transmitting publication
References cr, helics::Core::getInjectionType(), and handle.
const std::string & helics::Interface::getInjectionUnits | ( | ) | const |
get the injection units for an interface, this is the units associated with data coming into an interface
for inputs this is the input type, for publications this is the units used to transmit data, and for inputs this is the units of the transmitting publication
References cr, helics::Core::getInjectionUnits(), and handle.
|
inline |
get the Name/Key for the input
the name is the local name if given, key is the full key name
const std::string & helics::Interface::getName | ( | ) | const |
get the Name/Key for the input
the name is the local name if given, key is the full key name
References cr, helics::Core::getHandleName(), and handle.
Referenced by helics::ValueFederateManager::addAlias(), and addAlias().
|
virtual |
get the current value of a flag for the handle
Reimplemented in helics::Input.
References cr, helics::Core::getHandleOption(), and handle.
Referenced by helics::Input::getOption().
const std::string & helics::Interface::getSourceTargets | ( | ) | const |
get the source targets for an interface, either the sources for endpoints or inputs, or the source endpoints for a filter
References cr, helics::Core::getSourceTargets(), and handle.
const std::string & helics::Interface::getTag | ( | std::string_view | tag | ) | const |
get the value of a specific tag (key-value pair) for an interface
the tag is an arbitrary user defined string and value; the tags for an interface are queryable
tag | the name of the tag to get the value for |
References cr, helics::Core::getInterfaceTag(), and handle.
const std::string & helics::Interface::getTarget | ( | ) | const |
get an associated target
References cr, helics::Core::getSourceTargets(), and handle.
Referenced by getDisplayName().
|
inline |
check if the Publication links to a valid operation
Referenced by helics::ValueFederateManager::addAlias(), helics::Federate::getFilter(), helics::Federate::getTranslator(), and helics::ValueFederateManager::setDefaultValue().
|
inline |
implicit conversion operator for extracting the handle
void helics::Interface::removeTarget | ( | std::string_view | targetToRemove | ) |
remove a named interface from the target lists
References cr, handle, and helics::Core::removeTarget().
Referenced by helics::CloningFilter::setString().
void helics::Interface::setInfo | ( | std::string_view | info | ) |
set the interface information field of the input
References cr, handle, and helics::Core::setInterfaceInfo().
|
virtual |
set a handle flag for the input
Reimplemented in helics::Input.
References cr, handle, and helics::Core::setHandleOption().
Referenced by helics::Input::setOption().
void helics::Interface::setTag | ( | std::string_view | tag, |
std::string_view | value | ||
) |
set a tag (key-value pair) for an interface
the tag is an arbitrary user defined string and value; the tags for an interface are queryable
tag | the name of the tag to set the value for |
value | the value for the given tag |
References cr, handle, and helics::Core::setInterfaceTag().