Contents Functions Classes Topics User Forum CVS

G3D::Set< T > Class Template Reference

#include <Set.h>

List of all members.

Public Member Functions

virtual ~Set ()
int size () const
bool contains (const T &member) const
void insert (const T &member)
void remove (const T &member)
Array< T > getMembers () const
void getMembers (Array< T > &keyArray) const
void clear ()
void deleteAll ()
Iterator begin () const
const Iterator end () const

Classes

class  Iterator


Detailed Description

template<class T>
class G3D::Set< T >

An unordered data structure that has at most one of each element. Provides O(1) time insert, remove, and member test (contains).

Set uses G3D::Table internally, which means that the template type T must define a hashCode and operator== function. See G3D::Table for a discussion of these functions.


Constructor & Destructor Documentation

template<class T>
virtual G3D::Set< T >::~Set  )  [inline, virtual]
 


Member Function Documentation

template<class T>
Iterator G3D::Set< T >::begin  )  const [inline]
 

C++ STL style iterator method. Returns the first member. Use preincrement (++entry) to get to the next element. Do not modify the set while iterating.

template<class T>
void G3D::Set< T >::clear  )  [inline]
 

template<class T>
bool G3D::Set< T >::contains const T &  member  )  const [inline]
 

template<class T>
void G3D::Set< T >::deleteAll  )  [inline]
 

template<class T>
const Iterator G3D::Set< T >::end  )  const [inline]
 

C++ STL style iterator method. Returns one after the last iterator element.

template<class T>
void G3D::Set< T >::getMembers Array< T > &  keyArray  )  const [inline]
 

template<class T>
Array<T> G3D::Set< T >::getMembers  )  const [inline]
 

template<class T>
void G3D::Set< T >::insert const T &  member  )  [inline]
 

Inserts into the table if not already present.

template<class T>
void G3D::Set< T >::remove const T &  member  )  [inline]
 

It is an error to remove members that are not already present.

template<class T>
int G3D::Set< T >::size  )  const [inline]
 


The documentation for this class was generated from the following file:
Generated on Mon Jul 17 11:50:47 2006 for G3D by doxygen 1.4.5
Hosted by SourceForge.net Logo