helics  2.8.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, const std::string &filtName=EMPTY_STRING)
 
 Filter (Federate *ffed, const std::string &filtName, interface_handle ihandle)
 
 Filter (interface_visibility locality, Federate *ffed, const std::string &filtName=EMPTY_STRING)
 
 Filter (Core *cr, const std::string &filtName=EMPTY_STRING)
 
virtual ~Filter ()=default
 
 Filter (Filter &&filt)=default
 
 Filter (const Filter &filt)=default
 
Filteroperator= (Filter &&filt)=default
 
Filteroperator= (const Filter &filt)=default
 
bool isValid () const
 
bool isCloningFilter () const
 
void setOperator (std::shared_ptr< FilterOperator > mo)
 
interface_handle getHandle () const
 
 operator interface_handle () const
 
const std::string & getName () const
 
const std::string & getKey () const
 
const std::string & getInjectionType () const
 
const std::string & getExtractionType () const
 
const std::string & getInfo () const
 
void setInfo (const std::string &info)
 
virtual void set (const std::string &property, double val)
 
virtual void setString (const std::string &property, const std::string &val)
 
virtual void addSourceTarget (const std::string &sourceName)
 
virtual void addDestinationTarget (const std::string &destinationName)
 
void addTarget (const std::string &target)
 
virtual void removeTarget (const std::string &sourceName)
 
void setOption (int32_t option, int32_t value)
 
void close ()
 
int32_t getOption (int32_t option) const
 

Protected Member Functions

void setFilterOperations (std::shared_ptr< FilterOperations > filterOps)
 

Protected Attributes

CorecorePtr = nullptr
 the Core to use
 
Federatefed = nullptr
 pointer to fed
 
interface_handle handle
 the handle as generated by the Federate
 
bool cloning = false
 
bool disableAssign = false
 disable assignment for the object
 
std::string name
 The name of the filter.
 

Friends

void addOperations (Filter *filt, filter_types type, Core *cptr)
 

Detailed Description

class for managing a particular filter

Constructor & Destructor Documentation

◆ Filter() [1/6]

helics::Filter::Filter ( )
default

default constructor

◆ Filter() [2/6]

helics::Filter::Filter ( Federate ffed,
const std::string &  filtName = EMPTY_STRING 
)
explicit

construct through a federate

◆ Filter() [3/6]

helics::Filter::Filter ( Federate ffed,
const std::string &  filtName,
interface_handle  ihandle 
)

construct from handle

References corePtr, and helics::Federate::getCorePointer().

◆ Filter() [4/6]

helics::Filter::Filter ( interface_visibility  locality,
Federate ffed,
const std::string &  filtName = EMPTY_STRING 
)

construct through a federate

References corePtr, and helics::Federate::getCorePointer().

◆ Filter() [5/6]

helics::Filter::Filter ( Core cr,
const std::string &  filtName = EMPTY_STRING 
)
explicit

construct through a core object

References corePtr, fed, handle, and helics::Core::registerFilter().

◆ ~Filter()

virtual helics::Filter::~Filter ( )
virtualdefault

virtual destructor

◆ Filter() [6/6]

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

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

Member Function Documentation

◆ addDestinationTarget()

void helics::Filter::addDestinationTarget ( const std::string &  destinationName)
virtual

add a destination endpoint to the list of endpoints to clone

References helics::Core::addDestinationTarget(), corePtr, and handle.

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

◆ addSourceTarget()

void helics::Filter::addSourceTarget ( const std::string &  sourceName)
virtual

add a sourceEndpoint to the list of endpoint to clone

References helics::Core::addSourceTarget(), corePtr, and handle.

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

◆ addTarget()

void helics::Filter::addTarget ( const std::string &  target)
inline

alias for addSourceTarget

◆ close()

void helics::Filter::close ( )

close a filter during an active simulation

it is not necessary to call this function unless you are continuing the simulation after the close

References helics::Core::closeHandle(), corePtr, and handle.

◆ getExtractionType()

const std::string & helics::Filter::getExtractionType ( ) const

get the specified output type of the filter

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

◆ getHandle()

interface_handle helics::Filter::getHandle ( ) const
inline

get the underlying core handle for use with a core

Referenced by helics::Federate::addDestinationTarget(), helics::Federate::addSourceTarget(), and helics::Federate::setFilterOperator().

◆ getInfo()

const std::string & helics::Filter::getInfo ( ) const

get the interface information field of the publication

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

◆ getInjectionType()

const std::string & helics::Filter::getInjectionType ( ) const

get the specified input type of the filter

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

◆ getKey()

const std::string & helics::Filter::getKey ( ) const

get the full global key for the filter

References corePtr, helics::Core::getHandleName(), and handle.

◆ getName()

const std::string& helics::Filter::getName ( ) const
inline

get the name for the filter

◆ getOption()

int32_t helics::Filter::getOption ( int32_t  option) const

get the current value of a flag for the handle

References corePtr, helics::Core::getHandleOption(), and handle.

◆ isCloningFilter()

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

check if the filter is a cloning filter

◆ isValid()

bool helics::Filter::isValid ( ) const
inline

check if the Filter links to a valid filter

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

◆ operator interface_handle()

helics::Filter::operator interface_handle ( ) const
inline

implicit conversion operator for extracting the handle

◆ operator=()

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

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

◆ removeTarget()

void helics::Filter::removeTarget ( const std::string &  sourceName)
virtual

remove a sourceEndpoint to the list of endpoint to clone

References corePtr, handle, and helics::Core::removeTarget().

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

◆ set()

void helics::Filter::set ( const std::string &  property,
double  val 
)
virtual

set a property on a filter

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

◆ setFilterOperations()

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

set a filter operations object

References corePtr, handle, and helics::Core::setFilterOperator().

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

◆ setInfo()

void helics::Filter::setInfo ( const std::string &  info)

set the interface information field of the publication

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

◆ setOperator()

void helics::Filter::setOperator ( std::shared_ptr< FilterOperator mo)

set a message operator to process the message

References corePtr, handle, and helics::Core::setFilterOperator().

◆ setOption()

void helics::Filter::setOption ( int32_t  option,
int32_t  value 
)

set an interface option for a filter

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

◆ setString()

void helics::Filter::setString ( const std::string &  property,
const std::string &  val 
)
virtual

set a string property on a filter

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

Reimplemented in helics::CloningFilter.

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

Friends And Related Function Documentation

◆ addOperations

void addOperations ( Filter filt,
filter_types  type,
Core cptr 
)
friend

add a defined operation to a filter


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