DART  6.10.1
dart::common::LockableReference Class Referenceabstract

LockableReference is a wrapper class of single or multiple Lockable object(s) to provide unified interface that guarantees deadlock-free locking and unlocking of the internal lockable(s). More...

#include <LockableReference.hpp>

Inheritance diagram for dart::common::LockableReference:
dart::common::MultiLockableReference< LockableT > dart::common::SingleLockableReference< LockableT >

Public Member Functions

constexpr LockableReference () noexcept=default
 Default construtor. More...
 
virtual ~LockableReference ()=default
 Default destructor. More...
 
virtual void lock ()=0
 Locks lockable that this class references; blocks if one of the lockables are not avaliable. More...
 
virtual bool try_lock () noexcept=0
 Tries to lock the lockables that this class references; returns false if one of the lockables is not avaliable. More...
 
virtual void unlock () noexcept=0
 Unlocks the lockables. More...
 

Protected Member Functions

 LockableReference (const LockableReference &)=delete
 Copy construction is not allowed. More...
 

Detailed Description

LockableReference is a wrapper class of single or multiple Lockable object(s) to provide unified interface that guarantees deadlock-free locking and unlocking of the internal lockable(s).

This class is compatible to BasicLockable concept so that it can be used as a template parameter that requires BasicLockable concept such as std::lock_guard.

Constructor & Destructor Documentation

◆ LockableReference() [1/2]

constexpr dart::common::LockableReference::LockableReference ( )
constexprdefaultnoexcept

Default construtor.

◆ ~LockableReference()

virtual dart::common::LockableReference::~LockableReference ( )
virtualdefault

Default destructor.

◆ LockableReference() [2/2]

dart::common::LockableReference::LockableReference ( const LockableReference )
protecteddelete

Copy construction is not allowed.

Member Function Documentation

◆ lock()

virtual void dart::common::LockableReference::lock ( )
pure virtual

Locks lockable that this class references; blocks if one of the lockables are not avaliable.

Implemented in dart::common::MultiLockableReference< LockableT >, and dart::common::SingleLockableReference< LockableT >.

◆ try_lock()

virtual bool dart::common::LockableReference::try_lock ( )
pure virtualnoexcept

Tries to lock the lockables that this class references; returns false if one of the lockables is not avaliable.

Implemented in dart::common::MultiLockableReference< LockableT >, and dart::common::SingleLockableReference< LockableT >.

◆ unlock()

virtual void dart::common::LockableReference::unlock ( )
pure virtualnoexcept