MySQL 9.1.0
Source Code Documentation
raii::Sentry< F > Class Template Reference

Generic sentry class that invokes some callable object of type F upon disposal of an instance of this class. More...

#include <sentry.h>

Inheritance diagram for raii::Sentry< F >:
[legend]

Public Member Functions

 Sentry (F dispose)
 Constructor for the class that stores the callable object passed as argument, to be invoked upon disposal of the object. More...
 
virtual ~Sentry ()
 Destructor for the class. More...
 

Private Attributes

m_dispose
 The callable to be invoked upon disposal of the object. More...
 

Detailed Description

template<typename F = std::function<void()>>
class raii::Sentry< F >

Generic sentry class that invokes some callable object of type F upon disposal of an instance of this class.

Check C++ documentation for the definition of Callable named requirement for more information.

Constructor & Destructor Documentation

◆ Sentry()

template<typename F >
raii::Sentry< F >::Sentry ( dispose)

Constructor for the class that stores the callable object passed as argument, to be invoked upon disposal of the object.

Parameters
disposeThe callable object to be invoked upon disposal of the object.

◆ ~Sentry()

template<typename F >
raii::Sentry< F >::~Sentry
virtual

Destructor for the class.

It will call the stored callable.

Member Data Documentation

◆ m_dispose

template<typename F = std::function<void()>>
F raii::Sentry< F >::m_dispose
private

The callable to be invoked upon disposal of the object.


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