ChimeraTK-DeviceAccess  03.18.00
NumericAddressedBackendRegisterAccessor.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 
5 #include "createDataConverter.h"
6 #include "FixedPointConverter.h"
7 #include "ForwardDeclarations.h"
9 #include "NDRegisterAccessor.h"
11 
12 #include <ChimeraTK/cppext/finally.hpp>
13 
14 namespace ChimeraTK {
15 
16  template<typename UserType, typename DataConverterType, bool isRaw>
18 
19  /********************************************************************************************************************/
20 
24  template<typename UserType, typename DataConverterType, bool isRaw>
26  public:
27  NumericAddressedBackendRegisterAccessor(const boost::shared_ptr<DeviceBackend>& dev,
28  const RegisterPath& registerPathName, size_t numberOfWords, size_t wordOffsetInRegister, AccessModeFlags flags)
29  : NDRegisterAccessor<UserType>(registerPathName, flags), _dataConverter(registerPathName),
30  _dev(boost::dynamic_pointer_cast<NumericAddressedBackend>(dev)) {
31  // check for unknown flags
33 
34  // check device backend
35  _dev = boost::dynamic_pointer_cast<NumericAddressedBackend>(dev);
36  if(!_dev) {
37  throw ChimeraTK::logic_error("NumericAddressedBackendRegisterAccessor is used with a backend which is not "
38  "a NumericAddressedBackend.");
39  }
40 
41  // obtain register information
42  _registerInfo = _dev->getRegisterInfo(registerPathName);
43  assert(!_registerInfo.channels.empty());
44 
45  if(_registerInfo.elementPitchBits % 8 != 0) {
46  throw ChimeraTK::logic_error("NumericAddressedBackendRegisterAccessor: Elements must be byte aligned.");
47  }
48 
49  if(_registerInfo.channels.size() > 1) {
50  throw ChimeraTK::logic_error("NumericAddressedBackendRegisterAccessor is used with a 2D register.");
51  }
52 
53  if(_registerInfo.channels.front().bitOffset > 0) {
54  throw ChimeraTK::logic_error("NumericAddressedBackendRegisterAccessor: Registers must be byte aligned.");
55  }
56 
57  // check number of words
59  // in void registers we always create one element
60  if(numberOfWords == 0) {
61  numberOfWords = 1;
62  }
63  if(numberOfWords > 1) {
65  "Requested number of words is larger than 1 in VOID register '" + registerPathName + "'!");
66  }
67  if(wordOffsetInRegister > 0) {
68  throw ChimeraTK::logic_error("No offset allowed in VOID register '" + registerPathName + "'!");
69  }
70  }
71  else { // do the regular consistency check
72  if(numberOfWords == 0) {
73  numberOfWords = _registerInfo.getNumberOfElements();
74  }
75  if(numberOfWords + wordOffsetInRegister > _registerInfo.getNumberOfElements()) {
76  throw ChimeraTK::logic_error("Requested number of words (" + std::to_string(numberOfWords) + " + " +
77  std::to_string(wordOffsetInRegister) + ") exceeds the size (" +
78  std::to_string(_registerInfo.getNumberOfElements()) + ") of the register '" + registerPathName + "'!");
79  }
80  if(wordOffsetInRegister >= _registerInfo.getNumberOfElements()) {
81  throw ChimeraTK::logic_error("Requested offset (" + std::to_string(wordOffsetInRegister) +
82  ") exceeds the size (" + std::to_string(_registerInfo.getNumberOfElements()) + ") of the register'" +
83  registerPathName + "'!");
84  }
85  }
86 
87  // change registerInfo (local copy!) to account for given offset and length override
88  _registerInfo.address += wordOffsetInRegister * _registerInfo.elementPitchBits / 8;
89  _registerInfo.nElements = numberOfWords;
90 
91  // create low-level transfer element handling the actual data transfer to the hardware with raw data
92  assert(_registerInfo.elementPitchBits % 8 == 0);
93  _rawAccessor = boost::make_shared<NumericAddressedLowLevelTransferElement>(
95 
96  // allocated the buffers
99 
100  // We don't have to fill it in a special way if the accessor is raw
101  // because we have an overloaded, more efficient implementation
102  // in this case. So we can use it in setAsCooked() and getAsCooked()
103  _dataConverter = detail::createDataConverter<DataConverterType>(_registerInfo);
104 
105  if(flags.has(AccessMode::raw)) {
106  if(DataType(typeid(UserType)) != _registerInfo.getDataDescriptor().rawDataType()) {
107  throw ChimeraTK::logic_error("Given UserType when obtaining the NumericAddressedBackendRegisterAccessor in "
108  "raw mode does not match the expected type. Use an " +
110  " instead! (Register name: " + registerPathName + "')");
111  }
112  }
113 
116  }
117 
118  void doReadTransferSynchronously() override { _rawAccessor->readTransfer(); }
119 
120  bool doWriteTransfer(ChimeraTK::VersionNumber versionNumber) override {
122  _rawAccessor->writeTransfer(versionNumber);
123  return false;
124  }
125 
126  void doPostRead(TransferType type, bool hasNewData) override {
127  if(!_dev->isOpen()) return; // do not delegate if exception was thrown by us in doPreWrite
128 
129  _rawAccessor->setActiveException(this->_activeException);
130  _rawAccessor->postRead(type, hasNewData);
131 
132  if(!hasNewData) return;
133 
134  if constexpr(!isRaw || std::is_same<UserType, std::string>::value) {
136  typedef decltype(t) RawType;
137  auto itsrc = (RawType*)_rawAccessor->begin(_registerInfo.address);
138  _dataConverter.template vectorToCooked<UserType>(itsrc, itsrc + buffer_2D[0].size(), buffer_2D[0].begin());
139  });
140  }
141  else {
142  // optimised variant for raw transfers (unless type is a string)
143  auto* itsrc = _rawAccessor->begin(_registerInfo.address);
144  auto* itdst = buffer_2D[0].data();
145  memcpy(itdst, itsrc, buffer_2D[0].size() * sizeof(UserType));
146  }
147 
148  // we don't put the setting of the version number into the PrePostActionImplementor
149  // because it does not need template specialisation, and the implementer does not
150  // know about _versionNumber. It's just easier here.
151  this->_versionNumber = _rawAccessor->getVersionNumber();
152  this->_dataValidity = _rawAccessor->dataValidity();
153  }
154 
155  void doPreWrite(TransferType type, VersionNumber versionNumber) override {
156  if(!_dev->isOpen()) throw ChimeraTK::logic_error("Device not opened.");
157  // raw accessor preWrite must be called before our _prePostActionsImplementor.doPreWrite(), as it needs to
158  // prepare the buffer in case of unaligned access and acquire the lock.
159  _rawAccessor->preWrite(type, versionNumber);
160 
161  if constexpr(!isRaw || std::is_same<UserType, std::string>::value) {
162  if(!_registerInfo.isWriteable()) {
164  "NumericAddressedBackend: Writing to a non-writeable register is not allowed (Register name: " +
165  _registerInfo.getRegisterName() + ").");
166  }
168  typedef decltype(t) RawType;
169  auto itsrc = (RawType*)_rawAccessor->begin(_registerInfo.address);
170  for(auto itdst = buffer_2D[0].begin(); itdst != buffer_2D[0].end(); ++itdst) {
171  *itsrc = _dataConverter.template toRaw<UserType>(*itdst);
172  ++itsrc;
173  }
174  });
175  }
176  else {
177  // optimised variant for raw transfers (unless type is a string)
178  auto* itdst = _rawAccessor->begin(_registerInfo.address);
179  auto itsrc = buffer_2D[0].begin();
180  memcpy(&(*itdst), &(*itsrc), buffer_2D[0].size() * sizeof(UserType));
181  }
182 
183  _rawAccessor->setDataValidity(this->_dataValidity);
184  }
185 
186  void doPreRead(TransferType type) override {
187  if(!_dev->isOpen()) throw ChimeraTK::logic_error("Device not opened.");
188  if(!_registerInfo.isReadable()) {
190  "NumericAddressedBackend: Reading from a non-readable register is not allowed (Register name: " +
191  _registerInfo.getRegisterName() + ").");
192  }
193  _rawAccessor->preRead(type);
194  }
195 
196  void doPostWrite(TransferType type, VersionNumber versionNumber) override {
197  if(!_dev->isOpen()) return; // do not delegate if exception was thrown by us in doPreWrite
198  _rawAccessor->setActiveException(this->_activeException);
199  _rawAccessor->postWrite(type, versionNumber);
200  }
201 
202  [[nodiscard]] bool mayReplaceOther(const boost::shared_ptr<TransferElement const>& other) const override {
203  auto rhsCasted = boost::dynamic_pointer_cast<
205  if(!rhsCasted) return false;
206  if(_dev != rhsCasted->_dev) return false;
207  if(_registerInfo != rhsCasted->_registerInfo) return false;
208  if(_dataConverter != rhsCasted->_dataConverter) return false;
209  return true;
210  }
211 
212  [[nodiscard]] bool isReadOnly() const override { return isReadable() && !isWriteable(); }
213 
214  [[nodiscard]] bool isReadable() const override { return _registerInfo.isReadable(); }
215 
216  [[nodiscard]] bool isWriteable() const override { return _registerInfo.isWriteable(); }
217 
218  template<typename COOKED_TYPE>
219  COOKED_TYPE getAsCooked_impl(unsigned int channel, unsigned int sample);
220 
221  template<typename COOKED_TYPE>
222  void setAsCooked_impl(unsigned int channel, unsigned int sample, COOKED_TYPE value);
223 
224  // a local typename so the DEFINE_VIRTUAL_FUNCTION_TEMPLATE_VTABLE_FILLER does
225  // not get confused by the comma which separates the two template parameters
227 
230 
231  void setExceptionBackend(boost::shared_ptr<DeviceBackend> exceptionBackend) override {
232  this->_exceptionBackend = exceptionBackend;
233  _rawAccessor->setExceptionBackend(exceptionBackend);
234  }
235 
236  protected:
240 
242  DataConverterType _dataConverter;
243 
245  boost::shared_ptr<NumericAddressedLowLevelTransferElement> _rawAccessor;
246 
248  boost::shared_ptr<NumericAddressedBackend> _dev;
249 
250  std::vector<boost::shared_ptr<TransferElement>> getHardwareAccessingElements() override {
251  return _rawAccessor->getHardwareAccessingElements();
252  }
253 
254  std::list<boost::shared_ptr<TransferElement>> getInternalElements() override {
255  return {_rawAccessor}; // the rawAccessor always returns an empty list
256  }
257 
258  void replaceTransferElement(boost::shared_ptr<TransferElement> newElement) override {
259  auto casted = boost::dynamic_pointer_cast<NumericAddressedLowLevelTransferElement>(newElement);
260  if(casted && casted->isMergeable(_rawAccessor)) {
261  size_t newStartAddress = std::min(casted->_startAddress, _rawAccessor->_startAddress);
262  size_t newStopAddress = std::max(
263  casted->_startAddress + casted->_numberOfBytes, _rawAccessor->_startAddress + _rawAccessor->_numberOfBytes);
264  size_t newNumberOfBytes = newStopAddress - newStartAddress;
265  casted->changeAddress(newStartAddress, newNumberOfBytes);
266  _rawAccessor = casted;
267  }
268  _rawAccessor->setExceptionBackend(this->_exceptionBackend);
269  }
270 
275  template<typename RawT, typename CookedT>
277  static CookedT vectorToCooked(DataConverterType&, const typename std::vector<RawT>::const_iterator&,
278  const typename std::vector<RawT>::const_iterator&, const typename std::vector<CookedT>::iterator&) {
279  throw ChimeraTK::logic_error("Getting as cooked is only available for raw accessors!");
280  }
281  static RawT toRaw(DataConverterType&, CookedT&) {
282  throw ChimeraTK::logic_error("Setting as cooked is only available for raw accessors!");
283  }
284  };
285  template<typename CookedT>
287  static void vectorToCooked(DataConverterType& dataConverter,
288  const typename std::vector<int8_t>::const_iterator& start,
289  const typename std::vector<int8_t>::const_iterator& end,
290  const typename std::vector<CookedT>::iterator& cooked) {
291  dataConverter.template vectorToCooked<CookedT>(start, end, cooked);
292  }
293  static int8_t toRaw(DataConverterType& dataConverter, CookedT& value) { return dataConverter.toRaw(value); }
294  };
295  template<typename CookedT>
296  struct dataConverterTemplateSpecialisationHelper<int16_t, CookedT> {
297  static void vectorToCooked(DataConverterType& dataConverter,
298  const typename std::vector<int16_t>::const_iterator& start,
299  const typename std::vector<int16_t>::const_iterator& end,
300  const typename std::vector<CookedT>::iterator& cooked) {
301  dataConverter.template vectorToCooked<CookedT>(start, end, cooked);
302  }
303  static int16_t toRaw(DataConverterType& dataConverter, CookedT& value) { return dataConverter.toRaw(value); }
304  };
305  template<typename CookedT>
306  struct dataConverterTemplateSpecialisationHelper<int32_t, CookedT> {
307  static void vectorToCooked(DataConverterType& dataConverter,
308  const typename std::vector<int32_t>::const_iterator& start,
309  const typename std::vector<int32_t>::const_iterator& end,
310  const typename std::vector<CookedT>::iterator& cooked) {
311  dataConverter.template vectorToCooked<CookedT>(start, end, cooked);
312  }
313  static int32_t toRaw(DataConverterType& dataConverter, CookedT& value) { return dataConverter.toRaw(value); }
314  };
315 
317  }; // namespace ChimeraTK
318 
320 
321  template<typename UserType, typename DataConverterType, bool isRaw>
322  template<typename COOKED_TYPE>
324  unsigned int channel, unsigned int sample) {
325  if(isRaw) {
326  std::vector<COOKED_TYPE> cookedData(1);
328  NDRegisterAccessor<UserType>::buffer_2D[channel].begin() + sample,
329  NDRegisterAccessor<UserType>::buffer_2D[channel].begin() + sample + 1, cookedData.begin());
330  return cookedData[0];
331  }
332  throw ChimeraTK::logic_error("Getting as cooked is only available for raw accessors!");
333  }
334 
336 
337  template<typename UserType, typename DataConverterType, bool isRaw>
338  template<typename COOKED_TYPE>
340  unsigned int channel, unsigned int sample, COOKED_TYPE value) {
341  if(isRaw) {
342  NDRegisterAccessor<UserType>::buffer_2D[channel][sample] =
344  }
345  else {
346  throw ChimeraTK::logic_error("Setting as cooked is only available for raw accessors!");
347  }
348  }
349 
351 
358 
359 } // namespace ChimeraTK
ChimeraTK::NumericAddressedRegisterInfo::address
uint64_t address
Lower part of the address relative to BAR, in bytes.
Definition: NumericAddressedRegisterCatalogue.h:114
ChimeraTK::NumericAddressedBackendRegisterAccessor::doReadTransferSynchronously
void doReadTransferSynchronously() override
Definition: NumericAddressedBackendRegisterAccessor.h:118
IEEE754_SingleConverter.h
ForwardDeclarations.h
ChimeraTK::AccessMode::raw
@ raw
Raw access: disable any possible conversion from the original hardware data type into the given UserT...
ChimeraTK::NumericAddressedBackendRegisterAccessor::dataConverterTemplateSpecialisationHelper< int8_t, CookedT >::vectorToCooked
static void vectorToCooked(DataConverterType &dataConverter, const typename std::vector< int8_t >::const_iterator &start, const typename std::vector< int8_t >::const_iterator &end, const typename std::vector< CookedT >::iterator &cooked)
Definition: NumericAddressedBackendRegisterAccessor.h:287
ChimeraTK::NumericAddressedRegisterInfo::getNumberOfElements
unsigned int getNumberOfElements() const override
Return number of elements per channel.
Definition: NumericAddressedRegisterCatalogue.h:79
ChimeraTK::NumericAddressedRegisterInfo::nElements
uint32_t nElements
Number of elements in register.
Definition: NumericAddressedRegisterCatalogue.h:110
ChimeraTK::NumericAddressedBackendRegisterAccessor::replaceTransferElement
void replaceTransferElement(boost::shared_ptr< TransferElement > newElement) override
Definition: NumericAddressedBackendRegisterAccessor.h:258
FixedPointConverter.h
ChimeraTK::NumericAddressedRegisterInfo
Definition: NumericAddressedRegisterCatalogue.h:15
ChimeraTK::NumericAddressedBackendRegisterAccessor::dataConverterTemplateSpecialisationHelper::vectorToCooked
static CookedT vectorToCooked(DataConverterType &, const typename std::vector< RawT >::const_iterator &, const typename std::vector< RawT >::const_iterator &, const typename std::vector< CookedT >::iterator &)
Definition: NumericAddressedBackendRegisterAccessor.h:277
ChimeraTK::NumericAddressedBackendRegisterAccessor
Implementation of the NDRegisterAccessor for NumericAddressedBackends for scalar and 1D registers.
Definition: NumericAddressedBackendRegisterAccessor.h:17
ChimeraTK::NumericAddressedBackendRegisterAccessor::_rawAccessor
boost::shared_ptr< NumericAddressedLowLevelTransferElement > _rawAccessor
raw accessor
Definition: NumericAddressedBackendRegisterAccessor.h:245
ChimeraTK::DataType::getAsString
std::string getAsString() const
Return string representation of the data type.
Definition: SupportedUserTypes.h:795
ChimeraTK::NumericAddressedBackendRegisterAccessor::doPostWrite
void doPostWrite(TransferType type, VersionNumber versionNumber) override
Definition: NumericAddressedBackendRegisterAccessor.h:196
ChimeraTK::NumericAddressedBackendRegisterAccessor::dataConverterTemplateSpecialisationHelper::toRaw
static RawT toRaw(DataConverterType &, CookedT &)
Definition: NumericAddressedBackendRegisterAccessor.h:281
ChimeraTK::TransferElement::_isInTransferGroup
bool _isInTransferGroup
Flag whether this TransferElement has been added to a TransferGroup or not.
Definition: TransferElement.h:820
ChimeraTK::NumericAddressedBackendRegisterAccessor::doWriteTransfer
bool doWriteTransfer(ChimeraTK::VersionNumber versionNumber) override
Definition: NumericAddressedBackendRegisterAccessor.h:120
ChimeraTK::NumericAddressedBackendRegisterAccessor::doPreRead
void doPreRead(TransferType type) override
Definition: NumericAddressedBackendRegisterAccessor.h:186
FILL_VIRTUAL_FUNCTION_TEMPLATE_VTABLE
#define FILL_VIRTUAL_FUNCTION_TEMPLATE_VTABLE(functionName)
Fill the vtable of a virtual function template defined with DEFINE_VIRTUAL_FUNCTION_TEMPLATE.
Definition: VirtualFunctionTemplate.h:84
ChimeraTK::NumericAddressedRegisterInfo::Type::VOID
@ VOID
ChimeraTK::NumericAddressedBackendRegisterAccessor::doPreWrite
void doPreWrite(TransferType type, VersionNumber versionNumber) override
Definition: NumericAddressedBackendRegisterAccessor.h:155
ChimeraTK::NumericAddressedBackendRegisterAccessor::dataConverterTemplateSpecialisationHelper< int32_t, CookedT >::vectorToCooked
static void vectorToCooked(DataConverterType &dataConverter, const typename std::vector< int32_t >::const_iterator &start, const typename std::vector< int32_t >::const_iterator &end, const typename std::vector< CookedT >::iterator &cooked)
Definition: NumericAddressedBackendRegisterAccessor.h:307
ChimeraTK::NumericAddressedBackendRegisterAccessor::_dataConverter
DataConverterType _dataConverter
Converter to interpret the data.
Definition: NumericAddressedBackendRegisterAccessor.h:242
ChimeraTK::NumericAddressedBackendRegisterAccessor::isReadable
bool isReadable() const override
Definition: NumericAddressedBackendRegisterAccessor.h:214
ChimeraTK::AccessModeFlags::has
bool has(AccessMode flag) const
Check if a certain flag is in the set.
Definition: AccessMode.cc:20
ChimeraTK::NumericAddressedBackendRegisterAccessor::_registerInfo
NumericAddressedRegisterInfo _registerInfo
Address, size and fixed-point representation information of the register from the map file.
Definition: NumericAddressedBackendRegisterAccessor.h:239
ChimeraTK::NumericAddressedBackendRegisterAccessor::NumericAddressedBackendRegisterAccessor
NumericAddressedBackendRegisterAccessor(const boost::shared_ptr< DeviceBackend > &dev, const RegisterPath &registerPathName, size_t numberOfWords, size_t wordOffsetInRegister, AccessModeFlags flags)
Definition: NumericAddressedBackendRegisterAccessor.h:27
ChimeraTK::NumericAddressedRegisterInfo::getDataDescriptor
const DataDescriptor & getDataDescriptor() const override
Return desciption of the actual payload data for this register.
Definition: NumericAddressedRegisterCatalogue.h:83
ChimeraTK::NumericAddressedBackendRegisterAccessor::getHardwareAccessingElements
std::vector< boost::shared_ptr< TransferElement > > getHardwareAccessingElements() override
Definition: NumericAddressedBackendRegisterAccessor.h:250
NumericAddressedLowLevelTransferElement.h
ChimeraTK::NumericAddressedBackendRegisterAccessor::mayReplaceOther
bool mayReplaceOther(const boost::shared_ptr< TransferElement const > &other) const override
Definition: NumericAddressedBackendRegisterAccessor.h:202
NDRegisterAccessor.h
ChimeraTK::NumericAddressedBackend
Base class for address-based device backends (e.g.
Definition: NumericAddressedBackend.h:20
ChimeraTK::callForRawType
void callForRawType(const DataType &type, LAMBDATYPE lambda)
callForRawType() is similar to callForType(), just with a subset of supported data types which can be...
Definition: SupportedUserTypes.h:1024
ChimeraTK::NumericAddressedRegisterInfo::getRegisterName
RegisterPath getRegisterName() const override
Return full path name of the register (including modules)
Definition: NumericAddressedRegisterCatalogue.h:77
ChimeraTK::NumericAddressedRegisterInfo::bar
uint64_t bar
Upper part of the address (name originally from PCIe, meaning now generalised)
Definition: NumericAddressedRegisterCatalogue.h:113
ChimeraTK::NumericAddressedBackendRegisterAccessor::dataConverterTemplateSpecialisationHelper< int32_t, CookedT >::toRaw
static int32_t toRaw(DataConverterType &dataConverter, CookedT &value)
Definition: NumericAddressedBackendRegisterAccessor.h:313
ChimeraTK::NumericAddressedBackendRegisterAccessor::setAsCooked_impl
void setAsCooked_impl(unsigned int channel, unsigned int sample, COOKED_TYPE value)
Definition: NumericAddressedBackendRegisterAccessor.h:339
ChimeraTK::NumericAddressedBackendRegisterAccessor::getAsCooked_impl
COOKED_TYPE getAsCooked_impl(unsigned int channel, unsigned int sample)
Definition: NumericAddressedBackendRegisterAccessor.h:323
ChimeraTK::NumericAddressedBackendRegisterAccessor::isWriteable
bool isWriteable() const override
Definition: NumericAddressedBackendRegisterAccessor.h:216
ChimeraTK::TransferType
TransferType
Used to indicate the applicable operation on a Transferelement.
Definition: TransferElement.h:51
ChimeraTK::NumericAddressedBackendRegisterAccessor::setExceptionBackend
void setExceptionBackend(boost::shared_ptr< DeviceBackend > exceptionBackend) override
Definition: NumericAddressedBackendRegisterAccessor.h:231
ChimeraTK::AccessModeFlags::checkForUnknownFlags
void checkForUnknownFlags(const std::set< AccessMode > &knownFlags) const
Check of any flag which is not in the given set "knownFlags" is set.
Definition: AccessMode.cc:32
createDataConverter.h
ChimeraTK::NumericAddressedBackendRegisterAccessor::dataConverterTemplateSpecialisationHelper< int8_t, CookedT >::toRaw
static int8_t toRaw(DataConverterType &dataConverter, CookedT &value)
Definition: NumericAddressedBackendRegisterAccessor.h:293
ChimeraTK::DataType
A class to describe which of the supported data types is used.
Definition: SupportedUserTypes.h:599
ChimeraTK::DataDescriptor::rawDataType
DataType rawDataType() const
Get the raw data type.
Definition: DataDescriptor.cpp:112
DECLARE_MULTI_TEMPLATE_FOR_CHIMERATK_USER_TYPES
#define DECLARE_MULTI_TEMPLATE_FOR_CHIMERATK_USER_TYPES(TemplateClass,...)
Macro to declare a template class with multiple template parameters for all supported user types.
Definition: SupportedUserTypes.h:532
ChimeraTK::NumericAddressedRegisterInfo::channels
std::vector< ChannelInfo > channels
Define per-channel information (bit interpretation etc.), 1D/scalars have exactly one entry.
Definition: NumericAddressedRegisterCatalogue.h:120
ChimeraTK::NumericAddressedRegisterInfo::isWriteable
bool isWriteable() const override
Return whether the register is writeable.
Definition: NumericAddressedRegisterCatalogue.h:90
ChimeraTK::NumericAddressedRegisterInfo::elementPitchBits
uint32_t elementPitchBits
Distance in bits (!) between two elements (of the same channel)
Definition: NumericAddressedRegisterCatalogue.h:111
ChimeraTK::NumericAddressedBackendRegisterAccessor::_dev
boost::shared_ptr< NumericAddressedBackend > _dev
the backend to use for the actual hardware access
Definition: NumericAddressedBackendRegisterAccessor.h:248
ChimeraTK::RegisterPath
Class to store a register path name.
Definition: RegisterPath.h:16
ChimeraTK::NumericAddressedBackendRegisterAccessor::dataConverterTemplateSpecialisationHelper< int16_t, CookedT >::toRaw
static int16_t toRaw(DataConverterType &dataConverter, CookedT &value)
Definition: NumericAddressedBackendRegisterAccessor.h:303
ChimeraTK::NumericAddressedBackendRegisterAccessor::dataConverterTemplateSpecialisationHelper< int16_t, CookedT >::vectorToCooked
static void vectorToCooked(DataConverterType &dataConverter, const typename std::vector< int16_t >::const_iterator &start, const typename std::vector< int16_t >::const_iterator &end, const typename std::vector< CookedT >::iterator &cooked)
Definition: NumericAddressedBackendRegisterAccessor.h:297
ChimeraTK::NumericAddressedBackendRegisterAccessor::dataConverterTemplateSpecialisationHelper
A helper class to implement template specialisation on certain functions.
Definition: NumericAddressedBackendRegisterAccessor.h:276
ChimeraTK::VersionNumber
Class for generating and holding version numbers without exposing a numeric representation.
Definition: VersionNumber.h:23
DEFINE_VIRTUAL_FUNCTION_TEMPLATE_VTABLE_FILLER
#define DEFINE_VIRTUAL_FUNCTION_TEMPLATE_VTABLE_FILLER(className, functionName, numberOfArguments)
Compatibility, do not use.
Definition: VirtualFunctionTemplate.h:108
ChimeraTK::FixedPointConverter
The fixed point converter provides conversion functions between a user type and up to 32 bit fixed po...
Definition: FixedPointConverter.h:28
ChimeraTK::AccessModeFlags
Set of AccessMode flags with additional functionality for an easier handling.
Definition: AccessMode.h:48
ChimeraTK::NumericAddressedBackendRegisterAccessor::doPostRead
void doPostRead(TransferType type, bool hasNewData) override
Definition: NumericAddressedBackendRegisterAccessor.h:126
ChimeraTK::NumericAddressedBackendRegisterAccessor::getInternalElements
std::list< boost::shared_ptr< TransferElement > > getInternalElements() override
Definition: NumericAddressedBackendRegisterAccessor.h:254
ChimeraTK
Definition: DummyBackend.h:16
ChimeraTK::to_string
std::string to_string(Boolean &value)
Definition: SupportedUserTypes.h:59
ChimeraTK::IEEE754_SingleConverter
Needs to have the same interface as FixedPointConverter, except for the constructor.
Definition: IEEE754_SingleConverter.h:46
ChimeraTK::NDRegisterAccessor
N-dimensional register accessor.
Definition: ForwardDeclarations.h:17
ChimeraTK::logic_error
Exception thrown when a logic error has occured.
Definition: Exception.h:51
ChimeraTK::NumericAddressedBackendRegisterAccessor::isReadOnly
bool isReadOnly() const override
Definition: NumericAddressedBackendRegisterAccessor.h:212