ChimeraTK-DeviceAccess-DoocsBackend  01.09.02
DoocsBackendImageRegisterAccessor.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 
4 #pragma once
5 
7 #include <doocs/EqCall.h>
8 
9 #include <ChimeraTK/MappedImage.h>
10 
11 namespace ChimeraTK {
12 
13  /**********************************************************************************************************************/
14 
16  public:
18 
19  protected:
23  DoocsBackendImageRegisterAccessor(boost::shared_ptr<DoocsBackend> backend, const std::string& path,
24  const std::string& registerPathName, size_t numberOfBytes, size_t wordOffsetInRegister, AccessModeFlags flags);
25 
26  bool isReadOnly() const override { return true; }
27 
28  bool isReadable() const override { return true; }
29 
30  bool isWriteable() const override { return false; }
31 
32  bool doWriteTransfer(VersionNumber /*versionNumber = {}*/) override {
33  // do not throw again, already done in doPreWrite...
34  return false;
35  }
36 
37  void doPostRead(TransferType type, bool hasNewData) override;
38 
39  friend class DoocsBackend;
40  };
41 
42  /**********************************************************************************************************************/
43 
45  struct MappedDoocsImgIn : public MappedImage {
46  using MappedImage::MappedImage;
47 
48  ImgFormat getImgFormat(const IMH* h);
49 
50  void set(const IMH* h, const std::uint8_t* body);
51  };
52 
53  /**********************************************************************************************************************/
54 
55 } // namespace ChimeraTK
ChimeraTK::DoocsBackendRegisterAccessor
Definition: DoocsBackendRegisterAccessor.h:75
ChimeraTK::DoocsBackendImageRegisterAccessor::DoocsBackendImageRegisterAccessor
DoocsBackendImageRegisterAccessor(boost::shared_ptr< DoocsBackend > backend, const std::string &path, const std::string &registerPathName, size_t numberOfBytes, size_t wordOffsetInRegister, AccessModeFlags flags)
numberOfBytes: defines length or byte array.
Definition: DoocsBackendImageRegisterAccessor.cc:17
ChimeraTK::DoocsBackendImageRegisterAccessor
Definition: DoocsBackendImageRegisterAccessor.h:15
ChimeraTK::DoocsBackendImageRegisterAccessor::doPostRead
void doPostRead(TransferType type, bool hasNewData) override
Definition: DoocsBackendImageRegisterAccessor.cc:43
ChimeraTK::DoocsBackendImageRegisterAccessor::isReadOnly
bool isReadOnly() const override
Definition: DoocsBackendImageRegisterAccessor.h:26
ChimeraTK::DoocsBackendImageRegisterAccessor::~DoocsBackendImageRegisterAccessor
virtual ~DoocsBackendImageRegisterAccessor()
Definition: DoocsBackendImageRegisterAccessor.cc:37
ChimeraTK::MappedDoocsImgIn::set
void set(const IMH *h, const std::uint8_t *body)
Definition: DoocsBackendImageRegisterAccessor.cc:88
ChimeraTK::DoocsBackendImageRegisterAccessor::doWriteTransfer
bool doWriteTransfer(VersionNumber) override
Definition: DoocsBackendImageRegisterAccessor.h:32
ChimeraTK::MappedDoocsImgIn
implements conversion from DOOCS image -> MappedImage
Definition: DoocsBackendImageRegisterAccessor.h:45
ChimeraTK::DoocsBackendImageRegisterAccessor::isReadable
bool isReadable() const override
Definition: DoocsBackendImageRegisterAccessor.h:28
ChimeraTK::DoocsBackendImageRegisterAccessor::isWriteable
bool isWriteable() const override
Definition: DoocsBackendImageRegisterAccessor.h:30
ChimeraTK::MappedDoocsImgIn::getImgFormat
ImgFormat getImgFormat(const IMH *h)
Definition: DoocsBackendImageRegisterAccessor.cc:67
ChimeraTK
Definition: spec_DoocsBackend.dox:2
ChimeraTK::DoocsBackend
Backend to access DOOCS control system servers.
Definition: DoocsBackend.h:56
DoocsBackendRegisterAccessor.h