ChimeraTK-DeviceAccess  03.18.00
DummyInterruptTriggerAccessor.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 "NDRegisterAccessor.h"
6 
7 #include <utility>
8 
9 namespace ChimeraTK {
10  class DummyBackendBase;
11 
20  template<typename UserType>
22  public:
23  DummyInterruptTriggerAccessor(boost::shared_ptr<DeviceBackend> backend,
24  std::function<VersionNumber(void)> interruptTrigger, const RegisterPath& registerPathName,
25  size_t numberOfElements = 1, size_t elementsOffset = 0, const AccessModeFlags& flags = {});
26 
28 
29  void doReadTransferSynchronously() override {}
30 
31  void doPreRead(TransferType) override;
32 
33  void doPreWrite(TransferType, VersionNumber) override;
34 
35  [[nodiscard]] bool isReadOnly() const override { return false; }
36  [[nodiscard]] bool isReadable() const override { return false; }
37  [[nodiscard]] bool isWriteable() const override { return true; }
38 
39  protected:
40  std::vector<boost::shared_ptr<TransferElement>> getHardwareAccessingElements() override {
41  return {boost::enable_shared_from_this<TransferElement>::shared_from_this()};
42  }
43 
44  std::list<boost::shared_ptr<TransferElement>> getInternalElements() override { return {}; }
45 
46  private:
47  boost::shared_ptr<DummyBackendBase> _backend;
48  std::function<VersionNumber(void)> _interruptTrigger;
49  };
50 
51  DECLARE_TEMPLATE_FOR_CHIMERATK_USER_TYPES(DummyInterruptTriggerAccessor);
52 
53 } // namespace ChimeraTK
ChimeraTK::DummyInterruptTriggerAccessor::isReadable
bool isReadable() const override
Definition: DummyInterruptTriggerAccessor.h:36
ChimeraTK::DummyInterruptTriggerAccessor::getHardwareAccessingElements
std::vector< boost::shared_ptr< TransferElement > > getHardwareAccessingElements() override
Definition: DummyInterruptTriggerAccessor.h:40
ChimeraTK::DummyInterruptTriggerAccessor
The DummyInterruptTriggerAccessor class.
Definition: DummyInterruptTriggerAccessor.h:21
ChimeraTK::DummyInterruptTriggerAccessor::DummyInterruptTriggerAccessor
DummyInterruptTriggerAccessor(boost::shared_ptr< DeviceBackend > backend, std::function< VersionNumber(void)> interruptTrigger, const RegisterPath &registerPathName, size_t numberOfElements=1, size_t elementsOffset=0, const AccessModeFlags &flags={})
Definition: DummyInterruptTriggerAccessor.cc:13
ChimeraTK::DummyInterruptTriggerAccessor::doPreRead
void doPreRead(TransferType) override
Definition: DummyInterruptTriggerAccessor.cc:47
ChimeraTK::DummyInterruptTriggerAccessor::doWriteTransfer
bool doWriteTransfer(ChimeraTK::VersionNumber) override
Definition: DummyInterruptTriggerAccessor.cc:38
NDRegisterAccessor.h
ChimeraTK::DummyInterruptTriggerAccessor::doPreWrite
void doPreWrite(TransferType, VersionNumber) override
Definition: DummyInterruptTriggerAccessor.cc:54
ChimeraTK::TransferType
TransferType
Used to indicate the applicable operation on a Transferelement.
Definition: TransferElement.h:51
ChimeraTK::DummyInterruptTriggerAccessor::isWriteable
bool isWriteable() const override
Definition: DummyInterruptTriggerAccessor.h:37
ChimeraTK::RegisterPath
Class to store a register path name.
Definition: RegisterPath.h:16
ChimeraTK::VersionNumber
Class for generating and holding version numbers without exposing a numeric representation.
Definition: VersionNumber.h:23
ChimeraTK::DummyInterruptTriggerAccessor::isReadOnly
bool isReadOnly() const override
Definition: DummyInterruptTriggerAccessor.h:35
ChimeraTK::AccessModeFlags
Set of AccessMode flags with additional functionality for an easier handling.
Definition: AccessMode.h:48
ChimeraTK::DECLARE_TEMPLATE_FOR_CHIMERATK_USER_TYPES
DECLARE_TEMPLATE_FOR_CHIMERATK_USER_TYPES(DummyInterruptTriggerAccessor)
ChimeraTK
Definition: DummyBackend.h:16
ChimeraTK::DummyInterruptTriggerAccessor::getInternalElements
std::list< boost::shared_ptr< TransferElement > > getInternalElements() override
Definition: DummyInterruptTriggerAccessor.h:44
ChimeraTK::DummyInterruptTriggerAccessor::doReadTransferSynchronously
void doReadTransferSynchronously() override
Definition: DummyInterruptTriggerAccessor.h:29
ChimeraTK::NDRegisterAccessor
N-dimensional register accessor.
Definition: ForwardDeclarations.h:17