ChimeraTK-DeviceAccess 03.25.00
Loading...
Searching...
No Matches
Domain.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 <boost/enable_shared_from_this.hpp>
6#include <boost/shared_ptr.hpp>
7
8#include <mutex>
9
10namespace ChimeraTK::async {
11
25 class Domain : public boost::enable_shared_from_this<Domain> {
26 public:
27 virtual void sendException(const std::exception_ptr& e) noexcept = 0;
28 virtual void deactivate() = 0;
29 virtual ~Domain() = default;
30
31 std::lock_guard<std::mutex> getDomainLock() { return std::lock_guard<std::mutex>{_mutex}; }
32
33 protected:
34 // This mutex is protecting all members and all functions in Domain and DomainImpl
35 std::mutex _mutex;
36 bool _isActive{false};
37
42 bool unsafeGetIsActive() const { return _isActive; }
43
44 // The friend functions are only allowed to call unsafeGetIsActive(). They must not touch any of the
45 // internal variables directly.
48 template<typename BackendSpecificDataType>
49 friend class SubDomain;
51
52 template<typename SourceType>
54
55 template<typename UserType>
57 };
58} // namespace ChimeraTK::async
The AsyncAccessorManager has three main functionalities:
The AsyncNDRegisterAccessor implements a data transport queue with typed data as continuation of the ...
The Domain is the thread-safe entry point for each distribution tree.
Definition Domain.h:25
bool unsafeGetIsActive() const
Friend classes are allowed to read the _isActiveFlag without acquiring the mutex.
Definition Domain.h:42
std::lock_guard< std::mutex > getDomainLock()
Definition Domain.h:31
virtual void sendException(const std::exception_ptr &e) noexcept=0
virtual ~Domain()=default
virtual void deactivate()=0
Interface base class for interrupt controller handlers.
Send backend-specific asynchronous data to different distributors:
Definition SubDomain.h:33
The TriggeredPollDistributor has std::nullptr_t source data type and is polling the data for the Asyn...