ChimeraTK-DeviceAccess 03.26.00
Loading...
Searching...
No Matches
ChimeraTK::RawConverter::Converter< UserType, RawType, sc, fc, isSigned > Class Template Reference

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)
 

Detailed Description

template<typename UserType, typename RawType, SignificantBitsCase sc, FractionalCase fc, bool isSigned>
class ChimeraTK::RawConverter::Converter< UserType, RawType, sc, fc, isSigned >

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.

Constructor & Destructor Documentation

◆ Converter()

template<typename UserType , typename RawType , SignificantBitsCase sc, FractionalCase fc, bool isSigned>
ChimeraTK::RawConverter::Converter< UserType, RawType, sc, fc, isSigned >::Converter ( const ChimeraTK::NumericAddressedRegisterInfo::ChannelInfo info)
explicit

Definition at line 366 of file RawConverter.h.

Member Function Documentation

◆ toCooked()

template<typename UserType , typename RawType , SignificantBitsCase sc, FractionalCase fc, bool isSigned>
UserType ChimeraTK::RawConverter::Converter< UserType, RawType, sc, fc, isSigned >::toCooked ( RawType  rawValue)

Definition at line 427 of file RawConverter.h.

◆ toRaw()

template<typename UserType , typename RawType , SignificantBitsCase sc, FractionalCase fc, bool isSigned>
RawType ChimeraTK::RawConverter::Converter< UserType, RawType, sc, fc, isSigned >::toRaw ( UserType  cookedValue)

Definition at line 459 of file RawConverter.h.


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