diff src/ov-bool-mat.h @ 3219:30770ba4457a

[project @ 1998-11-13 03:44:31 by jwe]
author jwe
date Fri, 13 Nov 1998 03:44:36 +0000
parents fbb332b96e4f
children 3deb1105fbc1
line wrap: on
line diff
--- a/src/ov-bool-mat.h
+++ b/src/ov-bool-mat.h
@@ -38,6 +38,7 @@
 
 #include "error.h"
 #include "ov-base.h"
+#include "ov-base-mat.h"
 #include "ov-typeinfo.h"
 
 class Octave_map;
@@ -48,29 +49,23 @@
 // Character matrix values.
 
 class
-octave_bool_matrix : public octave_base_value
+octave_bool_matrix : public octave_base_matrix<boolMatrix>
 {
 public:
 
   octave_bool_matrix (void)
-    : octave_base_value () { }
+    : octave_base_matrix () { }
 
   octave_bool_matrix (const boolMatrix& bm)
-    : octave_base_value (), matrix (bm) { }
+    : octave_base_matrix (bm) { }
 
   octave_bool_matrix (const octave_bool_matrix& bm)
-    : octave_base_value (), matrix (bm.matrix) { }
+    : octave_base_matrix (bm) { }
 
   ~octave_bool_matrix (void) { }
 
   octave_value *clone (void) { return new octave_bool_matrix (*this); }
 
-  void *operator new (size_t size)
-    { return allocator.alloc (size); }
-
-  void operator delete (void *p, size_t size)
-    { allocator.free (p, size); }
-
   type_conv_fcn numeric_conversion_function (void) const;
 
   octave_value *try_narrowing_conversion (void);
@@ -81,21 +76,6 @@
 
   idx_vector index_vector (void) const { return idx_vector (matrix); }
 
-  int rows (void) const { return matrix.rows (); }
-  int columns (void) const { return matrix.columns (); }
-
-  int length (void) const
-  {
-    int r = rows ();
-    int c = columns ();
-
-    return r > c ? r : c;
-  }
-
-  bool is_defined (void) const { return true; }
-
-  bool is_constant (void) const { return true; }
-
   bool is_bool_matrix (void) const { return true; }
 
   octave_value all (void) const { return matrix.all (); }
@@ -133,32 +113,11 @@
   octave_value convert_to_str (void) const
     { return octave_value (matrix); }
 
-  void print (ostream& os, bool pr_as_read_syntax = false) const;
-
-  void print_raw (ostream& os, bool pr_as_read_syntax = false) const;
-
-  bool print_name_tag (ostream& os, const string& name) const;
-
-  int type_id (void) const { return t_id; }
-
-  string type_name (void) const { return t_name; }
-
-  static int static_type_id (void) { return t_id; }
-
-  static void register_type (void)
-    { t_id = octave_value_typeinfo::register_type (t_name); }
-
 protected:
 
-  boolMatrix matrix;
-
-  static octave_allocator allocator;
+  DECLARE_OCTAVE_ALLOCATOR
 
-  // Type id of bool matrix objects, set by register_type().
-  static int t_id;
-
-  // Type name of bool matrix objects, defined in ov-bool-mat.cc.
-  static const string t_name;
+  DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
 };
 
 #endif