Open
Graph Drawing
Framework

 v.2007.11
 

ogdf::HashArray2D< I1_, I2_, E_, Hash1_, Hash2_ > Class Template Reference

Indexed 2-dimensional arrays using hashing for element access. More...

#include <HashArray2D.h>

Inheritance diagram for ogdf::HashArray2D< I1_, I2_, E_, Hash1_, Hash2_ >:

ogdf::Hashing< K, I, H >

List of all members.

Public Types

typedef HashConstIterator2D
< I1_, I2_, E_, Hash1_, Hash2_ > 
const_terator
 The type of const-iterators for 2D-hash arrays.

Public Member Functions

 HashArray2D ()
 Creates a 2D-hash array.
 HashArray2D (const E_ &defaultValue, const Hash1_ &hashFunc1=Hash1_(), const Hash2_ &hashFunc2=Hash2_())
 Creates a 2D-hash array and sets the default value to x.
 HashArray2D (const HashArray2D< I1_, I2_, E_, Hash1_, Hash2_ > &A)
 Copy constructor.
HashArray2Doperator= (const HashArray2D< I1_, I2_, E_, Hash1_, Hash2_ > &A)
 Assignment operator.
 ~HashArray2D ()
const E_ & operator() (const I1_ &i, const I2_ &j) const
 Returns a const reference to entry (i,j).
E_ & operator() (const I1_ &i, const I2_ &j)
 Returns a reference to entry (i,j).
bool isDefined (const I1_ &i, const I2_ &j) const
 Returns true iff entry (i,j) is defined.
void undefine (const I1_ &i, const I2_ &j)
 Undefines the entry at index (i,j).
HashConstIterator2D< I1_, I2_,
E_, Hash1_, Hash2_ > 
begin () const
 Returns an iterator pointing to the first element.
int size () const
 Returns the number of defined elements in the table.
int empty () const
 Returns if any indices are defined.
void clear ()
 Undefines all indices.

Private Attributes

E_ m_defaultValue
 The default value of the array.


Detailed Description

template<class I1_, class I2_, class E_, class Hash1_ = DefHashFunc<I1_>, class Hash2_ = DefHashFunc<I2_>>
class ogdf::HashArray2D< I1_, I2_, E_, Hash1_, Hash2_ >

Indexed 2-dimensional arrays using hashing for element access.

A 2D-hash array can be used like a usual 2-dimensional array but with a general index type. The class uses five template parameters:

Definition at line 86 of file HashArray2D.h.


Member Typedef Documentation

template<class I1_, class I2_, class E_, class Hash1_ = DefHashFunc<I1_>, class Hash2_ = DefHashFunc<I2_>>
typedef HashConstIterator2D<I1_,I2_,E_,Hash1_,Hash2_> ogdf::HashArray2D< I1_, I2_, E_, Hash1_, Hash2_ >::const_terator

The type of const-iterators for 2D-hash arrays.

Reimplemented from ogdf::Hashing< K, I, H >.

Definition at line 91 of file HashArray2D.h.


Constructor & Destructor Documentation

template<class I1_, class I2_, class E_, class Hash1_ = DefHashFunc<I1_>, class Hash2_ = DefHashFunc<I2_>>
ogdf::HashArray2D< I1_, I2_, E_, Hash1_, Hash2_ >::HashArray2D (  )  [inline]

Creates a 2D-hash array.

Definition at line 94 of file HashArray2D.h.

template<class I1_, class I2_, class E_, class Hash1_ = DefHashFunc<I1_>, class Hash2_ = DefHashFunc<I2_>>
ogdf::HashArray2D< I1_, I2_, E_, Hash1_, Hash2_ >::HashArray2D ( const E_ &  defaultValue,
const Hash1_ &  hashFunc1 = Hash1_(),
const Hash2_ &  hashFunc2 = Hash2_() 
) [inline]

Creates a 2D-hash array and sets the default value to x.

Definition at line 97 of file HashArray2D.h.

template<class I1_, class I2_, class E_, class Hash1_ = DefHashFunc<I1_>, class Hash2_ = DefHashFunc<I2_>>
ogdf::HashArray2D< I1_, I2_, E_, Hash1_, Hash2_ >::HashArray2D ( const HashArray2D< I1_, I2_, E_, Hash1_, Hash2_ > &  A  )  [inline]

Copy constructor.

Definition at line 105 of file HashArray2D.h.

template<class I1_, class I2_, class E_, class Hash1_ = DefHashFunc<I1_>, class Hash2_ = DefHashFunc<I2_>>
ogdf::HashArray2D< I1_, I2_, E_, Hash1_, Hash2_ >::~HashArray2D (  )  [inline]

