SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG
DONATE


YUM REPOSITORY

 
 

MAN page from OpenSuSE perl-Cache-Cache-1.08-lp151.2.2.noarch.rpm

Cache::BaseCache

Section: User Contributed Perl Documentation (3)
Updated: 2015-04-17
Index 

NAME

Cache::BaseCache -- abstract cache base class 

DESCRIPTION

BaseCache provides functionality common to all instances of a cache.It differs from the CacheUtils package insofar as it is designed tobe used as superclass for cache implementations. 

SYNOPSIS

Cache::BaseCache is to be used as a superclass for cacheimplementations. The most effective way to use BaseCache is to usethe protected _set_backend method, which will be used to retrieve thepersistence mechanism. The subclass can then inherit the BaseCache'simplementation of get, set, etc. However, due to the difficultyinheriting static methods in Perl, the subclass will likely need toexplicitly implement Clear, Purge, and Size. Also, a factory patternshould be used to invoke the _complete_initialization routine afterthe object is constructed.

  package Cache::MyCache;  use vars qw( @ISA );  use Cache::BaseCache;  use Cache::MyBackend;  @ISA = qw( Cache::BaseCache );  sub new  {    my ( $self ) = _new( @_ );    $self->_complete_initialization( );    return $self;  }  sub _new  {    my ( $proto, $p_options_hash_ref ) = @_;    my $class = ref( $proto ) || $proto;    my $self = $class->SUPER::_new( $p_options_hash_ref );    $self->_set_backend( new Cache::MyBackend( ) );    return $self;  }  sub Clear  {    foreach my $namespace ( _Namespaces( ) )    {      _Get_Backend( )->delete_namespace( $namespace );    }  }  sub Purge  {    foreach my $namespace ( _Namespaces( ) )    {      _Get_Cache( $namespace )->purge( );    }  }  sub Size  {    my $size = 0;    foreach my $namespace ( _Namespaces( ) )    {      $size += _Get_Cache( $namespace )->size( );    }    return $size;  }
 

SEE ALSO

Cache::Cache, Cache::FileCache, Cache::MemoryCache 

AUTHOR

Original author: DeWitt Clinton <dewittAATTunto.net>

Last author: $Author: dclinton $

Copyright (C) 2001-2003 DeWitt Clinton


 

Index

NAME
DESCRIPTION
SYNOPSIS
SEE ALSO
AUTHOR

This document was created byman2html,using the manual pages.