Rogue Wave Views
Data Access Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Static Public Member Functions
IliRepository Class Reference

User interface class. More...

#include <ilviews/dataccess/reposit.h>

Static Public Member Functions

static IliDataSourceFindDataSource (const char *name, IlvGraphicHolder *holder)
 Attempts to find a registered data source. More...
 
static IliDataSourceGetDataSource (IlInt index)
 Returns a registered data source. More...
 
static IlInt GetDataSourcesCount ()
 Returns the number of data sources that are currently registered. More...
 
static IlvSymbolGetScopeClass (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...
 

Detailed Description

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.

See also
IliDataSource, IliDataSourceCallback

Accessors

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:

Method 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:

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:

Member Function Documentation

static IliDataSource* IliRepository::FindDataSource ( const char *  name,
IlvGraphicHolder holder 
)
static

Attempts to find a registered data source.

Attempts to find a registered data source according to the following rules:

  • Same Holder: If a data source named name exists in the given holder, this data source is returned. The data-source scope can be local or global.
  • Same Scope Class: If the holder belongs to an 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.
  • Same Container Hierarchy: If the holder is contained in another holder or if the holder itself contains other holders, all holders related directly or indirectly to the holder by the containment relation are considered. (For example, this situation occurs when you use an 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.
  • Global Scope: If a global data source named name exists, this data source is returned. The data-source scope must be global. If more than one data source matches, one is picked at random and is returned.
  • If none of the previous conditions are met, the FindDataSource() static member function returns 0.
Parameters
nameThe data source name.
holderThe holder.
Returns
The data source.
static IliDataSource* IliRepository::GetDataSource ( IlInt  index)
static

Returns a registered data source.

Parameters
indexThe data source index.
Returns
The data source, or 0 if the index is out of bounds.
static IlInt IliRepository::GetDataSourcesCount ( )
static

Returns the number of data sources that are currently registered.

Returns
The count.
static IlvSymbol* IliRepository::GetScopeClass ( IlvContainer cont)
static

Returns the scope class assigned to the container.

Initially, the scope class of a container is 0.

Parameters
contThe container.
Returns
The scope class.
static IlBoolean IliRepository::IsBadLicense ( )
static

Returns IlTrue if the license is invalid.

Returns
IlTrue if the license is invalid.
static void IliRepository::SetScopeClass ( IlvContainer cont,
IlvSymbol scopeClass 
)
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.

Parameters
contThe container.
scopeClassThe scope class, if 0, the container is cleared from the previously set scope class.
static void IliRepository::SubscribeToDataSource ( const char *  dataSourceName,
IliDataSourceCallback  cb,
IlvGraphic subscriber,
IlAny  userData 
)
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:

cb(dataSource, subscriber, userData);

If the data source later goes out of scope, the callback function is be called again with the following parameters:

cb(0, subscriber, userData);
Parameters
dataSourceNameThe data source name.
cbThe callback.
subscriberThe graphic object which subscribes.
userDataThe user data.
static void IliRepository::UnSubscribeToDataSource ( const char *  dataSourceName,
IliDataSourceCallback  cb,
IlvGraphic subscriber,
IlAny  userData 
)
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:

cb(0, subscriber, userData);
Parameters
dataSourceNameThe data source name.
cbThe callback.
subscriberThe graphic object which subscribes.
userDataThe user data.

© Copyright 2016, 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.