Botcraft 1.21.4
Loading...
Searching...
No Matches
Botcraft::Utilities::OnEndScope Class Reference

A class to execute a callback when destroyed. More...

#include <MiscUtilities.hpp>

Public Member Functions

 OnEndScope (const std::function< void()> &f=[]() {})
 
 ~OnEndScope ()
 
 OnEndScope (const OnEndScope &other)=delete
 
 OnEndScope (OnEndScope &&other)=delete
 
OnEndScopeoperator= (const OnEndScope &other)=delete
 

Private Attributes

std::function< void()> callback
 

Detailed Description

A class to execute a callback when destroyed.

Definition at line 8 of file MiscUtilities.hpp.

Constructor & Destructor Documentation

◆ OnEndScope() [1/3]

Botcraft::Utilities::OnEndScope::OnEndScope ( const std::function< void()> &  f = []() {})
inline

Definition at line 11 of file MiscUtilities.hpp.

◆ ~OnEndScope()

Botcraft::Utilities::OnEndScope::~OnEndScope ( )
inline

Definition at line 12 of file MiscUtilities.hpp.

References callback.

◆ OnEndScope() [2/3]

Botcraft::Utilities::OnEndScope::OnEndScope ( const OnEndScope other)
delete

◆ OnEndScope() [3/3]

Botcraft::Utilities::OnEndScope::OnEndScope ( OnEndScope &&  other)
delete

Member Function Documentation

◆ operator=()

OnEndScope & Botcraft::Utilities::OnEndScope::operator= ( const OnEndScope other)
delete

Member Data Documentation

◆ callback

std::function<void()> Botcraft::Utilities::OnEndScope::callback
private

Definition at line 20 of file MiscUtilities.hpp.

Referenced by ~OnEndScope().


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