changeset 10649:64472dd48517

cosmetic changes in Cell interface
author Jaroslav Hajek <highegg@gmail.com>
date Mon, 24 May 2010 12:41:43 +0200
parents bc4eb29e0cb4
children f0dc41c824ce
files src/Cell.cc src/Cell.h src/ChangeLog src/oct-map.cc
diffstat 4 files changed, 19 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/Cell.cc	Sun May 23 17:11:50 2010 -0700
+++ b/src/Cell.cc	Mon May 24 12:41:43 2010 +0200
@@ -196,7 +196,7 @@
   return retval;
 }
 
-Cell&
+void
 Cell::assign (const octave_value_list& idx_arg, const Cell& rhs,
               const octave_value& fill_val)
 
@@ -209,11 +209,9 @@
     ra_idx(i) = idx_arg(i).index_vector ();
 
   Array<octave_value>::assign (ra_idx, rhs, fill_val);
-
-  return *this;
 }
 
-Cell&
+void
 Cell::delete_elements (const octave_value_list& idx_arg)
 
 {
@@ -225,8 +223,6 @@
     ra_idx.xelem (i) = idx_arg(i).index_vector ();
 
   Array<octave_value>::delete_elements (ra_idx);
-
-  return *this;
 }
 
 octave_idx_type
--- a/src/Cell.h	Sun May 23 17:11:50 2010 -0700
+++ b/src/Cell.h	Mon May 24 12:41:43 2010 +0200
@@ -74,12 +74,18 @@
 
   Array<std::string> cellstr_value (void) const;
 
+  using Array<octave_value>::index;
+
   Cell index (const octave_value_list& idx, bool resize_ok = false) const;
 
-  Cell& delete_elements (const octave_value_list& idx);
+  using Array<octave_value>::delete_elements;
+
+  void delete_elements (const octave_value_list& idx);
 
-  Cell& assign (const octave_value_list& idx, const Cell& rhs,
-                const octave_value& fill_val = resize_fill_value ());
+  using Array<octave_value>::assign;
+
+  void assign (const octave_value_list& idx, const Cell& rhs,
+               const octave_value& fill_val = resize_fill_value ());
 
   Cell reshape (const dim_vector& new_dims) const
     { return Array<octave_value>::reshape (new_dims); }
--- a/src/ChangeLog	Sun May 23 17:11:50 2010 -0700
+++ b/src/ChangeLog	Mon May 24 12:41:43 2010 +0200
@@ -1,3 +1,10 @@
+2010-05-24  Jaroslav Hajek  <highegg@gmail.com>
+
+	* Cell.h (Cell::index, Cell::assign, Cell::delete_elements):
+	Make signatures consistent with inherited overloads. Import inherited
+	overloads to class's scope.
+	* oct-map.cc (Octave_map::maybe_delete_elements): Simplify.
+
 2010-05-20  John W. Eaton  <jwe@octave.org>
 
 	* utils.cc (Ffile_in_path, Ffile_in_loadpath): If no file is
--- a/src/oct-map.cc	Sun May 23 17:11:50 2010 -0700
+++ b/src/oct-map.cc	Mon May 24 12:41:43 2010 +0200
@@ -343,7 +343,7 @@
         {
           std::string k = t_keys[i];
 
-          map[k] = contents(k).delete_elements (idx);
+          contents(k).delete_elements (idx);
 
           if (error_state)
             break;