# HG changeset patch # User Michael Goffioul # Date 1357327753 18000 # Node ID a413c6fe1726bcdac03cc71ec2e8558c3bd4da04 # Parent 57be060d7672a22bf97ff8033ef157aff7cd28fc Add metaclass function. * libinterp/octave-value/ov-classdef.cc (Fmetaclass): New function. diff -r 57be060d7672 -r a413c6fe1726 libinterp/octave-value/ov-classdef.cc --- a/libinterp/octave-value/ov-classdef.cc Thu Jan 03 21:01:11 2013 -0500 +++ b/libinterp/octave-value/ov-classdef.cc Fri Jan 04 14:29:13 2013 -0500 @@ -2601,6 +2601,29 @@ return retval; } +DEFUN (metaclass, args, /* nargout */, + "-*- texinfo -*-\n\ +@deftypefn {Built-in Function} {} metaclass (obj)\n\ +Returns the meta.class object corresponding to the class of @var{obj}.\n\ +@end deftypefn") +{ + octave_value retval; + + if (args.length () == 1) + { + cdef_object obj = to_cdef (args(0)); + + if (! error_state) + retval = to_ov (obj.get_class ()); + else + print_usage (); + } + else + print_usage (); + + return retval; +} + /* ;;; Local Variables: *** ;;; mode: C++ ***