SALOME - SMESH
NCollection_BaseCollection< TheItemType > Class Template Referenceabstract

Purpose: NCollection_BaseCollection is the base abstract class for all collection templates of this package. More...

#include <NCollection_BaseCollection.hxx>

Data Structures

class  Iterator
 

Public Member Functions

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

Protected Member Functions

const Handle (NCollection_BaseAllocator) &IterAllocator(void) const
 
void exchangeAllocators (NCollection_BaseCollection &theOther)
 Exchange allocators of two collections. More...
 
 Handle (NCollection_BaseAllocator) myAllocator
 

Private Member Functions

 Handle (NCollection_BaseAllocator) myIterAllocator
 

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.

Definition at line 44 of file NCollection_BaseCollection.hxx.

Constructor & Destructor Documentation

◆ NCollection_BaseCollection()

template<class TheItemType >
NCollection_BaseCollection< TheItemType >::NCollection_BaseCollection ( const Handle(NCollection_BaseAllocator)&  theAllocator = 0L)

Common for all collections constructor takes care of theAllocator.

Definition at line 79 of file NCollection_BaseCollection.hxx.

◆ ~NCollection_BaseCollection()

template<class TheItemType >
virtual NCollection_BaseCollection< TheItemType >::~NCollection_BaseCollection ( void  )
virtual

Destructor - must be implemented to release the memory.

Definition at line 98 of file NCollection_BaseCollection.hxx.

Member Function Documentation

◆ Size()

template<class TheItemType >
virtual Standard_Integer NCollection_BaseCollection< TheItemType >::Size ( void  ) const
pure virtual

Number of items.

◆ Assign()

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

Virtual assignment.

◆ CreateIterator()

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

Method to create iterators for base collections.

◆ Handle() [1/4]

template<class TheItemType >
const NCollection_BaseCollection< TheItemType >::Handle ( NCollection_BaseAllocator  ) const &

Returns attached allocator.

Definition at line 101 of file NCollection_BaseCollection.hxx.

◆ Handle() [2/4]

template<class TheItemType >
const NCollection_BaseCollection< TheItemType >::Handle ( NCollection_BaseAllocator  ) const &
protected

Definition at line 105 of file NCollection_BaseCollection.hxx.

◆ exchangeAllocators()

template<class TheItemType >
void NCollection_BaseCollection< TheItemType >::exchangeAllocators ( NCollection_BaseCollection< TheItemType > &  theOther)
protected

Exchange allocators of two collections.

Definition at line 114 of file NCollection_BaseCollection.hxx.

◆ Handle() [3/4]

template<class TheItemType >
NCollection_BaseCollection< TheItemType >::Handle ( NCollection_BaseAllocator  )
protected

◆ Handle() [4/4]

template<class TheItemType >
NCollection_BaseCollection< TheItemType >::Handle ( NCollection_BaseAllocator  )
private