7 #include "unifiltergen.h"
18 UniFilterGen::~UniFilterGen()
40 mapped_key = unmapped_key;
47 unmapped_key = mapped_key;
71 if (xinner &&
keymap(key, mapped_key))
72 xinner->
prefetch(mapped_key, recursive);
79 if (xinner &&
keymap(key, mapped_key))
80 return xinner->
get(mapped_key);
82 return WvString::null;
96 if (xinner &&
keymap(key, mapped_key))
97 xinner->
set(mapped_key, value);
111 if (xinner &&
keymap(key, mapped_key))
112 return xinner->
exists(mapped_key);
121 if (xinner &&
keymap(key, mapped_key))
131 return xinner->
isok();
140 if (xinner &&
keymap(key, mapped_key))
141 return xinner->
iterator(mapped_key);
150 if (xinner &&
keymap(key, mapped_key))
161 delta(unmapped_key, value);
void setinner(IUniConfGen *inner)
Rebinds the inner generator and prepares its callback.
virtual void set(const UniConfKey &key, WvStringParm value)=0
Stores a string value for a key into the registry.
virtual bool exists(const UniConfKey &key)=0
Without fetching its value, returns true if a key exists.
virtual void prefetch(const UniConfKey &key, bool recursive)=0
Indicate that we will eventually be interested in doing get(), haschildren(), or other "get-like" ope...
virtual bool keymap(const UniConfKey &unmapped_key, UniConfKey &mapped_key)
A mapping function for filters that remap one keyspace onto another.
virtual WvString get(const UniConfKey &key)=0
Fetches a string value for a key from the registry.
virtual void set(const UniConfKey &key, WvStringParm value)
Stores a string value for a key into the registry.
virtual void flush_buffers()=0
Flushes any commitment/notification buffers .
virtual void gencallback(const UniConfKey &key, WvStringParm value)
Called by inner generator when a key changes.
virtual WvString get(const UniConfKey &key)
Fetches a string value for a key from the registry.
virtual Iter * iterator(const UniConfKey &key)
Returns an iterator over the children of the specified key.
virtual bool haschildren(const UniConfKey &key)=0
Returns true if a key has children.
WvString is an implementation of a simple and efficient printable-string class.
An abstract data container that backs a UniConf tree.
Represents a UniConf key which is a path in a hierarchy structured much like the traditional Unix fil...
virtual bool isok()
Determines if the generator is usable and working properly.
virtual bool reversekeymap(const UniConfKey &mapped_key, UniConfKey &unmapped_key)
A mapping function for filters that unmap a keyspace.
IUniConfGen * inner() const
Returns the inner generator.
void delta(const UniConfKey &key, WvStringParm value)
Call this when a key's value or children have possibly changed.
virtual void commit()=0
Commits any changes.
virtual void del_callback(void *cookie)=0
Removes a callback for change notification.
virtual bool isok()=0
Determines if the generator is usable and working properly.
virtual Iter * iterator(const UniConfKey &key)=0
Returns an iterator over the children of the specified key.
virtual bool refresh()=0
Refreshes information about a key recursively.
virtual void add_callback(void *cookie, const UniConfGenCallback &callback)=0
Adds a callback for change notification.
virtual bool exists(const UniConfKey &key)
Without fetching its value, returns true if a key exists.
virtual void setv(const UniConfPairList &pairs)
Stores multiple key-value pairs into the registry.
virtual bool refresh()
Refreshes information about a key recursively.
virtual void commit()
Commits any changes.
virtual void setv(const UniConfPairList &pairs)=0
Stores multiple key-value pairs into the registry.
virtual Iter * recursiveiterator(const UniConfKey &key)=0
Like iterator(), but the returned iterator is recursive, that is, it will return children of the imme...
virtual bool haschildren(const UniConfKey &key)
Returns true if a key has children.
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 flush_buffers()
Flushes any commitment/notification buffers .
virtual Iter * recursiveiterator(const UniConfKey &key)
Like iterator(), but the returned iterator is recursive, that is, it will return children of the imme...
An abstract iterator over keys and values in a generator.