diff libinterp/corefcn/mxarray.in.h @ 22462:6cb7813e5b2f

Add new mxIsScalar function for MEX API. * NEWS: Announce new function. * mex.cc (mxArray_octave_value::is_scalar): New function. * mex.cc (mxArray_matlab::is_scalar): New function. * mex.cc (mxIsScalar): New API function which calls internal is_scalar. * mexproto.h (mxIsScalar): Add new function prototype. Organize list of prototypes to be clearer. * mxarray.in.h (mxArray_base::is_scalar): Declare virtual function. * mxarray.in.h (mxArray::is_scalar): Declare function which calls the is_scalar member function based on the object type (octave_value or matlab).
author Rik <rik@octave.org>
date Sat, 10 Sep 2016 07:40:52 -0700
parents ca01dc025e2c
children 1d2960b5efe6
line wrap: on
line diff
--- a/libinterp/corefcn/mxarray.in.h	Sat Sep 10 06:20:03 2016 -0700
+++ b/libinterp/corefcn/mxarray.in.h	Sat Sep 10 07:40:52 2016 -0700
@@ -214,6 +214,8 @@
 
   virtual int is_empty (void) const = 0;
 
+  virtual bool is_scalar (void) const = 0;
+
   virtual mxClassID get_class_id (void) const = 0;
 
   virtual const char *get_class_name (void) const = 0;
@@ -421,6 +423,8 @@
 
   int is_empty (void) const { return get_number_of_elements () == 0; }
 
+  bool is_scalar (void) const { return rep->is_scalar (); }
+
   const char *get_name (void) const { return name; }
 
   void set_name (const char *name_arg);