# FoundationClasses
TKernel
NCollection

# FoundationClasses
TKernel
NCollection

# FoundationClasses
TKernel
NCollection

# NCollection_BaseCollection< TheItemType > Class Template Reference

`#include <NCollection_BaseCollection.hxx>`

Inheritance diagram for NCollection_BaseCollection< TheItemType >:

[legend]

## Public Member Functions

| NCollection_BaseCollection (const Handle(NCollection_BaseAllocator)&theAllocator=0L)
| Common for all collections constructor takes care of theAllocator.
virtual Standard_Integer | Size (void) const =0
| Number of items.
virtual void | Assign (const NCollection_BaseCollection &theOther)=0
| Virtual assignment.
virtual Iterator & | CreateIterator (void) const =0
| Method to create iterators for base collections.
virtual | ~NCollection_BaseCollection (void)
| Destructor - must be implemented to release the memory.

## Protected Member Functions

const | Handle (NCollection_BaseAllocator)&IterAllocator(void) const
| Handle (NCollection_BaseAllocator) myAllocator

## Private Member Functions

| Handle (NCollection_BaseAllocator) myIterAllocator

## Data Structures

class | Iterator

## Detailed Description

### template<class TheItemType>
class NCollection_BaseCollection< TheItemType >

Purpose: NCollection_BaseCollection is the base abstract class for all collection templates of this package. The set of collections is similar to that of TCollection. Also the methods of classes have mostly the same names for easy switch from TCollection <-> NCollection containers.

NCollection is a nocdlpack, thus it is compiled without WOK. BaseCollection allows assigning the collections of different kinds (the items type being the same) with a few obvious exclusions - one can not assign any collection to the map having double data (two keys or a key plus value). Only the maps of the very same type may be assigned through operator= Said maps are: DoubleMap, DataMap, IndexedDataMap

For the users needing control over the memory usage the allocators were added (see NCollection_BaseAllocator header) Others may forget it - BaseAllocator is used by default and then memory is managed through Standard::Allocate/::Free.

## Constructor & Destructor Documentation

template<class TheItemType>
NCollection_BaseCollection< TheItemType >::NCollection_BaseCollection | ( | const Handle(NCollection_BaseAllocator)& | theAllocator = `0L` | ) | `[inline]`

template<class TheItemType>
virtual NCollection_BaseCollection< TheItemType >::~NCollection_BaseCollection | ( | void |  | ) | `[inline, virtual]`

## Member Function Documentation

template<class TheItemType>
virtual void NCollection_BaseCollection< TheItemType >::Assign | ( | const NCollection_BaseCollection< TheItemType > & | theOther | ) | `[pure virtual]`

template<class TheItemType>
virtual Iterator& NCollection_BaseCollection< TheItemType >::CreateIterator | ( | void |  | ) | const`[pure virtual]`

Implemented in NCollection_Array1< TheItemType >, NCollection_Array2< TheItemType >, NCollection_DataMap< TheKeyType, TheItemType >, NCollection_DoubleMap< TheKey1Type, TheKey2Type >, NCollection_IndexedDataMap< TheKeyType, TheItemType >, NCollection_IndexedMap< TheKeyType >, NCollection_List< TheItemType >, NCollection_Map< TheKeyType >, NCollection_Queue< TheItemType >, NCollection_Sequence< TheItemType >, NCollection_Set< TheItemType >, NCollection_SList< TheItemType >, NCollection_Stack< TheItemType >, NCollection_Vector< TheItemType >, NCollection_DataMap< TheObjType, TreeNode * >, NCollection_Map< Cell >, NCollection_Vector< ObjBnd >, NCollection_Vector< Poly_CoherentLink >, NCollection_Vector< Poly_CoherentNode >, and NCollection_Vector< Poly_CoherentTriangle >.

template<class TheItemType>
NCollection_BaseCollection< TheItemType >::Handle | ( | NCollection_BaseAllocator |  | ) | `[private]`

template<class TheItemType>
NCollection_BaseCollection< TheItemType >::Handle | ( | NCollection_BaseAllocator |  | ) | `[protected]`

template<class TheItemType>
const NCollection_BaseCollection< TheItemType >::Handle | ( | NCollection_BaseAllocator |  | ) | const`[inline, protected]`

template<class TheItemType>
virtual Standard_Integer NCollection_BaseCollection< TheItemType >::Size | ( | void |  | ) | const`[pure virtual]`

Implemented in NCollection_Array1< TheItemType >, NCollection_Array2< TheItemType >, NCollection_DataMap< TheKeyType, TheItemType >, NCollection_DoubleMap< TheKey1Type, TheKey2Type >, NCollection_IndexedDataMap< TheKeyType, TheItemType >, NCollection_IndexedMap< TheKeyType >, NCollection_List< TheItemType >, NCollection_Map< TheKeyType >, NCollection_Queue< TheItemType >, NCollection_Sequence< TheItemType >, NCollection_Set< TheItemType >, NCollection_SList< TheItemType >, NCollection_Stack< TheItemType >, NCollection_Vector< TheItemType >, NCollection_DataMap< TheObjType, TreeNode * >, NCollection_Map< Cell >, NCollection_Vector< ObjBnd >, NCollection_Vector< Poly_CoherentLink >, NCollection_Vector< Poly_CoherentNode >, and NCollection_Vector< Poly_CoherentTriangle >.

The documentation for this class was generated from the following file:

- NCollection_BaseCollection.hxx