WvStreams
unicachegen.h
1/* -*- Mode: C++ -*-
2 * Worldvisions Weaver Software:
3 * Copyright (C) 2002 Net Integration Technologies, Inc.
4 *
5 * A UniConf generator that caches keys/values in memory.
6 */
7#ifndef __UNICACHEGEN_H
8#define __UNICACHEGEN_H
9
10#include "unitempgen.h"
11#include "uniconftree.h"
12#include "wvlog.h"
13
26class UniCacheGen : public UniTempGen
27{
28protected:
29 WvLog log;
30 IUniConfGen *inner;
31 bool refreshed_once; //< we cache forever, so no need to re-refresh()
32
33 void loadtree(const UniConfKey &key = "");
34 void deltacallback(const UniConfKey &key, WvStringParm value);
35
36public:
37 UniCacheGen(IUniConfGen *_inner);
38 virtual ~UniCacheGen();
39
40 /***** Overridden members *****/
41 virtual bool isok();
42 virtual bool refresh();
43 virtual void commit();
44 virtual void set(const UniConfKey &key, WvStringParm value);
45 virtual WvString get(const UniConfKey &key);
46};
47
48#endif // __UNICACHEGEN_H
An abstract data container that backs a UniConf tree.
Definition: uniconfgen.h:40
A UniConf generator that adds a cache layer on top of another generator.
Definition: unicachegen.h:27
virtual bool refresh()
Refreshes information about a key recursively.
Definition: unicachegen.cc:50
virtual void commit()
Commits any changes.
Definition: unicachegen.cc:64
virtual void set(const UniConfKey &key, WvStringParm value)
Stores a string value for a key into the registry.
Definition: unicachegen.cc:96
virtual bool isok()
Determines if the generator is usable and working properly.
Definition: unicachegen.cc:44
virtual WvString get(const UniConfKey &key)
Fetches a string value for a key from the registry.
Definition: unicachegen.cc:101
Represents a UniConf key which is a path in a hierarchy structured much like the traditional Unix fil...
Definition: uniconfkey.h:39
A UniConf generator that stores keys in memory.
Definition: unitempgen.h:21
A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
Definition: wvstring.h:94
A WvLog stream accepts log messages from applications and forwards them to all registered WvLogRcv's.
Definition: wvlog.h:57
WvString is an implementation of a simple and efficient printable-string class.
Definition: wvstring.h:330