24 #if !defined (octave_ov_base_h)
25 #define octave_ov_base_h 1
119 #define DEF_CLASS_TO_BTYP(CLASS,BTYP) \
121 struct class_to_btyp<CLASS> \
122 { static const builtin_type_t btyp = BTYP; }
142 #define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA \
143 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA2 (OCTAVE_EMPTY_CPP_ARG)
145 #define DECLARE_OV_BASE_TYPEID_FUNCTIONS_AND_DATA \
146 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA2(virtual)
148 #define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA2(VIRTUAL) \
150 VIRTUAL int type_id (void) const { return t_id; } \
151 VIRTUAL std::string type_name (void) const { return t_name; } \
152 VIRTUAL std::string class_name (void) const { return c_name; } \
153 static int static_type_id (void) { return t_id; } \
154 static std::string static_type_name (void) { return t_name; } \
155 static std::string static_class_name (void) { return c_name; } \
156 static void register_type (void); \
160 static const std::string t_name; \
161 static const std::string c_name;
164 #define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c) \
166 const std::string t::t_name (n); \
167 const std::string t::c_name (c); \
168 void t::register_type (void) \
171 octave_value v (&exemplar, true); \
172 t_id = octave_value_typeinfo::register_type (t::t_name, t::c_name, v); \
192 : _fcn (
f), _type_id (t) { }
194 operator type_conv_fcn (
void)
const {
return _fcn; }
197 {
return (*_fcn) (v); }
228 virtual type_conv_info
232 virtual type_conv_info
250 const std::list<octave_value_list>& idx);
254 const std::list<octave_value_list>& idx,
259 const std::list<octave_value_list>& idx,
264 const std::list<octave_value_list>& idx,
266 const std::list<octave_lvalue> *lvalue_list);
276 const std::list<octave_lvalue> *lvalue_list);
282 const std::list<octave_value_list>& idx,
287 const std::list<octave_value_list>& idx,
337 virtual bool is_cell (
void)
const {
return false; }
363 virtual bool is_range (
void)
const {
return false; }
365 virtual bool is_map (
void)
const {
return false; }
369 virtual bool is_java (
void)
const {
return false; }
423 virtual bool is_true (
void)
const {
return false; }
451 virtual short int short_value (
bool =
false,
bool =
false)
const;
453 virtual unsigned short int ushort_value (
bool =
false,
bool =
false)
const;
455 virtual int int_value (
bool =
false,
bool =
false)
const;
457 virtual unsigned int uint_value (
bool =
false,
bool =
false)
const;
461 virtual long int long_value (
bool =
false,
bool =
false)
const;
463 virtual unsigned long int ulong_value (
bool =
false,
bool =
false)
const;
465 virtual int64_t
int64_value (
bool =
false,
bool =
false)
const;
467 virtual uint64_t
uint64_value (
bool =
false,
bool =
false)
const;
562 virtual std::string
string_value (
bool force =
false)
const;
574 virtual size_t nparents (
void)
const;
601 char type =
'\'')
const;
609 virtual void print (std::ostream& os,
bool pr_as_read_syntax =
false)
const;
612 print_raw (std::ostream& os,
bool pr_as_read_syntax =
false)
const;
619 bool print_padding =
true);
621 virtual void short_disp (std::ostream& os)
const { os <<
"..."; }
623 virtual void print_info (std::ostream& os,
const std::string& prefix)
const;
629 virtual bool save_binary (std::ostream& os,
bool& save_as_floats);
631 virtual bool load_binary (std::istream& is,
bool swap,
634 #if defined (HAVE_HDF5)
636 save_hdf5 (hid_t loc_id,
const char *name,
bool save_as_floats);
639 load_hdf5 (hid_t loc_id,
const char *name);
672 virtual void lock (
void);
674 virtual void unlock (
void);
676 virtual bool islocked (
void)
const {
return false; }
678 virtual void dump (std::ostream& os)
const;
745 num_unary_mappers = umap_unknown
790 const std::list<octave_value_list>& idx,
793 void reset_indent_level (
void)
const
794 { curr_print_indent_level = 0; }
796 void increment_indent_level (
void)
const
797 { curr_print_indent_level += 2; }
799 void decrement_indent_level (
void)
const
800 { curr_print_indent_level -= 2; }
802 int current_print_indent_level (
void)
const
803 {
return curr_print_indent_level; }
805 void indent (std::ostream& os)
const;
807 void newline (std::ostream& os)
const;
809 void reset (
void)
const;