MySQL 8.4.0
Source Code Documentation
ut::bool_scope_guard_t Class Reference

A RAII-style class, which sets a given boolean to true in constructor, and to false in destructor, effectively making sure that it is true for the duration of the object lifetime/scope. More...

#include <ut0bool_scope_guard.h>

Inheritance diagram for ut::bool_scope_guard_t:
[legend]

Public Member Functions

 bool_scope_guard_t (bool &active)
 Creates the RAII guard which sets active to true for the duration of its lifetime. More...
 
 ~bool_scope_guard_t ()
 
 bool_scope_guard_t (bool_scope_guard_t const &)=delete
 
bool_scope_guard_toperator= (bool_scope_guard_t const &)=delete
 
bool_scope_guard_toperator= (bool_scope_guard_t &&)=delete
 
 bool_scope_guard_t (bool_scope_guard_t &&old)
 

Private Attributes

bool * m_active
 boolean to be manipulated, or nullptr if the object was moved from, or already destructed More...
 

Detailed Description

A RAII-style class, which sets a given boolean to true in constructor, and to false in destructor, effectively making sure that it is true for the duration of the object lifetime/scope.

Constructor & Destructor Documentation

◆ bool_scope_guard_t() [1/3]

ut::bool_scope_guard_t::bool_scope_guard_t ( bool &  active)
inlineexplicit

Creates the RAII guard which sets active to true for the duration of its lifetime.

Parameters
[in,out]activethe boolean which is to be manipulated

◆ ~bool_scope_guard_t()

ut::bool_scope_guard_t::~bool_scope_guard_t ( )
inline

◆ bool_scope_guard_t() [2/3]

ut::bool_scope_guard_t::bool_scope_guard_t ( bool_scope_guard_t const &  )
delete

◆ bool_scope_guard_t() [3/3]

ut::bool_scope_guard_t::bool_scope_guard_t ( bool_scope_guard_t &&  old)
inline

Member Function Documentation

◆ operator=() [1/2]

bool_scope_guard_t & ut::bool_scope_guard_t::operator= ( bool_scope_guard_t &&  )
delete

◆ operator=() [2/2]

bool_scope_guard_t & ut::bool_scope_guard_t::operator= ( bool_scope_guard_t const &  )
delete

Member Data Documentation

◆ m_active

bool* ut::bool_scope_guard_t::m_active
private

boolean to be manipulated, or nullptr if the object was moved from, or already destructed


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