26 #if ! defined (octave_ov_fcn_handle_h)
27 #define octave_ov_fcn_handle_h 1
29 #include "octave-config.h"
55 const std::string&
file =
"")
65 virtual std::string
type (
void)
const = 0;
69 virtual bool is_simple (
void)
const {
return false; }
71 virtual bool is_scoped (
void)
const {
return false; }
73 virtual bool is_nested (
void)
const {
return false; }
75 virtual bool is_nested (
const std::shared_ptr<stack_frame>&)
const
97 subsref (
const std::string&
type,
const std::list<octave_value_list>& idx,
132 virtual bool save_binary (std::ostream& os,
bool save_as_floats);
134 virtual bool load_binary (std::istream& is,
bool swap,
138 bool save_as_floats);
152 set_fcn (
const std::string& ,
const std::string& )
159 void warn_load (
const char *file_type)
const;
160 void warn_save (
const char *file_type)
const;
202 const std::string& meth_nm);
206 const std::string& class_nm,
207 const std::string& meth_nm);
211 const std::list<std::string>& parentage);
215 const std::shared_ptr<octave::stack_frame>& closure_frames);
220 const octave::stack_frame::local_vars_map& local_vars,
221 const std::shared_ptr<octave::stack_frame>& closure_frames
222 = std::shared_ptr<octave::stack_frame> ());
246 const std::list<octave_value_list>& idx)
253 const std::list<octave_value_list>& idx,
256 return m_rep->subsref (type, idx, nargout);
269 bool is_simple (
void)
const {
return m_rep->is_simple (); }
271 bool is_scoped (
void)
const {
return m_rep->is_scoped (); }
273 bool is_nested (
void)
const {
return m_rep->is_nested (); }
275 bool is_nested (
const std::shared_ptr<octave::stack_frame>& frame)
const
277 return m_rep->is_nested (frame);
290 return m_rep->make_weak_nested_handle ();
295 return m_rep->make_weak_anonymous_handle ();
317 std::string
fcn_name (
void)
const {
return m_rep->fcn_name (); }
321 return m_rep->workspace ();
328 m_rep->set_dispatch_class (class_name);
333 return m_rep->get_dispatch_class ();
341 bool save_ascii (std::ostream& os);
343 bool load_ascii (std::istream& is);
345 bool save_binary (std::ostream& os,
bool save_as_floats);
347 bool load_binary (std::istream& is,
bool swap,
350 bool save_hdf5 (
octave_hdf5_id loc_id,
const char *name,
bool save_as_floats);
354 void print (std::ostream& os,
bool pr_as_read_syntax =
false);
356 void print_raw (std::ostream& os,
bool pr_as_read_syntax =
false)
const;
366 std::shared_ptr<octave::base_fcn_handle>
m_rep;
368 octave::base_fcn_handle *
get_rep (
void)
const {
return m_rep.get (); }
virtual bool save_binary(std::ostream &os, bool save_as_floats)
virtual bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
virtual octave_value make_weak_anonymous_handle(void) const
virtual octave_value workspace(void) const
virtual octave_value fcn_val(void)
virtual bool is_weak_nested(void) const
virtual bool print_as_scalar(void) const
void unimplemented(const char *op, const char *fmt) const
virtual base_fcn_handle * clone(void) const =0
std::string fcn_name(void) const
virtual octave_scalar_map info(void)
virtual bool is_nested(const std::shared_ptr< stack_frame > &) const
virtual bool save_ascii(std::ostream &os)
virtual void set_dispatch_class(const std::string &)
virtual std::string type(void) const =0
void warn_save(const char *file_type) const
virtual bool load_binary(std::istream &is, bool swap, mach_info::float_format fmt)
virtual octave_value make_weak_nested_handle(void) const
virtual bool is_scoped(void) const
virtual bool load_hdf5(octave_hdf5_id &group_hid, octave_hdf5_id &space_hid, octave_hdf5_id &type_hid)
virtual bool is_simple(void) const
base_fcn_handle(const base_fcn_handle &)=default
virtual octave_value_list call(int nargout, const octave_value_list &args)=0
virtual bool is_weak_anonymous(void) const
virtual ~base_fcn_handle(void)=default
void warn_load(const char *file_type) const
virtual bool is_anonymous(void) const
virtual octave_function * function_value(bool=false)
virtual bool is_nested(void) const
base_fcn_handle(const std::string &name="", const std::string &file="")
virtual bool is_class_simple(void) const
virtual bool load_ascii(std::istream &is)
octave_value_list subsref(const std::string &type, const std::list< octave_value_list > &idx, int nargout)
std::string file(void) const
octave_value convert_to_str_internal(bool pad, bool force, char type) const
virtual bool is_internal(void) const
virtual std::string get_dispatch_class(void) const
virtual octave_user_function * user_function_value(bool=false)
virtual bool set_fcn(const std::string &, const std::string &)
virtual void print_raw(std::ostream &, bool, int) const
Vector representing the dimensions (size) of an Array.
virtual octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
virtual octave_function * function_value(bool silent=false)
builtin_type_t builtin_type(void) const
static const std::string anonymous
std::string fcn_name(void) const
octave_base_value * empty_clone(void) const
bool is_defined(void) const
octave_value make_weak_nested_handle(void) const
octave_scalar_map info(void)
bool is_simple(void) const
std::shared_ptr< octave::base_fcn_handle > m_rep
bool is_function_handle(void) const
bool print_as_scalar(void) const
bool is_internal(void) const
~octave_fcn_handle(void)=default
octave_base_value * clone(void) const
bool is_weak_anonymous(void) const
bool is_class_simple(void) const
octave_user_function * user_function_value(bool=false)
octave::base_fcn_handle * get_rep(void) const
octave_value fcn_val(void)
bool is_anonymous(void) const
octave_value_list call(int nargout, const octave_value_list &args)
octave_value convert_to_str_internal(bool pad, bool force, char type) const
octave_value make_weak_anonymous_handle(void) const
octave_fcn_handle * fcn_handle_value(bool=false)
octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
bool is_scoped(void) const
octave_value workspace(void) const
octave_value_list subsref(const std::string &type, const std::list< octave_value_list > &idx, int nargout)
bool is_nested(void) const
octave_function * function_value(bool=false)
bool is_weak_nested(void) const
std::string get_dispatch_class(void) const
bool is_nested(const std::shared_ptr< octave::stack_frame > &frame) const
void set_dispatch_class(const std::string &class_name)
octave_user_function * user_function_value(bool=false)
octave_idx_type length(void) const
octave_value convert_to_str_internal(bool pad, bool force, char type) const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
bool is_equal_to(const octave_fcn_handle &fh1, const octave_fcn_handle &fh2)