Cache::BaseCache man page on OpenServer

Man page or keyword search:  
man Server   5388 pages
apropos Keyword Search (all sections)
Output format
OpenServer logo
[printable version]

Cache::BaseCache(3)   User Contributed Perl Documentation  Cache::BaseCache(3)

NAME
       Cache::BaseCache -- abstract cache base class

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

SYNOPSIS
       Cache::BaseCache is to be used as a superclass for cache implementa-
       tions.  The most effective way to use BaseCache is to use the protected
       _set_backend method, which will be used to retrieve the persistance
       mechanism.  The subclass can then inherit the BaseCache's implentation
       of get, set, etc.  However, due to the difficulty inheriting static
       methods in Perl, the subclass will likely need to explicitly implement
       Clear, Purge, and Size.	Also, a factory pattern should be used to
       invoke the _complete_initialization routine after the object is con-
       structed.

	 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 <dewitt@unto.net>

       Last author:	$Author: dclinton $

       Copyright (C) 2001-2003 DeWitt Clinton

perl v5.8.8			  2003-04-15		   Cache::BaseCache(3)
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server OpenServer

List of man pages available for OpenServer

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net