33 #ifndef DART_COMMON_LOCKABLEREFERENCE_IMPL_HPP_
34 #define DART_COMMON_LOCKABLEREFERENCE_IMPL_HPP_
42 template <
typename Lockable>
44 std::weak_ptr<const void> lockableHolder,
Lockable& lockable) noexcept
45 : mLockableHolder(std::move(lockableHolder)),
52 template <
typename Lockable>
55 if (mLockableHolder.expired())
62 template <
typename Lockable>
65 if (mLockableHolder.expired())
68 return mLockable.try_lock();
72 template <
typename Lockable>
75 if (mLockableHolder.expired())
82 template <
typename Lockable>
83 template <
typename InputIterator>
85 std::weak_ptr<const void> lockableHolder,
88 : mLockableHolder(
std::move(lockableHolder)), mLockables(first, last)
90 using IteratorValueType =
91 typename std::iterator_traits<InputIterator>::value_type;
92 using IteratorLockable =
typename std::remove_pointer<
96 std::is_same<Lockable, IteratorLockable>::value,
97 "Lockable of this class and the lockable of InputIterator are not the "
102 template <
typename Lockable>
105 if (mLockableHolder.expired())
108 for (
auto lockable : mLockables)
113 template <
typename Lockable>
116 if (mLockableHolder.expired())
119 for (
auto lockable : mLockables)
121 if (!lockable->try_lock())
129 template <
typename Lockable>
132 if (mLockableHolder.expired())
135 for (
auto it = mLockables.rbegin(); it != mLockables.rend(); ++it)
140 template <
typename Lockable>
141 template <
typename T>
148 template <
typename Lockable>
149 template <
typename T>
std::string type
Definition: SdfParser.cpp:82
bool try_lock() noexcept override
Tries to lock the lockables that this class references; returns false if one of the lockables is not ...
Definition: LockableReference-impl.hpp:114
MultiLockableReference(std::weak_ptr< const void > lockableHolder, InputIterator first, InputIterator last)
Constructs from multiple lockables.
Definition: LockableReference-impl.hpp:84
void unlock() noexcept override
Unlocks the lockables.
Definition: LockableReference-impl.hpp:130
void lock() override
Locks lockable that this class references; blocks if one of the lockables are not avaliable.
Definition: LockableReference-impl.hpp:103
T * ptr(T &obj)
Converts reference to pointer.
Definition: LockableReference-impl.hpp:142
bool try_lock() noexcept override
Tries to lock the lockables that this class references; returns false if one of the lockables is not ...
Definition: LockableReference-impl.hpp:63
LockableT Lockable
Definition: LockableReference.hpp:82
void unlock() noexcept override
Unlocks the lockables.
Definition: LockableReference-impl.hpp:73
void lock() override
Locks lockable that this class references; blocks if one of the lockables are not avaliable.
Definition: LockableReference-impl.hpp:53
SingleLockableReference(std::weak_ptr< const void > lockableHolder, Lockable &lockable) noexcept
Constructor from a single lockable.
Definition: LockableReference-impl.hpp:43
Definition: BulletCollisionDetector.cpp:63
Definition: SharedLibraryManager.hpp:43