ChimeraTK-ApplicationCore 04.06.00
Loading...
Searching...
No Matches
ChimeraTK::FanIn< AccessorType > Class Template Reference

Special accessor allows multiple incoming connections to the same logical process variable. More...

#include <FanIn.h>

+ Inheritance diagram for ChimeraTK::FanIn< AccessorType >:
+ Collaboration diagram for ChimeraTK::FanIn< AccessorType >:

Classes

class  Inputs
 

Public Types

using AbstractorType = detail::FanIn::AccessorTypeHelper< AccessorType >::type
 
using value_type = typename AccessorType::value_type
 
using AggregatorType = std::function< value_type(TransferElementID, const std::map< TransferElementID, AbstractorType > &)>
 
using out_type = detail::FanIn::AccessorTypeHelper< AccessorType >::out_type
 

Public Member Functions

 FanIn (VariableGroup *owner, std::string name, std::string unit, const std::string &description, AggregatorType aggregator, const std::unordered_set< std::string > &tags={})
 Construct FanIn.
 
 FanIn (VariableGroup *owner, std::string name, std::initializer_list< std::string > additionalNames, std::string unit, const std::string &description, AggregatorType aggregator, const std::unordered_set< std::string > &tags={})
 Construct FanIn with additional inputs.
 
 FanIn (FanIn &&other) noexcept
 
FanInoperator= (FanIn &&other) noexcept
 
 FanIn (const FanIn &other)=delete
 
FanInoperator= (const FanIn &other)=delete
 
 FanIn ()=default
 
const AbstractorTypeinput (const TransferElementID &id) const
 Return the internal input accessor for the given TransferElementID.
 
bool hasInput (const TransferElementID &id) const
 Check whether the given TransferElementID identifies an internal input.
 
auto inputs () const
 Return iterable range of all internal input accessors.
 
auto inputs ()
 Return iterable range of all internal input accessors.
 
void replace (FanIn &&other)
 

Protected Attributes

Inputs _inputs
 

Detailed Description

template<push_input AccessorType>
class ChimeraTK::FanIn< AccessorType >

Special accessor allows multiple incoming connections to the same logical process variable.

The FanIn is meant to be used with a ReadAnyGroup, hence its read functions are not available for the user. It will create internally one input for each incoming connection and alter the name of that internal process variable into something unique. The user must provide an aggergator function which decides how to map the incoming data onto a single value. The single value will then be made available through an internal output to other ApplicationModules, the control system and/or devices. It can also be accessed by the owing ApplicationModule code as if it were an ordinary ScalarPushInput or ArrayPushInput.

For convenience, it is recommended to use the type aliases ScalarFanIn, ArrayFanIn etc. instead of this class directly.

Definition at line 56 of file FanIn.h.

Member Typedef Documentation

◆ AbstractorType

template<push_input AccessorType>
using ChimeraTK::FanIn< AccessorType >::AbstractorType = detail::FanIn::AccessorTypeHelper<AccessorType>::type

Definition at line 58 of file FanIn.h.

◆ AggregatorType

template<push_input AccessorType>
using ChimeraTK::FanIn< AccessorType >::AggregatorType = std::function<value_type(TransferElementID, const std::map<TransferElementID, AbstractorType>&)>

Definition at line 60 of file FanIn.h.

◆ out_type

template<push_input AccessorType>
using ChimeraTK::FanIn< AccessorType >::out_type = detail::FanIn::AccessorTypeHelper<AccessorType>::out_type

Definition at line 62 of file FanIn.h.

◆ value_type

template<push_input AccessorType>
using ChimeraTK::FanIn< AccessorType >::value_type = typename AccessorType::value_type

Definition at line 59 of file FanIn.h.

Constructor & Destructor Documentation

◆ FanIn() [1/5]

template<push_input AccessorType>
ChimeraTK::FanIn< AccessorType >::FanIn ( VariableGroup owner,
std::string  name,
std::string  unit,
const std::string &  description,
AggregatorType  aggregator,
const std::unordered_set< std::string > &  tags = {} 
)