Definition at line 117 of file HashArray2D.h.


Member Function Documentation

template<class I1_, class I2_, class E_, class Hash1_ = DefHashFunc<I1_>, class Hash2_ = DefHashFunc<I2_>>
HashArray2D& ogdf::HashArray2D< I1_, I2_, E_, Hash1_, Hash2_ >::operator= ( const HashArray2D< I1_, I2_, E_, Hash1_, Hash2_ > &  A  )  [inline]

Assignment operator.

Definition at line 110 of file HashArray2D.h.

template<class I1_, class I2_, class E_, class Hash1_ = DefHashFunc<I1_>, class Hash2_ = DefHashFunc<I2_>>
const E_& ogdf::HashArray2D< I1_, I2_, E_, Hash1_, Hash2_ >::operator() ( const I1_ &  i,
const I2_ &  j 
) const [inline]

Returns a const reference to entry (i,j).

Definition at line 120 of file HashArray2D.h.

template<class I1_, class I2_, class E_, class Hash1_ = DefHashFunc<I1_>, class Hash2_ = DefHashFunc<I2_>>
E_& ogdf::HashArray2D< I1_, I2_, E_, Hash1_, Hash2_ >::operator() ( const I1_ &  i,
const I2_ &  j 
) [inline]

Returns a reference to entry (i,j).

Definition at line 128 of file HashArray2D.h.

template<class I1_, class I2_, class E_, class Hash1_ = DefHashFunc<I1_>, class Hash2_ = DefHashFunc<I2_>>
bool ogdf::HashArray2D< I1_, I2_, E_, Hash1_, Hash2_ >::isDefined ( const I1_ &  i,
const I2_ &  j 
) const [inline]

Returns true iff entry (i,j) is defined.

Definition at line 138 of file HashArray2D.h.

template<class I1_, class I2_, class E_, class Hash1_ = DefHashFunc<I1_>, class Hash2_ = DefHashFunc<I2_>>
void ogdf::HashArray2D< I1_, I2_, E_, Hash1_, Hash2_ >::undefine ( const I1_ &  i,
const I2_ &  j 
) [inline]

Undefines the entry at index (i,j).

Definition at line 143 of file HashArray2D.h.

template<class I1_, class I2_, class E_, class Hash1_ = DefHashFunc<I1_>, class Hash2_ = DefHashFunc<I2_>>
HashConstIterator2D<I1_,I2_,E_,Hash1_,Hash2_> ogdf::HashArray2D< I1_, I2_, E_, Hash1_, Hash2_ >::begin (  )  const [inline]

Returns an iterator pointing to the first element.

Reimplemented from ogdf::Hashing< K, I, H >.

Definition at line 148 of file HashArray2D.h.

template<class I1_, class I2_, class E_, class Hash1_ = DefHashFunc<I1_>, class Hash2_ = DefHashFunc<I2_>>
int ogdf::HashArray2D< I1_, I2_, E_, Hash1_, Hash2_ >::size (  )  const [inline]

Returns the number of defined elements in the table.

Reimplemented from ogdf::Hashing< K, I, H >.

Definition at line 154 of file HashArray2D.h.

template<class I1_, class I2_, class E_, class Hash1_ = DefHashFunc<I1_>, class Hash2_ = DefHashFunc<I2_>>
int ogdf::HashArray2D< I1_, I2_, E_, Hash1_, Hash2_ >::empty (  )  const [inline]

Returns if any indices are defined.

Reimplemented from ogdf::Hashing< K, I, H >.

Definition at line 159 of file HashArray2D.h.

template<class I1_, class I2_, class E_, class Hash1_ = DefHashFunc<I1_>, class Hash2_ = DefHashFunc<I2_>>
void ogdf::HashArray2D< I1_, I2_, E_, Hash1_, Hash2_ >::clear (  )  [inline]

Undefines all indices.

Reimplemented from ogdf::Hashing< K, I, H >.

Definition at line 165 of file HashArray2D.h.


Member Data Documentation

template<class I1_, class I2_, class E_, class Hash1_ = DefHashFunc<I1_>, class Hash2_ = DefHashFunc<I2_>>
E_ ogdf::HashArray2D< I1_, I2_, E_, Hash1_, Hash2_ >::m_defaultValue [private]

The default value of the array.

Definition at line 170 of file HashArray2D.h.


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

© 1999-2007 by oreas GmbH, © 2005-2007 by University Dortmund and University Cologne.

Generated on Thu Nov 22 19:40:08 2007 by doxygen 1.5.4.