11 Aug 2011 02:55:56 UTC
- Distribution: Lucy
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (1)
- Testers (3 / 16 / 0)
- KwaliteeBus factor: 1
- License: apache_2_0
- Perl: v5.8.3
- Activity24 month
- Download (1.02MB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:6 non-PAUSE usersCREAMYG Marvin Humphreyand 1 contributors
- The Apache Lucy Project <lucy-dev at incubator dot apache dot org>
- get_cnick get_struct_sym get_parent_class_name get_source_class get_docucomment get_parent get_autocode inert final
Clownfish::Class - An object representing a single class definition.
Clownfish::Class objects are stored as quasi-singletons, one for each unique parcel/class_name combination.
my $class = Clownfish::Class->fetch_singleton( parcel => 'Crustacean', class_name => 'Crustacean::Lobster::LobsterClaw', );
Retrieve a Class, if one has already been created.
my $class = Clownfish::Class->create( parcel => 'Crustacean', # default: special class_name => 'Crustacean::Lobster::LobsterClaw', # required cnick => 'LobClaw', # default: special exposure => 'public', # default: 'parcel' source_class => undef, # default: same as class_name parent_class_name => 'Crustacean::Claw', # default: undef inert => undef, # default: undef docucomment => $documcom, # default: undef, );
Create and register a quasi-singleton. May only be called once for each unique parcel/class_name combination.
parcel, class_name, cnick, exposure - see Clownfish::Symbol.
source_class - The name of the class that owns the file in which this class was declared. Should be "Foo" if "Foo::FooJr" is defined in
parent_class_name - The name of this class's parent class. Needed in order to establish the class hierarchy.
inert - Should be true if the class is inert, i.e. cannot be instantiated.
docucomment - A Clownfish::DocuComment describing this Class.
Set the parent class.
Add a child class.
Add a Method to the class. Valid only before grow_tree() is called.
Add a Function to the class. Valid only before grow_tree() is called.
Add a member variable to the class. Valid only before grow_tree() is called.
Add an inert (class) variable to the class. Valid only before grow_tree() is called.
Add an arbitrary attribute to the class.
my $do_stuff_function = $class->function("do_stuff");
Return the inert Function object for the supplied
micro_sym, if any.
my $pinch_method = $class->method("Pinch");
Return the Method object for the supplied
macro_sym, if any.
my $pinch_method = $class->novel_method("Pinch");
Return a Method object if the Method corresponding to the supplied string is novel.
my $child_classes = $class->children;
Return an array of all child classes.
my $functions = $class->functions;
Return an array of all (inert) functions.
my $methods = $class->methods;
Return an array of all methods.
my $inert_vars = $class->inert_vars;
Return an array of all inert (shared, class) variables.
my $members = $class->member_vars;
Return an array of all member variables.
my $novel_methods = $class->novel_methods;
Return an array of all novel methods.
my $new_members = $class->novel_member_vars;
Return an array of all novel member variables.
Bequeath all inherited methods and members to children.
my $ordered = $class->tree_to_ladder;
Return this class and all its child classes as an array, where all children appear after their parent nodes.
my $relative_path = $class->include_h;
Return a relative path to a C header file, appropriately formatted for a pound-include directive.
Append auxiliary C code.
The short name of the global VTable object for this class.
Fully qualified vtable variable name, including the parcel prefix.
The fully qualified C type specifier for this class's vtable, including the parcel prefix. Each vtable needs to have its own type because each has a variable number of methods at the end of the struct, and it's not possible to initialize a static struct with a flexible array at the end under C89.
Fully qualified struct symbol, including the parcel prefix.