Construct FanIn.

Parameters
ownerSee normal accessors.
nameSee normal accessors.
unitSee normal accessors.
descriptionSee normal accessors.
tagsSee normal accessors.
aggregatorFunctor which is called for each incoming change. It must accept two arguments:
  • TransferElementID - id of the internal accessor receiving the change
  • std::map<TransferElementID, AbstractorType>) - map of all internal input accessors This functor can either just deal with the arriving value, or it can iterate all inputs and so somthing more complex with them.

If the user is just interested in the most recent value, regardles of its source, simply pass keepLastValue as an aggregator.

Definition at line 226 of file FanIn.h.

◆ FanIn() [2/5]

template<push_input AccessorType>
ChimeraTK::FanIn< AccessorType >::FanIn ( VariableGroup owner,
std::string  name,
std::initializer_list< std::string >  additionalNames,
std::string  unit,
const std::string &  description,
AggregatorType  aggregator,
const std::unordered_set< std::string > &  tags = {} 
)

Construct FanIn with additional inputs.

Parameters
ownerSee normal accessors.
nameSee normal accessors.
additionalNamesNames (relative or absolute) of additional PVs feeding into the FanIn. These can be also control system inputs. Note that each of the additional inputs can have only one feeder. Automatic faning in only works with the PV name defined by the name parameter.
unitSee normal accessors.
descriptionSee normal accessors.
tagsSee normal accessors.
aggregatorSee other constructor signature.

Definition at line 234 of file FanIn.h.

◆ FanIn() [3/5]

template<push_input AccessorType>
ChimeraTK::FanIn< AccessorType >::FanIn ( FanIn< AccessorType > &&  other)
inlinenoexcept

Definition at line 100 of file FanIn.h.

◆ FanIn() [4/5]

template<push_input AccessorType>
ChimeraTK::FanIn< AccessorType >::FanIn ( const FanIn< AccessorType > &  other)
delete

◆ FanIn() [5/5]

template<push_input AccessorType>
ChimeraTK::FanIn< AccessorType >::FanIn ( )
default

Member Function Documentation

◆ hasInput()

template<push_input AccessorType>
bool ChimeraTK::FanIn< AccessorType >::hasInput ( const TransferElementID &  id) const
inline

Check whether the given TransferElementID identifies an internal input.

Definition at line 114 of file FanIn.h.

◆ input()

template<push_input AccessorType>
const AbstractorType & ChimeraTK::FanIn< AccessorType >::input ( const TransferElementID &  id) const
inline

Return the internal input accessor for the given TransferElementID.

Definition at line 109 of file FanIn.h.

◆ inputs() [1/2]

template<push_input AccessorType>
auto ChimeraTK::FanIn< AccessorType >::inputs ( )

Return iterable range of all internal input accessors.

Definition at line 265 of file FanIn.h.

◆ inputs() [2/2]

template<push_input AccessorType>
auto ChimeraTK::FanIn< AccessorType >::inputs ( ) const

Return iterable range of all internal input accessors.

Definition at line 256 of file FanIn.h.

◆ operator=() [1/2]

template<push_input AccessorType>
FanIn & ChimeraTK::FanIn< AccessorType >::operator= ( const FanIn< AccessorType > &  other)
delete

◆ operator=() [2/2]

template<push_input AccessorType>
FanIn< AccessorType > & ChimeraTK::FanIn< AccessorType >::operator= ( FanIn< AccessorType > &&  other)
noexcept

Definition at line 243 of file FanIn.h.

◆ replace()

template<push_input AccessorType>
void ChimeraTK::FanIn< AccessorType >::replace ( FanIn< AccessorType > &&  other)
inline

Definition at line 126 of file FanIn.h.

Member Data Documentation

◆ _inputs

template<push_input AccessorType>
Inputs ChimeraTK::FanIn< AccessorType >::_inputs
protected

Definition at line 203 of file FanIn.h.


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