WvStreams
debian/libwvstreams-dev/usr/include/wvstreams/unifiltergen.h
1/* -*- Mode: C++ -*-
2 * Worldvisions Weaver Software:
3 * Copyright (C) 2002 Net Integration Technologies, Inc.
4 *
5 * A UniConfGen framework to simplify writing filtering generators.
6 */
7#ifndef __UNIFILTERGEN_H
8#define __UNIFILTERGEN_H
9
10#include "uniconfgen.h"
11
18{
19 IUniConfGen *xinner;
20
21protected:
23 virtual ~UniFilterGen();
24
30
31public:
34 { return xinner; }
35
47 virtual bool keymap(const UniConfKey &unmapped_key, UniConfKey &mapped_key);
48
56 virtual bool reversekeymap(const UniConfKey &mapped_key, UniConfKey &unmapped_key);
57
58
59 /***** Overridden methods *****/
60
61 virtual void commit();
62 virtual bool refresh();
63 virtual void flush_buffers();
64 virtual void prefetch(const UniConfKey &key, bool recursive);
65 virtual WvString get(const UniConfKey &key);
66 virtual void set(const UniConfKey &key, WvStringParm value);
67 virtual void setv(const UniConfPairList &pairs);
68 virtual bool exists(const UniConfKey &key);
69 virtual bool haschildren(const UniConfKey &key);
70 virtual bool isok();
71 virtual Iter *iterator(const UniConfKey &key);
72 virtual Iter *recursiveiterator(const UniConfKey &key);
73
74protected:
79 virtual void gencallback(const UniConfKey &key, WvStringParm value);
80};
81
82#endif //__UNIFILTERGEN_H
An abstract data container that backs a UniConf tree.
A default implementation of IUniConfGen, providing various handy features that save trouble when impl...
Represents a UniConf key which is a path in a hierarchy structured much like the traditional Unix fil...
A UniConfGen that delegates all requests to an inner generator.
virtual void prefetch(const UniConfKey &key, bool recursive)
Indicate that we will eventually be interested in doing get(), haschildren(), or other "get-like" ope...
virtual void gencallback(const UniConfKey &key, WvStringParm value)
Called by inner generator when a key changes.
void setinner(IUniConfGen *inner)
Rebinds the inner generator and prepares its callback.
virtual void setv(const UniConfPairList &pairs)
Stores multiple key-value pairs into the registry.
virtual Iter * recursiveiterator(const UniConfKey &key)
Like iterator(), but the returned iterator is recursive, that is, it will return children of the imme...
virtual WvString get(const UniConfKey &key)
Fetches a string value for a key from the registry.
virtual bool keymap(const UniConfKey &unmapped_key, UniConfKey &mapped_key)
A mapping function for filters that remap one keyspace onto another.
IUniConfGen * inner() const
Returns the inner generator.
virtual bool exists(const UniConfKey &key)
Without fetching its value, returns true if a key exists.
virtual bool refresh()
Refreshes information about a key recursively.
virtual void commit()
Commits any changes.
virtual Iter * iterator(const UniConfKey &key)
Returns an iterator over the children of the specified key.
virtual bool isok()
Determines if the generator is usable and working properly.
virtual bool haschildren(const UniConfKey &key)
Returns true if a key has children.
virtual void flush_buffers()
Flushes any commitment/notification buffers .
virtual bool reversekeymap(const UniConfKey &mapped_key, UniConfKey &unmapped_key)
A mapping function for filters that unmap a keyspace.
A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
WvString is an implementation of a simple and efficient printable-string class.