GNU Octave  8.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"
Include dependency graph for ov-base.h:
This graph shows which files directly or indirectly include this file:

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__ (const std::string &)
 
OCTINTERP_API type_info__get_type_info__ (void)
 
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)
 
OCTINTERP_API 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...
 
OCTINTERP_API bool called_from_builtin (void)
 
OCTINTERP_API octave_value make_idx_args (const std::string &type, const std::list< octave_value_list > &idx, const std::string &who)
 

Variables

OCTINTERP_API std::string btyp_class_name []
 
OCTINTERP_API 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 (void) const { return t_id; } \
VIRTUAL std::string type_name (void) const { return t_name; } \
VIRTUAL std::string class_name (void) const { return c_name; } \
static int static_type_id (void) { return t_id; } \
static std::string static_type_name (void) { return t_name; } \
static std::string static_class_name (void) { return c_name; } \
static void register_type (void); \
static void register_type (octave::type_info&); \
\
private: \
static int t_id; \
static const std::string t_name; \
static const std::string c_name;
int register_type(const std::string &t_name, const std::string &c_name, const octave_value &val)
Definition: ov-typeinfo.cc:771

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 (void); \
template <> void cls<type>::register_type (octave::type_info&); \
template <> int cls<type>::t_id; \
template <> const std::string cls<type>::t_name; \
template <> const std::string cls<type>::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 229 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::t_id (-1); \
tspec const std::string t::t_name (n); \
tspec const std::string t::c_name (c); \
tspec void t::register_type (void) \
{ \
octave::type_info& type_info = octave::__get_type_info__ (); \
} \
tspec void t::register_type (octave::type_info& ti) \
{ \
octave_value v (new t ()); \
t_id = ti.register_type (t::t_name, t::c_name, v); \
}
octave_idx_type n
Definition: mx-inlines.cc:753
OCTINTERP_API type_info & __get_type_info__(void)

Definition at line 210 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 226 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]

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

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

References __get_type_info__().

◆ __get_type_info__() [2/2]

◆ btyp_isarray()

bool btyp_isarray ( builtin_type_t  btyp)
inline

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

References btyp_char.

Referenced by build_sup_table().

◆ 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 build_sup_table(), and ov_range< T >::isinteger().

◆ btyp_isnumeric()

bool btyp_isnumeric ( builtin_type_t  btyp)
inline

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

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

◆ btyp_mixed_numeric()

OCTINTERP_API 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 65 of file ov-base.cc.

References btyp_bool, btyp_double, btyp_unknown, and x.

Referenced by do_minmax_body().

◆ called_from_builtin()

◆ make_idx_args()

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

Variable Documentation

◆ btyp_class_name

OCTINTERP_API std::string btyp_class_name[]
extern

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

Referenced by get_dispatch_type().

◆ Vsparse_auto_mutate

OCTINTERP_API bool Vsparse_auto_mutate
extern

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