ChimeraTK-DeviceAccess-TangoBackend 00.01.02
Loading...
Searching...
No Matches
RegisterCatalogue.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 <ChimeraTK/BackendRegisterCatalogue.h>
6
7#include <tango/tango.h>
8
9namespace ChimeraTK {
10
11 /********************************************************************************************************************/
12
13 struct TangoRegisterInfo;
14
15 /********************************************************************************************************************/
16
17 class TangoRegisterCatalogue : public ChimeraTK::BackendRegisterCatalogue<TangoRegisterInfo> {};
18
19 /********************************************************************************************************************/
20
21 struct TangoRegisterInfo : public ChimeraTK::BackendRegisterInfoBase {
22 TangoRegisterInfo() = default;
23
24 explicit TangoRegisterInfo(Tango::AttributeInfoEx& info);
25
26 [[nodiscard]] ChimeraTK::RegisterPath getRegisterName() const override { return "/" + attributeInfo.name; }
27
28 [[nodiscard]] unsigned int getNumberOfElements() const override { return attributeInfo.max_dim_x; }
29
30 [[nodiscard]] unsigned int getNumberOfChannels() const override { return attributeInfo.max_dim_y; }
31
32 [[nodiscard]] bool isReadable() const override {
33 return attributeInfo.writable == Tango::AttrWriteType::READ_WITH_WRITE ||
34 attributeInfo.writable == Tango::AttrWriteType::READ_WRITE ||
35 attributeInfo.writable == Tango::AttrWriteType::READ;
36 }
37
38 [[nodiscard]] bool isWriteable() const override {
39 return attributeInfo.writable == Tango::AttrWriteType::READ_WRITE ||
40 attributeInfo.writable == Tango::AttrWriteType::WRITE;
41 }
42
43 [[nodiscard]] ChimeraTK::AccessModeFlags getSupportedAccessModes() const override { return {}; }
44
45 [[nodiscard]] const ChimeraTK::DataDescriptor& getDataDescriptor() const override { return descriptor; }
46
47 [[nodiscard]] std::unique_ptr<ChimeraTK::BackendRegisterInfoBase> clone() const override;
48
49 DataDescriptor descriptor;
50 Tango::AttributeInfoEx attributeInfo;
51 };
52} // namespace ChimeraTK
unsigned int getNumberOfChannels() const override
ChimeraTK::RegisterPath getRegisterName() const override
Tango::AttributeInfoEx attributeInfo
bool isReadable() const override
ChimeraTK::AccessModeFlags getSupportedAccessModes() const override
unsigned int getNumberOfElements() const override
std::unique_ptr< ChimeraTK::BackendRegisterInfoBase > clone() const override
bool isWriteable() const override
const ChimeraTK::DataDescriptor & getDataDescriptor() const override