33 #ifndef DART_COMMON_LOCKABLEREFERENCE_HPP_ 34 #define DART_COMMON_LOCKABLEREFERENCE_HPP_ 61 virtual void lock() = 0;
65 virtual bool try_lock() noexcept = 0;
68 virtual void unlock() noexcept = 0;
78 template <
typename LockableT>
82 using Lockable = LockableT;
91 std::weak_ptr<const void> lockableHolder, Lockable& lockable) noexcept;
100 void unlock() noexcept
override;
104 std::weak_ptr<const void> mLockableHolder;
117 template <
typename LockableT>
121 using Lockable = LockableT;
130 template <
typename InputIterator>
132 std::weak_ptr<const void> lockableHolder,
137 void lock()
override;
143 void unlock() noexcept
override;
147 template <
typename T>
151 template <
typename T>
155 std::weak_ptr<const void> mLockableHolder;
158 std::vector<Lockable*> mLockables;
164 #include "dart/common/detail/LockableReference-impl.hpp" 166 #endif // DART_COMMON_LOCKABLEREFERENCE_HPP_ MultiLockableReference references multiple lockables.
Definition: LockableReference.hpp:118
LockableReference is a wrapper class of single or multiple Lockable object(s) to provide unified inte...
Definition: LockableReference.hpp:49
Definition: Aspect.cpp:40
virtual ~LockableReference()=default
Default destructor.
virtual bool try_lock() noexcept=0
Tries to lock the lockables that this class references; returns false if one of the lockables is not ...
virtual void lock()=0
Locks lockable that this class references; blocks if one of the lockables are not avaliable...
This class references a single lockable.
Definition: LockableReference.hpp:79
virtual void unlock() noexcept=0
Unlocks the lockables.
constexpr LockableReference() noexcept=default
Default construtor.