TDiskSet class

The member functions for TDiskSet and TDiskSetIterator are shown in Figure 27. Use TDiskSet to store simple objects that are not key-value pairs. You can put objects that are instances of any MCollectible subclass into a disk-based set and retrieve these objects later during a different invocation of your program or task. You must define both the IsEqual and Hash member functions for subclasses of MCollectible placed in sets. IsEqual and Hash determine how set elements are compared for equality.

Operations you can perform on sets include: adding objects, retrieving objects, searching a set to see if objects are members, and counting the number of objects in the set.

Use an instance of TDiskSetIterator to step through each object stored in a TDiskSet. Like TDiskDictionaryIterator, this iterator is different from the other iterators in collection classes. Clients of TDiskDictionaryIterator are responsible for deleting items returned by the iterator. Instantiate an iterator by providing a TDiskSet instance in the constructor.



[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker