WvStreams
|
An abstract data container that backs a UniConf tree. More...
#include <uniconfgen.h>
Public Types | |
typedef ::UniListIter | ListIter |
An iterator over a constant list of keys (see below) | |
Public Member Functions | |
virtual void | add_callback (void *cookie, const UniConfGenCallback &callback)=0 |
Adds a callback for change notification. | |
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. More... | |
virtual void | commit ()=0 |
Commits any changes. More... | |
virtual bool | refresh ()=0 |
Refreshes information about a key recursively. More... | |
virtual void | flush_buffers ()=0 |
Flushes any commitment/notification buffers . More... | |
virtual void | prefetch (const UniConfKey &key, bool recursive)=0 |
Indicate that we will eventually be interested in doing get(), haschildren(), or other "get-like" operations on a particular key or tree of keys. More... | |
virtual WvString | get (const UniConfKey &key)=0 |
Fetches a string value for a key from the registry. More... | |
virtual bool | exists (const UniConfKey &key)=0 |
Without fetching its value, returns true if a key exists. More... | |
virtual int | str2int (WvStringParm s, int defvalue) const =0 |
Converts a string to an integer. More... | |
virtual void | set (const UniConfKey &key, WvStringParm value)=0 |
Stores a string value for a key into the registry. More... | |
virtual void | setv (const UniConfPairList &pairs)=0 |
Stores multiple key-value pairs into the registry. More... | |
virtual bool | haschildren (const UniConfKey &key)=0 |
Returns true if a key has children. More... | |
virtual Iter * | iterator (const UniConfKey &key)=0 |
Returns an iterator over the children of the specified key. More... | |
virtual Iter * | recursiveiterator (const UniConfKey &key)=0 |
Like iterator(), but the returned iterator is recursive, that is, it will return children of the immediate children, not just the immediate children themselves. More... | |
virtual unsigned int | addRef ()=0 |
Indicate you are using this object. More... | |
virtual unsigned int | release ()=0 |
Indicate that you are finished using this object. More... | |
virtual IObject * | getInterface (const UUID &)=0 |
Returns the requested XPLC interface. More... | |
virtual IWeakRef * | getWeakRef ()=0 |
Return a weak reference to this object. More... | |
An abstract data container that backs a UniConf tree.
This is intended to be implemented to provide support for fetching and storing keys and values using different access methods.
Definition at line 39 of file uniconfgen.h.
|
pure virtual |
Determines if the generator is usable and working properly.
The default implementation always returns true.
Implemented in UniConfGen, UniTransactionGen, UniRetryGen, UniFilterGen, UniReplicateGen, UniPStoreGen, UniClientGen, UniUnwrapGen, UniListGen, UniCacheGen, and UniRegistryGen.
Referenced by UniCacheGen::isok(), UniUnwrapGen::isok(), UniFilterGen::isok(), UniTransactionGen::isok(), and UniConf::isok().
|
pure virtual |
Commits any changes.
The default implementation does nothing.
Implemented in UniConfGen, UniMountGen, UniTransactionGen, UniRetryGen, UniReplicateGen, UniClientGen, UniFilterGen, UniSecureGen, UniIniGen, UniUnwrapGen, UniCacheGen, UniListGen, UniTempGen, UniSlowGen, and UniBachelorGen.
Referenced by UniCacheGen::commit(), UniFilterGen::commit(), UniTransactionGen::commit(), and UniMountGen::unmount().
|
pure virtual |
Refreshes information about a key recursively.
May discard uncommitted data.
The default implementation always returns true.
Implemented in UniConfGen, UniMountGen, UniTransactionGen, UniRetryGen, UniReplicateGen, UniClientGen, UniFilterGen, UniSecureGen, UniIniGen, UniUnwrapGen, UniCacheGen, UniListGen, UniTempGen, UniSlowGen, and UniBachelorGen.
Referenced by UniMountGen::mountgen(), UniCacheGen::refresh(), UniFilterGen::refresh(), and UniTransactionGen::refresh().
|
pure virtual |
Flushes any commitment/notification buffers .
The default implementation always returns true. NOTE: This method should be 'protected'
Implemented in UniConfGen, UniMountGen, UniTransactionGen, UniPermGen, UniRetryGen, UniReplicateGen, UniClientGen, UniFilterGen, UniDefGen, UniPStoreGen, UniUnwrapGen, UniFileSystemGen, UniSecureGen, UniListGen, UniWvConfGen, UniTempGen, UniSlowGen, UniRegistryGen, UniNullGen, and UniReadOnlyGen.
Referenced by UniFilterGen::flush_buffers(), and UniCacheGen::get().
|
pure virtual |
Indicate that we will eventually be interested in doing get(), haschildren(), or other "get-like" operations on a particular key or tree of keys.
The generator may be able to speed up these operations by, say, caching them in advance.
This function is not allowed to do blocking operations. It is allowed to do nothing at all, however, and then get() might block later.
Implemented in UniConfGen, UniRetryGen, UniFilterGen, and UniUnwrapGen.
Referenced by UniFilterGen::prefetch().
|
pure virtual |
Fetches a string value for a key from the registry.
If the key doesn't exist, the return value has .isnull() == true.
Implemented in UniConfGen, UniMountGen, UniTransactionGen, UniCallbackGen, UniRetryGen, UniReplicateGen, UniClientGen, UniFilterGen, UniPStoreGen, UniDefGen, UniUnwrapGen, UniSecureGen, UniCacheGen, UniFileSystemGen, UniListGen, UniFastRegetGen, UniRegistryGen, UniWvConfGen, UniSlowGen, UniTempGen, and UniNullGen.
Referenced by UniTransactionGen::cancel_changes(), UniTransactionGen::cancel_values(), UniFilterGen::get(), UniTransactionGen::get(), UniListIter::value(), and GenStyleChangeTreeIter::value().
|
pure virtual |
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().
Implemented in UniConfGen, UniMountGen, UniRetryGen, UniFilterGen, UniPStoreGen, UniUnwrapGen, UniSecureGen, UniListGen, UniRegistryGen, UniFastRegetGen, and UniSlowGen.
Referenced by UniTransactionGen::apply_changes(), UniTransactionGen::cancel_changes(), UniTransactionGen::cancel_values(), UniFilterGen::exists(), UniMountGen::mount(), and UniMountGen::mountgen().
|
pure virtual |
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.
Implemented in UniConfGen.
|
pure virtual |
Stores a string value for a key into the registry.
If the value is WvString::null, the key is deleted.
Implemented in UniConfGen, UniMountGen, UniTransactionGen, UniCallbackGen, UniRetryGen, UniReplicateGen, UniClientGen, UniFilterGen, UniPStoreGen, UniDefGen, UniUnwrapGen, UniIniGen, UniSecureGen, UniFileSystemGen, UniCacheGen, UniListGen, UniRegistryGen, UniWvConfGen, UniTempGen, UniNullGen, and UniReadOnlyGen.
Referenced by UniTransactionGen::apply_changes(), UniTransactionGen::apply_values(), UniMountGen::mount(), UniMountGen::mountgen(), UniCacheGen::set(), UniDefGen::set(), UniFilterGen::set(), UniPermGen::setgroup(), and UniPermGen::setowner().
|
pure virtual |
Stores multiple key-value pairs into the registry.
If the value is WvString::null, the key is deleted.
Implemented in UniConfGen, UniMountGen, UniTransactionGen, UniReplicateGen, UniClientGen, UniFilterGen, UniPStoreGen, UniUnwrapGen, UniFileSystemGen, UniListGen, UniRegistryGen, UniWvConfGen, UniTempGen, and UniNullGen.
Referenced by UniFilterGen::setv().
|
pure virtual |
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.
Implemented in UniConfGen, UniMountGen, UniRetryGen, UniFilterGen, UniClientGen, UniPStoreGen, UniUnwrapGen, UniSecureGen, UniListGen, UniRegistryGen, UniFastRegetGen, UniWvConfGen, UniSlowGen, UniTempGen, and UniNullGen.
Referenced by UniFilterGen::haschildren().
|
pure virtual |
Returns an iterator over the children of the specified key.
May return NULL or an empty iterator if the key has no children.
The caller takes ownership of the returned iterator and is responsible for deleting it when finished.
Implemented in UniConfGen, UniMountGen, UniTransactionGen, UniRetryGen, UniFilterGen, UniReplicateGen, UniClientGen, UniPStoreGen, UniUnwrapGen, UniSecureGen, UniFileSystemGen, UniListGen, UniRegistryGen, UniWvConfGen, UniSlowGen, UniTempGen, and UniNullGen.
Referenced by UniTransactionGen::apply_values(), UniTransactionGen::cancel_values(), UniTransactionGen::deletion_simulator(), UniFilterGen::iterator(), and UniTransactionGen::iterator().
|
pure virtual |
Like iterator(), but the returned iterator is recursive, that is, it will return children of the immediate children, not just the immediate children themselves.
May return NULL if the key has no immediate children (since that means there are also no indirect children).
Note that UniConfGen::recursiveiterator() is a default implementation that just calls iterator() recursively, so it'll work in any derived class without you overriding this function. However, you might want to do it anyway if it would be more efficient in your particular case.
Implemented in UniConfGen, UniMountGen, UniRetryGen, UniFilterGen, UniClientGen, UniAutoMountGen, UniUnwrapGen, UniSecureGen, and UniSlowGen.
Referenced by UniFilterGen::recursiveiterator().
|
pure virtualinherited |
Indicate you are using this object.
This increases the reference count of the object by one. Usually, when the reference count reaches zero, the object is freed automatically.
This called a "strong reference", because they will prevent the object from being destroyed. They should thus be used carefully, as they control the lifetime of the object. For example, you do not need to call addRef() on object passed as parameters, unless you intend on keeping them.
addRef() is often called automatically for you in XPLC, but you'll have to call release() by hand sometimes unless you use xplc_ptr.
Referenced by WvIStreamList::execute(), IObjectImplInternal::getInterface(), StaticServiceHandler::getObject(), WeakRef::getObject(), WvIStreamList::post_select(), WvQtStreamClone::WvQtStreamClone(), and WvSSLStream::WvSSLStream().
|
pure virtualinherited |
Indicate that you are finished using this object.
This decreases the reference count of the object by one. Usually, when the reference count reaches zero, the object is freed automatically.
You will usually need to manually release() any object given to you by any other XPLC function, unless you give the object to someone else who will call release.
If you use xplc_ptr, it will do this for you.
Referenced by WvIStreamList::execute(), mutate(), NewMoniker::resolve(), and MonikerService::resolve().
Returns the requested XPLC interface.
Will return NULL if the interface is not supported. The returned interface has been addRef()ed, so you will need to release() it when done. Note that the interface returned may be a pointer to the same object or a different one - that's none of your business. Asking for the IObject interface should always return the same pointer for a given logical object, so this can be used for comparison by identity.
You should probably use the convenient mutate() and get() functions instead of this, or use an xplc_ptr, which mutates the object for you.
|
pure virtualinherited |