helics  3.5.2
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
helics::Translator Class Reference

#include <Translator.hpp>

+ Inheritance diagram for helics::Translator:

Public Member Functions

 Translator ()=default
 
 Translator (Federate *ffed, std::string_view translatorName, InterfaceHandle ihandle)
 
 Translator (Core *core, std::string_view translatorName, InterfaceHandle ihandle)
 
 Translator (Core *core, std::string_view translatorName=emptyString)
 
virtual ~Translator ()=default
 
 Translator (Translator &&trans)=default
 
 Translator (const Translator &trans)=default
 
Translatoroperator= (Translator &&trans)=default
 
Translatoroperator= (const Translator &trans)=default
 
void setOperator (std::shared_ptr< TranslatorOperator > operation)
 
virtual const std::string & getDisplayName () const override
 
virtual void set (std::string_view property, double val)
 
virtual void setString (std::string_view property, std::string_view val)
 
void addPublication (std::string_view target)
 
void addInputTarget (std::string_view target)
 
void addSourceEndpoint (std::string_view target)
 
void addDestinationEndpoint (std::string_view target)
 
void addSourceFilter (std::string_view filterName)
 
void addDestinationFilter (std::string_view filterName)
 
void setTranslatorType (std::int32_t type)
 
- Public Member Functions inherited from helics::Interface
 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
 
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 Member Functions

void setTranslatorOperations (std::shared_ptr< TranslatorOperations > translatorOps)
 

Protected Attributes

bool disableAssign = false
 disable assignment for the object
 
- Protected Attributes inherited from helics::Interface
CoremCore {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
 

Friends

void addOperations (Translator *translator, TranslatorTypes type)
 

Detailed Description

class for managing a particular translator

Constructor & Destructor Documentation

◆ Translator() [1/5]

helics::Translator::Translator ( )
default

default constructor

◆ Translator() [2/5]

helics::Translator::Translator ( Federate ffed,
std::string_view  translatorName,
InterfaceHandle  ihandle 
)

construct from handle and federate

◆ Translator() [3/5]

helics::Translator::Translator ( Core core,
std::string_view  translatorName,
InterfaceHandle  ihandle 
)

construct from handle and core

◆ Translator() [4/5]

helics::Translator::Translator ( Core core,
std::string_view  translatorName = emptyString 
)
explicit

◆ ~Translator()

virtual helics::Translator::~Translator ( )
virtualdefault

virtual destructor

◆ Translator() [5/5]

helics::Translator::Translator ( const Translator trans)
default

copy the translator, a copied translator will point to the same object

Member Function Documentation

◆ addDestinationFilter()

void helics::Translator::addDestinationFilter ( std::string_view  filterName)
inline

add a named filter to an endpoint for all message going to the endpoint

References helics::FILTER.

◆ getDisplayName()

virtual const std::string& helics::Translator::getDisplayName ( ) const
inlineoverridevirtual

get the display name for an input

the name is the given local name or if empty the name of the target

Implements helics::Interface.

◆ operator=()

Translator& helics::Translator::operator= ( const Translator trans)
default

copy the translator, a copied translator will point to the same object as the original

◆ set()

void helics::Translator::set ( std::string_view  property,
double  val 
)
virtual

set a property on a translator

Parameters
propertythe name of the property of the translator to change
valthe numerical value of the property

Referenced by helicsTranslatorSet().

◆ setOperator()

void helics::Translator::setOperator ( std::shared_ptr< TranslatorOperator operation)

set a message operator to process the message

References setTranslatorOperations().

◆ setString()

void helics::Translator::setString ( std::string_view  property,
std::string_view  val 
)
virtual

set a string property on a translator

Parameters
propertythe name of the property of the translator to change
valthe numerical value of the property

Referenced by helicsTranslatorSetString().

◆ setTranslatorOperations()

void helics::Translator::setTranslatorOperations ( std::shared_ptr< TranslatorOperations translatorOps)
protected

set a translator operations object

References helics::Interface::handle, helics::Interface::mCore, and helics::Core::setTranslatorOperator().

Referenced by setOperator().

◆ setTranslatorType()

void helics::Translator::setTranslatorType ( std::int32_t  type)

set the type of operations specifying how the translator should operate

References addOperations.

Referenced by helics::Federate::registerGlobalTranslator(), and helics::Federate::registerTranslator().

Friends And Related Function Documentation

◆ addOperations

void addOperations ( Translator translator,
TranslatorTypes  type 
)
friend

add a defined operation to a translator

Referenced by setTranslatorType().


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