dart
Public Member Functions | Protected Member Functions | List of all members
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:
Inheritance graph
[legend]

Public Member Functions

constexpr LockableReference () noexcept=default
 Default construtor.
 
virtual ~LockableReference ()=default
 Default destructor.
 
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.
 

Protected Member Functions

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

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.

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 >.


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