Rogue Wave Views Data Access Package API Reference Guide |
Rogue Wave Views Documentation Home |
User interface class. More...
#include <ilviews/dataccess/reposit.h>
Static Public Member Functions | |
static IliDataSource * | FindDataSource (const char *name, IlvGraphicHolder *holder) |
Attempts to find a registered data source. More... | |
static IliDataSource * | GetDataSource (IlInt index) |
Returns a registered data source. More... | |
static IlInt | GetDataSourcesCount () |
Returns the number of data sources that are currently registered. More... | |
static IlvSymbol * | GetScopeClass (IlvContainer *cont) |
Returns the scope class assigned to the container. More... | |
static IlBoolean | IsBadLicense () |
Returns IlTrue if the license is invalid. More... | |
static void | SetScopeClass (IlvContainer *cont, IlvSymbol *scopeClass) |
Sets the scope class of one container. More... | |
static void | SubscribeToDataSource (const char *dataSourceName, IliDataSourceCallback cb, IlvGraphic *subscriber, IlAny userData) |
Subscribes the graphic object to a data source. More... | |
static void | UnSubscribeToDataSource (const char *dataSourceName, IliDataSourceCallback cb, IlvGraphic *subscriber, IlAny userData) |
Unsubscribes the graphic object from a data source. More... | |
User interface class.
Library: dataccess
The repository keeps track of all available data-sources. It can be used to find a data-source given its name or to enumerate all data-sources. For a more advanced usage, it can be used to subscribe a graphic object to a data-source. This may be useful when designing new graphic classes that need to be data-source aware.
About subscription A graphic object can subscribe itself to a data source name so that when a data source with that name becomes available, the graphic object will be notified. Similarly, if or when the data source is no longer available the graphic object will also be notified.
Accessors provide a scriptable and uniform way to inspect and modify an object by using its base class methods IlvValueInterface::queryValue()
, IlvValueInterface::queryValues()
, IlvValueInterface::changeValue()
, IlvValueInterface::changeValues()
. This class defines the following accessors:
Name | Return type | Equivalent methods |
---|---|---|
getDataSource(String name, Object near) | IliDataSource | FindDataSource(name, holder) . See [getDataSource] below. |
getDataSourceAt(Int index) | IliDataSource | GetDataSource(index) |
getScopeClass(IlvContainer container) | String | GetScopeClass(container) |
setScopeClass(IlvContainer container, String scopeClass) | Void | SetScopeClass(container, scopeClass) |
[getDataSource] The near parameter can be:
IlvContainer
): A data source within the scope of the container is searched for. IlvGraphic
): A data source within the scope of the holder (container or manager) in which this graphic object is located is searched for. null:
A global data source located in any container or manager is searched for. Note that following Rogue Wave Views terminology, the holder of a graphic object designates the container or manager in which the graphic object is located.
The data source is searched for according to the following rules:
IliRepository.setScopeClass()
function). If a data-source named name exists in any of these containers, this data source is returned. The scope of the data source can be local or global. If more than one data source matches, one is picked at random and returned. IlvNotebook
gadget: each notebook page contains a container), all containers and managers related directly or indirectly to the holder via the containment relation are considered. If a data source named name exists in any of of the holders, the data source is returned. The scope of the data source can be local or global. If more than one data source matches, one is picked at random and returned. IliRepository.getDataSource()
returns null
.
|
static |
Attempts to find a registered data source.
Attempts to find a registered data source according to the following rules:
IlvContainer
and the container has been assigned a scope class (see the setScopeClass()
static member function), all containers with the same scope class are considered. If a data source named name exists in any of the containers, this data source is returned. The data-source scope can be local or global. If more than one data source matches, one is picked at random and is returned. IlvNotebook
gadget. Each notebook page contains a container.) If a data source named name exists in any of these containers, this data source is returned. The data-source scope can be local or global. If more than one data source matches, one is picked at random and is returned. FindDataSource()
static member function returns 0
. name | The data source name. |
holder | The holder. |
|
static |
Returns a registered data source.
index | The data source index. |
0
if the index is out of bounds.
|
static |
Returns the number of data sources that are currently registered.
|
static |
Returns the scope class assigned to the container.
Initially, the scope class of a container is 0
.
cont | The container. |
|
static |
Returns IlTrue
if the license is invalid.
IlTrue
if the license is invalid.
|
static |
Sets the scope class of one container.
This static member function should be called before any gadgets are added to the container or else the repository subscription mechanism may not function properly.
cont | The container. |
scopeClass | The scope class, if 0 , the container is cleared from the previously set scope class. |
|
static |
Subscribes the graphic object to a data source.
When such a data source becomes available, the callback function is be invoked with the following parameters:
If the data source later goes out of scope, the callback function is be called again with the following parameters:
dataSourceName | The data source name. |
cb | The callback. |
subscriber | The graphic object which subscribes. |
userData | The user data. |
|
static |
Unsubscribes the graphic object from a data source.
The cb and userData parameters must match those that were given at subscription time. Note that if the subscriber has previously been notified of the presence of the data source then this member function makes the following call:
dataSourceName | The data source name. |
cb | The callback. |
subscriber | The graphic object which subscribes. |
userData | The user data. |
© Copyright 2018, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.