24 #if ! defined (octave_action_container_h) 25 #define octave_action_container_h 1 27 #include "octave-config.h" 61 elem& operator = (
const elem&) =
delete;
63 virtual ~
elem (
void) =
default;
65 virtual void run (
void) { }
77 void run (
void) { e_fptr (); }
81 void (*e_fptr) (void);
93 : e_fcn (
fcn), e_arg (
arg) { }
101 void run (
void) { e_fcn (e_arg); }
114 template <
typename T>
120 : e_fcn (
fcn), e_arg (
arg) { }
122 void run (
void) { e_fcn (e_arg); }
126 void (*e_fcn) (
const T&);
133 template <
typename T>
139 : e_obj (obj), e_method (
method) { }
142 : e_obj (&obj), e_method (
method) { }
150 void run (
void) { (e_obj->*e_method) (); }
156 void (T::*e_method) (void);
161 template <
typename T,
typename A>
167 : e_obj (obj), e_method (
method), e_arg (
arg) { }
170 : e_obj (&obj), e_method (
method), e_arg (
arg) { }
178 void run (
void) { (e_obj->*e_method) (e_arg); }
184 void (T::*e_method) (
A);
191 template <
typename T,
typename A>
197 : e_obj (obj), e_method (
method), e_arg (
arg) { }
200 : e_obj (&obj), e_method (
method), e_arg (
arg) { }
208 void run (
void) { (e_obj->*e_method) (e_arg); }
214 void (T::*e_method) (
const A&);
220 template <
class T,
class A,
class B>
226 : e_obj (obj), e_method (
method),
229 void run (
void) { (e_obj->*e_method) (e_arg_a, e_arg_b); }
234 void (T::*e_method) (
const A&,
const B&);
246 template <
class T,
class A,
class B,
class C>
251 void (T::*
method) (
const A&,
const B&,
const C&),
253 : e_obj (obj), e_method (
method),
257 void run (
void) { (e_obj->*e_method) (e_arg_a, e_arg_b, e_arg_c); }
262 void (T::*e_method) (
const A&,
const B&,
const C&);
275 template <
class T,
class A,
class B,
class C,
class D>
280 void (T::*
method) (
const A&,
const B&,
const C&,
const D&),
283 : e_obj (obj), e_method (
method),
289 (e_obj->*e_method) (e_arg_a, e_arg_b, e_arg_c, e_arg_d);
295 void (T::*e_method) (
const A&,
const B&,
const C&,
const D&);
310 template <
typename T>
316 : e_ptr (&ref), e_val (
val) { }
324 void run (
void) { *e_ptr = e_val; }
333 template <
typename T>
347 void run (
void) {
delete e_ptr; }
364 virtual void add (
elem *new_elem) = 0;
373 template <
typename T>
380 template <
typename T>
387 template <
typename T>
393 template <
typename T>
400 template <
typename T,
typename A>
406 template <
typename T,
typename A>
413 template <
typename T,
typename A>
419 template <
typename T,
typename A>
426 template <
class T,
class A,
class B>
434 template <
class T,
class A,
class B,
class C>
436 void (T::*
method) (
const A&,
const B&,
const C&),
444 template <
class T,
class A,
class B,
class C,
class D>
446 void (T::*
method) (
const A&,
const B&,
const C&,
const D&),
448 const C&
arg_c,
const D& arg_d)
456 template <
typename T>
463 template <
typename T>
470 template <
typename T>
478 virtual void run_first (
void) = 0;
485 for (
size_t i = 0;
i < num;
i++)
491 virtual void discard_first (
void) = 0;
498 for (
size_t i = 0;
i < num;
i++)
504 virtual size_t size (
void)
const = 0;
506 bool empty (
void)
const {
return size () == 0; }
510 #if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS) 512 OCTAVE_DEPRECATED (4.4,
"use 'octave::action_container' instead")
513 typedef
octave::action_container action_container;
void add_method(T &obj, void(T::*method)(const A &), const A &arg)
F77_RET_T const F77_INT F77_CMPLX const F77_INT F77_CMPLX * B
void add_fcn(void(*action)(T), T val)
identity matrix If supplied two scalar respectively For allows like xample val
method_elem(T &obj, void(T::*method)(void))
void add_method(T *obj, void(T::*method)(const A &, const B &), const A &arg_a, const B &arg_b)
method_arg3_elem(T *obj, void(T::*method)(const A &, const B &, const C &), const A &arg_a, const B &arg_b, const C &arg_c)
void add_fcn(void(*fcn)(void))
method_arg2_elem(T *obj, void(T::*method)(const A &, const B &), const A &arg_a, const B &arg_b)
void protect_var(T &var, const T &val)
restore_var_elem(T &ref, const T &val)
method_arg4_elem(T *obj, void(T::*method)(const A &, const B &, const C &, const D &), const A &arg_a, const B &arg_b, const C &arg_c, const D &arg_d)
fcn_crefarg_elem(void(*fcn)(const T &), const T &arg)
void add_method(T *obj, void(T::*method)(const A &), const A &arg)
create a structure array and initialize its values The dimensions of each cell array of values must match Singleton cells and non cell values are repeated so that they fill the entire array If the cells are empty
void add_method(T &obj, void(T::*method)(A), A arg)
void add_method(T *obj, void(T::*method)(const A &, const B &, const C &, const D &), const A &arg_a, const B &arg_b, const C &arg_c, const D &arg_d)
F77_RET_T const F77_INT F77_CMPLX * A
void add_method(T *obj, void(T::*method)(const A &, const B &, const C &), const A &arg_a, const B &arg_b, const C &arg_c)
An element for calling a member function with three arguments.
method_arg_elem(T *obj, void(T::*method)(A), A arg)
An element for calling a member function with three arguments.
void add_method(T *obj, void(T::*method)(A), A arg)
fcn_arg_elem(void(*fcn)(T), T arg)
method_crefarg_elem(T *obj, void(T::*method)(const A &), const A &arg)
An element for calling a member function with two arguments.
FloatComplex(* fptr)(const FloatComplex &, float, int, octave_idx_type &)
void add_method(T *obj, void(T::*method)(void))
fcn_elem(void(*fptr)(void))
method_elem(T *obj, void(T::*method)(void))
void add_fcn(void(*action)(const T &), const T &val)
method_crefarg_elem(T &obj, void(T::*method)(const A &), const A &arg)
method_arg_elem(T &obj, void(T::*method)(A), A arg)
void add_method(T &obj, void(T::*method)(void))