ChimeraTK-DeviceAccess  03.18.00
BackendRegisterInfoBase.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 "AccessMode.h"
6 #include "DataDescriptor.h"
7 #include "RegisterPath.h"
8 
9 #include <memory>
10 
11 namespace ChimeraTK {
12 
13  /********************************************************************************************************************/
14 
17  public:
19  virtual ~BackendRegisterInfoBase() = default;
20 
22  [[nodiscard]] virtual RegisterPath getRegisterName() const = 0;
23 
25  [[nodiscard]] virtual unsigned int getNumberOfElements() const = 0;
26 
28  [[nodiscard]] virtual unsigned int getNumberOfChannels() const = 0;
29 
31  [[nodiscard]] unsigned int getNumberOfDimensions() const;
32 
35  [[nodiscard]] virtual const DataDescriptor& getDataDescriptor() const = 0;
36 
38  [[nodiscard]] virtual bool isReadable() const = 0;
39 
41  [[nodiscard]] virtual bool isWriteable() const = 0;
42 
44  [[nodiscard]] virtual AccessModeFlags getSupportedAccessModes() const = 0;
45 
47  [[nodiscard]] virtual std::unique_ptr<BackendRegisterInfoBase> clone() const = 0;
48 
53  [[nodiscard]] virtual std::vector<size_t> getQualifiedAsyncId() const { return {}; }
54  };
55 
56  /********************************************************************************************************************/
57 
58  inline unsigned int BackendRegisterInfoBase::getNumberOfDimensions() const {
59  if(getNumberOfChannels() > 1) return 2;
60  if(getNumberOfElements() > 1) return 1;
61  return 0;
62  }
63 
64 } // namespace ChimeraTK
DataDescriptor.h
ChimeraTK::BackendRegisterInfoBase::getSupportedAccessModes
virtual AccessModeFlags getSupportedAccessModes() const =0
Return all supported AccessModes for this register.
ChimeraTK::BackendRegisterInfoBase::getDataDescriptor
virtual const DataDescriptor & getDataDescriptor() const =0
Return desciption of the actual payload data for this register.
ChimeraTK::BackendRegisterInfoBase::getNumberOfChannels
virtual unsigned int getNumberOfChannels() const =0
Return number of channels in register.
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::BackendRegisterInfoBase::getNumberOfDimensions
unsigned int getNumberOfDimensions() const
Return number of dimensions of this register.
Definition: BackendRegisterInfoBase.h:58
ChimeraTK::BackendRegisterInfoBase::getNumberOfElements
virtual unsigned int getNumberOfElements() const =0
Return number of elements per channel.
ChimeraTK::BackendRegisterInfoBase::isWriteable
virtual bool isWriteable() const =0
Return whether the register is writeable.
ChimeraTK::BackendRegisterInfoBase::getRegisterName
virtual RegisterPath getRegisterName() const =0
Return full path name of the register (including modules)
ChimeraTK::RegisterPath
Class to store a register path name.
Definition: RegisterPath.h:16
ChimeraTK::BackendRegisterInfoBase::isReadable
virtual bool isReadable() const =0
Return whether the register is readable.
AccessMode.h
ChimeraTK::BackendRegisterInfoBase::getQualifiedAsyncId
virtual std::vector< size_t > getQualifiedAsyncId() const
Return the fully qualified async::SubDomain ID.
Definition: BackendRegisterInfoBase.h:53
ChimeraTK::AccessModeFlags
Set of AccessMode flags with additional functionality for an easier handling.
Definition: AccessMode.h:48
ChimeraTK::BackendRegisterInfoBase::~BackendRegisterInfoBase
virtual ~BackendRegisterInfoBase()=default
Virtual destructor.
ChimeraTK
Definition: DummyBackend.h:16
ChimeraTK::BackendRegisterInfoBase
DeviceBackend-independent register description.
Definition: BackendRegisterInfoBase.h:16
RegisterPath.h