Purpose:
A federated collection allows an application program to process data objects resulting from a query as a group or collection and at the same time preserves the sub-grouping relationships that exists between them. It provides the user with a mechanism to:
A federated collection is a collection of DKAny containing DKResults objects, it is created to hold the results of DKFederatedQuery, which may come from several heterogeneous datastores. Each DKResults contains the results of subquery of the federated query submitted to a specific native datastore associated with the federated datastore.
To iterate over federated collection members (which are DKResults objects), create and use dkIterator or DKSequentialIterator to pull each DKResults object. Then, create another dkIterator on this DKResults to iterate over it and to process the result according to its datastore origin. Alternatively, create a federated iterator, DKFederatedIterator, and use it to iterate over all element members across collection boundaries, regardless of which datastore the result came from.
In theory, a federated collection can contains other nested collections up to any arbitrary depth. In the current implementation, a federated collection is not queryable.
Class summary:
class DKFederatedCollection : public DKSequentialCollection { DKFederatedCollection(); virtual ~DKFederatedCollection(); virtual unsigned long cardinality(); virtual unsigned long memberCardinality(); virtual dkIterator* createIterator(); virtual dkIterator* createMemberIterator(); virtual DKAny& retrieveElementAt(dkIterator& where); virtual void addElement(const DKAny& element); virtual void addAllElements(dkCollection& elements); virtual void insertElementAt(const DKAny& element, dkIterator& where); virtual void replaceElementAt(const DKAny& element, dkIterator& where); virtual void removeElementAt(dkIterator& where); virtual void removeAllElements(); };
Members:
virtual unsigned long cardinality();
virtual unsigned long memberCardinality();
virtual dkIterator* createIterator();
virtual dkIterator* createMemberIterator();
(c) Copyright International Business Machines Corporation 1996, 2003. IBM Corp. All rights reserved.