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 
26 class UniCacheGen : public UniTempGen
27 {
28 protected:
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 
36 public:
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
UniCacheGen::set
virtual void set(const UniConfKey &key, WvStringParm value)
Stores a string value for a key into the registry.
Definition: unicachegen.cc:96
UniCacheGen::commit
virtual void commit()
Commits any changes.
Definition: unicachegen.cc:64
UniCacheGen::get
virtual WvString get(const UniConfKey &key)
Fetches a string value for a key from the registry.
Definition: unicachegen.cc:101
UniCacheGen
A UniConf generator that adds a cache layer on top of another generator.
Definition: unicachegen.h:26
UniCacheGen::refresh
virtual bool refresh()
Refreshes information about a key recursively.
Definition: unicachegen.cc:50
WvString
WvString is an implementation of a simple and efficient printable-string class.
Definition: wvstring.h:329
IUniConfGen
An abstract data container that backs a UniConf tree.
Definition: uniconfgen.h:39
WvLog
A WvLog stream accepts log messages from applications and forwards them to all registered WvLogRcv's.
Definition: wvlog.h:56
UniConfKey
Represents a UniConf key which is a path in a hierarchy structured much like the traditional Unix fil...
Definition: uniconfkey.h:38
UniCacheGen::isok
virtual bool isok()
Determines if the generator is usable and working properly.
Definition: unicachegen.cc:44
UniTempGen
A UniConf generator that stores keys in memory.
Definition: unitempgen.h:20