Template Class Synchronised::LockedImpl¶
Defined in File synchronised.h
Nested Relationships¶
This class is a nested type of Template Class Synchronised.
Class Documentation¶
-
template<typename U>
class LockedImpl¶ Smart-pointer-esque accessor for the protected data.
Ensures exclusive access to the referenced data.
Note
Instances of Locked must not outlive the Synchronised they are derived from.
Public Functions
-
inline LockedImpl(LockedImpl &&from) noexcept¶
-
~LockedImpl() = default¶
-
inline void drop()¶
Relinquish access to the data.
This prevents further access to the contained data through this handle, and allows other code to acquire access.
-
template<typename Cv, typename Predicate>
inline void wait(Cv &cv, Predicate stop_waiting)¶ Allows waiting for a condition variable.
The protected data may be accessed both in the predicate and after this method completes.
-
template<typename Cv, typename Duration, typename Predicate>
inline bool wait_for(Cv &cv, Duration const &timeout, Predicate stop_waiting)¶ Allows waiting for a condition variable with a timeout.
The protected data may be accessed both in the predicate and after this method completes.
- Returns:
true if the predicate was satisfied, false if the timeout elapsed.
-
inline LockedImpl(LockedImpl &&from) noexcept¶