Internal Interface Wrap
API reference
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
PlatformUniqueLock< Mutex > Class Template Reference

RAII exclusive lock guard for any mutex with lock()/try_lock_for()/unlock(). More...

#include <PlatformMutex.h>

Public Member Functions

 PlatformUniqueLock (Mutex &mutex, uint32_t timeout_ms=0) noexcept
 
 ~PlatformUniqueLock () noexcept
 
 PlatformUniqueLock (const PlatformUniqueLock &)=delete
 
PlatformUniqueLock & operator= (const PlatformUniqueLock &)=delete
 
 PlatformUniqueLock (PlatformUniqueLock &&other) noexcept
 
PlatformUniqueLock & operator= (PlatformUniqueLock &&other) noexcept
 
bool IsLocked () const noexcept
 
void Unlock () noexcept
 

Private Attributes

Mutex * mutex_
 
bool locked_
 

Detailed Description

template<typename Mutex>
class PlatformUniqueLock< Mutex >

RAII exclusive lock guard for any mutex with lock()/try_lock_for()/unlock().

Template Parameters
MutexType providing lock(), try_lock_for(uint32_t), unlock().

Constructor & Destructor Documentation

◆ PlatformUniqueLock() [1/3]

template<typename Mutex >
PlatformUniqueLock< Mutex >::PlatformUniqueLock ( Mutex &  mutex,
uint32_t  timeout_ms = 0 
)
inlineexplicitnoexcept

◆ ~PlatformUniqueLock()

template<typename Mutex >
PlatformUniqueLock< Mutex >::~PlatformUniqueLock ( )
inlinenoexcept

◆ PlatformUniqueLock() [2/3]

◆ PlatformUniqueLock() [3/3]

template<typename Mutex >
PlatformUniqueLock< Mutex >::PlatformUniqueLock ( PlatformUniqueLock< Mutex > &&  other)
inlinenoexcept

Member Function Documentation

◆ IsLocked()

template<typename Mutex >
bool PlatformUniqueLock< Mutex >::IsLocked ( ) const
inlinenoexcept

◆ operator=() [1/2]

◆ operator=() [2/2]

◆ Unlock()

template<typename Mutex >
void PlatformUniqueLock< Mutex >::Unlock ( )
inlinenoexcept

Member Data Documentation

◆ locked_

template<typename Mutex >
bool PlatformUniqueLock< Mutex >::locked_
private

◆ mutex_

template<typename Mutex >
Mutex* PlatformUniqueLock< Mutex >::mutex_
private

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