10 #include "uniconfpair.h"
11 #include "wvcallbacklist.h"
30 typedef wv::function<void(const UniConfKey&, WvStringParm)>
48 const UniConfGenCallback &callback) = 0;
60 virtual bool isok() = 0;
139 virtual void setv(
const UniConfPairList &pairs) = 0;
192 {0xb0, 0x56, 0x8b, 0x9d, 0xde, 0x9a, 0xbe, 0x9f}});
208 UniConfPairList deltas;
225 const UniConfGenCallback &callback);
289 virtual void setv(
const UniConfPairList &pairs) = 0;
302 void setv_naive(
const UniConfPairList &pairs);
333 virtual void rewind() = 0;
340 virtual bool next() = 0;
363 virtual bool next() {
return false; }
369 #endif // __UNICONFGEN_H
A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
Represents a UniConf key which is a path in a hierarchy structured much like the traditional Unix fil...
virtual bool haschildren(const UniConfKey &key)
Returns true if a key has children.
The basic interface which is included by all other XPLC interfaces and objects.
void delta(const UniConfKey &key, WvStringParm value)
Call this when a key's value or children have possibly changed.
void clear_delta()
Clears the list of pending notifications without sending them.
virtual void set(const UniConfKey &key, WvStringParm value)=0
Stores a string value for a key into the registry.
An iterator that iterates through a constant list of keys.
An abstract data container that backs a UniConf tree.
virtual void flush_buffers()=0
Flushes any commitment/notification buffers .
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...
An abstract iterator over keys and values in a generator.
virtual bool exists(const UniConfKey &key)=0
Without fetching its value, returns true if a key exists.
virtual bool next()=0
Seeks to the next element in the sequence.
virtual void setv(const UniConfPairList &pairs)=0
Stores multiple key-value pairs into the registry.
virtual int str2int(WvStringParm s, int defvalue) const
Converts a string to an integer.
virtual bool next()
Seeks to the next element in the sequence.
virtual bool refresh()
Refreshes information about a key recursively.
virtual bool haschildren(const UniConfKey &key)=0
Returns true if a key has children.
virtual void del_callback(void *cookie)
Removes a callback for change notification.
void flush_delta()
Flushes the list of pending notifications by sending them.
::UniListIter ListIter
An iterator over a constant list of keys (see below)
virtual bool exists(const UniConfKey &key)
Without fetching its value, returns true if a key exists.
virtual Iter * iterator(const UniConfKey &key)=0
Returns an iterator over the children of the specified key.
virtual void add_callback(void *cookie, const UniConfGenCallback &callback)
Adds a callback for change notification.
UniConfGen()
Creates a UniConfGen object.
virtual WvString value() const =0
Returns the value of the current key.
virtual ~Iter()
Destroys the iterator.
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 UniConfKey key() const =0
Returns the current key.
virtual bool isok()
Determines if the generator is usable and working properly.
void hold_delta()
Pauses notifications until matched with a call to unhold_delta().
virtual void commit()=0
Commits any changes.
An iterator that's always empty.
virtual void rewind()
Rewinds the iterator.
virtual void flush_buffers()=0
Flushes any commitment/notification buffers .
virtual void rewind()=0
Rewinds the iterator.
#define DEFINE_IID(iface, u1, u2, u3, u4, u5, u6, u7, u8, u9, u10, u11)
Used to define the IID of an interface.
virtual bool refresh()=0
Refreshes information about a key recursively.
virtual bool isok()=0
Determines if the generator is usable and working properly.
virtual void add_callback(void *cookie, const UniConfGenCallback &callback)=0
Adds a callback for change notification.
void dispatch_delta(const UniConfKey &key, WvStringParm value)
Immediately sends notification that a key has possibly changed.
virtual ~UniConfGen()
Destroys the UniConfGen and may discard uncommitted data.
virtual UniConfKey key() const
Returns the current key.
virtual void del_callback(void *cookie)=0
Removes a callback for change notification.
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 WvString value() const
Returns the value of the current key.
virtual int str2int(WvStringParm s, int defvalue) const =0
Converts a string to an integer.
void unhold_delta()
Resumes notifications when each hold_delta() has been matched.
virtual Iter * recursiveiterator(const UniConfKey &key)
Like iterator(), but the returned iterator is recursive, that is, it will return children of the imme...
WvString is an implementation of a simple and efficient printable-string class.
A default implementation of IUniConfGen, providing various handy features that save trouble when impl...
virtual Iter * iterator(const UniConfKey &key)=0
Returns an iterator over the children of the specified key.
virtual void commit()
Commits any changes.
virtual void setv(const UniConfPairList &pairs)=0
Stores multiple key-value pairs into the registry.
virtual void set(const UniConfKey &key, WvStringParm value)=0
Stores a string value for a key into the registry.