WvStreams
uniunwrapgen.h
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     UniConfKey xfullkey;
00037 
00038 public:
00039     UniUnwrapGen(const UniConf &inner);
00040     virtual ~UniUnwrapGen();
00041 
00042     void setinner(const UniConf &inner);
00043 
00045     const UniConf &inner() const
00046         { return xinner; }
00047 
00048     /***** Overridden methods *****/
00049     virtual void commit();
00050     virtual bool refresh();
00051     virtual void flush_buffers() { }
00052     virtual void prefetch(const UniConfKey &key, bool recursive);
00053     virtual WvString get(const UniConfKey &key);
00054     virtual void set(const UniConfKey &key, WvStringParm value);
00055     virtual void setv(const UniConfPairList &pairs);
00056     virtual bool exists(const UniConfKey &key);
00057     virtual bool haschildren(const UniConfKey &key);
00058     virtual bool isok();
00059     virtual Iter *iterator(const UniConfKey &key);
00060     virtual Iter *recursiveiterator(const UniConfKey &key);
00061 
00062 private:
00067     virtual void gencallback(const UniConfKey &key, WvStringParm value);
00068     
00070     UniConf _sub(const UniConfKey &key);
00071     
00072     class Iter;
00073     class RecursiveIter;
00074     
00075     bool refreshing, committing;
00076 };
00077 
00078 #endif //__UNIUNWRAPGEN_H