GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
unwind_protect Class Reference

#include "unwind-prot.h"

Inheritance diagram for unwind_protect:
action_container unwind_protect_safe

Public Member Functions

 unwind_protect ()
 
 ~unwind_protect ()
 
void discard_first ()
 
 operator bool () const
 
void run_first ()
 
std::size_t size () const
 
- Public Member Functions inherited from action_container
 action_container ()
 
virtual ~action_container ()=default
 
template<typename F , typename... Args>
void add (F &&fcn, Args &&... args)
 
template<typename T >
void add_delete (T *obj)
 
template<typename... Params, typename... Args>
void add_fcn (void(*fcn)(Params...), Args &&... args)
 
template<typename T , typename... Params, typename... Args>
void add_method (T &obj, void(T::*method)(Params...), Args &&... args)
 
template<typename T , typename... Params, typename... Args>
void add_method (T *obj, void(T::*method)(Params...), Args &&... args)
 
void discard ()
 
void discard (std::size_t num)
 
bool empty () const
 
 operator bool () const
 
template<typename T >
void protect_var (T &var)
 
template<typename T >
void protect_var (T &var, const T &val)
 
void run ()
 
void run (std::size_t num)
 

Protected Member Functions

virtual void add_action (elem *new_elem)
 

Protected Attributes

std::stack< elem * > m_lifo
 

Detailed Description

Definition at line 40 of file unwind-prot.h.

Constructor & Destructor Documentation

◆ unwind_protect()

unwind_protect::unwind_protect ( )
inline

Definition at line 46 of file unwind-prot.h.

◆ ~unwind_protect()

unwind_protect::~unwind_protect ( )
inline

Definition at line 54 of file unwind-prot.h.

Member Function Documentation

◆ add_action()

virtual void unwind_protect::add_action ( elem new_elem)
inlineprotectedvirtual

Implements action_container.

Definition at line 83 of file unwind-prot.h.

◆ discard_first()

void unwind_protect::discard_first ( )
inlinevirtual

Implements action_container.

Definition at line 69 of file unwind-prot.h.

◆ operator bool()

unwind_protect::operator bool ( ) const
inline

Definition at line 56 of file unwind-prot.h.

◆ run_first()

void unwind_protect::run_first ( )
inlinevirtual

Implements action_container.

Definition at line 58 of file unwind-prot.h.

◆ size()

std::size_t unwind_protect::size ( ) const
inlinevirtual

Implements action_container.

Definition at line 79 of file unwind-prot.h.

Member Data Documentation

◆ m_lifo

std::stack<elem *> unwind_protect::m_lifo
protected

Definition at line 88 of file unwind-prot.h.


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