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; }
371 virtual bool is_java (
void)
const {
return false; }
425 virtual bool is_true (
void)
const {
return false; }
453 virtual short int short_value (
bool =
false,
bool =
false)
const;
455 virtual unsigned short int ushort_value (
bool =
false,
bool =
false)
const;
457 virtual int int_value (
bool =
false,
bool =
false)
const;
459 virtual unsigned int uint_value (
bool =
false,
bool =
false)
const;
463 virtual long int long_value (
bool =
false,
bool =
false)
const;
465 virtual unsigned long int ulong_value (
bool =
false,
bool =
false)
const;
467 virtual int64_t
int64_value (
bool =
false,
bool =
false)
const;
469 virtual uint64_t
uint64_value (
bool =
false,
bool =
false)
const;
564 virtual std::string
string_value (
bool force =
false)
const;
576 virtual size_t nparents (
void)
const;
606 char type =
'\'')
const;
614 virtual void print (std::ostream& os,
bool pr_as_read_syntax =
false);
617 print_raw (std::ostream& os,
bool pr_as_read_syntax =
false)
const;
624 bool print_padding =
true);
626 virtual void short_disp (std::ostream& os)
const { os <<
"..."; }
628 virtual void print_info (std::ostream& os,
const std::string& prefix)
const;
634 virtual bool save_binary (std::ostream& os,
bool& save_as_floats);
636 virtual bool load_binary (std::istream& is,
bool swap,
675 virtual void lock (
void);
677 virtual void unlock (
void);
679 virtual bool islocked (
void)
const {
return false; }
681 virtual void dump (std::ostream& os)
const;
748 num_unary_mappers = umap_unknown
793 const std::list<octave_value_list>& idx,
797 { curr_print_indent_level = 0; }
800 { curr_print_indent_level += 2; }
803 { curr_print_indent_level -= 2; }
806 {
return curr_print_indent_level; }
808 void indent (std::ostream& os)
const;
810 void newline (std::ostream& os)
const;
812 void reset (
void)
const;
822 void gripe_load (
const char *
type)
const;
823 void gripe_save (
const char *
type)
const;
842 const std::list<octave_value_list>& idx,
843 const std::string& who);
sortmode is_sorted_rows(sortmode mode=UNSORTED) const
uint8NDArray uint8_array_value(void) const
virtual bool is_uint32_type(void) const
virtual octave_base_value * unique_parent_class(const std::string &)
virtual dim_vector dims(void) const
octave_idx_type nnz(void) const
#define DEF_CLASS_TO_BTYP(CLASS, BTYP)
virtual octave_idx_type capacity(void) const
ComplexNDArray complex_array_value(bool frc_str_conv=false) const
bool btyp_isfloat(builtin_type_t btyp)
virtual bool is_sparse_type(void) const
virtual bool is_bool_matrix(void) const
FloatComplexDiagMatrix float_complex_diag_matrix_value(bool force=false) const
OCTINTERP_API octave_value make_idx_args(const std::string &type, const std::list< octave_value_list > &idx, const std::string &who)
virtual bool is_mex_function(void) const
virtual bool is_true(void) const
virtual bool is_complex_matrix(void) const
size_t nparents(void) const
charNDArray char_array_value(bool frc_str_conv=false) const
virtual bool is_function(void) const
bool load_binary(std::istream &is, bool swap, oct_mach_info::float_format fmt)
octave_refcount< octave_idx_type > count
virtual bool is_real_type(void) const
boolMatrix bool_matrix_value(bool warn=false) const
virtual bool is_function_handle(void) const
octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
bool print_name_tag(std::ostream &os, const std::string &name) const
virtual type_conv_info numeric_conversion_function(void) const
octave_value reshape(const dim_vector &dv) const
octave_value permute(const Array< int > &vec, bool inv=false) const
void increment_indent_level(void) const
virtual bool is_double_type(void) const
octave_int16 int16_scalar_value(void) const
octave_value full_value(void) const
unsigned int uint_value(bool req_int=false, bool frc_str_conv=false) const
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
int8NDArray int8_array_value(void) const
octave_idx_type columns(void) const
void print_info(std::ostream &os, const std::string &prefix=std::string()) const
FloatComplexMatrix float_complex_matrix_value(bool frc_str_conv=false) const
octave_base_value * empty_clone(void) const
mxArray * as_mxArray(void) const
virtual bool is_bool_type(void) const
virtual bool is_real_matrix(void) const
virtual void short_disp(std::ostream &os) const
int16NDArray int16_array_value(void) const
virtual type_conv_info numeric_demotion_function(void) const
octave_idx_type nfields(void) const
std::list< std::string > parent_class_name_list(void) const
virtual bool is_magic_colon(void) const
octave_map map_value(void) const
octave_user_code * user_code_value(bool silent=false) const
octave_value diag(octave_idx_type k=0) const
virtual void assign(const std::string &, const octave_value &)
virtual bool is_int8_type(void) const
virtual void maybe_economize(void)
virtual octave_idx_type * mex_get_ir(void) const
int int_value(bool req_int=false, bool frc_str_conv=false) const
uint64NDArray uint64_array_value(void) const
virtual bool is_classdef_object(void) const
int64_t int64_value(bool req_int=false, bool frc_str_conv=false) const
OCTINTERP_API string_vector get_builtin_classes(void)
virtual bool is_user_code(void) const
virtual double scalar_value(bool frc_str_conv=false) const
octave_int32 int32_scalar_value(void) const
float float_value(bool frc_str_conv=false) const
int32NDArray int32_array_value(void) const
virtual bool is_anonymous_function(void) const
bool btyp_isarray(builtin_type_t btyp)
octave_value map(octave_base_value::unary_mapper_t umap) const
Array< octave_idx_type > sort_rows_idx(sortmode mode=ASCENDING) const
virtual bool is_perm_matrix(void) const
virtual float float_scalar_value(bool frc_str_conv=false) const
virtual bool is_numeric_type(void) const
octave_value resize(const dim_vector &dv, bool fill=false) const
OCTINTERP_API std::string btyp_class_name[btyp_num_types]
octave_idx_type nzmax(void) const
virtual size_t byte_size(void) const
octave_value convert_to_str_internal(bool pad, bool force, char type) const
virtual bool is_cs_list(void) const
virtual bool is_cell(void) const
octave_fcn_handle * fcn_handle_value(bool silent=false) const
virtual bool is_null_value(void) const
ComplexDiagMatrix complex_diag_matrix_value(bool force=false) const
virtual bool is_int64_type(void) const
virtual bool is_cellstr(void) const
OCTINTERP_API bool called_from_builtin(void)
bool is_empty(void) const
boolNDArray bool_array_value(bool warn=false) const
virtual octave_idx_type * mex_get_jc(void) const
virtual bool is_scalar_type(void) const
octave_base_value * clone(void) const
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
string_vector all_strings(bool pad=false) const
virtual void * mex_get_data(void) const
virtual bool is_range(void) const
virtual bool is_map(void) const
virtual octave_idx_type numel(void) const
octave_value subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
int64NDArray int64_array_value(void) const
Cell cell_value(void) const
static int curr_print_indent_level
virtual bool is_single_type(void) const
OCTINTERP_API bool Vsparse_auto_mutate
sortmode is_sorted(sortmode mode=UNSORTED) const
idx_vector index_vector(bool require_integers=false) const
virtual bool is_uint64_type(void) const
Array< std::string > cellstr_value(void) const
octave_value_list do_multi_index_op(int nargout, const octave_value_list &idx)
static const builtin_type_t btyp
virtual octave_base_value * clone(void) const
octave_value any(int dim=0) const
long int long_value(bool req_int=false, bool frc_str_conv=false) const
virtual octave_base_value * try_narrowing_conversion(void)
FloatNDArray float_array_value(bool frc_str_conv=false) const
void dump(std::ostream &os) const
virtual octave_base_value * find_parent_class(const std::string &)
#define DECLARE_OV_BASE_TYPEID_FUNCTIONS_AND_DATA
unsigned long int ulong_value(bool req_int=false, bool frc_str_conv=false) const
octave_uint8 uint8_scalar_value(void) const
virtual bool is_builtin_function(void) const
virtual bool is_integer_type(void) const
F77_RET_T const double const double * f
octave_value convert_to_str(bool pad=false, bool force=false, char type= '\'') const
uint64_t uint64_value(bool req_int=false, bool frc_str_conv=false) const
octave_value squeeze(void) const
virtual bool is_all_va_args(void) const
virtual bool is_object(void) const
void print(std::ostream &os, bool pr_as_read_syntax=false)
std::string string_value(bool force=false) const
FloatDiagMatrix float_diag_matrix_value(bool force=false) const
virtual int ndims(void) const
int nint_value(bool frc_str_conv=false) const
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
FloatComplex float_complex_value(bool frc_str_conv=false) const
virtual bool is_bool_scalar(void) const
Range range_value(void) const
FloatComplexNDArray float_complex_array_value(bool frc_str_conv=false) const
virtual bool is_int16_type(void) const
octave_user_function * user_function_value(bool silent=false) const
bool save_binary(std::ostream &os, bool &save_as_floats)
SparseBoolMatrix sparse_bool_matrix_value(bool warn=false) const
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
virtual bool is_int32_type(void) const
bool btyp_isnumeric(builtin_type_t btyp)
virtual bool is_real_scalar(void) const
virtual bool is_instance_of(const std::string &) const
virtual bool print_as_scalar(void) const
virtual bool is_complex_type(void) const
virtual bool is_user_script(void) const
string_vector map_keys(void) const
virtual bool is_user_function(void) const
octave_value all(int dim=0) const
size_t size(T const (&)[z])
SparseComplexMatrix sparse_complex_matrix_value(bool frc_str_conv=false) const
string_vector parent_class_names(void) const
bool btyp_isinteger(builtin_type_t btyp)
dim_vector dims(void) const
Matrix matrix_value(bool frc_str_conv=false) const
virtual bool is_dld_function(void) const
int write(octave_stream &os, int block_size, oct_data_conv::data_type output_type, int skip, oct_mach_info::float_format flt_fmt) const
void decrement_indent_level(void) const
virtual bool is_defined(void) const
virtual bool is_sq_string(void) const
virtual bool is_java(void) const
octave_idx_type numel(void) const
charMatrix char_matrix_value(bool frc_str_conv=false) const
virtual octave_base_value * unique_clone(void)
octave_function * function_value(bool silent=false) const
bool save_ascii(std::ostream &os)
MatrixType matrix_type(void) const
DiagMatrix diag_matrix_value(bool force=false) const
virtual bool is_constant(void) const
unsigned short int ushort_value(bool req_int=false, bool frc_str_conv=false) const
Handles the reference counting for all the derived classes.
octave_value sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
virtual bool islocked(void) const
octave_value undef_subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs)
virtual ~octave_base_value(void)
NDArray array_value(bool frc_str_conv=false) const
octave_base_value(const octave_base_value &)
octave_int8 int8_scalar_value(void) const
virtual bool is_float_type(void) const
virtual void erase_subfunctions(void)
octave_scalar_map scalar_map_value(void) const
type_conv_info(type_conv_fcn f=0, int t=-1)
bool load_ascii(std::istream &is)
bool bool_value(bool warn=false) const
virtual bool is_complex_scalar(void) const
ComplexMatrix complex_matrix_value(bool frc_str_conv=false) const
virtual bool is_string(void) const
int current_print_indent_level(void) const
virtual bool is_uint16_type(void) const
Complex complex_value(bool frc_str_conv=false) const
FloatMatrix float_matrix_value(bool frc_str_conv=false) const
void print_with_name(std::ostream &os, const std::string &name) const
virtual bool is_matrix_type(void) const
virtual bool is_inline_function(void) const
octave_int64 int64_scalar_value(void) const
virtual builtin_type_t builtin_type(void) const
OCTINTERP_API builtin_type_t btyp_mixed_numeric(builtin_type_t x, builtin_type_t y)
virtual bool is_char_matrix(void) const
octave_uint64 uint64_scalar_value(void) const
octave_value fast_elem_extract(octave_idx_type n) const
octave_value_list list_value(void) const
std::complex< float > FloatComplex
virtual bool fast_elem_insert(octave_idx_type n, const octave_value &x)
PermMatrix perm_matrix_value(void) const
SparseMatrix sparse_matrix_value(bool frc_str_conv=false) const
virtual bool is_uint8_type(void) const
void reset_indent_level(void) const
virtual bool is_diag_matrix(void) const
std::complex< double > Complex
octave_fcn_inline * fcn_inline_value(bool silent=false) const
double double_value(bool frc_str_conv=false) const
static bool beginning_of_line
octave_user_script * user_script_value(bool silent=false) const
octave_uint32 uint32_scalar_value(void) const
uint32NDArray uint32_array_value(void) const
uint16NDArray uint16_array_value(void) const
void convert_to_row_or_column_vector(void)
octave_uint16 uint16_scalar_value(void) const
octave_idx_type rows(void) const
F77_RET_T const double * x
short int short_value(bool req_int=false, bool frc_str_conv=false) const
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)