GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
ov-base.h File Reference
#include "octave-config.h"
#include <cstdlib>
#include <iosfwd>
#include <list>
#include <memory>
#include <string>
#include "Range.h"
#include "data-conv.h"
#include "mx-base.h"
#include "str-vec.h"
#include "auto-shlib.h"
#include "oct-hdf5-types.h"
#include "oct-stream.h"

Go to the source code of this file.

Classes

struct  btyp_to_class< BTYP >
 
struct  btyp_to_class< btyp_bool >
 
struct  btyp_to_class< btyp_char >
 
struct  btyp_to_class< btyp_complex >
 
struct  btyp_to_class< btyp_double >
 
struct  btyp_to_class< btyp_float >
 
struct  btyp_to_class< btyp_float_complex >
 
struct  btyp_to_class< btyp_int16 >
 
struct  btyp_to_class< btyp_int32 >
 
struct  btyp_to_class< btyp_int64 >
 
struct  btyp_to_class< btyp_int8 >
 
struct  btyp_to_class< btyp_uint16 >
 
struct  btyp_to_class< btyp_uint32 >
 
struct  btyp_to_class< btyp_uint64 >
 
struct  btyp_to_class< btyp_uint8 >
 
struct  class_to_btyp< T >
 
struct  class_to_btyp< bool >
 
struct  class_to_btyp< char >
 
struct  class_to_btyp< Complex >
 
struct  class_to_btyp< double >
 
struct  class_to_btyp< float >
 
struct  class_to_btyp< FloatComplex >
 
struct  class_to_btyp< octave_int16 >
 
struct  class_to_btyp< octave_int32 >
 
struct  class_to_btyp< octave_int64 >
 
struct  class_to_btyp< octave_int8 >
 
struct  class_to_btyp< octave_uint16 >
 
struct  class_to_btyp< octave_uint32 >
 
struct  class_to_btyp< octave_uint64 >
 
struct  class_to_btyp< octave_uint8 >
 
class  octave_base_dld_value
 
class  octave_base_value
 
class  octave_base_value::type_conv_info
 

Macros

#define DECLARE_OV_BASE_TYPEID_FUNCTIONS_AND_DATA    DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA2(virtual)
 
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA    DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA2 (OCTAVE_EMPTY_CPP_ARG)
 
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA2(VIRTUAL)
 
#define DECLARE_TEMPLATE_OV_TYPEID_SPECIALIZATIONS(cls, type)
 
#define DEF_BTYP_TRAITS(BTYP, CLASS)
 
#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c)    DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA_INTERNAL ( , t, n, c)
 
#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA_INTERNAL(tspec, t, n, c)
 
#define DEFINE_TEMPLATE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c)    DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA_INTERNAL (template <>, t, n, c)
 
#define OCTAVE_EMPTY_CPP_ARG   /* empty */
 

Enumerations

enum  builtin_type_t {
  btyp_double , btyp_float , btyp_complex , btyp_float_complex ,
  btyp_int8 , btyp_int16 , btyp_int32 , btyp_int64 ,
  btyp_uint8 , btyp_uint16 , btyp_uint32 , btyp_uint64 ,
  btyp_bool , btyp_char , btyp_struct , btyp_cell ,
  btyp_func_handle , btyp_unknown , btyp_num_types = btyp_unknown
}
 

Functions

type_info__get_type_info__ ()
 
type_info__get_type_info__ (const std::string &)
 
bool btyp_isarray (builtin_type_t btyp)
 
bool btyp_isfloat (builtin_type_t btyp)
 
bool btyp_isinteger (builtin_type_t btyp)
 
bool btyp_isnumeric (builtin_type_t btyp)
 
builtin_type_t btyp_mixed_numeric (builtin_type_t x, builtin_type_t y)
 Determine the resulting type for a possible mixed-type operation. More...
 
bool called_from_builtin ()
 
octave_value make_idx_args (const std::string &type, const std::list< octave_value_list > &idx, const std::string &who)
 

Variables

std::string btyp_class_name []
 
bool Vsparse_auto_mutate
 

Macro Definition Documentation

◆ DECLARE_OV_BASE_TYPEID_FUNCTIONS_AND_DATA

#define DECLARE_OV_BASE_TYPEID_FUNCTIONS_AND_DATA    DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA2(virtual)

Definition at line 184 of file ov-base.h.

◆ DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA

#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA    DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA2 (OCTAVE_EMPTY_CPP_ARG)

Definition at line 181 of file ov-base.h.

◆ DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA2

#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA2 (   VIRTUAL)
Value:
public: \
VIRTUAL int type_id () const { return s_t_id; } \
VIRTUAL std::string type_name () const { return s_t_name; } \
VIRTUAL std::string class_name () const { return s_c_name; } \
static int static_type_id () { return s_t_id; } \
static std::string static_type_name () { return s_t_name; } \
static std::string static_class_name () { return s_c_name; } \
static void register_type (); \
static void register_type (octave::type_info&); \
\
private: \
static int s_t_id; \
static const std::string s_t_name; \
static const std::string s_c_name;
int register_type(const std::string &t_name, const std::string &c_name, const octave_value &val)
Definition: ov-typeinfo.cc:784

