ChimeraTK-DeviceAccess 03.27.00
Loading...
Searching...
No Matches
SubdeviceConvertingRawDecorator.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Deutsches Elektronen-Synchrotron DESY, MSK, ChimeraTK Project <chimeratk-support@desy.de>
2// SPDX-License-Identifier: LGPL-3.0-or-later
3#pragma once
4
6#include "RawConverter.h"
7
8namespace ChimeraTK {
9
10 /********************************************************************************************************************/
11
12 template<typename TargetUserType>
13 class ConvertingRawDecorator : public NDRegisterAccessorDecorator<TargetUserType> {
14 public:
16 NumericAddressedRegisterInfo const& registerInfo);
17
18 template<typename COOKED_TYPE>
19 // NOLINTNEXTLINE(readability-identifier-naming)
20 COOKED_TYPE getAsCooked_impl(unsigned int channel, unsigned int sample);
21
22 template<typename COOKED_TYPE>
23 // NOLINTNEXTLINE(readability-identifier-naming)
24 void setAsCooked_impl(unsigned int channel, unsigned int sample, COOKED_TYPE value);
25
26 [[nodiscard]] bool mayReplaceOther(const boost::shared_ptr<ChimeraTK::TransferElement const>& other) const override;
27
28 protected:
31 FixedPointConvertingRawDecorator<TargetUserType>, getAsCooked_impl, 2);
33 FixedPointConvertingRawDecorator<TargetUserType>, setAsCooked_impl, 3);
34
35 using NDRegisterAccessorDecorator<TargetUserType>::_target;
36 using NDRegisterAccessor<TargetUserType>::buffer_2D;
37 };
38
39 /********************************************************************************************************************/
40
42
43 // FIXME: get rid of the deprecated signed raw
44 extern template class ConvertingRawDecorator<int8_t>;
45 extern template class ConvertingRawDecorator<int16_t>;
46 extern template class ConvertingRawDecorator<int32_t>;
47 extern template class ConvertingRawDecorator<int64_t>;
48
49} // namespace ChimeraTK
#define DECLARE_TEMPLATE_FOR_CHIMERATK_RAW_TYPES(TemplateClass)
DEFINE_VIRTUAL_FUNCTION_TEMPLATE_VTABLE_FILLER(FixedPointConvertingRawDecorator< TargetUserType >, getAsCooked_impl, 2)
DEFINE_VIRTUAL_FUNCTION_TEMPLATE_VTABLE_FILLER(FixedPointConvertingRawDecorator< TargetUserType >, setAsCooked_impl, 3)
COOKED_TYPE getAsCooked_impl(unsigned int channel, unsigned int sample)
void setAsCooked_impl(unsigned int channel, unsigned int sample, COOKED_TYPE value)
bool mayReplaceOther(const boost::shared_ptr< ChimeraTK::TransferElement const > &other) const override
Base class for decorators of the NDRegisterAccessor.
N-dimensional register accessor.
std::vector< std::vector< UserType > > buffer_2D
Buffer of converted data elements.