52 if (pl != 0 && pl->
length () > 0)
53 warning (
"onCleanup: cleanup action takes parameters");
57 error (
"onCleanup: no default dispatch for function handle");
62 error (
"onCleanup: argument must be a function handle");
90 catch (octave_interrupt_exception)
93 warning (
"onCleanup: interrupt occured in cleanup action");
98 error (
"onCleanup: internal error: unhandled exception in cleanup action");
117 warning (
"onCleanup: load and save not supported");
183 DEFUN (onCleanup, args, ,
185 @deftypefn {Built-in Function} {@var{obj} =} onCleanup (@var{function})\n\
186 Create a special object that executes a given function upon destruction.\n\
188 If the object is copied to multiple variables (or cell or struct array\n\
189 elements) or returned from a function, @var{function} will be executed after\n\
190 clearing the last copy of the object. Note that if multiple local onCleanup\n\
191 variables are created, the order in which they are called is unspecified.\n\
192 For similar functionality @xref{The unwind_protect Statement}.\n\
197 if (args.length () == 1)
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
size_t length(void) const
tree_parameter_list * parameter_list(void)
OCTINTERP_API void print_usage(void)
static void warn_save_load(void)
bool is_defined(void) const
FloatComplex(* fptr)(const FloatComplex &, float, int, octave_idx_type &)
#define DEFUN(name, args_name, nargout_name, doc)
void error(const char *fmt,...)
void setfield(const std::string &key, const octave_value &val)
#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c)
void newline(std::ostream &os) const
bool is_function_handle(void) const
octave_value_list do_multi_index_op(int nargout, const octave_value_list &idx)
F77_RET_T const double const double * f
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
sig_atomic_t octave_interrupt_state
bool load_binary(std::istream &is, bool swap, oct_mach_info::float_format fmt)
bool save_binary(std::ostream &os, bool &save_as_floats)
friend class octave_value
octave_function * function_value(bool silent=false) const
bool save_ascii(std::ostream &os)
void warning(const char *fmt,...)
octave_scalar_map scalar_map_value(void) const
bool is_undefined(void) const
void print(std::ostream &os, bool pr_as_read_syntax=false)
bool load_ascii(std::istream &is)
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)