#include <unimountgen.h>
Inherits UniConfGen.
Collaboration diagram for UniMountGen:
Definition at line 17 of file unimountgen.h.
Public Member Functions | |
UniMountGen () | |
Creates an empty UniConf tree with no mounted stores. | |
UniMountGen (const UniMountGen &other) | |
undefined. | |
virtual | ~UniMountGen () |
Destroys the UniConf tree along with all uncommitted data. | |
virtual UniConfGen * | mount (const UniConfKey &key, WvStringParm moniker, bool refresh) |
Mounts a generator at a key using a moniker. | |
virtual UniConfGen * | mountgen (const UniConfKey &key, UniConfGen *gen, bool refresh) |
Mounts a generator at a key. | |
virtual void | unmount (UniConfGen *gen, bool commit) |
Unmounts the generator at a key and destroys it. | |
virtual UniConfGen * | whichmount (const UniConfKey &key, UniConfKey *mountpoint) |
Finds the generator that owns a key. | |
virtual bool | ismountpoint (const UniConfKey &key) |
Determines if a key is a mountpoint. | |
virtual bool | exists (const UniConfKey &key) |
Without fetching its value, returns true if a key exists. | |
virtual bool | haschildren (const UniConfKey &key) |
Returns true if a key has children. | |
virtual WvString | get (const UniConfKey &key) |
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 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. | |
void | setcallback (const UniConfGenCallback &callback, void *userdata) |
Sets the callback for change notification. | |
void | dispatch_delta (const UniConfKey &key, WvStringParm value) |
Immediately sends notification that a key has possibly changed. | |
void | hold_delta () |
Pauses notifications until matched with a call to unhold_delta(). | |
void | unhold_delta () |
Resumes notifications when each hold_delta() has been matched. | |
void | clear_delta () |
Clears the list of pending notifications without sending them. | |
void | flush_delta () |
Flushes the list of pending notifications by sending them. | |
void | delta (const UniConfKey &key, WvStringParm value) |
Call this when a key's value or children have possibly changed. | |
virtual bool | isok () |
Determines if the generator is usable and working properly. | |
virtual int | str2int (WvStringParm s, int defvalue) const |
Converts a string to an integer. | |
virtual unsigned int | addRef () |
virtual unsigned int | release () |
Protected Types | |
typedef WvList< UniGenMount > | MountList |
Protected Member Functions | |
void | seterror (WvStringParm error) |
Raises an error condition. | |
Protected Attributes | |
MountList | mounts |
|
Definition at line 36 of file unimountgen.h. |
|
Creates an empty UniConf tree with no mounted stores.
Definition at line 41 of file unimountgen.h. |
|
undefined.
|
|
Destroys the UniConf tree along with all uncommitted data.
Definition at line 48 of file unimountgen.h. |
|
Implements IObject. |
|
Clears the list of pending notifications without sending them. Does not affect the hold nesting count. Definition at line 38 of file uniconfgen.cc. |
|
Commits any changes. The default implementation does nothing. Reimplemented from UniConfGen. Definition at line 85 of file unimountgen.cc. References UniConfGen::hold_delta(), mounts, and UniConfGen::unhold_delta(). |
|
Call this when a key's value or children have possibly changed. If the hold nesting count is 0, the notification is sent immediately. Otherwise it is added to a pending list for later. Definition at line 69 of file uniconfgen.cc. References UniConfGen::dispatch_delta(), UniConfGen::hold_delta(), UniConfGen::unhold_delta(), and WvStringParm. Referenced by UniClientGen::deltacb(), UniFilterGen::gencallback(), mountgen(), UniIniGen::refresh(), UniTempGen::set(), UniRegistryGen::set(), UniPStoreGen::set(), and unmount(). |
|
Immediately sends notification that a key has possibly changed. Takes care of the details of invoking the callback. Note: You probably want to be using delta() instead. Definition at line 62 of file uniconfgen.cc. References WvStringParm. Referenced by UniConfGen::delta(), and UniConfGen::flush_delta(). |
|
Without fetching its value, returns true if a key exists. This is provided because it is often more efficient to test existance than to actually retrieve the value. The default implementation returns !get(key).isnull(). Reimplemented from UniConfGen. Definition at line 32 of file unimountgen.cc. References UniConfGen::exists(), UniMountGen::UniGenMount::gen, and UniMountGen::UniGenMount::key. |
|
Flushes the list of pending notifications by sending them. Does not affect the hold nesting count. Definition at line 44 of file uniconfgen.cc. References UniConfGen::dispatch_delta(). Referenced by UniConfGen::unhold_delta(). |
|
Fetches a string value for a key from the registry. If the key doesn't exist, the return value is WvString::null. Implements UniConfGen. Definition at line 12 of file unimountgen.cc. References UniMountGen::UniGenMount::gen, UniConfGen::get(), and UniMountGen::UniGenMount::key. Referenced by mountgen(), and unmount(). |
|
Returns true if a key has children. This is provided because it is often more efficient to test existance than to actually retrieve the keys. The default implementation uses the iterator returned by iterator() to test whether the child has any keys. Subclasses are strongly encouraged to provide a better implementation. Reimplemented from UniConfGen. Definition at line 42 of file unimountgen.cc. References UniMountGen::UniGenMount::gen, UniConfGen::haschildren(), UniMountGen::UniGenMount::key, mounts, and UniConfKey::suborsame(). |
|
Pauses notifications until matched with a call to unhold_delta(). While paused, notification events are placed into a pending list. Redundant notifications may be discarded. Use this to safeguard non-reentrant code. Definition at line 23 of file uniconfgen.cc. Referenced by UniMountTreeGen::commit(), commit(), UniConfGen::delta(), UniClientGen::deltacb(), UniMountTreeGen::exists(), UniMountTreeGen::get(), UniMountTreeGen::haschildren(), UniConfGen::haschildren(), UniMountTreeGen::mountgen(), mountgen(), UniMountTreeGen::refresh(), refresh(), UniIniGen::refresh(), UniMountTreeGen::KeyIter::rewind(), UniTempGen::set(), UniClientGen::set(), UniMountTreeGen::unmount(), unmount(), and UniMountTreeGen::whichmount(). |
|
Determines if a key is a mountpoint.
Definition at line 199 of file unimountgen.cc. References mounts. |
|
Determines if the generator is usable and working properly. The default implementation always returns true. Reimplemented in UniClientGen, UniFilterGen, UniListGen, UniPStoreGen, and UniRegistryGen. Definition at line 131 of file uniconfgen.cc. Referenced by UniFilterGen::isok(), and trymount(). |
|
Returns an iterator over the children of the specified key. Must not return NULL; consider returning a NullIter instead. The caller takes ownership of the returned iterator and is responsible for deleting it when finished. Implements UniConfGen. Definition at line 213 of file unimountgen.cc. References UniMountGen::UniGenMount::gen, UniConfGen::iterator(), and UniMountGen::UniGenMount::key. |
|
Mounts a generator at a key using a moniker. Returns the generator instance pointer, or NULL on failure. Definition at line 97 of file unimountgen.cc. References mountgen(), and WvStringParm. Referenced by UniConfRoot::UniConfRoot(). |
|
Mounts a generator at a key. Takes ownership of the supplied generator instance. "key" is the key "gen" is the generator instance "refresh" is if true, refreshes the generator after mount Returns: the generator instance pointer, or NULL on failure Definition at line 109 of file unimountgen.cc. References UniConfGen::delta(), get(), UniConfGen::hold_delta(), UniMountGen::UniGenMount::key, mounts, WvList< T >::prepend(), UniConfGen::refresh(), UniConfGen::setcallback(), UniConfGen::unhold_delta(), and UniConfGenCallback. Referenced by mount(), and UniConfRoot::UniConfRoot(). |
|
Refreshes information about a key recursively. May discard uncommitted data. The default implementation always returns true. Reimplemented from UniConfGen. Definition at line 70 of file unimountgen.cc. References UniConfGen::hold_delta(), mounts, and UniConfGen::unhold_delta(). |
|
Implements IObject. |
|
Stores a string value for a key into the registry. If the value is WvString::null, the key is deleted. Returns true on success. Implements UniConfGen. Definition at line 22 of file unimountgen.cc. References UniMountGen::UniGenMount::gen, UniMountGen::UniGenMount::key, UniConfGen::set(), and WvStringParm. |
|
Sets the callback for change notification. Must not be reimplemented by subclasses. Definition at line 137 of file uniconfgen.cc. References UniConfGenCallback. Referenced by UniMountTreeGen::mountgen(), mountgen(), UniFilterGen::setinner(), UniCacheGen::UniCacheGen(), UniConfRoot::UniConfRoot(), UniMountTreeGen::unmount(), unmount(), and UniConfRoot::~UniConfRoot(). |
|
Raises an error condition.
Definition at line 57 of file uniconfgen.h. Referenced by UniClientGen::do_select(), and UniClientGen::get(). |
|
Converts a string to an integer. If the string is null or not recognized, return defvalue. This is here to support the common str2int(get(key)). The default implementation recognizes the booleans 'true', 'yes', 'on' and 'enabled' as 1, and 'false', 'no', 'off' and 'disabled' as 0. Definition at line 105 of file uniconfgen.cc. References WvFastString::cstr(), WvFastString::isnull(), and WvStringParm. |
|
Resumes notifications when each hold_delta() has been matched. On resumption, dispatches all pending notifications except those that were destined to watches that were removed. Use this to safeguard non-reentrant code. Definition at line 29 of file uniconfgen.cc. References UniConfGen::flush_delta(). Referenced by UniMountTreeGen::commit(), commit(), UniConfGen::delta(), UniClientGen::deltacb(), UniMountTreeGen::exists(), UniMountTreeGen::get(), UniMountTreeGen::haschildren(), UniConfGen::haschildren(), UniMountTreeGen::mountgen(), mountgen(), UniMountTreeGen::refresh(), refresh(), UniIniGen::refresh(), UniMountTreeGen::KeyIter::rewind(), UniTempGen::set(), UniClientGen::set(), UniMountTreeGen::unmount(), unmount(), and UniMountTreeGen::whichmount(). |
|
Unmounts the generator at a key and destroys it. "gen" is the generator instance "commit" is if true, commits the generator before unmount Definition at line 135 of file unimountgen.cc. References UniConfGen::commit(), UniConfGen::delta(), get(), UniConfGen::hold_delta(), mounts, UniConfGen::setcallback(), UniConfKey::suborsame(), UniConfGen::unhold_delta(), and UniConfGenCallback. |
|
Finds the generator that owns a key. If the key exists, returns the generator that provides its contents. Otherwise returns the generator that would be updated if a value were set. "key" is the key "mountpoint" is if not NULL, replaced with the mountpoint path on success Returns: the handle, or a null handle if none Definition at line 180 of file unimountgen.cc. References mounts. |
|
Definition at line 37 of file unimountgen.h. Referenced by commit(), haschildren(), ismountpoint(), mountgen(), refresh(), unmount(), and whichmount(). |