ChimeraTK-DeviceAccess 03.25.00
Loading...
Searching...
No Matches
RegisterCatalogue.cc
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 "RegisterCatalogue.h"
5
7
8namespace ChimeraTK {
9
10 /********************************************************************************************************************/
11
12 RegisterCatalogue::RegisterCatalogue(std::unique_ptr<BackendRegisterCatalogueBase>&& impl) : _impl(std::move(impl)) {}
13
14 /********************************************************************************************************************/
15
16 RegisterCatalogue::RegisterCatalogue(const RegisterCatalogue& other) : _impl(other._impl->clone()) {}
17
18 /********************************************************************************************************************/
19
20 RegisterCatalogue::RegisterCatalogue(RegisterCatalogue&& other) noexcept : _impl(std::move(other._impl)) {}
21
22 /********************************************************************************************************************/
23
25 if(this != &other) {
26 _impl = other._impl->clone();
27 }
28 return *this;
29 }
30
31 /********************************************************************************************************************/
32
34 _impl = std::move(other._impl);
35 return *this;
36 }
37
38 /********************************************************************************************************************/
39
40 // need to declare in .cc file, since the type RegisterCatalogueImpl must be complete
42
43 /********************************************************************************************************************/
44
46 return _impl->getRegister(registerPathName);
47 }
48
49 /********************************************************************************************************************/
50
51 bool RegisterCatalogue::hasRegister(const RegisterPath& registerPathName) const {
52 return _impl->hasRegister(registerPathName);
53 }
54
55 /********************************************************************************************************************/
56
58 return _impl->getNumberOfRegisters();
59 }
60
61 /********************************************************************************************************************/
62
66
67 /********************************************************************************************************************/
68
72
73 /********************************************************************************************************************/
74 /********************************************************************************************************************/
75
76 RegisterCatalogue::const_iterator::const_iterator(std::unique_ptr<const_RegisterCatalogueImplIterator> it)
77 : _impl(std::move(it)) {}
78
79 /********************************************************************************************************************/
80
82
83 /********************************************************************************************************************/
84
86
87 /********************************************************************************************************************/
88
90 if(this != &other) {
91 _impl = other._impl->clone();
92 }
93 return *this;
94 }
95
96 /********************************************************************************************************************/
97
99 const_iterator&& other) noexcept = default;
100
101 /********************************************************************************************************************/
102
107
108 /********************************************************************************************************************/
109
115
116 /********************************************************************************************************************/
117
122
123 /********************************************************************************************************************/
124
130
131 /********************************************************************************************************************/
132
136
137 /********************************************************************************************************************/
138
142
143 /********************************************************************************************************************/
144
146 return _impl->isEqual(rightHandSide._impl);
147 }
148
149 /********************************************************************************************************************/
150
152 return !_impl->isEqual(rightHandSide._impl);
153 }
154
155 /********************************************************************************************************************/
156
160
161 /********************************************************************************************************************/
162
166
167 /********************************************************************************************************************/
168
169} /* namespace ChimeraTK */
Pure virtual implementation base class for the register catalogue.
virtual HiddenRange hiddenRegisters() const =0
DeviceBackend-independent register description.
Const iterator for iterating through the registers in the catalogue.
bool operator!=(const const_iterator &rightHandSide) const
std::unique_ptr< const_RegisterCatalogueImplIterator > _impl
const_iterator(std::unique_ptr< const_RegisterCatalogueImplIterator > it)
const BackendRegisterInfoBase * operator->()
bool operator==(const const_iterator &rightHandSide) const
const_iterator & operator=(const const_iterator &other)
const BackendRegisterInfoBase & operator*()
Catalogue of register information.
RegisterInfo getRegister(const RegisterPath &registerPathName) const
Get register information for a given full path name.
std::unique_ptr< BackendRegisterCatalogueBase > _impl
size_t getNumberOfRegisters() const
Get number of registers in the catalogue.
bool hasRegister(const RegisterPath &registerPathName) const
Check if register with the given path name exists.
HiddenRange hiddenRegisters() const
Returns non-owning range of all hidden registers in the catalogue.
RegisterCatalogue & operator=(const RegisterCatalogue &other)
const_iterator begin() const
Return iterators for iterating through the registers in the catalogue.
const BackendRegisterCatalogueBase & getImpl() const
Return a const reference to the implementation object.
RegisterCatalogue(std::unique_ptr< BackendRegisterCatalogueBase > &&impl)
Class to store a register path name.
boost::any_range< BackendRegisterInfoBase, boost::forward_traversal_tag, const BackendRegisterInfoBase &, std::ptrdiff_t > HiddenRange
Forward range with type-erasure, used to get a range of hidden registers.
STL namespace.