9 template<
typename UserType,
typename RawConverter>
16 void toRaw(UserType cooked, std::byte*
raw)
override;
19 RawConverter _converter;
24 template<
typename UserType,
typename RawConverter>
26 using RawType = RawConverter::raw_type;
28 std::memcpy(&rawValue,
raw,
sizeof(RawType));
29 return _converter.toCooked(rawValue);
34 template<
typename UserType,
typename RawConverter>
36 using RawType = RawConverter::raw_type;
37 RawType rawValue = _converter.toRaw(cooked);
38 std::memcpy(
raw, &rawValue,
sizeof(RawType));
44 template<
typename UserType>
47 std::shared_ptr<RawConverterCapsule<UserType>> rv;
50 using RawType = std::make_unsigned_t<decltype(dummy)>;
51 ChimeraTK::RawConverter::withConverter<UserType, RawType>(info, channelIndex, [&](auto converter) {
52 rv = std::make_shared<RawConverterCapsuleImpl<UserType, decltype(converter)>>(converter);
#define INSTANTIATE_TEMPLATE_FOR_CHIMERATK_USER_TYPES_NO_VOID(TemplateClass)
std::vector< ChannelInfo > channels
Define per-channel information (bit interpretation etc.), 1D/scalars have exactly one entry.
This abstract class encapsulates a RawConverter to erase the exact RawConverter type (with all its te...
static std::shared_ptr< RawConverterCapsule< UserType > > makeCapsule(const ChimeraTK::NumericAddressedRegisterInfo &info, size_t channelIndex)
void toRaw(UserType cooked, std::byte *raw) override
UserType toCooked(std::byte *raw) override
RawConverterCapsuleImpl(RawConverter converter)
We are using temporary proxy classes to realise element access with fixed point conversion.
void callForRawType(const DataType &type, LAMBDATYPE lambda)
callForRawType() is similar to callForType(), just with a subset of supported data types which can be...
@ raw
Raw access: disable any possible conversion from the original hardware data type into the given UserT...