| helics 3.6.1

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

`#include <Filters.hpp>`

Inheritance diagram for helics::Filter:

## Public Member Functions
| Filter ()=default
| Filter (Federate *ffed, std::string_view filtName=EMPTY_STRING)
| Filter (Federate *ffed, std::string_view filtName, InterfaceHandle ihandle)
| Filter (Core *core, std::string_view filtName, InterfaceHandle ihandle)
| Filter (InterfaceVisibility locality, Federate *ffed, std::string_view filtName=EMPTY_STRING)
| Filter (Core *core, std::string_view filtName=EMPTY_STRING)
virtual | ~Filter ()=default
| Filter (Filter &&filt)=default
| Filter (const Filter &filt)=default
Filter & | operator= (Filter &&filt)=default
Filter & | operator= (const Filter &filt)=default
bool | isCloningFilter () const
void | setOperator (std::shared_ptr< FilterOperator > filterOp)
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)
virtual std::string | getString (std::string_view property)
virtual double | getProperty (std::string_view property)
void | addTarget (std::string_view target)
void | setFilterType (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 | setFilterOperations (std::shared_ptr< FilterOperations > filterOps)

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

## Friends
void | addOperations (Filter *filt, FilterTypes type, Core *cptr)

## Detailed Description

class for managing a particular filter

## Constructor & Destructor Documentation

## ◆ Filter() [1/7]

helics::Filter::Filter | ( |  | ) |
| default

default constructor

## ◆ Filter() [2/7]

helics::Filter::Filter | ( | Federate * | ffed,
|  | std::string_view | filtName = `EMPTY_STRING`
| ) |  |
| explicit

construct through a federate

## ◆ Filter() [3/7]

helics::Filter::Filter | ( | Federate * | ffed,
|  | std::string_view | filtName,
|  | InterfaceHandle | ihandle
| ) |  |

construct from handle and federate

## ◆ Filter() [4/7]

helics::Filter::Filter | ( | Core * | core,
|  | std::string_view | filtName,
|  | InterfaceHandle | ihandle
| ) |  |

construct from handle and core

## ◆ Filter() [5/7]

helics::Filter::Filter | ( | InterfaceVisibility | locality,
|  | Federate * | ffed,
|  | std::string_view | filtName = `EMPTY_STRING`
| ) |  |

construct through a federate

## ◆ Filter() [6/7]

helics::Filter::Filter | ( | Core * | core,
|  | std::string_view | filtName = `EMPTY_STRING`
| ) |  |
| explicit

construct through a core object

References helics::Interface::handle, and helics::Core::registerFilter().

## ◆ ~Filter()

virtual helics::Filter::~Filter | ( |  | ) |
| virtual default

virtual destructor

## ◆ Filter() [7/7]

helics::Filter::Filter | ( | const Filter & | filt | ) |
| default

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

## Member Function Documentation

## ◆ addTarget()

void helics::Filter::addTarget | ( | std::string_view | target | ) |
| inline

add a target to the filter

## ◆ getDisplayName()

virtual const std::string& helics::Filter::getDisplayName | ( |  | ) | const
| inline override virtual

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.

## ◆ getProperty()

double helics::Filter::getProperty | ( | std::string_view | property | ) |
| virtual

get a double valued property of a filter

Parameters

  property | the name of the property of the filter to retrieve

References helics::invalidDouble.

Referenced by helicsFilterGetPropertyDouble().

## ◆ getString()

std::string helics::Filter::getString | ( | std::string_view | property | ) |
| virtual

get a string property on a filter

Parameters

  property | the name of the property of the filter to get

## ◆ isCloningFilter()

bool helics::Filter::isCloningFilter | ( |  | ) | const
| inline

check if the filter is a cloning filter

## ◆ operator=()

Filter& helics::Filter::operator= | ( | const Filter & | filt | ) |
| default

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

## ◆ set()

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

set a property on a filter

Parameters

  property | the name of the property of the filter to change
  val | the numerical value of the property

Referenced by helicsFilterSet().

## ◆ setFilterOperations()

void helics::Filter::setFilterOperations | ( | std::shared_ptr< FilterOperations > | filterOps | ) |
| protected

set a filter operations object

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

Referenced by helics::CloningFilter::CloningFilter().

## ◆ setFilterType()

void helics::Filter::setFilterType | ( | std::int32_t | type | ) |

set the type of operations specifying how the filter should operate

References addOperations.

## ◆ setOperator()

void helics::Filter::setOperator | ( | std::shared_ptr< FilterOperator > | filterOp | ) |

set a message operator to process the message

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

Referenced by helics::Federate::setFilterOperator().

## ◆ setString()

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

set a string property on a filter

Parameters

  property | the name of the property of the filter to change
  val | the numerical value of the property

Reimplemented in helics::CloningFilter.

Referenced by helics::CloningFilter::addDeliveryEndpoint(), helicsFilterSetString(), helics::CloningFilter::removeDeliveryEndpoint(), and helics::CloningFilter::setString().

## Friends And Related Function Documentation

## ◆ addOperations

void addOperations | ( | Filter * | filt,
|  | FilterTypes | type,
|  | Core * | cptr
| ) |  |
| friend

add a defined operation to a filter

Referenced by setFilterType().

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

- Filters.hpp
- Filters.cpp