Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Essential Tools Module User's Guide

7.2 Generic Collection Classes

Generic collection classes are called generic because they use the macros defined in <generic.h>, an early approximation to parameterized types first described in Stroustrup (1986, p. 209). Generic collection classes are less manageable than true templates, but they are portable to any C++ compiler. You can use them even with older compilers. Generic macros are easy to use, but they are difficult to write. They are also difficult to debug because they are preprocessor macros, and most debuggers cannot enter macro code.

Most of the generic collection classes use reference-based semantics; that is, they store and retrieve pointers to other objects, as described in Section 6.3. With these classes, as with all Rogue Wave collection classes, you are responsible for the allocation and deallocation of the objects themselves.

Three vector-based generic collections use value-based semantics: RWGVector(val), RWGOrderedVector(val), and RWGSortedVector(val). These classes store the type itself, which could be a pointer to an object.

The storage and retrieval methods and criteria differ from class to class.



Previous fileTop of DocumentContentsIndex pageNext file

©2004 Copyright Quovadx, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.