WvStreams
unifiltergen.h
00001 /* -*- Mode: C++ -*-
00002  * Worldvisions Weaver Software:
00003  *   Copyright (C) 2002 Net Integration Technologies, Inc.
00004  * 
00005  * A UniConfGen framework to simplify writing filtering generators.
00006  */
00007 #ifndef __UNIFILTERGEN_H
00008 #define __UNIFILTERGEN_H
00009 
00010 #include "uniconfgen.h"
00011 
00017 class UniFilterGen : public UniConfGen
00018 {
00019     IUniConfGen *xinner;
00020 
00021 protected:
00022     UniFilterGen(IUniConfGen *inner);
00023     virtual ~UniFilterGen();
00024 
00029     void setinner(IUniConfGen *inner);
00030 
00031 public:
00033     IUniConfGen *inner() const
00034         { return xinner; }
00035     
00047     virtual bool keymap(const UniConfKey &unmapped_key, UniConfKey &mapped_key);
00048 
00056     virtual bool reversekeymap(const UniConfKey &mapped_key, UniConfKey &unmapped_key);
00057     
00058 
00059     /***** Overridden methods *****/
00060 
00061     virtual void commit();
00062     virtual bool refresh();
00063     virtual void flush_buffers();
00064     virtual void prefetch(const UniConfKey &key, bool recursive);
00065     virtual WvString get(const UniConfKey &key);
00066     virtual void set(const UniConfKey &key, WvStringParm value);
00067     virtual void setv(const UniConfPairList &pairs);
00068     virtual bool exists(const UniConfKey &key);
00069     virtual bool haschildren(const UniConfKey &key);
00070     virtual bool isok();
00071     virtual Iter *iterator(const UniConfKey &key);
00072     virtual Iter *recursiveiterator(const UniConfKey &key);
00073 
00074 protected:
00079     virtual void gencallback(const UniConfKey &key, WvStringParm value);
00080 };
00081 
00082 #endif //__UNIFILTERGEN_H