WvStreams
uniunwrapgen.h
1 /* -*- Mode: C++ -*-
2  * Worldvisions Weaver Software:
3  * Copyright (C) 2004 Net Integration Technologies, Inc.
4  *
5  * A totally evil UniConfGen that "unwraps" a UniConf object by turning it
6  * back into a UniConfGen.
7  */
8 #ifndef __UNIUNWRAPGEN_H
9 #define __UNIUNWRAPGEN_H
10 
11 #include "uniconf.h"
12 
33 class UniUnwrapGen : public UniConfGen
34 {
35  UniConf xinner;
36  UniConfKey xfullkey;
37 
38 public:
39  UniUnwrapGen(const UniConf &inner);
40  virtual ~UniUnwrapGen();
41 
42  void setinner(const UniConf &inner);
43 
45  const UniConf &inner() const
46  { return xinner; }
47 
48  /***** Overridden methods *****/
49  virtual void commit();
50  virtual bool refresh();
51  virtual void flush_buffers() { }
52  virtual void prefetch(const UniConfKey &key, bool recursive);
53  virtual WvString get(const UniConfKey &key);
54  virtual void set(const UniConfKey &key, WvStringParm value);
55  virtual void setv(const UniConfPairList &pairs);
56  virtual bool exists(const UniConfKey &key);
57  virtual bool haschildren(const UniConfKey &key);
58  virtual bool isok();
59  virtual Iter *iterator(const UniConfKey &key);
60  virtual Iter *recursiveiterator(const UniConfKey &key);
61 
62 private:
67  virtual void gencallback(const UniConfKey &key, WvStringParm value);
68 
70  UniConf _sub(const UniConfKey &key);
71 
72  class Iter;
73  class RecursiveIter;
74 
75  bool refreshing, committing;
76 };
77 
78 #endif //__UNIUNWRAPGEN_H