Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

Collection Class Template Reference

Base template class for all collection types (Stack, List, etc.). More...

#include <collection.h>

Inheritance diagram for Collection:

HashTable List Queue Stack List of all members.

Public Methods

 Collection (void)
 A constructor. More...

virtual void clear (void)=0
 Clear contents of the collection. More...

virtual size_t count (void)
 Return the number of items in the collection. More...

virtual bool isEmpty (void)
 Test whether the collection is empty. More...

virtual void setAutoDelete (bool ad)
 Set auto delete flag. More...


Protected Methods

virtual void init_ (void)
 Initialization of the collection.


Protected Attributes

size_t cnt_
 Number of items in the collection.

bool autoDelete_
 Auto deletion flag.


Detailed Description

template<class T_>
class Collection< T_ >

Base template class for all collection types (Stack, List, etc.).

Inherit this class whenever you intend to create a new collection type.

Definition at line 36 of file collection.h.


Constructor & Destructor Documentation

template<class T_>
Collection< T_ >::Collection void    [inline]
 

A constructor.

Calls init_()

Definition at line 44 of file collection.h.


Member Function Documentation

template<class T_>
virtual void Collection< T_ >::clear void    [pure virtual]
 

Clear contents of the collection.

Behaviour is dependend on auto deletion flag. If auto deletion is enabled, the memory occupied by the items in the collection will be freed; otherwise it will be preserved.

See also:
setAudoDelete()

Implemented in HashTable.

template<class T_>
virtual size_t Collection< T_ >::count void    [inline, virtual]
 

Return the number of items in the collection.

Returns:
Number of items.

Definition at line 60 of file collection.h.

template<class T_>
virtual bool Collection< T_ >::isEmpty void    [inline, virtual]
 

Test whether the collection is empty.

Return values:
true  Collection is empty.
false  Collection isn't empty.

Definition at line 68 of file collection.h.

Referenced by ElementModelEntropyCalculator::calculate, and main.

template<class T_>
virtual void Collection< T_ >::setAutoDelete bool    ad [inline, virtual]
 

Set auto delete flag.

If auto deletion is enabled, the memory occupied by the items in the collection will be freed when they are removed from the collection; otherwise they will be preserved.

Auto deletion is implicitly disabled.

Parameters:
ad  Turn on/off auto deletion (true/false).

Reimplemented in HashTable.

Definition at line 79 of file collection.h.

Referenced by ElementModelEntropyCalculator::calculate.


The documentation for this class was generated from the following file:
Generated on Wed Feb 5 10:43:04 2003 for Exalt by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002