-
-
27 Feb 2018 08:38:55 UTC
- Distribution: Clownfish
- Module version: 0.006003
- Source (raw)
- Pod Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Clone repository
- Issues
- Testers (1301 / 0 / 7)
- Kwalitee
Bus factor: 0- License: apache_2_0
- Perl: v5.8.3
- Activity
24 month- Tools
- Download (230.31KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors- The Apache Lucy Project <dev at lucy dot apache dot org>
- Dependencies
- unknown
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Clownfish::Class - Class.
SYNOPSIS
my $class = Clownfish::Class->fetch_class('Foo::Bar'); my $subclass = Clownfish::Class->singleton('Foo::Bar::Jr', $class);
DESCRIPTION
Classes are first-class objects in Clownfish. Class objects are instances of Clownfish::Class.
CONSTRUCTORS
fetch_class
my $class = Clownfish::Class->fetch_class($class_name);
Find a registered class. May return undef if the class is not registered.
singleton
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
parent
as a base.If
parent
is undef, an attempt will be made to find it. If the attempt fails, an error will result.METHODS
make_obj
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.
get_name
my $string = $class->get_name();
Return the name of the class.
get_parent
my $result = $class->get_parent();
Return the parent class, or undef for a root of the class hierarchy.
get_obj_alloc_size
my $int = $class->get_obj_alloc_size();
Return the number of bytes needed to hold an instance of the class.
INHERITANCE
Clownfish::Class isa Clownfish::Obj.
Module Install Instructions
To install Clownfish, copy and paste the appropriate command in to your terminal.
cpanm Clownfish
perl -MCPAN -e shell install Clownfish
For more information on module installation, please visit the detailed CPAN module installation guide.