![]() |
Home · All Classes · All Functions · | ![]() |
The QAbstractValueSpaceLayer class provides support for adding new logical data layers to the Qt Value Space. More...
#include <QAbstractValueSpaceLayer>
Inherits QObject.
typedef | Handle |
enum | Properties { Publish } |
enum | Type { Server, Client } |
virtual void | addWatch ( QValueSpacePublisher * creator, Handle handle ) = 0 |
virtual QSet<QString> | children ( Handle handle ) = 0 |
virtual QUuid | id () = 0 |
virtual Handle | item ( Handle parent, const QString & subPath ) = 0 |
virtual QValueSpace::LayerOptions | layerOptions () const = 0 |
virtual QString | name () = 0 |
virtual bool | notifyInterest ( Handle handle, bool interested ) = 0 |
virtual unsigned int | order () = 0 |
virtual void | removeHandle ( Handle handle ) = 0 |
virtual bool | removeSubTree ( QValueSpacePublisher * creator, Handle handle ) = 0 |
virtual bool | removeValue ( QValueSpacePublisher * creator, Handle handle, const QString & subPath ) = 0 |
virtual void | removeWatches ( QValueSpacePublisher * creator, Handle parent ) = 0 |
virtual void | setProperty ( Handle handle, Properties property ) = 0 |
virtual bool | setValue ( QValueSpacePublisher * creator, Handle handle, const QString & subPath, const QVariant & value ) = 0 |
virtual bool | startup ( Type type ) = 0 |
virtual bool | supportsInterestNotification () const = 0 |
virtual void | sync () = 0 |
virtual bool | value ( Handle handle, QVariant * data ) = 0 |
virtual bool | value ( Handle handle, const QString & subPath, QVariant * data ) = 0 |
void | handleChanged ( quintptr handle ) |
void | emitInterestChanged ( QValueSpacePublisher * publisher, const QString & path, bool interested ) |
QVALUESPACE_AUTO_INSTALL_LAYER ( className ) |
The QAbstractValueSpaceLayer class provides support for adding new logical data layers to the Qt Value Space.
To create a new layer in the Value Space subclass this class and reimplement all of the virtual functions. The new layer is installed by either calling QValueSpace::installLayer() or by adding the QVALUESPACE_AUTO_INSTALL_LAYER() macro in your implementation file.
The Handle type is an opaque, pointer sized contextual handle used to represent paths within Value Space layers. Handles are only ever created by QAbstractValueSpaceLayer::item() and are always released by calls to QAbstractValueSpaceLayer::removeHandle(). The special value, InvalidHandle is reserved to represent an invalid handle.
To allow for efficient layer implementations, expensive handle operations, currently only monitoring for changes, are enabled and disabled as needed on a per-handle basis. The Properties enumeration is a bitmask representing the different properties that can exist on a handle.
Constant | Value | Description |
---|---|---|
QAbstractValueSpaceLayer::Publish | 0x00000001 | Enable change notification for the handle. When set, the layer should emit QAbstractValueSpaceLayer::handleChanged() signals when appropriate for the handle. |
Value Space layers are initialized in either a "Server" or a "Client" context. There is only a single server in the Value Space architecture, and its layers are always initialized before any clients. This distinction allows layers to implement Client/Server architecture if required. If not, layers are free to treat Server and Client contexts identically.
Constant | Value | Description |
---|---|---|
QAbstractValueSpaceLayer::Server | 0 | The layer is being initialized in the "server" context. |
QAbstractValueSpaceLayer::Client | 1 | The layer is being initialized in the "client" context. |
Registers creator for change notifications to values under handle.
See also removeWatches().
Returns the set of children of handle. For example, in a layer providing the following items:
/Device/Configuration/Applications/FocusedApplication /Device/Configuration/Buttons/PrimaryInput /Device/Configuration/Name
a request for children of "/Device/Configuration" will return { "Applications", "Buttons", "Name" }.
Emits the QValueSpacePublisher::interestChanged() signal on publisher with path and interested.
Emitted whenever the handle's value, or any sub value, changes.
Returns a globally unique identifier for the layer. This id is used to break ordering ties.
Returns a new opaque handle for the requested subPath of parent. If parent is an InvalidHandle, subPath is interpreted as an absolute path.
The caller should call removeHandle() to free resources used by the handle when it is no longer required.
Returns the QValueSpace::LayerOptions describing this layer.
See also QValueSpace::LayerOption.
Returns the name of the Value Space layer. This name is only used for diagnostics purposes.
Registers or unregisters that the caller is interested in handle and any subpaths under it. If interested is true interest in handle is registered; otherwise it is unregistered.
The caller should ensure that all calls to this function with interested set to true have a matching call with interested set to false.
Returns true if the notification was successfully sent; otherwise returns false.
Return the position in the Value Space layer stack that this layer should reside. Higher numbers mean the layer has a higher precedence and its values will "shadow" those below it. If two layers specify the same ordering, the id() value is used to break the tie.
Releases a handle previously returned from QAbstractValueSpaceLayer::item().
Process calls to QValueSpacePublisher::~QValueSpacePublisher() by removing the entire sub tree created by creator under handle.
Returns true on success; otherwise returns false.
Process calls to QValueSpacePublisher::resetValue() by removing the Value Space item identified by handle and subPath and created by creator.
Returns true on success; otherwise returns false.
Removes all registered change notifications for creator under parent.
See also addWatch().
Apply the specified property mask to handle.
Process calls to QValueSpacePublisher::setValue() by setting the value specified by the subPath under handle to value. Ownership of the Value Space item is assigned to creator.
Returns true on success; otherwise returns false.
See also value().
Called by the Value Space system to initialize each layer. The type parameter will be set accordingly, and layer implementors can use this to implement a client/server architecture if desired.
Returns true upon success; otherwise returns false.
Returns true if the layer supports interest notifications; otherwise returns false.
Flushes all pending changes made by calls to setValue(), removeValue() and removeSubTree().
Returns the value for a particular handle. If a value is available, the layer will set data and return true. If no value is available, false is returned.
See also setValue().
Returns the value for a particular subPath of handle. If a value is available, the layer will set data and return true. If no value is available, false is returned.
This macro installs new Value Space layer. className is the name of the class implementing the new layer.
The method className *className::instance() must exist and return a pointer to an instance of the layer to install. This method will only be invoked after QApplication has been constructed, making it safe to use any Qt class in your layer's constructor.
This macro can only be used once for any given class and it should be used where the implementation is written rather than in a header file.
Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) | Trademarks | Qt Mobility Project 1.0.0 |