MySQL 9.1.0
Source Code Documentation
Arch_scope_guard Class Reference

Guard to release resources safely. More...

#include <arch0arch.h>

Public Member Functions

 Arch_scope_guard (std::function< void()> function)
 Attach a function to the guard which releases some resource. More...
 
 ~Arch_scope_guard ()
 Release the resources automatically at the time of destruction. More...
 
void cleanup ()
 Manually release the resource. More...
 

Private Attributes

std::function< void()> m_cleanup {}
 Function to release the resource. More...
 

Detailed Description

Guard to release resources safely.

Constructor & Destructor Documentation

◆ Arch_scope_guard()

Arch_scope_guard::Arch_scope_guard ( std::function< void()>  function)
inline

Attach a function to the guard which releases some resource.

◆ ~Arch_scope_guard()

Arch_scope_guard::~Arch_scope_guard ( )
inline

Release the resources automatically at the time of destruction.

Member Function Documentation

◆ cleanup()

void Arch_scope_guard::cleanup ( void  )
inline

Manually release the resource.

Member Data Documentation

◆ m_cleanup

std::function<void()> Arch_scope_guard::m_cleanup {}
private

Function to release the resource.


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