DynExp
Highly flexible laboratory automation for dynamically changing experiments.
DynExpHardware::PVCamHardwareAdapter::PVCamInitializer Class Reference

Only one instance of this class is allowed for synchronizing calls to the PVCam library from any PVCamHardwareAdapter instance. More...

+ Inheritance diagram for DynExpHardware::PVCamHardwareAdapter::PVCamInitializer:

Static Public Member Functions

static void Init ()
 
static auto GetIsInitialized () noexcept
 
static LockType Lock (const std::chrono::milliseconds Timeout=std::chrono::milliseconds(100))
 

Private Member Functions

 PVCamInitializer ()=default
 
 ~PVCamInitializer ()
 

Static Private Member Functions

static PVCamInitializerGetInstance (bool MayInit=false)
 

Private Attributes

std::atomic< bool > IsInitialized = false
 

Additional Inherited Members

- Public Member Functions inherited from Util::INonCopyable
 INonCopyable (const INonCopyable &)=delete
 
INonCopyableoperator= (const INonCopyable &)=delete
 
- Static Public Attributes inherited from Util::ILockable
static constexpr std::chrono::milliseconds DefaultTimeout = std::chrono::milliseconds(10)
 Duration which is used as a default timeout within all methods of this class if no different duration is passed to them. More...
 
- Protected Types inherited from Util::ILockable
using MutexType = std::timed_mutex
 
using LockType = std::unique_lock< MutexType >
 
- Protected Member Functions inherited from Util::ILockable
 ILockable ()=default
 
 ~ILockable ()=default
 
LockType AcquireLock (const std::chrono::milliseconds Timeout=DefaultTimeout) const
 Locks the internal mutex. Blocks until the mutex is locked or until the timeout duration is exceeded. More...
 
- Protected Member Functions inherited from Util::INonCopyable
constexpr INonCopyable ()=default
 
 ~INonCopyable ()=default
 

Detailed Description

Only one instance of this class is allowed for synchronizing calls to the PVCam library from any PVCamHardwareAdapter instance.

Warning
Always lock the mutex of PVCamHardwareAdapter (by a call to Util::ILockable::AcquireLock()) before the PVCamInitializer (by a call to PVCamInitializer::Lock()).

Definition at line 73 of file HardwareAdapterPVCam.h.

Constructor & Destructor Documentation

◆ PVCamInitializer()

DynExpHardware::PVCamHardwareAdapter::PVCamInitializer::PVCamInitializer ( )
privatedefault

◆ ~PVCamInitializer()

DynExpHardware::PVCamHardwareAdapter::PVCamInitializer::~PVCamInitializer ( )
private

Definition at line 46 of file HardwareAdapterPVCam.cpp.

Member Function Documentation

◆ GetInstance()

PVCamHardwareAdapter::PVCamInitializer & DynExpHardware::PVCamHardwareAdapter::PVCamInitializer::GetInstance ( bool  MayInit = false)
staticprivate

Definition at line 58 of file HardwareAdapterPVCam.cpp.

◆ GetIsInitialized()

static auto DynExpHardware::PVCamHardwareAdapter::PVCamInitializer::GetIsInitialized ( )
inlinestaticnoexcept

Definition at line 81 of file HardwareAdapterPVCam.h.

◆ Init()

static void DynExpHardware::PVCamHardwareAdapter::PVCamInitializer::Init ( )
inlinestatic

Definition at line 80 of file HardwareAdapterPVCam.h.

◆ Lock()

PVCamHardwareAdapter::PVCamInitializer::LockType DynExpHardware::PVCamHardwareAdapter::PVCamInitializer::Lock ( const std::chrono::milliseconds  Timeout = std::chrono::milliseconds(100))
static

Definition at line 53 of file HardwareAdapterPVCam.cpp.

Member Data Documentation

◆ IsInitialized

std::atomic<bool> DynExpHardware::PVCamHardwareAdapter::PVCamInitializer::IsInitialized = false
private

Definition at line 90 of file HardwareAdapterPVCam.h.


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