diff src/ov-ch-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 bc61b0e8d60e
children 3deb1105fbc1
line wrap: on
line diff
--- a/src/ov-ch-mat.h	Thu Nov 12 16:44:12 1998 +0000
+++ b/src/ov-ch-mat.h	Fri Nov 13 03:44:36 1998 +0000
@@ -39,6 +39,7 @@
 
 #include "error.h"
 #include "ov-base.h"
+#include "ov-base-mat.h"
 #include "ov-typeinfo.h"
 
 class Octave_map;
@@ -49,56 +50,35 @@
 // Character matrix values.
 
 class
-octave_char_matrix : public octave_base_value
+octave_char_matrix : public octave_base_matrix<charMatrix>
 {
 public:
 
   octave_char_matrix (void)
-    : octave_base_value () { }
+    : octave_base_matrix<charMatrix> () { }
 
   octave_char_matrix (const charMatrix& chm, bool = false)
-    : octave_base_value (), matrix (chm) { }
+    : octave_base_matrix<charMatrix> (chm) { }
 
   octave_char_matrix (char c)
-    : octave_base_value (), matrix (c) { }
+    : octave_base_matrix<charMatrix> (c) { }
 
   octave_char_matrix (const char *s)
-    : octave_base_value (), matrix (s) { }
+    : octave_base_matrix<charMatrix> (s) { }
 
   octave_char_matrix (const string& s)
-    : octave_base_value (), matrix (s) { }
+    : octave_base_matrix<charMatrix> (s) { }
 
   octave_char_matrix (const string_vector& s)
-    : octave_base_value (), matrix (s) { }
+    : octave_base_matrix<charMatrix> (s) { }
 
   octave_char_matrix (const octave_char_matrix& chm)
-    : octave_base_value (), matrix (chm.matrix) { }
+    : octave_base_matrix<charMatrix> (chm) { }
 
   ~octave_char_matrix (void) { }
 
   octave_value *clone (void) { return new octave_char_matrix (*this); }
 
-  void *operator new (size_t size)
-    { return allocator.alloc (size); }
-
-  void operator delete (void *p, size_t size)
-    { allocator.free (p, size); }
-
-  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_constant (void) const { return true; }
-
-  bool is_defined (void) const { return true; }
-
   bool is_char_matrix (void) const { return true; }
   bool is_real_matrix (void) const { return true; }
 
@@ -134,32 +114,11 @@
   octave_value convert_to_str (void) const
     { return octave_value (matrix, true); }
 
-  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:
 
-  charMatrix matrix;
-
-  static octave_allocator allocator;
+  DECLARE_OCTAVE_ALLOCATOR
 
-  // Type id of character matrix objects, set by register_type().
-  static int t_id;
-
-  // Type name of character matrix objects, defined in ov-ch-mat.cc.
-  static const string t_name;
+  DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
 };
 
 #endif