ChimeraTK-ApplicationCore 04.06.00
Loading...
Searching...
No Matches
DeviceModule.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 "ModuleGroup.h"
6
7#include <ChimeraTK/Device.h>
8#include <ChimeraTK/ForwardDeclarations.h>
9#include <ChimeraTK/RegisterPath.h>
10
11#include <boost/thread/latch.hpp>
12
13namespace ChimeraTK {
14 class DeviceManager;
15
16 /********************************************************************************************************************/
17
20 class DeviceModule : public ModuleGroup {
21 public:
44 DeviceModule(ModuleGroup* owner, const std::string& deviceAliasOrCDD, const std::string& triggerPath = {},
45 std::function<void(ChimeraTK::Device&)> initialisationHandler = nullptr, const std::string& pathInDevice = "/");
46
48
50 DeviceModule(DeviceModule&& other) noexcept { operator=(std::move(other)); }
51
53 DeviceModule& operator=(DeviceModule&& other) noexcept;
54
59 const DeviceManager& getDeviceManager() const;
60
62
63 const std::string& getDeviceAliasOrURI() const;
64
65 void addInitialisationHandler(std::function<void(ChimeraTK::Device&)> initialisationHandler);
66
72 void reportException(std::string errMsg);
73
74 const std::string& getTriggerPath() const { return _triggerPath; }
75
76 protected:
78 boost::weak_ptr<DeviceManager> _dm;
79
82
83 std::string _triggerPath;
84
85 std::string _pathInDevice;
86 };
87
88 /********************************************************************************************************************/
89
95 public:
96 explicit SetDMapFilePath(const std::string& dmapFilePath);
97 };
98
99 /********************************************************************************************************************/
100
101} /* namespace ChimeraTK */
Implements access to a ChimeraTK::Device.
DeviceModule & operator=(DeviceModule &&other) noexcept
Move assignment.
const std::string & getTriggerPath() const
boost::weak_ptr< DeviceManager > _dm
The corresponding DeviceManager.
void addInitialisationHandler(std::function< void(ChimeraTK::Device &)> initialisationHandler)
void reportException(std::string errMsg)
Use this function to report an exception.
DeviceManager & getDeviceManager()
Return the corresponding DeviceManager.
const std::string & getDeviceAliasOrURI() const
Model::DeviceModuleProxy getModel()
DeviceModule(DeviceModule &&other) noexcept
Move operation with the move constructor.
Model::DeviceModuleProxy _model
Implementation class for the model.
Definition Model.h:1360
friend class DeviceModule
Definition ModuleGroup.h:48
ModuleGroup()=default
Default constructor to allow late initialisation of module groups.
Helper class to set the DMAP file path.
InvalidityTracer application module.