File:  [parser3project] / parser3 / src / include / pa_cache_managers.h
Revision 1.9.2.5: download - view: text, annotated - select for diffs - revision graph
Fri Jan 31 12:34:29 2003 UTC (23 years, 5 months ago) by paf
Diff to: branchpoint 1.9: preferred, unified
grammar compiled

/** @file
	Parser: cache managers center decl.

	Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com)
	Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)

	$Date: 2003/01/31 12:34:29 $
*/

#ifndef PA_CACHE_MANAGERS_H
#define PA_CACHE_MANAGERS_H

static const char* IDENT_CACHE_MANAGERS_H="$Date: 2003/01/31 12:34:29 $";

#include "pa_hash.h"
#include "pa_value.h"

// defines

/// can return status and can expire it contents
class Cache_manager: public PA_Object {
public:
	/// if filter_server_id not null, returns status only Cachable -s with matching cacheable_item_server_id()
	virtual ValuePtr get_status(Pool& pool, StringPtr source) =0;
	virtual void maybe_expire_cache() {}
};

/// maintains name=>Cache_manager association, can expire its contents
class Cache_managers: public Hash<StringPtr, Cache_manager*> {
public:
	/// maybe-expires all caches it contains, each cache manager desides it itself
	void maybe_expire();

};

/// global
extern Cache_managers cache_managers;

#endif

E-mail: