Open
Graph Drawing
Framework

 v.2010.10
 

Public Member Functions | Private Member Functions | Private Attributes

ogdf::ClusterArray< T > Class Template Reference

Dynamic arrays indexed with clusters. More...

#include <ogdf/cluster/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 119 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 124 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 126 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 134 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 141 of file ClusterArray.h.


Member Function Documentation

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 226 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 218 of file ClusterArray.h.

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

Sets all array elements to x.

Definition at line 211 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 149 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 197 of file ClusterArray.h.

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

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

Definition at line 192 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 206 of file ClusterArray.h.

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

Definition at line 231 of file ClusterArray.h.

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

Definition at line 231 of file ClusterArray.h.

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

Definition at line 231 of file ClusterArray.h.

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

Assignment operator.

Definition at line 184 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 154 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!

Definition at line 179 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!

Definition at line 170 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 160 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 222 of file ClusterArray.h.

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

Returns true iff the array is associated with a graph.

Definition at line 146 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 120 of file ClusterArray.h.


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