00001 /* -*- Mode: C++ -*- 00002 * Worldvisions Weaver Software: 00003 * Copyright (C) 2002 Net Integration Technologies, Inc. 00004 * 00005 * A UniConf generator that caches keys/values in memory. 00006 */ 00007 #ifndef __UNICACHEGEN_H 00008 #define __UNICACHEGEN_H 00009 00010 #include "unitempgen.h" 00011 #include "uniconftree.h" 00012 #include "wvlog.h" 00013 00026 class UniCacheGen : public UniTempGen 00027 { 00028 protected: 00029 WvLog log; 00030 IUniConfGen *inner; 00031 bool refreshed_once; //< we cache forever, so no need to re-refresh() 00032 00033 void loadtree(const UniConfKey &key = ""); 00034 void deltacallback(const UniConfKey &key, WvStringParm value, 00035 void *userdata); 00036 00037 public: 00038 UniCacheGen(IUniConfGen *_inner); 00039 virtual ~UniCacheGen(); 00040 00041 /***** Overridden members *****/ 00042 virtual bool isok(); 00043 virtual bool refresh(); 00044 virtual void commit(); 00045 virtual void set(const UniConfKey &key, WvStringParm value); 00046 virtual WvString get(const UniConfKey &key); 00047 }; 00048 00049 #endif // __UNICACHEGEN_H