helics
3.5.1
|
#include <Federate.hpp>
Public Member Functions | |
Interface (Federate *federate, InterfaceHandle hid, std::string_view actName) | |
Interface (Core *core, InterfaceHandle hid, 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 * | mCore {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(), getName(), and mCore.
void helics::Interface::addDestinationTarget | ( | std::string_view | newTarget, |
InterfaceType | hint = InterfaceType::UNKNOWN |
||
) |
add destination for data sent via the interface
References helics::Core::addDestinationTarget(), handle, and mCore.
Referenced by helicsFilterAddDestinationTarget(), 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(), handle, and mCore.
Referenced by helicsFilterAddSourceTarget(), and helics::CloningFilter::setString().
void helics::Interface::close | ( | ) |
close the interface
References helics::Core::closeHandle(), helics::CoreFactory::getEmptyCorePtr(), handle, and mCore.
void helics::Interface::disconnectFromCore | ( | ) |
disconnect the object from the core
References helics::CoreFactory::getEmptyCorePtr(), and mCore.
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 helics::Core::getDestinationTargets(), handle, and mCore.
|
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::Translator, helics::Publication, helics::Input, helics::Filter, and helics::Endpoint.
References getSourceTargets(), 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 helics::Core::getExtractionType(), handle, and mCore.
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 helics::Core::getExtractionUnits(), handle, and mCore.
|
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 helics::Core::getInterfaceInfo(), handle, and mCore.
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 helics::Core::getInjectionType(), handle, and mCore.
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 helics::Core::getInjectionUnits(), handle, and mCore.
|
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 helics::Core::getHandleName(), handle, and mCore.
Referenced by helics::ValueFederateManager::addAlias(), addAlias(), helicsFilterGetName(), helicsTranslatorGetName(), and helics::apps::Probe::initialize().
|
virtual |
get the current value of a flag for the handle
Reimplemented in helics::Input.
References helics::Core::getHandleOption(), handle, and mCore.
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 helics::Core::getSourceTargets(), handle, and mCore.
Referenced by getDisplayName().
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 helics::Core::getInterfaceTag(), handle, and mCore.
const std::string & helics::Interface::getTarget | ( | ) | const |
get an associated target
References helics::Core::getSourceTargets(), handle, and mCore.
|
inline |
check if the Publication links to a valid operation
Referenced by helics::ValueFederateManager::addAlias(), helics::MessageFederate::getEndpoint(), helics::Federate::getFilter(), helics::Federate::getTranslator(), helicsFederateGetPublication(), helicsFederateGetPublicationByIndex(), helicsFilterIsValid(), helicsTranslatorIsValid(), 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 handle, mCore, and helics::Core::removeTarget().
Referenced by helicsFilterRemoveTarget(), helicsTranslatorRemoveTarget(), and helics::CloningFilter::setString().
void helics::Interface::setInfo | ( | std::string_view | info | ) |
set the interface information field of the input
References handle, mCore, and helics::Core::setInterfaceInfo().
|
virtual |
set a handle flag for the input
Reimplemented in helics::Input.
References handle, mCore, 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 handle, mCore, and helics::Core::setInterfaceTag().