CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::LockedObject< T, Mutex >::TemporaryLock< U > Class Template Reference

A helper class that acquires a temporary lock and overloads operator-> to allow access to the object. More...

#include <CeresEngine/Foundation/Threading/Threading.hpp>

Public Member Functions

 TemporaryLock (LockedObject< T, Mutex > &owner) noexcept
 Creates a new temporary lock object for owner.
 
Uoperator-> () const noexcept
 Access the LockedObject value from a temporary lock.
 
Uoperator* () const noexcept
 Access the LockedObject value from a temporary lock.
 
 operator bool () const noexcept
 Checks if the lock is owned.
 

Private Attributes

LockedObject< T, Mutex > & mOwner
 The temporary lock owner,.
 
UniqueLock< MutexmLock
 The temporary lock object.
 

Detailed Description

template<typename T, typename Mutex = Mutex>
template<typename U>
class CeresEngine::LockedObject< T, Mutex >::TemporaryLock< U >

A helper class that acquires a temporary lock and overloads operator-> to allow access to the object.

Constructor & Destructor Documentation

◆ TemporaryLock()

template<typename T , typename Mutex = Mutex>
template<typename U >
CeresEngine::LockedObject< T, Mutex >::TemporaryLock< U >::TemporaryLock ( LockedObject< T, Mutex > &  owner)
inlineexplicitnoexcept

Creates a new temporary lock object for owner.

Member Function Documentation

◆ operator bool()

template<typename T , typename Mutex = Mutex>
template<typename U >
CeresEngine::LockedObject< T, Mutex >::TemporaryLock< U >::operator bool ( ) const
inlineexplicitnoexcept

Checks if the lock is owned.

◆ operator*()

template<typename T , typename Mutex = Mutex>
template<typename U >
U & CeresEngine::LockedObject< T, Mutex >::TemporaryLock< U >::operator* ( ) const
inlinenoexcept

Access the LockedObject value from a temporary lock.

◆ operator->()

template<typename T , typename Mutex = Mutex>
template<typename U >
U * CeresEngine::LockedObject< T, Mutex >::TemporaryLock< U >::operator-> ( ) const
inlinenoexcept

Access the LockedObject value from a temporary lock.

Member Data Documentation

◆ mLock

template<typename T , typename Mutex = Mutex>
template<typename U >
UniqueLock<Mutex> CeresEngine::LockedObject< T, Mutex >::TemporaryLock< U >::mLock
private

The temporary lock object.

◆ mOwner

template<typename T , typename Mutex = Mutex>
template<typename U >
LockedObject<T, Mutex>& CeresEngine::LockedObject< T, Mutex >::TemporaryLock< U >::mOwner
private

The temporary lock owner,.


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