The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

XAO::DO::Cache::Memory - memory storage back-end for XAO::Cache

SYNOPSIS

You should not use this object directly, it is a back-end for XAO::Cache.

 if($backend->exists(\@c)) {
     return $backend->get(\@c);
 }

DESCRIPTION

Cache::Memory is the default implementation of XAO::Cache back-end. It stores data in memory.

METHODS

calculate_size ($)

Calculates size in bytes of the given reference.

drop (@)

Drops an element from the cache.

exists (@)

Checks if an element exists in the cache. Does not update its access time, but checks it. If the element should be expired it removes it from the cache and returns false.

get (\@)

Retrieves an element from the cache. Does not check if it is expired or not, that is done in exists() method, but update access time.

make_key (\@)

Makes a key from the given list of coordinates.

put (\@\$)

Add a new element to the cache; before adding it checks cache size and throws out elements to make space for the new element. Order of removal depends on when an element was accessed last.

setup (%)

Sets expiration time and maximum cache size.

PRIVATE METHODS

    ###############################################################################

    drop_oldest ($)

    Drops oldest element from the cache using supplied key and element.

    print_chain ()

    Prints cache as a chain from the most recent to the least recent. The order is most_recent->next->...->next->least_recent.

    touch ($)

    Private method that updates access time and moves an element to the most recent position.

AUTHORS

Copyright (c) 2002 XAO Inc.

Andrew Maltsev <am@xao.com>.

SEE ALSO

Have a look at: XAO::DO::Cache::Memory, XAO::Objects, XAO::Base, XAO::FS, XAO::Web.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 241:

You can't have =items (as at line 245) unless the first thing after the =over is an =item