Template Class Synchronised::LockedImpl

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 auto operator*() const -> U&
inline auto operator->() const -> U*
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.