27 Feb 2018 08:38:55 UTC
- Distribution: Clownfish
- Source (raw)
- Browse (raw)
- How to Contribute
- Clone repository
- Testers (1243 / 0 / 7)
- KwaliteeBus factor: 1
- License: apache_2_0
- Perl: v5.8.3
- Activity24 month
- Download (230.31KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:2 non-PAUSE usersNWELLNHOF Nick Wellnhoferand 1 contributors
- The Apache Lucy Project <dev at lucy dot apache dot org>
Clownfish::Class - Class.
my $class = Clownfish::Class->fetch_class('Foo::Bar'); my $subclass = Clownfish::Class->singleton('Foo::Bar::Jr', $class);
Classes are first-class objects in Clownfish. Class objects are instances of Clownfish::Class.
my $class = Clownfish::Class->fetch_class($class_name);
Find a registered class. May return undef if the class is not registered.
my $class = Clownfish::Class->singleton( class_name => $class_name, # required parent => $parent, # required );
Return a singleton. If a Class can be found in the registry based on the supplied class name, it will be returned. Otherwise, a new Class will be created using
parentas a base.
parentis undef, an attempt will be made to find it. If the attempt fails, an error will result.
my $obj = $class->make_obj();
Create an empty object of the type defined by the Class: allocate, assign its class and give it an initial refcount of 1. The caller is responsible for initialization.
my $string = $class->get_name();
Return the name of the class.
my $result = $class->get_parent();
Return the parent class, or undef for a root of the class hierarchy.
my $int = $class->get_obj_alloc_size();
Return the number of bytes needed to hold an instance of the class.
Clownfish::Class isa Clownfish::Obj.