Jerome Eteve > Data-Freezer-0.02 > Data::Freezer

Download:
Data-Freezer-0.02.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.02   Source  

NAME ^

Data::Freezer - A namespace aware object freezer based on Pixie.

SYNOPSIS ^

    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' );

REQUIREMENTS ^

Pixie release version 2.06 Class::AutoAccess 0.02

instance

Class method. Returns a global unique instance of a freezer.

new

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);

pixie

Gets/Sets the Pixie storage engine

getNameSpaces

Returns a reference on a list of all namespaces available in this storage

usage:

    my $nameSpaces = $store->getNameSpaces(); 

insert

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);

_assumeNameSpace

Assumes that given namespace exists. INTERNAL USAGE

Usage:

    $self->_assumeNameSpace($nameSpace);

_addToNameSpace

Adds given cookie to given namespace. INTERNAL USAGE

  Usage:
    $self->_addToNameSpace($nameSpace, $cookie);

_removeFromNameSpace

Removes given cookie from namespace. Dies if this cookie does not belongs to this namespace

Usage: $self->_removeFromNameSpace($nameSpace, $cookie);

getCookies

Gets the cookies associated with the given nameSpace. return undef if nameSpace does not exist.

Usage:

    my $cookies = $this->getCookies($nameSpace);

delete

Removes given cookie from given namespace. USER FUNCTION. Dies if cookie does not exist in given namespace

Usage: $this->delete($cookie, $namespace);

get

Gets the object associated with the given cookie. Undef is object not here.

Usage:

    my $o = $this->get($cookie);

getObjects

Gets all objects associated to the given namespace. Undef if namespace does not exists.

Usage : my $objects = $this->getObjects($nameSpace);

AUTHOR ^

Jerome Eteve, <jerome@eteve.net>

BUGS ^

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.

ACKNOWLEDGEMENTS ^

COPYRIGHT & LICENSE ^

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.

syntax highlighting: