ChimeraTK-DeviceAccess  03.18.00
ChimeraTK::async::Domain Class Referenceabstract

The Domain is the thread-safe entry point for each distribution tree. More...

#include <Domain.h>

+ Inheritance diagram for ChimeraTK::async::Domain:
+ Collaboration diagram for ChimeraTK::async::Domain:

Public Member Functions

virtual void sendException (const std::exception_ptr &e) noexcept=0
 
virtual void deactivate ()=0
 
virtual ~Domain ()=default
 
std::lock_guard< std::mutex > getDomainLock ()
 

Protected Member Functions

bool unsafeGetIsActive () const
 Friend classes are allowed to read the _isActiveFlag without acquiring the mutex. More...
 

Protected Attributes

std::mutex _mutex
 
bool _isActive {false}
 

Friends

class AsyncAccessorManager
 
class TriggeredPollDistributor
 
template<typename BackendSpecificDataType >
class SubDomain
 
class MuxedInterruptDistributor
 
template<typename SourceType >
class SourceTypedAsyncAccessorManager
 
template<typename UserType >
class AsyncNDRegisterAccessor
 

Detailed Description

The Domain is the thread-safe entry point for each distribution tree.

Distributing data to accessors, sending exceptions and subscription of new accessors will all happen from different threads. This class implements a central mutex such that only one operation on the distribution three is executed at the same time.

This base class is providing the mutex and the _isActive flag, which is needed throughout the distribution tree. It also has a virtual setException() function to a allow sending exception from code that does not know about the backend-specific data type.

All other functions depend on a backend-specific data type, the according SubDomain and distributors, and are implemented in the templated DomainImpl.

Definition at line 25 of file Domain.h.

Constructor & Destructor Documentation

◆ ~Domain()

virtual ChimeraTK::async::Domain::~Domain ( )
virtualdefault

Member Function Documentation

◆ deactivate()

virtual void ChimeraTK::async::Domain::deactivate ( )
pure virtual

◆ getDomainLock()

std::lock_guard<std::mutex> ChimeraTK::async::Domain::getDomainLock ( )
inline

Definition at line 31 of file Domain.h.

◆ sendException()

virtual void ChimeraTK::async::Domain::sendException ( const std::exception_ptr &  e)
pure virtualnoexcept

◆ unsafeGetIsActive()

bool ChimeraTK::async::Domain::unsafeGetIsActive ( ) const
inlineprotected

Friend classes are allowed to read the _isActiveFlag without acquiring the mutex.

The friend's functions are only called from the Domain functions after already locking the mutex.

Definition at line 42 of file Domain.h.

Friends And Related Function Documentation

◆ AsyncAccessorManager

friend class AsyncAccessorManager
friend

Definition at line 46 of file Domain.h.

◆ AsyncNDRegisterAccessor

template<typename UserType >
friend class AsyncNDRegisterAccessor
friend

Definition at line 56 of file Domain.h.

◆ MuxedInterruptDistributor

friend class MuxedInterruptDistributor
friend

Definition at line 50 of file Domain.h.

◆ SourceTypedAsyncAccessorManager

template<typename SourceType >
friend class SourceTypedAsyncAccessorManager
friend

Definition at line 53 of file Domain.h.

◆ SubDomain

template<typename BackendSpecificDataType >
friend class SubDomain
friend

Definition at line 49 of file Domain.h.

◆ TriggeredPollDistributor

friend class TriggeredPollDistributor
friend

Definition at line 47 of file Domain.h.

Member Data Documentation

◆ _isActive

bool ChimeraTK::async::Domain::_isActive {false}
protected

Definition at line 36 of file Domain.h.

◆ _mutex

std::mutex ChimeraTK::async::Domain::_mutex
protected

Definition at line 35 of file Domain.h.


The documentation for this class was generated from the following file: