| helics 3.6.1

Public Member Functions | Protected Attributes | List of all members
helics::Interface Class Referenceabstract

`#include <Federate.hpp>`

Inheritance diagram for helics::Interface:

## 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
std::size_t | getSourceTargetCount () const
std::size_t | getDestinationTargetCount () 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

## Detailed Description

base class for the interface objects

## Member Function Documentation

## ◆ addAlias()

void helics::Interface::addAlias | ( | std::string_view | alias | ) |

add an alternate global name for an interface

References helics::Core::addAlias(), getName(), and mCore.

## ◆ addDestinationTarget()

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().

## ◆ addSourceTarget()

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().

## ◆ close()

void helics::Interface::close | ( |  | ) |

close the interface

References helics::Core::closeHandle(), helics::CoreFactory::getEmptyCorePtr(), handle, and mCore.

## ◆ disconnectFromCore()

void helics::Interface::disconnectFromCore | ( |  | ) |

disconnect the object from the core

References helics::CoreFactory::getEmptyCorePtr(), and mCore.

## ◆ getDestinationTargetCount()

std::size_t helics::Interface::getDestinationTargetCount | ( |  | ) | const

get the number of destination targets

References getDestinationTargets().

## ◆ getDestinationTargets()

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.

Referenced by getDestinationTargetCount().

## ◆ getDisplayName()

const std::string & helics::Interface::getDisplayName | ( |  | ) | const
| 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.

## ◆ getExtractionType()

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

Returns
  a const ref to std::string

References helics::Core::getExtractionType(), handle, and mCore.

## ◆ getExtractionUnits()

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

Returns
  a const ref to std::string

References helics::Core::getExtractionUnits(), handle, and mCore.

## ◆ getHandle()

InterfaceHandle helics::Interface::getHandle | ( |  | ) | const
| inline

get the underlying handle that can be used to make direct calls to the Core API

## ◆ getInfo()

const std::string & helics::Interface::getInfo | ( |  | ) | const

get the interface information field of the input

References helics::Core::getInterfaceInfo(), handle, and mCore.

## ◆ getInjectionType()

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

Returns
  a const ref to std::string

References helics::Core::getInjectionType(), handle, and mCore.

## ◆ getInjectionUnits()

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

Returns
  a const ref to std::string

References helics::Core::getInjectionUnits(), handle, and mCore.

## ◆ getLocalName()

const std::string& helics::Interface::getLocalName | ( |  | ) | const
| inline

get the Name/Key for the input

the name is the local name if given, key is the full key name

## ◆ getName()

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().

## ◆ getOption()

int32_t helics::Interface::getOption | ( | int32_t | option | ) | const
| 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().

## ◆ getSourceTargetCount()

std::size_t helics::Interface::getSourceTargetCount | ( |  | ) | const

get the number of source targets

References getSourceTargets().

## ◆ getSourceTargets()

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(), and getSourceTargetCount().

## ◆ getTag()

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

Parameters

  tag | the name of the tag to get the value for

Returns
  a const std::string& containing the value of the tag, if the tag is not defined the value is an empty string

References helics::Core::getInterfaceTag(), handle, and mCore.

## ◆ getTarget()

const std::string & helics::Interface::getTarget | ( |  | ) | const

get an associated target

References helics::Core::getSourceTargets(), handle, and mCore.

## ◆ isValid()

bool helics::Interface::isValid | ( |  | ) | const
| inline

check if the Publication links to a valid operation

Referenced by helics::ValueFederateManager::addAlias(), helics::MessageFederate::getEndpoint(), helics::Federate::getFilter(), helics::Federate::getTranslator(), helicsFederateGetInput(), helicsFederateGetInputByIndex(), helicsFederateGetInputByTarget(), helicsFederateGetPublication(), helicsFederateGetPublicationByIndex(), helicsFilterIsValid(), helicsTranslatorIsValid(), and helics::ValueFederateManager::setDefaultValue().

## ◆ operator InterfaceHandle()

helics::Interface::operator InterfaceHandle | ( |  | ) | const
| inline

implicit conversion operator for extracting the handle

## ◆ removeTarget()

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().

## ◆ setInfo()

void helics::Interface::setInfo | ( | std::string_view | info | ) |

set the interface information field of the input

References handle, mCore, and helics::Core::setInterfaceInfo().

## ◆ setOption()

void helics::Interface::setOption | ( | int32_t | option,
|  | int32_t | value = `1`
| ) |  |
| virtual

set a handle flag for the input

Reimplemented in helics::Input.

References handle, mCore, and helics::Core::setHandleOption().

Referenced by helics::Input::setOption().

## ◆ setTag()

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

Parameters

  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().

The documentation for this class was generated from the following files:

- application_api/Federate.hpp
- Federate.cpp