Contents User Forum Source Index APIs by Task APIs by Level Data


G3D::Set< T > Class Template Reference

An unordered data structure that has at most one of each element. More...

#include <Set.h>

List of all members.

Public Member Functions

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

Classes

class  Iterator
 C++ STL style iterator variable. More...


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 Thu Aug 2 11:40:47 2007 for G3D by doxygen 1.5.2
Hosted by SourceForge.net Logo