1 #ifndef _VolatileCache_h_
2 #define _VolatileCache_h_
3 
4 //
5 // VolatileCache.h
6 //
7 // VolatileCache: the simplest non-persistent Query result cache.
8 //                This is default policy.
9 //
10 // Part of the ht://Dig package   <http://www.htdig.org/>
11 // Copyright (c) 1995-2004 The ht://Dig Group
12 // For copyright details, see the file COPYING in your distribution
13 // or the GNU Library General Public License (LGPL) version 2 or later
14 // <http://www.gnu.org/copyleft/lgpl.html>
15 //
16 // $Id: VolatileCache.h,v 1.4 2004/05/28 13:15:24 lha Exp $
17 //
18 
19 #ifdef HAVE_CONFIG_H
20 #include "htconfig.h"
21 #endif
22 
23 #include "QueryCache.h"
24 #include "Dictionary.h"
25 
26 class VolatileCache : public QueryCache
27 {
28 public:
29 	// cons & destr
VolatileCache()30 	VolatileCache() {}
31 	~VolatileCache();
32 
33 	// get cached result from in-memory cache
34 	ResultList *Lookup(const String &signature);
35 
36 	// add result to in-memory cache
37 	void Add(const String &signature, ResultList *entry);
38 
39 private:
40 	Dictionary cache;
41 	static ResultList * const empty;
42 };
43 
44 #endif
45