00001 /* -*- Mode: C++ -*- 00002 * Worldvisions Weaver Software: 00003 * Copyright (C) 2004 Net Integration Technologies, Inc. 00004 * 00005 * A totally evil UniConfGen that "unwraps" a UniConf object by turning it 00006 * back into a UniConfGen. 00007 */ 00008 #ifndef __UNIUNWRAPGEN_H 00009 #define __UNIUNWRAPGEN_H 00010 00011 #include "uniconf.h" 00012 00033 class UniUnwrapGen : public UniConfGen 00034 { 00035 UniConf xinner; 00036 00037 public: 00038 UniUnwrapGen(const UniConf &inner); 00039 virtual ~UniUnwrapGen(); 00040 00041 void setinner(const UniConf &inner); 00042 00044 const UniConf &inner() const 00045 { return xinner; } 00046 00047 /***** Overridden methods *****/ 00048 virtual void commit(); 00049 virtual bool refresh(); 00050 virtual void flush_buffers() { } 00051 virtual void prefetch(const UniConfKey &key, bool recursive); 00052 virtual WvString get(const UniConfKey &key); 00053 virtual void set(const UniConfKey &key, WvStringParm value); 00054 virtual bool exists(const UniConfKey &key); 00055 virtual bool haschildren(const UniConfKey &key); 00056 virtual bool isok(); 00057 virtual Iter *iterator(const UniConfKey &key); 00058 virtual Iter *recursiveiterator(const UniConfKey &key); 00059 00060 private: 00065 virtual void gencallback(const UniConf &cfg, const UniConfKey &key); 00066 00067 class Iter; 00068 class RecursiveIter; 00069 00070 bool refreshing, committing; 00071 }; 00072 00073 #endif //__UNIUNWRAPGEN_H