24 #if !defined (octave_action_container_h)
25 #define octave_action_container_h 1
45 virtual void run (
void) { }
68 void run (
void) { e_fptr (); }
82 : e_fcn (fcn), e_arg (arg) { }
84 void run (
void) { e_fcn (e_arg); }
107 : e_fcn (fcn), e_arg (arg) { }
109 void run (
void) { e_fcn (e_arg); }
123 : e_obj (obj), e_method (method) { }
125 void run (
void) { (e_obj->*e_method) (); }
141 template <
class T,
class A>
146 : e_obj (obj), e_method (method), e_arg (arg) { }
148 void run (
void) { (e_obj->*e_method) (e_arg); }
165 template <
class T,
class A>
170 : e_obj (obj), e_method (method), e_arg (arg) { }
172 void run (
void) { (e_obj->*e_method) (e_arg); }
194 : e_ptr (&ref), e_val (val) { }
196 void run (
void) { *e_ptr = e_val; }
218 void run (
void) {
delete e_ptr; }
235 virtual void add (
elem *new_elem) = 0;
238 void add_fcn (
void (*fcn) (
void))
245 void add_fcn (
void (*action) (T), T val)
252 void add_fcn (
void (*action) (
const T&),
const T& val)
259 void add_method (T *obj,
void (T::*method) (
void))
265 template <
class T,
class A>
266 void add_method (T *obj,
void (T::*method) (
A),
A arg)
272 template <
class T,
class A>
273 void add_method (T *obj,
void (T::*method) (
const A&),
const A&
arg)
281 void add_delete (T *obj)
288 void protect_var (T& var)
295 void protect_var (T& var,
const T& val)
300 operator bool (
void)
const {
return ! empty (); }
302 virtual void run_first (
void) = 0;
304 void run (
size_t num)
309 for (
size_t i = 0; i < num; i++)
315 virtual void discard_first (
void) = 0;
317 void discard (
size_t num)
322 for (
size_t i = 0; i < num; i++)
328 virtual size_t size (
void)
const = 0;