ChimeraTK-DeviceAccess 03.25.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
8#include "RegisterInfo.h"
9#include "TransferElement.h"
10
11#include <boost/shared_ptr.hpp>
12
13#include <mutex>
14
15namespace ChimeraTK {
16
17 namespace LNMBackend {
18 class AccessorPluginBase;
19 } // namespace LNMBackend
20
23 public:
26
31
32 [[nodiscard]] RegisterPath getRegisterName() const override { return name; }
33
34 [[nodiscard]] unsigned int getNumberOfElements() const override { return length; }
35
36 [[nodiscard]] unsigned int getNumberOfChannels() const override { return nChannels; }
37
38 [[nodiscard]] const DataDescriptor& getDataDescriptor() const override { return _dataDescriptor; }
39
40 [[nodiscard]] bool isReadable() const override { return readable; }
41
42 [[nodiscard]] bool isWriteable() const override { return writeable; }
43
44 [[nodiscard]] AccessModeFlags getSupportedAccessModes() const override { return supportedFlags; }
45
46 [[nodiscard]] std::set<std::string> getTags() const override { return tags; }
47
50
53
55 std::string deviceName;
56
58 std::string registerName;
59
61 unsigned int firstIndex{};
62
64 unsigned int length{};
65
67 unsigned int channel{};
68
70 unsigned int bit{};
71
73 unsigned int nChannels{};
74
77
78 // /** Hold values of CONSTANT or VARIABLE types in a type-dependent table. Only the entry matching the valueType
79 // * is actually valid.
80 // * Note: We cannot directly put the std::vector in a TemplateUserTypeMap, since it has more than one template
81 // * arguments (with defaults). */
82 // template<typename T>
83 // struct ValueTable {
84 // std::vector<T> latestValue;
85 // DataValidity latestValidity;
86 // VersionNumber latestVersion;
87 // struct QueuedValue {
88 // std::vector<T> value;
89 // DataValidity validity;
90 // VersionNumber version;
91 // };
92 // std::map<TransferElementID, cppext::future_queue<QueuedValue>> subscriptions;
93 // };
94 // TemplateUserTypeMap<ValueTable> valueTable;
95
96 // /** Mutex one needs to hold while accessing valueTable. */
97 // std::mutex valueTable_mutex;
98
101 bool readable{};
102
105 bool writeable{};
106
109
111 std::vector<boost::shared_ptr<LNMBackend::AccessorPluginBase>> plugins;
112
114
115 std::set<std::string> tags;
116
117 [[nodiscard]] std::unique_ptr<BackendRegisterInfoBase> clone() const override {
118 return std::make_unique<LNMBackendRegisterInfo>(*this);
119 }
120 };
121 /********************************************************************************************************************/
122
123 /*class LNMRegisterCatalogue : public BackendRegisterCatalogue<LNMBackendRegisterInfo> {
124 public:
125 LNMRegisterCatalogue() = default;
126 LNMRegisterCatalogue& operator=(const LNMRegisterCatalogue& other) = default;
127 LNMRegisterCatalogue(const LNMRegisterCatalogue&) = default;
128 };*/
129
130 /********************************************************************************************************************/
131} /* 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.
RegisterPath getRegisterName() const override
Return full path name of the register (including modules)
unsigned int firstIndex
The first index in the range.
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.
RegisterPath name
Name 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.