diff src/ov-base.cc @ 10087:090173f2db40

improve overload dispatching of built-in classes
author Jaroslav Hajek <highegg@gmail.com>
date Tue, 12 Jan 2010 13:20:17 +0100
parents 84b0725f4b09
children cd96d29c5efa
line wrap: on
line diff
--- a/src/ov-base.cc	Tue Jan 12 09:03:42 2010 +0100
+++ b/src/ov-base.cc	Tue Jan 12 13:20:17 2010 +0100
@@ -78,6 +78,36 @@
   return retval;
 }
 
+std::string btyp_class_name[btyp_num_types] = 
+{
+  "double", "single", "double", "single",
+  "int8", "int16", "int32", "int64",
+  "uint8", "uint16", "uint32", "uint64",
+  "logical", "char",
+  "struct", "cell", "function_handle"
+};
+
+string_vector
+get_builtin_classes (void)
+{
+  static string_vector retval;
+
+  if (retval.is_empty ())
+    {
+      int n = btyp_num_types - 2;
+      retval = string_vector (n);
+      int j = 0;
+      for (int i = 0; i < btyp_num_types; i++)
+        {
+          builtin_type_t ityp = static_cast<builtin_type_t> (i);
+          if (ityp != btyp_complex && ityp != btyp_float_complex)
+            retval(j++) = btyp_class_name[i];
+        }
+    }
+
+  return retval;
+}
+
 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_base_value,
 				     "<unknown type>", "unknown");