taco-db  0.1.0
Public Member Functions | List of all members
taco::MutexGuard Class Reference

MutexGuard is similar to std::lock_guard but it stores a pointer to a mutex and allows one to store a nullptr instead. More...

#include <utils/MutexGuard.h>

Inheritance diagram for taco::MutexGuard:
taco::ResourceGuard< std::mutex *, MutexReleaseFunc, std::mutex *, nullptr >

Public Member Functions

 MutexGuard ()
 
 MutexGuard (std::mutex *m)
 
- Public Member Functions inherited from taco::ResourceGuard< std::mutex *, MutexReleaseFunc, std::mutex *, nullptr >
 ResourceGuard ()
 
 ResourceGuard (std::mutex * val)
 
 ResourceGuard (const ResourceGuard &)=delete
 
 ResourceGuard (ResourceGuard &&other)
 
 ~ResourceGuard ()
 
ResourceGuardoperator= (const ResourceGuard &)=delete
 
ResourceGuardoperator= (ResourceGuard &&other)
 
 operator std::mutex * () const
 
std::mutex * Get () const
 
 operator bool () const
 
bool IsValid () const
 
void Reset ()
 Relinquishes the underlying resource and sets its to an invalid value. More...
 
std::mutex * Release ()
 Releases the underlying resource without relinquishing it and returns it to the caller. More...
 
constexpr bool operator== (std::mutex * rhs) const
 
constexpr bool operator!= (std::mutex * rhs) const
 

Detailed Description

MutexGuard is similar to std::lock_guard but it stores a pointer to a mutex and allows one to store a nullptr instead.

Constructor & Destructor Documentation

◆ MutexGuard() [1/2]

taco::MutexGuard::MutexGuard ( )
inline

◆ MutexGuard() [2/2]

taco::MutexGuard::MutexGuard ( std::mutex *  m)
inline

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