diff libinterp/octave-value/ov-classdef.cc @ 18441:b0aba84cf80f

Support handle to classdef constructor. * ov-classdef.cc (octave_classdef_meta::is_classdef_constructor): New method, makes the meta-object to look like a cdef constructor. * ov-fcn-handle.cc (make_fcn_handle): Handle classdef constructors like legacy class constructors.
author Michael Goffioul <michael.goffioul@gmail.com>
date Sat, 08 Feb 2014 19:17:25 -0500
parents d5aa615dcf4c
children 00ba456b9aa8
line wrap: on
line diff
--- a/libinterp/octave-value/ov-classdef.cc	Sat Feb 08 14:44:21 2014 -0800
+++ b/libinterp/octave-value/ov-classdef.cc	Sat Feb 08 19:17:25 2014 -0500
@@ -1129,6 +1129,27 @@
   bool is_postfix_index_handled (char type) const
     { return object.meta_is_postfix_index_handled (type); }
 
+  bool
+  is_classdef_constructor (const std::string& cname = std::string ()) const
+    {
+      bool retval = false;
+
+      if (object.is_class ())
+        {
+          if (cname.empty ())
+            retval = true;
+          else
+            {
+              cdef_class cls (object);
+
+              if (cls.get_name () == cname)
+                retval = true;
+            }
+        }
+
+      return retval;
+    }
+
 private:
   cdef_meta_object object;
 };