base class
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 8524
MRP::BaseClass 1.0
MRP Base Class 1.0 is an efficient base class for Perl objects that generates the class interface from a definition more>>
MRP Base Class 1.0 is an efficient base class for Perl objects that generates the class interface from a definition.
The aim of this package is to allow you to define a classes interface, and have perl generate all of the standard functions for you.
Major Features:
- Fields: Member access functions are auto-generated so that nowhere in your code do you ever directly access member variables.
- Package variables: Class functions are auto-generated to make package variables work like static class members.
- Default variables: The package variable an be made to act as the default value for a field of the same name.
- Delegation support: Simply specify which field is a delegate and which functions to delegate to it, and the glue code is auto-generated.
- Provide dramatically better error messages when methods or static functions can not be found. Try invoking the < C -w > flag. It even lists possible correct spellings of misspelled function names!
- The class definition in a BEGIN block is included at the end of the package. This allows the interface to be checked, and the code to be generated at compile time. This has the additional benefit that these checks are performed during a < C -c > compilation.
Requirements: Perl
<<less Added: 2009-06-10 License: Perl Artistic License Price: FREE
14 downloads
C++ base 1.0
C++ base is a base class suite contains several powerful c++ base classes for basic encapsulation. more>>
C++ base is a base class suite contains several powerful c++ base classes for basic encapsulation of low level operating system calls and basic library functions.
Further packages you may access from this page require the installation of this base package
<<lessFurther packages you may access from this page require the installation of this base package
Download (0.10MB)
Added: 2006-10-23 License: GPL (GNU General Public License) Price:
1097 downloads
Class::XML 0.06
Class::XML is a Perl module for simple XML Abstraction. more>>
Class::XML is a Perl module for simple XML Abstraction.
SYNOPSIS
package Foo;
use base qw/Class::XML/;
__PACKAGE__->has_attributes(qw/length colour/);
__PACKAGE__->has_child(bar => Bar);
package Bar;
use base qw/Class::XML/;
__PACKAGE__->has_parent(foo);
__PACKAGE__->has_attribute(counter);
# Meanwhile, in another piece of code -
my $foo = Foo->new( xml => # Or filename or ioref or parser
qq!< foo length="3m" colour="pink" >< bar / >< /foo >! );
$foo->length; # Returns "3m"
$foo->colour("purple"); # Sets colour to purple
print $foo; # Outputs
my $new_bar = new Bar; # Creates empty Bar node
$new_bar->counter("formica");
$foo->bar($new_bar); # Replaces child
$new_bar->foo->colour; # Returns "purple"
$foo->colour(undef); # Deletes colour attribute
print $foo; # Outputs < foo length="3m" >< bar counter="formica" / >< /foo >
Class::XML is designed to make it reasonably easy to create, consume or modify XML from Perl while thinking in terms of Perl objects rather than the available XML APIs; it was written out of a mixture of frustration that JAXB (for Java) and XMLSerializer (for .Net) provided programming capabilities that simply werent easy to do in Perl with the existing modules, and the sheer pleasure that Ive had using Class::DBI.
The aim is to provide a convenient abstraction layer that allows you to put as much of your logic as you like into methods on a class tree, then throw some XML at that tree and get back a tree of objects to work with. It should also be easy to get started with for anybody familiar with Class::DBI (although I doubt you could simply switch them due to the impedance mismatch between XML and relational data) and be pleasant to use from the Template Toolkit.
Finally, all Class::XML objects are also XML::XPath nodes so the full power of XPath is available to you if Class::XML doesnt provide a shortcut to what youre trying to do (but if you find it doesnt on a regular basis, contact me and Ill see if I can fix that.
<<lessSYNOPSIS
package Foo;
use base qw/Class::XML/;
__PACKAGE__->has_attributes(qw/length colour/);
__PACKAGE__->has_child(bar => Bar);
package Bar;
use base qw/Class::XML/;
__PACKAGE__->has_parent(foo);
__PACKAGE__->has_attribute(counter);
# Meanwhile, in another piece of code -
my $foo = Foo->new( xml => # Or filename or ioref or parser
qq!< foo length="3m" colour="pink" >< bar / >< /foo >! );
$foo->length; # Returns "3m"
$foo->colour("purple"); # Sets colour to purple
print $foo; # Outputs
my $new_bar = new Bar; # Creates empty Bar node
$new_bar->counter("formica");
$foo->bar($new_bar); # Replaces child
$new_bar->foo->colour; # Returns "purple"
$foo->colour(undef); # Deletes colour attribute
print $foo; # Outputs < foo length="3m" >< bar counter="formica" / >< /foo >
Class::XML is designed to make it reasonably easy to create, consume or modify XML from Perl while thinking in terms of Perl objects rather than the available XML APIs; it was written out of a mixture of frustration that JAXB (for Java) and XMLSerializer (for .Net) provided programming capabilities that simply werent easy to do in Perl with the existing modules, and the sheer pleasure that Ive had using Class::DBI.
The aim is to provide a convenient abstraction layer that allows you to put as much of your logic as you like into methods on a class tree, then throw some XML at that tree and get back a tree of objects to work with. It should also be easy to get started with for anybody familiar with Class::DBI (although I doubt you could simply switch them due to the impedance mismatch between XML and relational data) and be pleasant to use from the Template Toolkit.
Finally, all Class::XML objects are also XML::XPath nodes so the full power of XPath is available to you if Class::XML doesnt provide a shortcut to what youre trying to do (but if you find it doesnt on a regular basis, contact me and Ill see if I can fix that.
Download (0.018MB)
Added: 2006-09-07 License: Perl Artistic License Price:
1142 downloads
dtRdr::Traits::Class 0.0.11
dtRdr::Traits::Class is a Perl module with shared OO stuff. more>>
dtRdr::Traits::Class is a Perl module with shared OO stuff.
Methods to Break Things
NOT_IMPLEMENTED
Imported into base class. Gives a nicer message than the standard "Cant locate method...", indicating that you did not typo the method name, but instead forgot to override it.
sub virtual_method {my $self = shift; $self->NOT_IMPLEMENTED(@_);}
Is the shorter, less readable version worthwhile?
sub virtual_method { $_[0]->NOT_IMPLEMENTED(@_[1..$#_]);}
This should be safe for subclasses to override and/or call as ->SUPER::. This gives you something like an AUTOLOAD (though you would have to get (caller(1))[3] yourself) without having to also do can(), but thats untested...
WARN_NOT_IMPLEMENTED
Same as NOT_IMPLEMENTED(), but just a warning. Returns undef.
$self->WARN_NOT_IMPLEMENTED;
Class Hopping
claim
Assumes a hash-based object. Creates a copy (with only one level of dereference) and blesses it into Package.
$object = Package->claim($object);
<<lessMethods to Break Things
NOT_IMPLEMENTED
Imported into base class. Gives a nicer message than the standard "Cant locate method...", indicating that you did not typo the method name, but instead forgot to override it.
sub virtual_method {my $self = shift; $self->NOT_IMPLEMENTED(@_);}
Is the shorter, less readable version worthwhile?
sub virtual_method { $_[0]->NOT_IMPLEMENTED(@_[1..$#_]);}
This should be safe for subclasses to override and/or call as ->SUPER::. This gives you something like an AUTOLOAD (though you would have to get (caller(1))[3] yourself) without having to also do can(), but thats untested...
WARN_NOT_IMPLEMENTED
Same as NOT_IMPLEMENTED(), but just a warning. Returns undef.
$self->WARN_NOT_IMPLEMENTED;
Class Hopping
claim
Assumes a hash-based object. Creates a copy (with only one level of dereference) and blesses it into Package.
$object = Package->claim($object);
Download (2.8MB)
Added: 2007-03-16 License: GPL (GNU General Public License) Price:
952 downloads
Class::HPLOO 0.23
Class::HPLOO is an easier way to declare classes on Perl, based in the popular class {...} style and ePod. more>>
Class::HPLOO is an easier way to declare classes on Perl, based in the popular class {...} style and ePod.
USAGE
use Class::HPLOO ;
class Foo extends Bar , Baz {
use LWP::Simple qw(get) ; ## import the method get() to this package.
attr ( array foo_list , int age , string name , foo ) ## define attributes.
vars ($GLOBAL_VAR) ; ## same as: use vars qw($GLOBAL_VAR);
my ($local_var) ;
## constructor/initializer:
sub Foo {
$this->{attr} = $_[0] ;
}
## methods with input variables declared:
sub get_pages ($base , @pages , %options) {
my @htmls ;
if ( $options{proxy} ) { ... }
foreach my $pages_i ( @pages ) {
my $url = "$base/$pages_i" ;
my $html = get($url) ;
push(@htmls , $html) ;
$this->cache($url , $html) ;
}
return @htmls ;
}
## methos like a normal Perl sub:
sub cache {
my ( $url , $html ) = @_ ;
$this->{CACHE}{$url} = $html ;
}
sub attributes_example {
$this->set_foo_list(qw(a b c d e f)) ;
my @l = $this->get_foo_list ;
$this->set_age(30) ;
$this->set_name("Joe") ;
$this->set_foo( time() ) ;
print "NAME: ". $this->get_name ."n" ;
print "AGE: ". $this->get_age ."n" ;
print "FOO: ". $this->get_foo ."n" ;
}
}
## Example of use of the class:
package main ;
my $foo = new Foo(123) ;
$foo->get_pages(http://www.perlmonks.com/, [/index.pl,/foo] , {proxy => localhost:8080}) ;
<<lessUSAGE
use Class::HPLOO ;
class Foo extends Bar , Baz {
use LWP::Simple qw(get) ; ## import the method get() to this package.
attr ( array foo_list , int age , string name , foo ) ## define attributes.
vars ($GLOBAL_VAR) ; ## same as: use vars qw($GLOBAL_VAR);
my ($local_var) ;
## constructor/initializer:
sub Foo {
$this->{attr} = $_[0] ;
}
## methods with input variables declared:
sub get_pages ($base , @pages , %options) {
my @htmls ;
if ( $options{proxy} ) { ... }
foreach my $pages_i ( @pages ) {
my $url = "$base/$pages_i" ;
my $html = get($url) ;
push(@htmls , $html) ;
$this->cache($url , $html) ;
}
return @htmls ;
}
## methos like a normal Perl sub:
sub cache {
my ( $url , $html ) = @_ ;
$this->{CACHE}{$url} = $html ;
}
sub attributes_example {
$this->set_foo_list(qw(a b c d e f)) ;
my @l = $this->get_foo_list ;
$this->set_age(30) ;
$this->set_name("Joe") ;
$this->set_foo( time() ) ;
print "NAME: ". $this->get_name ."n" ;
print "AGE: ". $this->get_age ."n" ;
print "FOO: ". $this->get_foo ."n" ;
}
}
## Example of use of the class:
package main ;
my $foo = new Foo(123) ;
$foo->get_pages(http://www.perlmonks.com/, [/index.pl,/foo] , {proxy => localhost:8080}) ;
Download (0.027MB)
Added: 2007-06-09 License: Perl Artistic License Price:
867 downloads
KinoSearch::Util::Class 0.13
KinoSearch::Util::Class is a Perl class building utility. more>>
KinoSearch::Util::Class is a Perl class building utility.
PRIVATE CLASS
This is a private class and the interface may change radically and without warning. Do not use it on its own.
SYNOPSIS
package KinoSearch::SomePackage::SomeClass;
use base qw( KinoSearch::Util::Class );
BEGIN {
__PACKAGE__->init_instance_vars(
# constructor params / members
foo => undef,
bar => {},
# members
baz => {},
);
}
KinoSearch::Util::Class is a class-building utility a la Class::Accessor, Class::Meta, etc. It provides four main services:
- A mechanism for inheriting instance variable declarations.
- A constructor with basic argument checking.
- Manufacturing of get_xxxx and set_xxxx methods.
- Convenience methods which help in defining abstract classes.
<<lessPRIVATE CLASS
This is a private class and the interface may change radically and without warning. Do not use it on its own.
SYNOPSIS
package KinoSearch::SomePackage::SomeClass;
use base qw( KinoSearch::Util::Class );
BEGIN {
__PACKAGE__->init_instance_vars(
# constructor params / members
foo => undef,
bar => {},
# members
baz => {},
);
}
KinoSearch::Util::Class is a class-building utility a la Class::Accessor, Class::Meta, etc. It provides four main services:
- A mechanism for inheriting instance variable declarations.
- A constructor with basic argument checking.
- Manufacturing of get_xxxx and set_xxxx methods.
- Convenience methods which help in defining abstract classes.
Download (0.21MB)
Added: 2006-09-02 License: Perl Artistic License Price:
1147 downloads
Class::Simple 0.07
Class::Simple is a simple Object-Oriented Base Class. more>>
Class::Simple is a simple Object-Oriented Base Class.
SYNOPSIS
package Foo:
use base qw(Class::Simple);
BEGIN
{
Foo->privatize(qw(attrib1 attrib2)); # ...or not.
}
my $obj = Foo->new();
$obj->attrib(1); # The same as...
$obj->set_attrib(1); # ...this.
my $var = $obj->get_attrib(); # The same as...
$var = $obj->attrib; # ...this.
$obj->raise_attrib(); # The same as...
$obj->set_attrib(1); # ...this.
$obj->clear_attrib(); # The same as...
$obj->set_attrib(undef); # ...this
$obj->attrib(undef); # ...and this.
$obj->readonly_attrib(4);
sub foo
{
my $self = shift;
my $value = shift;
$self->_foo($value);
do_other_things(@_);
...
}
my $str = $obj->DUMP;
my $new_obj = Foo->new();
$new_obj->SLURP($str);
sub BUILD
{
my $self = shift;
# Various initializations
}
There are plenty of others that are much more thorough and whatnot but sometimes I want something simple so I can get just going (no doubt because I am a simple guy) so I use this.
What do I mean by simple? First off, I dont want to have to list out all my methods beforehand. I just want to use them (Yeah, yeah, it doesnt catch typos--thats what testing and Class::Std are for :-). Next, I want to be able to call my methods by $obj->foo(1) or $obj->set_foo(1), by $obj->foo() or $obj->get_foo(). Dont tell ME I have to use get_ and set_ (I would just override that restriction in Class::Std anyway). Simple!
I did want some neat features, though, so these are inside-out objects (meaning the object isnt simply a hash so you cant just go in and muck with attributes outside of methods), privatization of methods is supported, as is serialization out and back in again.
<<lessSYNOPSIS
package Foo:
use base qw(Class::Simple);
BEGIN
{
Foo->privatize(qw(attrib1 attrib2)); # ...or not.
}
my $obj = Foo->new();
$obj->attrib(1); # The same as...
$obj->set_attrib(1); # ...this.
my $var = $obj->get_attrib(); # The same as...
$var = $obj->attrib; # ...this.
$obj->raise_attrib(); # The same as...
$obj->set_attrib(1); # ...this.
$obj->clear_attrib(); # The same as...
$obj->set_attrib(undef); # ...this
$obj->attrib(undef); # ...and this.
$obj->readonly_attrib(4);
sub foo
{
my $self = shift;
my $value = shift;
$self->_foo($value);
do_other_things(@_);
...
}
my $str = $obj->DUMP;
my $new_obj = Foo->new();
$new_obj->SLURP($str);
sub BUILD
{
my $self = shift;
# Various initializations
}
There are plenty of others that are much more thorough and whatnot but sometimes I want something simple so I can get just going (no doubt because I am a simple guy) so I use this.
What do I mean by simple? First off, I dont want to have to list out all my methods beforehand. I just want to use them (Yeah, yeah, it doesnt catch typos--thats what testing and Class::Std are for :-). Next, I want to be able to call my methods by $obj->foo(1) or $obj->set_foo(1), by $obj->foo() or $obj->get_foo(). Dont tell ME I have to use get_ and set_ (I would just override that restriction in Class::Std anyway). Simple!
I did want some neat features, though, so these are inside-out objects (meaning the object isnt simply a hash so you cant just go in and muck with attributes outside of methods), privatization of methods is supported, as is serialization out and back in again.
Download (0.009MB)
Added: 2007-07-31 License: Perl Artistic License Price:
815 downloads
Class::Spiffy 0.15
Class::Spiffy is a Spiffy Framework with No Source Filtering. more>>
Class::Spiffy is a Spiffy Framework with No Source Filtering.
SYNOPSIS
package Keen;
use strict;
use warnings;
use Class::Spiffy -base;
field mirth;
const mood => :-);
sub happy {
my $self = shift;
if ($self->mood eq :-() {
$self->mirth(-1);
print "Cheer up!";
}
super;
}
1;
"Class::Spiffy" is a framework and methodology for doing object oriented (OO) programming in Perl. Class::Spiffy combines the best parts of Exporter.pm, base.pm, mixin.pm and SUPER.pm into one magic foundation class. It attempts to fix all the nits and warts of traditional Perl OO, in a clean, straightforward and (perhaps someday) standard way.
Class::Spiffy borrows ideas from other OO languages like Python, Ruby, Java and Perl 6. It also adds a few tricks of its own.
If you take a look on CPAN, there are a ton of OO related modules. When starting a new project, you need to pick the set of modules that makes most sense, and then you need to use those modules in each of your classes. Class::Spiffy, on the other hand, has everything youll probably need in one module, and you only need to use it once in one of your classes. If you make Class::Spiffy the base class of the basest class in your project, Class::Spiffy will automatically pass all of its magic to all of your subclasses. You may eventually forget that youre even using it!
The most striking difference between Class::Spiffy and other Perl object oriented base classes, is that it has the ability to export things. If you create a subclass of Class::Spiffy, all the things that Class::Spiffy exports will automatically be exported by your subclass, in addition to any more things that you want to export. And if someone creates a subclass of your subclass, all of those things will be exported automatically, and so on. Think of it as "Inherited Exportation", and it uses the familiar Exporter.pm specification syntax.
To use Class::Spiffy or any subclass of Class::Spiffy as a base class of your class, you specify the -base argument to the use command.
use MySpiffyBaseModule -base;
You can also use the traditional use base MySpiffyBaseModule; syntax and everything will work exactly the same. The only caveat is that Class::Spiffy must already be loaded. Thats because Class::Spiffy rewires base.pm on the fly to do all the Spiffy magics.
Class::Spiffy has support for Ruby-like mixins with Perl6-like roles. Just like base you can use either of the following invocations:
use mixin MySpiffyBaseModule;
use MySpiffyBaseModule -mixin;
The second version will only work if the class being mixed in is a subclass of Class::Spiffy. The first version will work in all cases, as long as Class::Spiffy has already been loaded.
To limit the methods that get mixed in, use roles. (Hint: they work just like an Exporter list):
use MySpiffyBaseModule -mixin => qw(:basics x y !foo);
A useful feature of Class::Spiffy is that it exports two functions: field and const that can be used to declare the attributes of your class, and automatically generate accessor methods for them. The only difference between the two functions is that const attributes can not be modified; thus the accessor is much faster.
One interesting aspect of OO programming is when a method calls the same method from a parent class. This is generally known as calling a super method. Perls facility for doing this is butt ugly:
sub cleanup {
my $self = shift;
$self->scrub;
$self->SUPER::cleanup(@_);
}
Class::Spiffy makes it, er, super easy to call super methods. You just use the super function. You dont need to pass it any arguments because it automatically passes them on for you. Heres the same function with Class::Spiffy:
sub cleanup {
my $self = shift;
$self->scrub;
super;
}
Class::Spiffy has a special method for parsing arguments called parse_arguments, that it also uses for parsing its own arguments. You declare which arguments are boolean (singletons) and which ones are paired, with two special methods called boolean_arguments and paired_arguments. Parse arguments pulls out the booleans and pairs and returns them in an anonymous hash, followed by a list of the unmatched arguments.
Finally, Class::Spiffy can export a few debugging functions WWW, XXX, YYY and ZZZ. Each of them produces a YAML dump of its arguments. WWW warns the output, XXX dies with the output, YYY prints the output, and ZZZ confesses the output. If YAML doesnt suit your needs, you can switch all the dumps to Data::Dumper format with the - dumper option.
<<lessSYNOPSIS
package Keen;
use strict;
use warnings;
use Class::Spiffy -base;
field mirth;
const mood => :-);
sub happy {
my $self = shift;
if ($self->mood eq :-() {
$self->mirth(-1);
print "Cheer up!";
}
super;
}
1;
"Class::Spiffy" is a framework and methodology for doing object oriented (OO) programming in Perl. Class::Spiffy combines the best parts of Exporter.pm, base.pm, mixin.pm and SUPER.pm into one magic foundation class. It attempts to fix all the nits and warts of traditional Perl OO, in a clean, straightforward and (perhaps someday) standard way.
Class::Spiffy borrows ideas from other OO languages like Python, Ruby, Java and Perl 6. It also adds a few tricks of its own.
If you take a look on CPAN, there are a ton of OO related modules. When starting a new project, you need to pick the set of modules that makes most sense, and then you need to use those modules in each of your classes. Class::Spiffy, on the other hand, has everything youll probably need in one module, and you only need to use it once in one of your classes. If you make Class::Spiffy the base class of the basest class in your project, Class::Spiffy will automatically pass all of its magic to all of your subclasses. You may eventually forget that youre even using it!
The most striking difference between Class::Spiffy and other Perl object oriented base classes, is that it has the ability to export things. If you create a subclass of Class::Spiffy, all the things that Class::Spiffy exports will automatically be exported by your subclass, in addition to any more things that you want to export. And if someone creates a subclass of your subclass, all of those things will be exported automatically, and so on. Think of it as "Inherited Exportation", and it uses the familiar Exporter.pm specification syntax.
To use Class::Spiffy or any subclass of Class::Spiffy as a base class of your class, you specify the -base argument to the use command.
use MySpiffyBaseModule -base;
You can also use the traditional use base MySpiffyBaseModule; syntax and everything will work exactly the same. The only caveat is that Class::Spiffy must already be loaded. Thats because Class::Spiffy rewires base.pm on the fly to do all the Spiffy magics.
Class::Spiffy has support for Ruby-like mixins with Perl6-like roles. Just like base you can use either of the following invocations:
use mixin MySpiffyBaseModule;
use MySpiffyBaseModule -mixin;
The second version will only work if the class being mixed in is a subclass of Class::Spiffy. The first version will work in all cases, as long as Class::Spiffy has already been loaded.
To limit the methods that get mixed in, use roles. (Hint: they work just like an Exporter list):
use MySpiffyBaseModule -mixin => qw(:basics x y !foo);
A useful feature of Class::Spiffy is that it exports two functions: field and const that can be used to declare the attributes of your class, and automatically generate accessor methods for them. The only difference between the two functions is that const attributes can not be modified; thus the accessor is much faster.
One interesting aspect of OO programming is when a method calls the same method from a parent class. This is generally known as calling a super method. Perls facility for doing this is butt ugly:
sub cleanup {
my $self = shift;
$self->scrub;
$self->SUPER::cleanup(@_);
}
Class::Spiffy makes it, er, super easy to call super methods. You just use the super function. You dont need to pass it any arguments because it automatically passes them on for you. Heres the same function with Class::Spiffy:
sub cleanup {
my $self = shift;
$self->scrub;
super;
}
Class::Spiffy has a special method for parsing arguments called parse_arguments, that it also uses for parsing its own arguments. You declare which arguments are boolean (singletons) and which ones are paired, with two special methods called boolean_arguments and paired_arguments. Parse arguments pulls out the booleans and pairs and returns them in an anonymous hash, followed by a list of the unmatched arguments.
Finally, Class::Spiffy can export a few debugging functions WWW, XXX, YYY and ZZZ. Each of them produces a YAML dump of its arguments. WWW warns the output, XXX dies with the output, YYY prints the output, and ZZZ confesses the output. If YAML doesnt suit your needs, you can switch all the dumps to Data::Dumper format with the - dumper option.
Download (0.024MB)
Added: 2007-06-19 License: Perl Artistic License Price:
857 downloads
MP3::Find::Base 0.06
MP3::Find::Base is a base class for MP3::Find backends. more>>
MP3::Find::Base is a base class for MP3::Find backends.
SYNOPSIS
package MyFinder;
use base MP3::Find::Base;
sub search {
my $self = shift;
my ($query, $dirs, $sort, $options) = @_;
# do something to find and sort the mp3s...
my @results = do_something(...);
return @results;
}
package main;
my $finder = MyFinder->new;
# see MP3::Find for details about %options
print "$_n" foreach $finder->find_mp3s(%options);
This is the base class for the classes that actually do the searching and sorting for MP3::Find.
<<lessSYNOPSIS
package MyFinder;
use base MP3::Find::Base;
sub search {
my $self = shift;
my ($query, $dirs, $sort, $options) = @_;
# do something to find and sort the mp3s...
my @results = do_something(...);
return @results;
}
package main;
my $finder = MyFinder->new;
# see MP3::Find for details about %options
print "$_n" foreach $finder->find_mp3s(%options);
This is the base class for the classes that actually do the searching and sorting for MP3::Find.
Download (0.029MB)
Added: 2006-11-08 License: Perl Artistic License Price:
1080 downloads
XML::SAX::Base 1.02
XML::SAX::Base is a base class SAX Drivers and Filters. more>>
XML::SAX::Base is a base Perl class with SAX Drivers and Filters.
SYNOPSIS
package MyFilter;
use XML::SAX::Base;
@ISA = (XML::SAX::Base);
This module has a very simple task - to be a base class for PerlSAX drivers and filters. Its default behaviour is to pass the input directly to the output unchanged. It can be useful to use this module as a base class so you dont have to, for example, implement the characters() callback.
The main advantages that it provides are easy dispatching of events the right way (ie it takes care for you of checking that the handler has implemented that method, or has defined an AUTOLOAD), and the guarantee that filters will pass along events that they arent implementing to handlers downstream that might nevertheless be interested in them.
WRITING SAX DRIVERS AND FILTERS
Writing SAX Filters is tremendously easy: all you need to do is inherit from this module, and define the events you want to handle. A more detailed explanation can be found at http://www.xml.com/pub/a/2001/10/10/sax-filters.html.
Writing Drivers is equally simple. The one thing you need to pay attention to is NOT to call events yourself (this applies to Filters as well). For instance:
package MyFilter;
use base qw(XML::SAX::Base);
sub start_element {
my $self = shift;
my $data = shift;
# do something
$self->{Handler}->start_element($data); # BAD
}
The above example works well as precisely that: an example. But it has several faults: 1) it doesnt test to see whether the handler defines start_element. Perhaps it doesnt want to see that event, in which case you shouldnt throw it (otherwise itll die). 2) it doesnt check ContentHandler and then Handler (ie it doesnt look to see that the user hasnt requested events on a specific handler, and if not on the default one), 3) if it did check all that, not only would the code be cumbersome (see this modules source to get an idea) but it would also probably have to check for a DocumentHandler (in case this were SAX1) and for AUTOLOADs potentially defined in all these packages. As you can tell, that would be fairly painful. Instead of going through that, simply remember to use code similar to the following instead:
package MyFilter;
use base qw(XML::SAX::Base);
sub start_element {
my $self = shift;
my $data = shift;
# do something to filter
$self->SUPER::start_element($data); # GOOD (and easy) !
}
This way, once youve done your job you hand the ball back to XML::SAX::Base and it takes care of all those problems for you!
Note that the above example doesnt apply to filters only, drivers will benefit from the exact same feature.
<<lessSYNOPSIS
package MyFilter;
use XML::SAX::Base;
@ISA = (XML::SAX::Base);
This module has a very simple task - to be a base class for PerlSAX drivers and filters. Its default behaviour is to pass the input directly to the output unchanged. It can be useful to use this module as a base class so you dont have to, for example, implement the characters() callback.
The main advantages that it provides are easy dispatching of events the right way (ie it takes care for you of checking that the handler has implemented that method, or has defined an AUTOLOAD), and the guarantee that filters will pass along events that they arent implementing to handlers downstream that might nevertheless be interested in them.
WRITING SAX DRIVERS AND FILTERS
Writing SAX Filters is tremendously easy: all you need to do is inherit from this module, and define the events you want to handle. A more detailed explanation can be found at http://www.xml.com/pub/a/2001/10/10/sax-filters.html.
Writing Drivers is equally simple. The one thing you need to pay attention to is NOT to call events yourself (this applies to Filters as well). For instance:
package MyFilter;
use base qw(XML::SAX::Base);
sub start_element {
my $self = shift;
my $data = shift;
# do something
$self->{Handler}->start_element($data); # BAD
}
The above example works well as precisely that: an example. But it has several faults: 1) it doesnt test to see whether the handler defines start_element. Perhaps it doesnt want to see that event, in which case you shouldnt throw it (otherwise itll die). 2) it doesnt check ContentHandler and then Handler (ie it doesnt look to see that the user hasnt requested events on a specific handler, and if not on the default one), 3) if it did check all that, not only would the code be cumbersome (see this modules source to get an idea) but it would also probably have to check for a DocumentHandler (in case this were SAX1) and for AUTOLOADs potentially defined in all these packages. As you can tell, that would be fairly painful. Instead of going through that, simply remember to use code similar to the following instead:
package MyFilter;
use base qw(XML::SAX::Base);
sub start_element {
my $self = shift;
my $data = shift;
# do something to filter
$self->SUPER::start_element($data); # GOOD (and easy) !
}
This way, once youve done your job you hand the ball back to XML::SAX::Base and it takes care of all those problems for you!
Note that the above example doesnt apply to filters only, drivers will benefit from the exact same feature.
Download (0.020MB)
Added: 2007-06-21 License: Perl Artistic License Price:
855 downloads
Translate 0.9
Translate are tools for Mozilla, OpenOffice, and Gettext PO translation. more>>
Translate is a toolkit to convert between various different translation formats (such as gettext-based .po formats, OpenOffice.org formats, and Mozilla formats).
This makes it possible to stay in one format across all your localisation. Tools to help process and validate localizations, etc.
Main features:
- conversion between gettext po format and mozilla, openoffice, csv formats
- lots of others that I havent had time to describe yet...
Enhancements:
- Almost all storage classes have been migrated to the projects base class.
- The base class should make it easier to add new formats in the future.
- Major work was done to move escaping into the storage classes and to roundtrip escaping.
- Many many unit tests were added to check compliance.
- Many bugs were fixed.
- The DTD format is no longer escaped, and it follows the DTD spec correctly.
- .properties files are no longer used escaped Unicode, following the Mozilla convention.
- Duplicates are merged by default using the PO method of merging locations.
<<lessThis makes it possible to stay in one format across all your localisation. Tools to help process and validate localizations, etc.
Main features:
- conversion between gettext po format and mozilla, openoffice, csv formats
- lots of others that I havent had time to describe yet...
Enhancements:
- Almost all storage classes have been migrated to the projects base class.
- The base class should make it easier to add new formats in the future.
- Major work was done to move escaping into the storage classes and to roundtrip escaping.
- Many many unit tests were added to check compliance.
- Many bugs were fixed.
- The DTD format is no longer escaped, and it follows the DTD spec correctly.
- .properties files are no longer used escaped Unicode, following the Mozilla convention.
- Duplicates are merged by default using the PO method of merging locations.
Download (0.50MB)
Added: 2006-06-19 License: GPL (GNU General Public License) Price:
1227 downloads
Class::Adapter 1.02
Class::Adapter is a Perl implementation of the Adapter Design Pattern. more>>
Class::Adapter is a Perl implementation of the "Adapter" Design Pattern.
The Class::Adapter class is intended as an abstract base class for creating any sort of class or object that follows the Adapter pattern.
What is an Adapter?
The term Adapter refers to a "Design Pattern" of the same name, from the famous "Gang of Four" book "Design Patterns". Although their original implementation was designed for Java and similar single-inheritance strictly-typed langauge, the situation for which it applies is still valid.
An Adapter in this Perl sense of the term is when a class is created to achieve by composition (objects containing other object) something that cant be achieved by inheritance (sub-classing).
This is similar to the Decorator pattern, but is intended to be applied on a class-by-class basis, as opposed to being able to be applied one object at a time, as is the case with the Decorator pattern.
The Class::Adapter object holds a parent object that it "wraps", and when a method is called on the Class::Adapter, it manually calls the same (or different) method with the same (or different) parameters on the parent object contained within it.
Instead of these custom methods being hooked in on an object-by-object basis, they are defined at the class level.
Basically, a Class::Adapter is one of your fall-back positions when Perls inheritance model fails you, or is no longer good enough, and you need to do something twisty in order to make several APIs play nicely with each other.
What can I do with the actual Class::Adapter class
Well... nothing really. It exist to provide some extremely low level fundamental methods, and to provide a common base for inheritance of Adapter classes.
The base Class::Adapter class doesnt even implement a way to push method calls through to the underlying object, since the way in which that happens is the bit that changes from case to case.
To actually DO something, you probably want to go take a look at Class::Adapter::Builder, which makes the creation of Adapter classes relatively quick and easy.
<<lessThe Class::Adapter class is intended as an abstract base class for creating any sort of class or object that follows the Adapter pattern.
What is an Adapter?
The term Adapter refers to a "Design Pattern" of the same name, from the famous "Gang of Four" book "Design Patterns". Although their original implementation was designed for Java and similar single-inheritance strictly-typed langauge, the situation for which it applies is still valid.
An Adapter in this Perl sense of the term is when a class is created to achieve by composition (objects containing other object) something that cant be achieved by inheritance (sub-classing).
This is similar to the Decorator pattern, but is intended to be applied on a class-by-class basis, as opposed to being able to be applied one object at a time, as is the case with the Decorator pattern.
The Class::Adapter object holds a parent object that it "wraps", and when a method is called on the Class::Adapter, it manually calls the same (or different) method with the same (or different) parameters on the parent object contained within it.
Instead of these custom methods being hooked in on an object-by-object basis, they are defined at the class level.
Basically, a Class::Adapter is one of your fall-back positions when Perls inheritance model fails you, or is no longer good enough, and you need to do something twisty in order to make several APIs play nicely with each other.
What can I do with the actual Class::Adapter class
Well... nothing really. It exist to provide some extremely low level fundamental methods, and to provide a common base for inheritance of Adapter classes.
The base Class::Adapter class doesnt even implement a way to push method calls through to the underlying object, since the way in which that happens is the bit that changes from case to case.
To actually DO something, you probably want to go take a look at Class::Adapter::Builder, which makes the creation of Adapter classes relatively quick and easy.
Download (0.024MB)
Added: 2007-06-20 License: Perl Artistic License Price:
856 downloads
GStreamer Base Plug-ins 0.10.13
GStreamer Base Plug-ins is a well-groomed and well-maintained collection of GStreamer plug-ins and elements. more>>
GStreamer Base Plug-ins is a well-groomed and well-maintained collection of GStreamer plug-ins and elements, spanning the range of possible types of elements one would want to write for GStreamer.
GStreamer Base Plug-ins also contains helper libraries and base classes useful for writing elements. A wide range of video and audio decoders, encoders, and filters are included.
<<lessGStreamer Base Plug-ins also contains helper libraries and base classes useful for writing elements. A wide range of video and audio decoders, encoders, and filters are included.
Download (1.9MB)
Added: 2007-06-05 License: GPL (GNU General Public License) Price:
878 downloads
Class::Cloneable 0.03
Class::Cloneable is a base class for Cloneable objects. more>>
Class::Cloneable is a base class for Cloneable objects.
SYNOPSIS
package MyObject;
our @ISA = (Class::Cloneable);
# calling clone on an instance of MyObject
# will give you full deep-cloning functionality
This module provides a flexible base class for building objects with cloning capabilities. This module does its best to respect the encapsulation of all other objects, including subclasses of itself. This is intended to be a stricter and more OO-ish option than the more general purpose Clone and Clone::PP modules.
<<lessSYNOPSIS
package MyObject;
our @ISA = (Class::Cloneable);
# calling clone on an instance of MyObject
# will give you full deep-cloning functionality
This module provides a flexible base class for building objects with cloning capabilities. This module does its best to respect the encapsulation of all other objects, including subclasses of itself. This is intended to be a stricter and more OO-ish option than the more general purpose Clone and Clone::PP modules.
Download (0.008MB)
Added: 2006-10-06 License: Perl Artistic License Price:
1114 downloads
Persistent::Base 0.52
Persistent::Base is an Abstract Persistent Base Class. more>>
Persistent::Base is an Abstract Persistent Base Class.
SYNOPSIS
### we are a subclass of ... ###
use Persistent::Base;
@ISA = qw(Persistent::Base);
ABSTRACT
This is an abstract class used by the Persistent framework of classes to implement persistence with various types of data stores. This class provides the methods and interface for implementing Persistent classes. Refer to the Persistent documentation for a very thorough introduction to using the Persistent framework of classes.
This class is part of the Persistent base package which is available from:
http://www.bigsnow.org/persistent
ftp://ftp.bigsnow.org/pub/persistent
Before we get started describing the methods in detail, it should be noted that all error handling in this class is done with exceptions. So you should wrap an eval block around all of your code. Please see the Persistent documentation for more information on exception handling in Perl.
ABSTRACT METHODS THAT NEED TO BE OVERRIDDEN IN THE SUBCLASS
datastore -- Sets/Returns the Data Store Parameters
eval {
### set the data store ###
$person->datastore(@args);
### get the data store ###
$href = $person->datastore();
};
croak "Exception caught: $@" if $@;
Returns (and optionally sets) the data store of the object. This method throws Perl execeptions so use it with an eval block.
Setting the data store can involve anything from initializing a connection to opening a file. Getting a data store usually means returning information pertaining to the data store in a useful form, such as a connection to a database or a location of a file.
<<lessSYNOPSIS
### we are a subclass of ... ###
use Persistent::Base;
@ISA = qw(Persistent::Base);
ABSTRACT
This is an abstract class used by the Persistent framework of classes to implement persistence with various types of data stores. This class provides the methods and interface for implementing Persistent classes. Refer to the Persistent documentation for a very thorough introduction to using the Persistent framework of classes.
This class is part of the Persistent base package which is available from:
http://www.bigsnow.org/persistent
ftp://ftp.bigsnow.org/pub/persistent
Before we get started describing the methods in detail, it should be noted that all error handling in this class is done with exceptions. So you should wrap an eval block around all of your code. Please see the Persistent documentation for more information on exception handling in Perl.
ABSTRACT METHODS THAT NEED TO BE OVERRIDDEN IN THE SUBCLASS
datastore -- Sets/Returns the Data Store Parameters
eval {
### set the data store ###
$person->datastore(@args);
### get the data store ###
$href = $person->datastore();
};
croak "Exception caught: $@" if $@;
Returns (and optionally sets) the data store of the object. This method throws Perl execeptions so use it with an eval block.
Setting the data store can involve anything from initializing a connection to opening a file. Getting a data store usually means returning information pertaining to the data store in a useful form, such as a connection to a database or a location of a file.
Download (0.038MB)
Added: 2007-05-18 License: Perl Artistic License Price:
889 downloads
Secleted [ 0 ] software to compare
Copyright Notice:
Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future software development. The above base class search only lists software in full, demo and trial versions for free download. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed