ChimeraTK-DeviceAccess  03.18.00
DummyForAreaHandshake.cc
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 #include "BackendFactory.h"
5 #include "DummyBackend.h"
6 
7 namespace ChimeraTK {
8  using namespace ChimeraTK;
9 }
10 using namespace ChimeraTK;
11 
14 
15  static boost::shared_ptr<DeviceBackend> createInstance(std::string, std::map<std::string, std::string> parameters) {
16  return returnInstance<DummyForAreaHandshakeBackend>(
17  parameters.at("map"), convertPathRelativeToDmapToAbs(parameters.at("map")));
18  }
19 
23  "dummyForAreaHandshake", &DummyForAreaHandshakeBackend::createInstance, {"map"});
24  }
25  };
26 
27  void write(uint64_t bar, uint64_t address, int32_t const* data, size_t sizeInBytes) {
28  setBusy();
29  DummyBackend::write(bar, address, data, sizeInBytes);
30  };
31  void setBusy() {
32  // APP.1.STATUS of tests/SubdeviceTarget.map
33  uint64_t address = 8;
34  int32_t data = 1;
35  DummyBackend::write(1, address, &data, 4);
36  }
37 };
38 
39 static DummyForAreaHandshakeBackend::BackendRegisterer gDFAHBackendRegisterer;
ChimeraTK::DummyBackend::write
void write(uint64_t bar, uint64_t address, int32_t const *data, size_t sizeInBytes) override
Write function to be implemented by backends.
Definition: DummyBackend.cc:61
ChimeraTK::DummyBackend::DummyBackend
DummyBackend(const std::string &mapFileName)
Definition: DummyBackend.cc:17
DummyForAreaHandshakeBackend
Definition: DummyForAreaHandshake.cc:12
ChimeraTK::BackendFactory::getInstance
static BackendFactory & getInstance()
Static function to get an instance of factory.
Definition: BackendFactory.cc:191
DummyBackend.h
DummyForAreaHandshakeBackend::BackendRegisterer
Definition: DummyForAreaHandshake.cc:20
DummyForAreaHandshakeBackend::createInstance
static boost::shared_ptr< DeviceBackend > createInstance(std::string, std::map< std::string, std::string > parameters)
Definition: DummyForAreaHandshake.cc:15
BackendFactory.h
DummyForAreaHandshakeBackend::write
void write(uint64_t bar, uint64_t address, int32_t const *data, size_t sizeInBytes)
Write function to be implemented by backends.
Definition: DummyForAreaHandshake.cc:27
ChimeraTK::DummyBackend
The dummy device opens a mapping file instead of a device, and implements all registers defined in th...
Definition: DummyBackend.h:45
ChimeraTK::BackendFactory::registerBackendType
void registerBackendType(const std::string &backendType, boost::shared_ptr< DeviceBackend >(*creatorFunction)(std::string address, std::map< std::string, std::string > parameters), const std::vector< std::string > &sdmParameterNames={}, const std::string &deviceAccessVersion=CHIMERATK_DEVICEACCESS_VERSION)
Register a backend by the name backendType with the given creatorFunction.
Definition: BackendFactory.cc:45
DummyForAreaHandshakeBackend::BackendRegisterer::BackendRegisterer
BackendRegisterer()
Definition: DummyForAreaHandshake.cc:21
ChimeraTK
Definition: DummyBackend.h:16
DummyForAreaHandshakeBackend::setBusy
void setBusy()
Definition: DummyForAreaHandshake.cc:31