ChimeraTK-DeviceAccess  03.18.00
RegisterInfo.cpp
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 
4 #include "RegisterInfo.h"
5 
6 namespace ChimeraTK {
7 
8  /********************************************************************************************************************/
9 
10  RegisterInfo::RegisterInfo(std::unique_ptr<BackendRegisterInfoBase>&& impl) : _impl(std::move(impl)) {}
11 
12  /********************************************************************************************************************/
13 
15  operator=(other);
16  }
17 
18  /********************************************************************************************************************/
19 
21  if(other.isValid()) {
22  _impl = other.getImpl().clone();
23  }
24  else {
25  _impl = nullptr;
26  }
27  return *this;
28  }
29 
30  /********************************************************************************************************************/
31 
33  return _impl->getRegisterName();
34  }
35 
36  /********************************************************************************************************************/
37 
38  unsigned int RegisterInfo::getNumberOfElements() const {
39  return _impl->getNumberOfElements();
40  }
41 
42  /********************************************************************************************************************/
43 
44  unsigned int RegisterInfo::getNumberOfChannels() const {
45  return _impl->getNumberOfChannels();
46  }
47 
48  /********************************************************************************************************************/
49 
50  unsigned int RegisterInfo::getNumberOfDimensions() const {
51  return _impl->getNumberOfDimensions();
52  }
53 
54  /********************************************************************************************************************/
55 
57  return _impl->getDataDescriptor();
58  }
59 
60  /********************************************************************************************************************/
61 
62  bool RegisterInfo::isReadable() const {
63  return _impl->isReadable();
64  }
65 
66  /********************************************************************************************************************/
67 
69  return _impl->isWriteable();
70  }
71 
72  /********************************************************************************************************************/
73 
75  return _impl->getSupportedAccessModes();
76  }
77 
78  /********************************************************************************************************************/
79 
80  bool RegisterInfo::isValid() const {
81  return _impl != nullptr;
82  }
83 
84  /********************************************************************************************************************/
85 
87  return *_impl;
88  }
89 
90  /********************************************************************************************************************/
91 
93  return *_impl;
94  }
95 
96  /********************************************************************************************************************/
97 
98  std::vector<size_t> RegisterInfo::getQualifiedAsyncId() const {
99  return _impl->getQualifiedAsyncId();
100  }
101 
102  /********************************************************************************************************************/
103 } // namespace ChimeraTK
ChimeraTK::RegisterInfo::getNumberOfDimensions
unsigned int getNumberOfDimensions() const
Return number of dimensions of this register.
Definition: RegisterInfo.cpp:50
ChimeraTK::RegisterInfo::getNumberOfChannels
unsigned int getNumberOfChannels() const
Return number of channels in register.
Definition: RegisterInfo.cpp:44
ChimeraTK::RegisterInfo::getRegisterName
RegisterPath getRegisterName() const
Return full path name of the register (including modules)
Definition: RegisterInfo.cpp:32
ChimeraTK::RegisterInfo::getQualifiedAsyncId
std::vector< size_t > getQualifiedAsyncId() const
Get the fully qualified async::SubDomain ID.
Definition: RegisterInfo.cpp:98
ChimeraTK::DataDescriptor
Class describing the actual payload data format of a register in an abstract manner.
Definition: DataDescriptor.h:19
ChimeraTK::BackendRegisterInfoBase::clone
virtual std::unique_ptr< BackendRegisterInfoBase > clone() const =0
Create copy of the object.
ChimeraTK::RegisterInfo
Definition: RegisterInfo.h:12
ChimeraTK::RegisterInfo::getDataDescriptor
const DataDescriptor & getDataDescriptor() const
Return desciption of the actual payload data for this register.
Definition: RegisterInfo.cpp:56
ChimeraTK::RegisterInfo::getSupportedAccessModes
AccessModeFlags getSupportedAccessModes() const
Return all supported AccessModes for this register.
Definition: RegisterInfo.cpp:74
ChimeraTK::RegisterInfo::operator=
RegisterInfo & operator=(const RegisterInfo &other)
Definition: RegisterInfo.cpp:20
ChimeraTK::RegisterInfo::isWriteable
bool isWriteable() const
Return whether the register is writeable.
Definition: RegisterInfo.cpp:68
RegisterInfo.h
ChimeraTK::RegisterInfo::getImpl
BackendRegisterInfoBase & getImpl()
Return a reference to the implementation object.
Definition: RegisterInfo.cpp:86
ChimeraTK::RegisterPath
Class to store a register path name.
Definition: RegisterPath.h:16
ChimeraTK::RegisterInfo::isValid
bool isValid() const
Check whether the RegisterPath object is valid (i.e.
Definition: RegisterInfo.cpp:80
ChimeraTK::AccessModeFlags
Set of AccessMode flags with additional functionality for an easier handling.
Definition: AccessMode.h:48
ChimeraTK::RegisterInfo::RegisterInfo
RegisterInfo(std::unique_ptr< BackendRegisterInfoBase > &&impl)
Definition: RegisterInfo.cpp:10
ChimeraTK::RegisterInfo::isReadable
bool isReadable() const
Return whether the register is readable.
Definition: RegisterInfo.cpp:62
ChimeraTK::RegisterInfo::getNumberOfElements
unsigned int getNumberOfElements() const
Return number of elements per channel.
Definition: RegisterInfo.cpp:38
ChimeraTK
Definition: DummyBackend.h:16
ChimeraTK::BackendRegisterInfoBase
DeviceBackend-independent register description.
Definition: BackendRegisterInfoBase.h:16
ChimeraTK::RegisterInfo::_impl
std::unique_ptr< BackendRegisterInfoBase > _impl
Definition: RegisterInfo.h:71