Navigation

Operators and Keywords

Function List:

C++ API

op-class.cc File Reference

#include "oct-time.h"
#include "gripes.h"
#include "load-path.h"
#include "oct-obj.h"
#include "ov.h"
#include "ov-class.h"
#include "ov-typeinfo.h"
#include "ops.h"
#include "symtab.h"
#include "parse.h"

Include dependency graph for op-class.cc:


Defines

#define DEF_CLASS_UNOP(name)
#define DEF_CLASS_BINOP(name)
#define INSTALL_CLASS_UNOP(op, f)
#define INSTALL_CLASS_BINOP(op, f)

Functions

void install_class_ops (void)

Define Documentation

#define DEF_CLASS_BINOP ( name   ) 

Value:

static octave_value \
  oct_binop_ ## name (const octave_value& a1, const octave_value& a2) \
  { \
    octave_value retval; \
 \
    std::string dispatch_type \
      = a1.is_object () ? a1.class_name () : a2.class_name (); \
 \
    octave_value meth = symbol_table::find_method (#name, dispatch_type); \
 \
    if (meth.is_defined ()) \
      { \
        octave_value_list args; \
 \
        args(1) = a2; \
        args(0) = a1; \
 \
        octave_value_list tmp = feval (meth.function_value (), args, 1); \
 \
        if (tmp.length () > 0) \
          retval = tmp(0); \
      } \
    else \
      error ("%s method not defined for %s class", \
             #name, dispatch_type.c_str ()); \
 \
    return retval; \
  }

#define DEF_CLASS_UNOP ( name   ) 

Value:

static octave_value \
  oct_unop_ ## name (const octave_value& a) \
  { \
    octave_value retval; \
 \
    std::string class_name = a.class_name (); \
 \
    octave_value meth = symbol_table::find_method (#name, class_name); \
 \
    if (meth.is_defined ()) \
      { \
        octave_value_list args; \
 \
        args(0) = a; \
 \
        octave_value_list tmp = feval (meth.function_value (), args, 1); \
 \
        if (tmp.length () > 0) \
          retval = tmp(0); \
      } \
    else \
      error ("%s method not defined for %s class", \
             #name, class_name.c_str ()); \
 \
    return retval; \
  }

#define INSTALL_CLASS_BINOP ( op,
 ) 

#define INSTALL_CLASS_UNOP ( op,
 ) 


Function Documentation

void install_class_ops ( void   )