The model of the subsystem in Figure 28 shows components provided by the default persistent storage environment. The example presented here adds a sorted disk dictionary class and a sequential index class to the subsystem, as shown in Figure 30. The right side of the figure shows a new disk dictionary class. TSortedDiskDictionary, which uses the new indexing class, TSequentialIndex. TSequentialIndex uses the existing record manager to write the values out to disk.
New functionality added by TSequentialIndex includes searching, sorting, and indexing based on keys of an imaginary class, TOrderableCollectibleLong.
The original TDiskDictionary uses an index manager to implement its indexing technology and an instance of TRecordManager for managing values. The new TSortedDiskDictionary class uses a sequential index manager and the same record manager (TRecordManager) for managing values.
A TSortedDiskDictionary is used for the storage of orderable instances on the disk. It works like a TDiskDictionary. You can have arbitrary ordered keys and arbitrary values. Keys must be MOrderableCollectibles. Key instances that are placed in disk dictionaries need to override the IsEqual, IsLessThan, IsGreaterThan, and the Hash member functions. Value instances must be MCollectibles and must override the Hash member functions inherited from MCollectible. Be aware that you must write the TSequentialIndex manager yourself. TSequentialIndex associates the key with a record handle.