NAME

Data::TagDB::Cache - Work with Tag databases

VERSION

version v0.07

SYNOPSIS

use Data::TagDB;

my Data::TagDB::Cache $cache = $db->create_cache;

Generic cache for Data::TagDB::Tag objects. Objects hold in a cache are kept available in a faster manner via Data::TagDB's interface. Multiple cache objects can be created. A cached object is cleaned up once all references (direct or via any cache object) are gone.

METHODS

db

my Data::TagDB $db = $cache->db;

Returns the current Data::TagDB object.

add

$cache->add($tag0, $tag1, ...);

Adds any number of tags to the cache. If any passed tag is undef it is ignored. This allows to pass things like $link->context without a manual check for undef.

clear

$cache->clear;

Clears the cache without destroying it. This is useful to clear caches owned by other objects.

AUTHOR

Löwenfelsen UG (haftungsbeschränkt) <support@loewenfelsen.net>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2024 by Löwenfelsen UG (haftungsbeschränkt) <support@loewenfelsen.net>.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)