Definition at line 187 of file ov-base.h.

◆ DECLARE_TEMPLATE_OV_TYPEID_SPECIALIZATIONS

#define DECLARE_TEMPLATE_OV_TYPEID_SPECIALIZATIONS (   cls,
  type 
)
Value:
template <> void cls<type>::register_type (); \
template <> void cls<type>::register_type (octave::type_info&); \
template <> int cls<type>::s_t_id; \
template <> const std::string cls<type>::s_t_name; \
template <> const std::string cls<type>::s_c_name;

Definition at line 203 of file ov-base.h.

◆ DEF_BTYP_TRAITS

#define DEF_BTYP_TRAITS (   BTYP,
  CLASS 
)
Value:
template <> \
{ \
static const builtin_type_t btyp = BTYP; \
}; \
\
template <> \
{ \
typedef CLASS type; \
}
builtin_type_t
Definition: ov-base.h:83

Definition at line 147 of file ov-base.h.

◆ DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA

#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (   t,
  n,
 
)     DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA_INTERNAL ( , t, n, c)

Definition at line 235 of file ov-base.h.

◆ DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA_INTERNAL

#define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA_INTERNAL (   tspec,
  t,
  n,
 
)
Value:
tspec int t::s_t_id (-1); \
tspec const std::string t::s_t_name (n); \
tspec const std::string t::s_c_name (c); \
tspec void t::register_type () \
{ \
octave::type_info& type_info = octave::__get_type_info__ (); \
} \
tspec void t::register_type (octave::type_info& ti) \
{ \
octave_value v = (new t ()); \
s_t_id = ti.register_type (t::s_t_name, t::s_c_name, v); \
}
octave_idx_type n
Definition: mx-inlines.cc:761
type_info & __get_type_info__()

Definition at line 216 of file ov-base.h.

◆ DEFINE_TEMPLATE_OV_TYPEID_FUNCTIONS_AND_DATA

#define DEFINE_TEMPLATE_OV_TYPEID_FUNCTIONS_AND_DATA (   t,
  n,
 
)     DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA_INTERNAL (template <>, t, n, c)

Definition at line 232 of file ov-base.h.

◆ OCTAVE_EMPTY_CPP_ARG

#define OCTAVE_EMPTY_CPP_ARG   /* empty */

Definition at line 179 of file ov-base.h.

Enumeration Type Documentation

◆ builtin_type_t

Enumerator
btyp_double 
btyp_float 
btyp_complex 
btyp_float_complex 
btyp_int8 
btyp_int16 
btyp_int32 
btyp_int64 
btyp_uint8 
btyp_uint16 
btyp_uint32 
btyp_uint64 
btyp_bool 
btyp_char 
btyp_struct 
btyp_cell 
btyp_func_handle 
btyp_unknown 
btyp_num_types 

Definition at line 82 of file ov-base.h.

Function Documentation

◆ __get_type_info__() [1/2]

◆ __get_type_info__() [2/2]

type_info& __get_type_info__ ( const std::string &  )
inline

Definition at line 63 of file ov-base.h.

References __get_type_info__().

◆ btyp_isarray()

bool btyp_isarray ( builtin_type_t  btyp)
inline

Definition at line 116 of file ov-base.h.

References btyp_char.

◆ btyp_isfloat()

bool btyp_isfloat ( builtin_type_t  btyp)
inline

Definition at line 113 of file ov-base.h.

References btyp_float_complex.

Referenced by ov_range< T >::isfloat().

◆ btyp_isinteger()

bool btyp_isinteger ( builtin_type_t  btyp)
inline

Definition at line 110 of file ov-base.h.

Referenced by ov_range< T >::isinteger().

◆ btyp_isnumeric()

bool btyp_isnumeric ( builtin_type_t  btyp)
inline

Definition at line 107 of file ov-base.h.

References btyp_uint64.

Referenced by ov_range< T >::isnumeric().

◆ btyp_mixed_numeric()

builtin_type_t btyp_mixed_numeric ( builtin_type_t  x,
builtin_type_t  y 
)

Determine the resulting type for a possible mixed-type operation.

Rules for the resulting type:

  • bool -> double
  • single + double -> single
  • real + complex -> complex
  • integer + real -> integer
  • uint + uint -> uint (the bigger one)
  • sint + sint -> sint (the bigger one)
Returns
The resulting type or "unknown type", if the resulting type cannot be determined.

Definition at line 67 of file ov-base.cc.

References btyp_bool, btyp_double, btyp_unknown, and x.

◆ called_from_builtin()

bool called_from_builtin ( )

◆ make_idx_args()

octave_value make_idx_args ( const std::string &  type,
const std::list< octave_value_list > &  idx,
const std::string &  who 
)

Definition at line 1461 of file ov-base.cc.

References error(), and len.

Variable Documentation

◆ btyp_class_name

std::string btyp_class_name[]
extern

Definition at line 91 of file ov-base.cc.

◆ Vsparse_auto_mutate

bool Vsparse_auto_mutate
extern

Definition at line 104 of file ov-base.cc.