comparison libinterp/octave-value/ov-classdef.cc @ 20946:6eff66fb8a02

style fixes for comments * find-dialog.cc, find-dialog.h, display.cc, error.cc, gl-render.cc, graphics.cc, graphics.in.h, max.cc, oct-handle.h, oct-obj.h, oct-stream.cc, oct.h, pr-output.cc, profiler.cc, str2double.cc, symtab.cc, toplev.cc, toplev.h, xgl2ps.c, zfstream.cc, zfstream.h, __glpk__.cc, audiodevinfo.cc, colamd.cc, symbfact.cc, ov-classdef.cc, ov-classdef.h, ov-java.cc, op-int.h, pt-pr-code.cc, pt-walk.h: Use C++-style comments where possible.
author John W. Eaton <jwe@octave.org>
date Fri, 18 Dec 2015 22:39:36 -0500
parents b17fda023ca6
children 3aa293be0e8d
comparison
equal deleted inserted replaced
20945:9d9270e2f98f 20946:6eff66fb8a02
2009 void visit_unwind_protect_command (tree_unwind_protect_command&) { } 2009 void visit_unwind_protect_command (tree_unwind_protect_command&) { }
2010 void visit_while_command (tree_while_command&) { } 2010 void visit_while_command (tree_while_command&) { }
2011 void visit_do_until_command (tree_do_until_command&) { } 2011 void visit_do_until_command (tree_do_until_command&) { }
2012 2012
2013 private: 2013 private:
2014 /* The name of the constructor being analyzed */ 2014 // The name of the constructor being analyzed.
2015 std::string who; 2015 std::string who;
2016 2016
2017 /* The name of the first output argument of the constructor */ 2017 // The name of the first output argument of the constructor.
2018 std::string obj_name; 2018 std::string obj_name;
2019 2019
2020 /* The list of superclass constructors that are explicitly called */ 2020 // The list of superclass constructors that are explicitly called.
2021 std::list<cdef_class> ctor_list; 2021 std::list<cdef_class> ctor_list;
2022 }; 2022 };
2023 2023
2024 void 2024 void
2025 cdef_class::cdef_class_rep::install_method (const cdef_method& meth) 2025 cdef_class::cdef_class_rep::install_method (const cdef_method& meth)
3503 void 3503 void
3504 install_classdef (void) 3504 install_classdef (void)
3505 { 3505 {
3506 octave_classdef::register_type (); 3506 octave_classdef::register_type ();
3507 3507
3508 /* bootstrap */ 3508 // bootstrap
3509 cdef_class handle = make_class ("handle"); 3509 cdef_class handle = make_class ("handle");
3510 cdef_class meta_class = cdef_class::_meta_class = make_meta_class ("meta.class", handle); 3510 cdef_class meta_class = cdef_class::_meta_class = make_meta_class ("meta.class", handle);
3511 handle.set_class (meta_class); 3511 handle.set_class (meta_class);
3512 meta_class.set_class (meta_class); 3512 meta_class.set_class (meta_class);
3513 3513
3514 /* meta classes */ 3514 // meta classes
3515 cdef_class meta_property = cdef_class::_meta_property = make_meta_class ("meta.property", handle); 3515 cdef_class meta_property = cdef_class::_meta_property = make_meta_class ("meta.property", handle);
3516 cdef_class meta_method = cdef_class::_meta_method = make_meta_class ("meta.method", handle); 3516 cdef_class meta_method = cdef_class::_meta_method = make_meta_class ("meta.method", handle);
3517 cdef_class meta_package = cdef_class::_meta_package = make_meta_class ("meta.package", handle); 3517 cdef_class meta_package = cdef_class::_meta_package = make_meta_class ("meta.package", handle);
3518 3518
3519 cdef_class meta_event = make_meta_class ("meta.event", handle); 3519 cdef_class meta_event = make_meta_class ("meta.event", handle);
3520 cdef_class meta_dynproperty = make_meta_class ("meta.dynamicproperty", handle); 3520 cdef_class meta_dynproperty = make_meta_class ("meta.dynamicproperty", handle);
3521 3521
3522 /* meta.class properties */ 3522 // meta.class properties
3523 meta_class.install_property (make_attribute (meta_class, "Abstract")); 3523 meta_class.install_property (make_attribute (meta_class, "Abstract"));
3524 meta_class.install_property (make_attribute (meta_class, "ConstructOnLoad")); 3524 meta_class.install_property (make_attribute (meta_class, "ConstructOnLoad"));
3525 meta_class.install_property (make_property (meta_class, "ContainingPackage")); 3525 meta_class.install_property (make_property (meta_class, "ContainingPackage"));
3526 meta_class.install_property (make_property (meta_class, "Description")); 3526 meta_class.install_property (make_property (meta_class, "Description"));
3527 meta_class.install_property (make_property (meta_class, "DetailedDescription")); 3527 meta_class.install_property (make_property (meta_class, "DetailedDescription"));
3556 "public", Matrix (), "private")); 3556 "public", Matrix (), "private"));
3557 meta_class.install_property 3557 meta_class.install_property
3558 (make_property (meta_class, "SuperClassList", 3558 (make_property (meta_class, "SuperClassList",
3559 make_fcn_handle (class_get_superclasses, "meta.class>get.SuperClassList"), 3559 make_fcn_handle (class_get_superclasses, "meta.class>get.SuperClassList"),
3560 "public", Matrix (), "private")); 3560 "public", Matrix (), "private"));
3561 /* meta.class methods */ 3561 // meta.class methods
3562 meta_class.install_method (make_method (meta_class, "fromName", class_fromName, 3562 meta_class.install_method (make_method (meta_class, "fromName", class_fromName,
3563 "public", true)); 3563 "public", true));
3564 meta_class.install_method (make_method (meta_class, "fevalStatic", class_fevalStatic, 3564 meta_class.install_method (make_method (meta_class, "fevalStatic", class_fevalStatic,
3565 "public", false)); 3565 "public", false));
3566 meta_class.install_method (make_method (meta_class, "getConstant", class_getConstant, 3566 meta_class.install_method (make_method (meta_class, "getConstant", class_getConstant,
3570 meta_class.install_method (make_method (meta_class, "lt", class_lt)); 3570 meta_class.install_method (make_method (meta_class, "lt", class_lt));
3571 meta_class.install_method (make_method (meta_class, "le", class_le)); 3571 meta_class.install_method (make_method (meta_class, "le", class_le));
3572 meta_class.install_method (make_method (meta_class, "gt", class_gt)); 3572 meta_class.install_method (make_method (meta_class, "gt", class_gt));
3573 meta_class.install_method (make_method (meta_class, "ge", class_ge)); 3573 meta_class.install_method (make_method (meta_class, "ge", class_ge));
3574 3574
3575 /* meta.method properties */ 3575 // meta.method properties
3576 meta_method.install_property (make_attribute (meta_method, "Abstract")); 3576 meta_method.install_property (make_attribute (meta_method, "Abstract"));
3577 meta_method.install_property (make_attribute (meta_method, "Access")); 3577 meta_method.install_property (make_attribute (meta_method, "Access"));
3578 meta_method.install_property (make_attribute (meta_method, "DefiningClass")); 3578 meta_method.install_property (make_attribute (meta_method, "DefiningClass"));
3579 meta_method.install_property (make_attribute (meta_method, "Description")); 3579 meta_method.install_property (make_attribute (meta_method, "Description"));
3580 meta_method.install_property (make_attribute (meta_method, "DetailedDescription")); 3580 meta_method.install_property (make_attribute (meta_method, "DetailedDescription"));
3581 meta_method.install_property (make_attribute (meta_method, "Hidden")); 3581 meta_method.install_property (make_attribute (meta_method, "Hidden"));
3582 meta_method.install_property (make_attribute (meta_method, "Name")); 3582 meta_method.install_property (make_attribute (meta_method, "Name"));
3583 meta_method.install_property (make_attribute (meta_method, "Sealed")); 3583 meta_method.install_property (make_attribute (meta_method, "Sealed"));
3584 meta_method.install_property (make_attribute (meta_method, "Static")); 3584 meta_method.install_property (make_attribute (meta_method, "Static"));
3585 3585
3586 /* meta.property properties */ 3586 // meta.property properties
3587 meta_property.install_property (make_attribute (meta_property, "Name")); 3587 meta_property.install_property (make_attribute (meta_property, "Name"));
3588 meta_property.install_property (make_attribute (meta_property, "Description")); 3588 meta_property.install_property (make_attribute (meta_property, "Description"));
3589 meta_property.install_property (make_attribute (meta_property, "DetailedDescription")); 3589 meta_property.install_property (make_attribute (meta_property, "DetailedDescription"));
3590 meta_property.install_property (make_attribute (meta_property, "Abstract")); 3590 meta_property.install_property (make_attribute (meta_property, "Abstract"));
3591 meta_property.install_property (make_attribute (meta_property, "Constant")); 3591 meta_property.install_property (make_attribute (meta_property, "Constant"));
3602 meta_property.install_property 3602 meta_property.install_property
3603 (make_property (meta_property, "DefaultValue", 3603 (make_property (meta_property, "DefaultValue",
3604 make_fcn_handle (property_get_defaultvalue, "meta.property>get.DefaultValue"), 3604 make_fcn_handle (property_get_defaultvalue, "meta.property>get.DefaultValue"),
3605 "public", Matrix (), "private")); 3605 "public", Matrix (), "private"));
3606 meta_property.install_property (make_attribute (meta_property, "HasDefault")); 3606 meta_property.install_property (make_attribute (meta_property, "HasDefault"));
3607 /* meta.property events */ 3607 // meta.property events
3608 // FIXME: add events 3608 // FIXME: add events
3609 3609
3610 /* handle methods */ 3610 // handle methods
3611 handle.install_method (make_method (handle, "delete", handle_delete)); 3611 handle.install_method (make_method (handle, "delete", handle_delete));
3612 3612
3613 /* meta.package properties */ 3613 // meta.package properties
3614 meta_package.install_property (make_attribute (meta_package, "Name")); 3614 meta_package.install_property (make_attribute (meta_package, "Name"));
3615 meta_package.install_property (make_property (meta_package, "ContainingPackage")); 3615 meta_package.install_property (make_property (meta_package, "ContainingPackage"));
3616 meta_package.install_property 3616 meta_package.install_property
3617 (make_property (meta_package, "ClassList", 3617 (make_property (meta_package, "ClassList",
3618 make_fcn_handle (package_get_classes, "meta.package>get.ClassList"), 3618 make_fcn_handle (package_get_classes, "meta.package>get.ClassList"),
3640 meta_package.install_method (make_method (meta_package, "fromName", package_fromName, 3640 meta_package.install_method (make_method (meta_package, "fromName", package_fromName,
3641 "public", true)); 3641 "public", true));
3642 meta_package.install_method (make_method (meta_package, "getAllPackages", package_getAllPackages, 3642 meta_package.install_method (make_method (meta_package, "getAllPackages", package_getAllPackages,
3643 "public", true)); 3643 "public", true));
3644 3644
3645 /* create "meta" package */ 3645 // create "meta" package
3646 cdef_package package_meta = cdef_package::_meta = make_package ("meta"); 3646 cdef_package package_meta = cdef_package::_meta = make_package ("meta");
3647 package_meta.install_class (meta_class, "class"); 3647 package_meta.install_class (meta_class, "class");
3648 package_meta.install_class (meta_property, "property"); 3648 package_meta.install_class (meta_property, "property");
3649 package_meta.install_class (meta_method, "method"); 3649 package_meta.install_class (meta_method, "method");
3650 package_meta.install_class (meta_package, "package"); 3650 package_meta.install_class (meta_package, "package");
3651 package_meta.install_class (meta_event, "event"); 3651 package_meta.install_class (meta_event, "event");
3652 package_meta.install_class (meta_dynproperty, "dynproperty"); 3652 package_meta.install_class (meta_dynproperty, "dynproperty");
3653 3653
3654 /* install built-in classes into the symbol table */ 3654 // install built-in classes into the symbol table
3655 symbol_table::install_built_in_function 3655 symbol_table::install_built_in_function
3656 ("meta.class", octave_value (meta_class.get_constructor_function ())); 3656 ("meta.class", octave_value (meta_class.get_constructor_function ()));
3657 symbol_table::install_built_in_function 3657 symbol_table::install_built_in_function
3658 ("meta.method", octave_value (meta_method.get_constructor_function ())); 3658 ("meta.method", octave_value (meta_method.get_constructor_function ()));
3659 symbol_table::install_built_in_function 3659 symbol_table::install_built_in_function
3812 std::string cname = args(0).xstring_value ("PACKAGE_NAME must be a string"); 3812 std::string cname = args(0).xstring_value ("PACKAGE_NAME must be a string");
3813 3813
3814 return to_ov (lookup_package (cname)); 3814 return to_ov (lookup_package (cname));
3815 } 3815 }
3816 3816
3817 DEFUN (__superclass_reference__, args, /* nargout */, 3817 DEFUN (__superclass_reference__, args, ,
3818 "-*- texinfo -*-\n\ 3818 "-*- texinfo -*-\n\
3819 @deftypefn {} {} __superclass_reference__ ()\n\ 3819 @deftypefn {} {} __superclass_reference__ ()\n\
3820 Undocumented internal function.\n\ 3820 Undocumented internal function.\n\
3821 @end deftypefn") 3821 @end deftypefn")
3822 { 3822 {
3823 return octave_value (new octave_classdef_superclass_ref (args)); 3823 return octave_value (new octave_classdef_superclass_ref (args));
3824 } 3824 }
3825 3825
3826 DEFUN (__meta_class_query__, args, /* nargout */, 3826 DEFUN (__meta_class_query__, args, ,
3827 "-*- texinfo -*-\n\ 3827 "-*- texinfo -*-\n\
3828 @deftypefn {} {} __meta_class_query__ ()\n\ 3828 @deftypefn {} {} __meta_class_query__ ()\n\
3829 Undocumented internal function.\n\ 3829 Undocumented internal function.\n\
3830 @end deftypefn") 3830 @end deftypefn")
3831 { 3831 {
3841 std::string cls = args(0).xstring_value ("CLASS_NAME must be a string"); 3841 std::string cls = args(0).xstring_value ("CLASS_NAME must be a string");
3842 3842
3843 return to_ov (lookup_class (cls)); 3843 return to_ov (lookup_class (cls));
3844 } 3844 }
3845 3845
3846 DEFUN (metaclass, args, /* nargout */, 3846 DEFUN (metaclass, args, ,
3847 "-*- texinfo -*-\n\ 3847 "-*- texinfo -*-\n\
3848 @deftypefn {} {} metaclass (obj)\n\ 3848 @deftypefn {} {} metaclass (obj)\n\
3849 Returns the meta.class object corresponding to the class of @var{obj}.\n\ 3849 Returns the meta.class object corresponding to the class of @var{obj}.\n\
3850 @end deftypefn") 3850 @end deftypefn")
3851 { 3851 {