![]() |
ChimeraTK-ApplicationCore 04.06.00
|
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 | |
| FanIn & | operator= (FanIn &&other) noexcept |
| FanIn (const FanIn &other)=delete | |
| FanIn & | operator= (const FanIn &other)=delete |
| FanIn ()=default | |
| const AbstractorType & | input (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 |
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.
| using ChimeraTK::FanIn< AccessorType >::AbstractorType = detail::FanIn::AccessorTypeHelper<AccessorType>::type |
| using ChimeraTK::FanIn< AccessorType >::AggregatorType = std::function<value_type(TransferElementID, const std::map<TransferElementID, AbstractorType>&)> |
| using ChimeraTK::FanIn< AccessorType >::out_type = detail::FanIn::AccessorTypeHelper<AccessorType>::out_type |
| using ChimeraTK::FanIn< AccessorType >::value_type = typename AccessorType::value_type |
| 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.
| owner | See normal accessors. |
| name | See normal accessors. |
| unit | See normal accessors. |
| description | See normal accessors. |
| tags | See normal accessors. |
| aggregator | Functor which is called for each incoming change. It must accept two arguments:
|
If the user is just interested in the most recent value, regardles of its source, simply pass keepLastValue as an aggregator.
| 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.
| owner | See normal accessors. |
| name | See normal accessors. |
| additionalNames | Names (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. |
| unit | See normal accessors. |
| description | See normal accessors. |
| tags | See normal accessors. |
| aggregator | See other constructor signature. |
|
inlinenoexcept |
|
delete |
|
default |
|
inline |
|
inline |
| auto ChimeraTK::FanIn< AccessorType >::inputs | ( | ) |
| auto ChimeraTK::FanIn< AccessorType >::inputs | ( | ) | const |
|
delete |
|
noexcept |
|
inline |
|
protected |