Open
Graph Drawing
Framework

 v.2007.11
 

ogdf::ClusterArray< T > Class Template Reference

Dynamic arrays indexed with clusters. More...

#include <ClusterArray.h>

Inheritance diagram for ogdf::ClusterArray< T >:

ogdf::Array< T > ogdf::ClusterArrayBase

List of all members.

Public Member Functions

 ClusterArray ()
 Constructs an empty cluster array associated with no graph.
 ClusterArray (const ClusterGraph &C)
 Constructs a cluster array associated with C.
 ClusterArray (const ClusterGraph &C, const T &x)
 Constructs a cluster array associated with C.
 ClusterArray (const ClusterArray< T > &A)
 Constructs a cluster array that is a copy of A.
bool valid () const
 Returns true iff the array is associated with a graph.
const ClusterGraphgraphOf () const
 Returns a pointer to the associated cluster graph.
const T & operator[] (cluster c) const
 Returns a reference to the element with index c.
T & operator[] (cluster c)
 Returns a reference to the element with index c.
const T & operator[] (int index) const
 Returns a reference to the element with index index.
T & operator[] (int index)
 Returns a reference to the element with index index.
ClusterArray< T > & operator= (const ClusterArray< T > &a)
 Assignment operator.
void init ()
 Reinitializes the array. Associates the array with no cluster graph.
void init (const ClusterGraph &C)
 Reinitializes the array. Associates the array with C.
void init (const ClusterGraph &C, const T &x)
 Reinitializes the array. Associates the array with C.
void fill (const T &x)
 Sets all array elements to x.
void * operator new (size_t nBytes)
void * operator new (size_t, void *p)
void operator delete (void *p, size_t nBytes)

Private Member Functions

virtual void enlargeTable (int newTableSize)
 Virtual function called when table size has to be enlarged.
virtual void reinit (int initTableSize)
 Virtual function called when table has to be reinitialized.
virtual void disconnect ()
 Virtual function called when array is disconnected from the cluster graph.

Private Attributes

m_x
 The default value for array elements.


Detailed Description

template<class T>
class ogdf::ClusterArray< T >

Dynamic arrays indexed with clusters.

Cluster arrays adjust their table size automatically when the cluster graph grows.

Definition at line 117 of file ClusterArray.h.


Constructor & Destructor Documentation

template<class T>
ogdf::ClusterArray< T >::ClusterArray (  )  [inline]

Constructs an empty cluster array associated with no graph.

Definition at line 122 of file ClusterArray.h.

template<class T>
ogdf::ClusterArray< T >::ClusterArray ( const ClusterGraph C  )  [inline]

Constructs a cluster array associated with C.

Definition at line 124 of file ClusterArray.h.

template<class T>
ogdf::ClusterArray< T >::ClusterArray ( const ClusterGraph C,
const T &  x 
) [inline]

Constructs a cluster array associated with C.

Parameters:
C is the associated cluster graph.
x is the default value for all array elements.

Definition at line 132 of file ClusterArray.h.

template<class T>
ogdf::ClusterArray< T >::ClusterArray ( const ClusterArray< T > &  A  )  [inline]

Constructs a cluster array that is a copy of A.

Associates the array with the same cluster graph as A and copies all elements.

Definition at line 139 of file ClusterArray.h.


Member Function Documentation

template<class T>
bool ogdf::ClusterArray< T >::valid (  )  const [inline]

Returns true iff the array is associated with a graph.

Definition at line 144 of file ClusterArray.h.

template<class T>
const ClusterGraph* ogdf::ClusterArray< T >::graphOf (  )  const [inline]

Returns a pointer to the associated cluster graph.

Definition at line 147 of file ClusterArray.h.

template<class T>
const T& ogdf::ClusterArray< T >::operator[] ( cluster  c  )  const [inline]

Returns a reference to the element with index c.

Definition at line 152 of file ClusterArray.h.

template<class T>
T& ogdf::ClusterArray< T >::operator[] ( cluster  c  )  [inline]

Returns a reference to the element with index c.

Definition at line 158 of file ClusterArray.h.

template<class T>
const T& ogdf::ClusterArray< T >::operator[] ( int  index  )  const [inline]

Returns a reference to the element with index index.

Attention:
Make sure that index is a valid index for a cluster in the associated cluster graph!

Reimplemented from ogdf::Array< T >.

Definition at line 168 of file ClusterArray.h.

template<class T>
T& ogdf::ClusterArray< T >::operator[] ( int  index  )  [inline]

Returns a reference to the element with index index.

Attention:
Make sure that index is a valid index for a cluster in the associated cluster graph!

Reimplemented from ogdf::Array< T >.

Definition at line 177 of file ClusterArray.h.

template<class T>
ClusterArray<T>& ogdf::ClusterArray< T >::operator= ( const ClusterArray< T > &  a  )  [inline]

Assignment operator.

Definition at line 182 of file ClusterArray.h.

template<class T>
void ogdf::ClusterArray< T >::init (  )  [inline]

Reinitializes the array. Associates the array with no cluster graph.

Reimplemented from ogdf::Array< T >.

Definition at line 190 of file ClusterArray.h.

template<class T>
void ogdf::ClusterArray< T >::init ( const ClusterGraph C  )  [inline]

Reinitializes the array. Associates the array with C.

Definition at line 195 of file ClusterArray.h.

template<class T>
void ogdf::ClusterArray< T >::init ( const ClusterGraph C,
const T &  x 
) [inline]

Reinitializes the array. Associates the array with C.

Parameters:
C is the associated cluster graph.
x is the default value.

Definition at line 204 of file ClusterArray.h.

template<class T>
void ogdf::ClusterArray< T >::fill ( const T &  x  )  [inline]

Sets all array elements to x.

Reimplemented from ogdf::Array< T >.

Definition at line 209 of file ClusterArray.h.

template<class T>
virtual void ogdf::ClusterArray< T >::enlargeTable ( int  newTableSize  )  [inline, private, virtual]

Virtual function called when table size has to be enlarged.

Implements ogdf::ClusterArrayBase.

Definition at line 216 of file ClusterArray.h.

template<class T>
virtual void ogdf::ClusterArray< T >::reinit ( int  initTableSize  )  [inline, private, virtual]

Virtual function called when table has to be reinitialized.

Implements ogdf::ClusterArrayBase.

Definition at line 220 of file ClusterArray.h.

template<class T>
virtual void ogdf::ClusterArray< T >::disconnect (  )  [inline, private, virtual]

Virtual function called when array is disconnected from the cluster graph.

Implements ogdf::ClusterArrayBase.

Definition at line 224 of file ClusterArray.h.

template<class T>
void* ogdf::ClusterArray< T >::operator new ( size_t  nBytes  )  [inline]

Reimplemented from ogdf::Array< T >.

Definition at line 229 of file ClusterArray.h.

template<class T>
void* ogdf::ClusterArray< T >::operator new ( size_t  ,
void *  p 
) [inline]

Reimplemented from ogdf::Array< T >.

Definition at line 229 of file ClusterArray.h.

template<class T>
void ogdf::ClusterArray< T >::operator delete ( void *  p,
size_t  nBytes 
) [inline]

Reimplemented from ogdf::Array< T >.

Definition at line 229 of file ClusterArray.h.


Member Data Documentation

template<class T>
T ogdf::ClusterArray< T >::m_x [private]

The default value for array elements.

Definition at line 118 of file ClusterArray.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:09 2007 by doxygen 1.5.4.