26 #if ! defined (octave_unwind_prot_h)
27 #define octave_unwind_prot_h 1
29 #include "octave-config.h"
60 operator bool (
void)
const {
return ! empty (); }
67 std::unique_ptr<elem> ptr (m_lifo.top ());
77 elem *ptr = m_lifo.top ();
83 std::size_t
size (
void)
const {
return m_lifo.size (); }
89 m_lifo.push (new_elem);
105 void warn_unhandled_exception (
void)
const;
127 warn_unhandled_exception ();
174 template <
typename F,
typename... Args>
176 : m_fcn (std::bind (fcn, args...))
190 template <
typename F,
typename... Args>
191 void set (F&& fcn, Args&& ... args)
193 m_fcn = std::bind (fcn, args...);
196 void set (
void) { m_fcn =
nullptr; }
223 void warn_unhandled_exception (
void)
const;
232 template <
typename F,
typename... Args>
234 : m_fcn (std::bind (fcn, args...))
248 template <
typename F,
typename... Args>
249 void set (F&& fcn, Args&& ... args)
251 m_fcn = std::bind (fcn, args...);
254 void set (
void) { m_fcn =
nullptr; }
268 warn_unhandled_exception ();
314 template <
typename T>
std::function< void(void)> m_fcn
~unwind_action_safe(void)
unwind_action_safe(F &&fcn, Args &&... args)
unwind_action_safe(const unwind_action_safe &)=delete
void set(F &&fcn, Args &&... args)
unwind_action(const unwind_action &)=delete
void set(F &&fcn, Args &&... args)
unwind_action(F &&fcn, Args &&... args)
std::function< void(void)> m_fcn
unwind_protect_safe(void)
unwind_protect_safe(const unwind_protect_safe &)=delete
~unwind_protect_safe(void)
unwind_protect_var(const unwind_protect_var &)=delete
unwind_protect_var & operator=(const unwind_protect_var &)=delete
unwind_protect_var(T &ref, const T &new_val)
unwind_protect_var(T &ref)
~unwind_protect_var(void)
std::size_t size(void) const
virtual void add_action(elem *new_elem)
unwind_protect(const unwind_protect &)=delete
std::stack< elem * > m_lifo
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn