diff src/symtab.h @ 9240:f27a8c07f0b2

clear -classes and support. * ov-class.h (octave_class::clear_exemplar_map): New function. * ov-class.cc (octave_class::clear_exemplar_map): New function. * symtab.h (symbol_record::clear_objects): New function * symtab.h (symbol_record::do_clear_objects): New function * variables.cc (do_matlab_compatible_clear, clear): Added classes option
author Robert T. Short <octave@phaselockedsystems.com>
date Thu, 21 May 2009 14:26:47 -0700
parents c6463412aebb
children 9c2349a51218
line wrap: on
line diff
--- a/src/symtab.h
+++ b/src/symtab.h
@@ -1318,6 +1318,14 @@
       inst->do_clear_variables ();
   }
 
+  static void clear_objects (scope_id scope = xcurrent_scope)
+  {
+    symbol_table *inst = get_instance (scope);
+
+    if (inst)
+      inst->do_clear_objects ();
+  }
+
   static void unmark_forced_variables (scope_id scope = xcurrent_scope)
   {
     symbol_table *inst = get_instance (scope);
@@ -2096,7 +2104,18 @@
       p->second.clear ();
   }
 
-  void do_unmark_forced_variables (void)
+  void do_clear_objects (void)
+  {
+    for (table_iterator p = table.begin (); p != table.end (); p++)
+      {
+	symbol_record& sr = p->second;
+	octave_value& val = sr.varref ();
+	if (val.is_object())
+	  p->second.clear ();
+      }
+  }
+
+ void do_unmark_forced_variables (void)
   {
     for (table_iterator p = table.begin (); p != table.end (); p++)
       p->second.unmark_forced ();