![]() |
ChimeraTK-DeviceAccess 03.26.00
|
Converter class for conversions from raw to cooked values. More...
#include <RawConverter.h>
Public Member Functions | |
| Converter (const ChimeraTK::NumericAddressedRegisterInfo::ChannelInfo &info) | |
| UserType | toCooked (RawType rawValue) |
| RawType | toRaw (UserType cookedValue) |
Converter class for conversions from raw to cooked values.
For maximum performance, some template parameters are added so generate optimised code branches for various conversion cases. This allows us to implement some decisions in critical pathes as "if constexpr", at the expense of a more complicated construction of the converter object.
The accessors which use the Converter shall not be required to be templated on the exact converter type (which would not work in case of the 2D multiplexed accessor at all). Hence the ConverterLoopHelper class is introduced to erase this type through a virtual base class. This allows to write the loop code in the accessor implementation (which may need to be optimised in a particular way as well), while having the (non-virtual) Converter object available for conversion.
For implementing getAsCooked/setAsCooked (which are templated on the COOKED_TYPE and hence require a new converter instance on each call), the function withConverter() can be used.
Definition at line 40 of file RawConverter.h.
|
explicit |
Definition at line 366 of file RawConverter.h.
| UserType ChimeraTK::RawConverter::Converter< UserType, RawType, sc, fc, isSigned >::toCooked | ( | RawType | rawValue | ) |
Definition at line 427 of file RawConverter.h.
| RawType ChimeraTK::RawConverter::Converter< UserType, RawType, sc, fc, isSigned >::toRaw | ( | UserType | cookedValue | ) |
Definition at line 459 of file RawConverter.h.