Backward-Compatible Items

The following are items of former releases that are compatible with the new release:

Reference Classes

Within the new release, reference classes are no longer necessary for polymorphic use of the collections. The concrete collection classes are now directly derived from the abstract class hierarchy. A linkage of abstract and concrete classes through reference classes is therefore superfluous. Nevertheless you can continue using the reference class syntax in existing programs.

IIterator and IConstantIterator

The classes IIterator and IConstantIterator are now called IApplicator and IConstantApplicator. The new names express more precisely what the purpose of objects from these classes is: They do not iterate over a collection themselves but they provide a function that is applied to the elements of a collection during iteration with allElementsDo.

The classes IIterator and IConstantIterator are still available but not recommended.

The forCursor macro

Instead of the forCursor macro the forICursor macro is introduced. The forCursor macro is still available but - as with the Iterator classes - you should prefer using the new version.

IECOps

Up to now all implementation variants of the collections bag, set, sorted bag and sorted set used the element operation class IECOps. In the new release, these collections require only class ICOps which is a subset of IECOps. That means, in the new release class IECOps is no longer needed, yet it is still available.

Naming Conventions

New names have been introduced for the implementation variants as well as for the corresponding header files. The old names can still be used in existing programs. Consider the key set as example:

Old Names New Names
IKeySet ikeyset.h IKeySet iks.h
    IKeySetAsAvlTree iksavl.h
IKeySetOnBSTKeySortedSet iksbst.h IKeySetAsBstTree iksbst.h
IHashKeySet ihshks.h IKeySetAsHshTable ikshsh.h
IKeySetOnSortedLinkedSequence ikssls.h IKeySetAsList ikslst.h
IKeySetOnSortedTabularSequence ikssts.h IKeySetAsTable ikstab.h
IKeySetOnSortedDilutedSequence ikssds.h IKeySetAsDilTable iksdil.h

Incompatibilities

The following items are not compatible with the new collection class library release:

New class hierarchy

The abstract hierarchy makes use of virtual inheritance. When you subclass from a Collection Class and implement your own copy constructor, you must initialize the virtual base class IACollection<Element> in your derived classes.

The newCursor method

Different from previous releases, the return type of the newCursor method is now for any collection a pointer to the abstract cursor class ICursor (ICursor*).

Deriving from Reference Classes

You can still derive from reference classes without overriding existing collection class member functions. Yet, you can no longer override existing collection class functions and use your derived collection class in a polymorphic way without additional effort.



Introduction to the Collection Classes
Collection Class Hierarchy
Overall Implementation Structure
Element Functions and Key-Type Functions
Collection Class Polymorphism
Collection Characteristics
Overview of Iteration
Iteration with Cursors
Iteration with allElementsDo
Flat Collections
Trees


Defining Equality Relation
Defining Key or Element Equality
Defining an Operations Class
Implementing Element- and Key-Type Functionality
Defining Member Functions of the Element Object Type
Defining Separate Global Functions
Using or Defining an Element Operation Class
Things to Watch Out For
Class Template Naming Conventions
Possible Implementation Paths
Choosing One of the Provided Implementation Variants
Taking Advantage of the Abstract Class Hierarchy
Using Cursors to Locate and Access Elements
Using Cursors to Iterate Over a Collection
Using allElementsDo and Applicators to Iterate Over a Collection
Cursors vs. Exception Handling