MySQL 26.7.0
Source Code Documentation
mysql::csa::Lock_guard_object< Type > Class Template Reference

Scope guard to unlock an object. More...

#include <lock_guard_object.h>

Public Member Functions

void reset ()
 Unlocks the object if the locked flag is set and then resets the flag. More...
 
 ~Lock_guard_object ()
 Destructor that unlocks if not unlocked. More...
 
 Lock_guard_object (Type *module)
 Constructor. More...
 

Protected Attributes

Typem_obj
 Locked object pointer. More...
 
bool locked {true}
 Lock flag. More...
 

Detailed Description

template<typename Type>
class mysql::csa::Lock_guard_object< Type >

Scope guard to unlock an object.

Assumes the object is locked upon construction and calls unlock() on destruction unless reset() is called.

Template Parameters
Typeof the object to unlock

Constructor & Destructor Documentation

◆ ~Lock_guard_object()

template<typename Type >
mysql::csa::Lock_guard_object< Type >::~Lock_guard_object ( )
inline

Destructor that unlocks if not unlocked.

◆ Lock_guard_object()

template<typename Type >
mysql::csa::Lock_guard_object< Type >::Lock_guard_object ( Type module)
inline

Constructor.

Parameters
modulePointer to the object to unlock

Member Function Documentation

◆ reset()

template<typename Type >
void mysql::csa::Lock_guard_object< Type >::reset ( )
inline

Unlocks the object if the locked flag is set and then resets the flag.

Member Data Documentation

◆ locked

template<typename Type >
bool mysql::csa::Lock_guard_object< Type >::locked {true}
protected

Lock flag.

◆ m_obj

template<typename Type >
Type* mysql::csa::Lock_guard_object< Type >::m_obj
protected

Locked object pointer.


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