ChimeraTK-DeviceAccess 03.29.00
Loading...
Searching...
No Matches
LNMBackendRegisterInfo.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
7#include <boost/shared_ptr.hpp>
8
9namespace ChimeraTK {
10
11 namespace LNMBackend {
12 class AccessorPluginBase;
13 } // namespace LNMBackend
14
17 public:
20
25
26 [[nodiscard]] bool operator==(const LNMBackendRegisterInfo&) const = default;
27
28 [[nodiscard]] RegisterPath getRegisterName() const override { return name; }
29
30 [[nodiscard]] unsigned int getNumberOfElements() const override { return length; }
31
32 [[nodiscard]] unsigned int getNumberOfChannels() const override { return nChannels; }
33
34 [[nodiscard]] const DataDescriptor& getDataDescriptor() const override { return _dataDescriptor; }
35
36 [[nodiscard]] bool isReadable() const override { return readable; }
37
38 [[nodiscard]] bool isWriteable() const override { return writeable; }
39
40 [[nodiscard]] AccessModeFlags getSupportedAccessModes() const override { return supportedFlags; }
41
42 [[nodiscard]] std::set<std::string> getTags() const override { return tags; }
43
46
49
51 std::string deviceName;
52
54 std::string registerName;
55
57 unsigned int firstIndex{};
58
60 unsigned int length{};
61
63 unsigned int channel{};
64
66 unsigned int bit{};
67
69 unsigned int nChannels{};
70
73
76 bool readable{};
77
80 bool writeable{};
81
84
86 std::vector<boost::shared_ptr<LNMBackend::AccessorPluginBase>> plugins;
87
89
90 std::set<std::string> tags;
91
93 std::string engineeringUnit;
94
96 std::string description;
97
99 [[nodiscard]] std::string getUnit() const override { return engineeringUnit; }
100
102 [[nodiscard]] std::string getDescription() const override { return description; }
103
104 [[nodiscard]] std::unique_ptr<BackendRegisterInfoBase> clone() const override {
105 return std::make_unique<LNMBackendRegisterInfo>(*this);
106 }
107 };
108
109 /********************************************************************************************************************/
110} /* namespace ChimeraTK */
Set of AccessMode flags with additional functionality for an easier handling.
Definition AccessMode.h:48
DeviceBackend-independent register description.
Class describing the actual payload data format of a register in an abstract manner.
A class to describe which of the supported data types is used.
RegisterInfo structure for the LogicalNameMappingBackend.
DataType valueType
Data type of CONSTANT or VARIABLE type.
std::string description
Custom description overwritten by plugins (e.g.
RegisterPath getRegisterName() const override
Return full path name of the register (including modules)
std::string engineeringUnit
Custom engineering unit overwritten by plugins (e.g.
unsigned int firstIndex
The first index in the range.
std::string getDescription() const override
Return the description of the register.
std::string registerName
The target register name.
AccessModeFlags supportedFlags
Supported AccessMode flags.
bool readable
Flag if the register is readable.
unsigned int nChannels
The number of channels of the logical register.
const DataDescriptor & getDataDescriptor() const override
Return description of the actual payload data for this register.
unsigned int getNumberOfElements() const override
Return number of elements per channel.
bool writeable
Flag if the register is writeable.
AccessModeFlags getSupportedAccessModes() const override
Return all supported AccessModes for this register.
unsigned int getNumberOfChannels() const override
Return number of channels in register.
std::set< std::string > getTags() const override
Get the list of tags associated with this register.
LNMBackendRegisterInfo & operator=(const LNMBackendRegisterInfo &other)=default
LNMBackendRegisterInfo(const LNMBackendRegisterInfo &)=default
unsigned int length
The length of the range (i.e.
std::unique_ptr< BackendRegisterInfoBase > clone() const override
Create copy of the object.
bool isReadable() const override
Return whether the register is readable.
std::string deviceName
The target device alias.
TargetType targetType
Type of the target.
bool isWriteable() const override
Return whether the register is writeable.
bool operator==(const LNMBackendRegisterInfo &) const =default
RegisterPath name
Name of the register.
std::string getUnit() const override
Return the engineering unit of the register.
unsigned int bit
The bit of the target register (if TargetType::BIT)
std::vector< boost::shared_ptr< LNMBackend::AccessorPluginBase > > plugins
List of accessor plugins enabled for this register.
LNMBackendRegisterInfo()=default
constructor: initialise values
unsigned int channel
The channel of the target 2D register (if TargetType::CHANNEL)
Class to store a register path name.