Mir
Public Member Functions | Friends | List of all members
mir::Synchronised< T >::LockedImpl< U > Class Template Reference

Smart-pointer-esque accessor for the protected data. More...

#include <synchronised.h>

Public Member Functions

 LockedImpl (LockedImpl &&from) noexcept
 
 ~LockedImpl ()=default
 
auto operator* () const -> U &
 
auto operator-> () const -> U *
 
void drop ()
 Relinquish access to the data. More...
 
template<typename Cv , typename Predicate >
void wait (Cv &cv, Predicate stop_waiting)
 Allows waiting for a condition variable. More...
 

Friends

class Synchronised
 

Detailed Description

template<typename T>
template<typename U>
class mir::Synchronised< T >::LockedImpl< U >

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.

Constructor & Destructor Documentation

◆ LockedImpl()

template<typename T >
template<typename U >
mir::Synchronised< T >::LockedImpl< U >::LockedImpl ( LockedImpl< U > &&  from)
inlinenoexcept

◆ ~LockedImpl()

template<typename T >
template<typename U >
mir::Synchronised< T >::LockedImpl< U >::~LockedImpl ( )
default

Member Function Documentation

◆ drop()

template<typename T >
template<typename U >
void mir::Synchronised< T >::LockedImpl< U >::drop ( )
inline

Relinquish access to the data.

This prevents further access to the contained data through this handle, and allows other code to acquire access.

◆ operator*()

template<typename T >
template<typename U >
auto mir::Synchronised< T >::LockedImpl< U >::operator* ( ) const -> U&
inline

◆ operator->()

template<typename T >
template<typename U >
auto mir::Synchronised< T >::LockedImpl< U >::operator-> ( ) const -> U*
inline

◆ wait()

template<typename T >
template<typename U >
template<typename Cv , typename Predicate >
void mir::Synchronised< T >::LockedImpl< U >::wait ( Cv &  cv,
Predicate  stop_waiting 
)
inline

Allows waiting for a condition variable.

The protected data may be accessed both in the predicate and after this method completes.

Friends And Related Function Documentation

◆ Synchronised

template<typename T >
template<typename U >
friend class Synchronised
friend

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

Copyright © 2012-2023 Canonical Ltd.
Generated on Tue 2 May 10:01:24 UTC 2023
This documentation is licensed under the GPL version 2 or 3.