Overview

The NCollection unit meets the requirements of Open Cascade community and all end users who do not use WOK development environment in their projects. Though it is quite natural to develop a code based on Open Cascade in any environment accepted in industry, there is still one limitation: the so-called Open Cascade generic classes provided in TCollection package require compilation of the definitions in the CDL language and therefore can only be instantiated in WOK development environment.

The directory NCollection provides a full replacement of all TCollection generic classes and some new classes so that any Open Cascade collection could be instantiated via C++ template or macro definitions. It can be used in WOK as nocdlpack development unit, or in any other configuration, since it only uses the standard capabilities of C++ compiler

Macro definitions of these classes are stored in NCollection_Define*.hxx files. These definitions are now obsolete though still can be used, particularly for compatibility with the existing code. On the contrary, template classes in NCollection_*.hxx files are recommended, they are supported by Open CASCADE Company and further developed according to various needs.

The technology used in this unit continues and complements the one offered in the header file Standard_DefineHandle – allowing to implement outside CDL the classes managed by Handle, also providing Open Cascade RTTI support.

There are 13 parameterised templates in the files NCollection_Define*.hxx defining the corresponding collection classes:

Array1

Array2

Vector

SparseArray

Stack

Queue

List

SList

Sequence

Set

Map

DataMap

DoubleMap

IndexedMap

IndexedDataMap

CellFilter

UBTree

and also 4 macro definitions of classes managed by Handle (corresponding to similar TCollection generic classes), in separate NCollection_Define*.hxx files:

HArray1

HArray2

HSequence

HSet

HUBTree (defined in NCollection_UBTree.hxx)

See Also

Instantiation of collection classes

Here we show how to use in the user code the definitions from NCollection, taking as example sequence of point (analogue of TColgp_SequenceOfPnt).

Definition of a new collection class

Definition of a new collection class managed by Handle

Class architecture (public API)

Interface to classes defined in CDL

New features

NCollection defines some new features, in addition to the public API inherited from TCollection classes. The general improvements are described below; there may be other (particular) ones documented in the corresponding .hxx files.

Iterators

Class BaseCollection

Heterogeneous Assign

Allocator

New Collection Types