Data::Freezer - A namespace aware object freezer based on Pixie.
use Pixie ; use Data::Freezer ; my $pixie = ... ; # Make a Pixie storage engine (See Pixie ). # EXAMPLE: use Pixie with memory storage # my $pixie = Pixie->connect('memory'); # use Data::Freezer { debug => [0|1] }; my $freezer = Data::Freezer->new($pixie); # OR DO ONCE AT THE BEGINING OF APP: Data::Freezer->instance()->pixie($pixie); # AND THEN $freezer = Data::Freezer->instance(); $freezer->insert( new Carot(...) , 'vegies'); $freezer->insert( new Rabbit(...) , 'meat' ); $freezer->insert( new Tomato(...) , 'vegies'); $freezer->insert( new RumSteak(..) , 'meat' );
Pixie release version 2.06 Class::AutoAccess 0.02
Class method. Returns a global unique instance of a freezer.
Returns a newly created freezer. You can give a pixie storage engine here.
Usage: my $f = Data::Freezer->new(); or my $f = Data::Freezer->new($pixie);
Gets/Sets the Pixie storage engine
Returns a reference on a list of all namespaces available in this storage
usage:
my $nameSpaces = $store->getNameSpaces();
Inserts an object into given name space storage.
Object must be Pixie friendly. ( See Pixie::Complicity in CPAN ). Usage:
my $o = ... ; my $nameSpace = ... ; my $cookie = $this->insert($o, $nameSpace);
Assumes that given namespace exists. INTERNAL USAGE
Usage:
$self->_assumeNameSpace($nameSpace);
Adds given cookie to given namespace. INTERNAL USAGE
Usage: $self->_addToNameSpace($nameSpace, $cookie);
Removes given cookie from namespace. Dies if this cookie does not belongs to this namespace
Usage: $self->_removeFromNameSpace($nameSpace, $cookie);
Gets the cookies associated with the given nameSpace. return undef if nameSpace does not exist.
my $cookies = $this->getCookies($nameSpace);
Removes given cookie from given namespace. USER FUNCTION. Dies if cookie does not exist in given namespace
Usage: $this->delete($cookie, $namespace);
Gets the object associated with the given cookie. Undef is object not here.
my $o = $this->get($cookie);
Gets all objects associated to the given namespace. Undef if namespace does not exists.
Usage : my $objects = $this->getObjects($nameSpace);
Jerome Eteve, <jerome@eteve.net>
<jerome@eteve.net>
Please report any bugs or feature requests to bug-data-freezer@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Data-Freezer. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-data-freezer@rt.cpan.org
Copyright 2005 Jerome Eteve, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Data::Freezer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Freezer
CPAN shell
perl -MCPAN -e shell install Data::Freezer
For more information on module installation, please visit the detailed CPAN module installation guide.