Open
Graph Drawing
Framework

 v.2010.10
 

Public Member Functions | Private Member Functions | Private Attributes

ogdf::NodeArray< T > Class Template Reference

Dynamic arrays indexed with nodes. More...

#include <ogdf/basic/NodeArray.h>

Inheritance diagram for ogdf::NodeArray< T >:
ogdf::Array< T > ogdf::NodeArrayBase

List of all members.

Public Member Functions

 NodeArray ()
 Constructs an empty node array associated with no graph.
 NodeArray (const Graph &G)
 Constructs a node array associated with G.
 NodeArray (const Graph &G, const T &x)
 Constructs a node array associated with G.
 NodeArray (const NodeArray< T > &A)
 Constructs a node array that is a copy of A.
bool valid () const
 Returns true iff the array is associated with a graph.
const GraphgraphOf () const
 Returns a pointer to the associated graph.
const T & operator[] (node v) const
 Returns a reference to the element with index v.
T & operator[] (node v)
 Returns a reference to the element with index v.
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.
NodeArray< T > & operator= (const NodeArray< T > &a)
 Assignment operator.
void init ()
 Reinitializes the array. Associates the array with no graph.
void init (const Graph &G)
 Reinitializes the array. Associates the array with G.
void init (const Graph &G, const T &x)
 Reinitializes the array. Associates the array with G.
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 graph.

Private Attributes

m_x
 The default value for array elements.

Detailed Description

template<class T>
class ogdf::NodeArray< T >

Dynamic arrays indexed with nodes.

Node arrays adjust their table size automatically when the graph grows.

Definition at line 115 of file NodeArray.h.


Constructor & Destructor Documentation

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

Constructs an empty node array associated with no graph.

Definition at line 120 of file NodeArray.h.

template<class T>
ogdf::NodeArray< T >::NodeArray ( const Graph G  )  [inline]

Constructs a node array associated with G.

Definition at line 122 of file NodeArray.h.

template<class T>
ogdf::NodeArray< T >::NodeArray ( const Graph G,
const T &  x 
) [inline]

Constructs a node array associated with G.

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

Definition at line 128 of file NodeArray.h.

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

Constructs a node array that is a copy of A.

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

Definition at line 134 of file NodeArray.h.


Member Function Documentation

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

Virtual function called when array is disconnected from the graph.

Implements ogdf::NodeArrayBase.

Definition at line 217 of file NodeArray.h.

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

Virtual function called when table size has to be enlarged.

Implements ogdf::NodeArrayBase.

Definition at line 209 of file NodeArray.h.

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

Sets all array elements to x.

Definition at line 202 of file NodeArray.h.

template<class T>
const Graph* ogdf::NodeArray< T >::graphOf (  )  const [inline]

Returns a pointer to the associated graph.

Definition at line 140 of file NodeArray.h.

template<class T>
void ogdf::NodeArray< T >::init ( const Graph G  )  [inline]

Reinitializes the array. Associates the array with G.

Definition at line 188 of file NodeArray.h.

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

Reinitializes the array. Associates the array with no graph.

Definition at line 183 of file NodeArray.h.

template<class T>
void ogdf::NodeArray< T >::init ( const Graph G,
const T &  x 
) [inline]

Reinitializes the array. Associates the array with G.

Parameters:
G is the associated graph.
x is the default value.

Definition at line 197 of file NodeArray.h.

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

Definition at line 222 of file NodeArray.h.

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

Definition at line 222 of file NodeArray.h.

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

Definition at line 222 of file NodeArray.h.

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

Assignment operator.

Definition at line 175 of file NodeArray.h.

template<class T>
const T& ogdf::NodeArray< T >::operator[] ( node  v  )  const [inline]

Returns a reference to the element with index v.

Definition at line 145 of file NodeArray.h.

template<class T>
T& ogdf::NodeArray< 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 node in the associated graph!

Definition at line 170 of file NodeArray.h.

template<class T>
const T& ogdf::NodeArray< 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 node in the associated graph!

Definition at line 161 of file NodeArray.h.

template<class T>
T& ogdf::NodeArray< T >::operator[] ( node  v  )  [inline]

Returns a reference to the element with index v.

Definition at line 151 of file NodeArray.h.

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

Virtual function called when table has to be reinitialized.

Implements ogdf::NodeArrayBase.

Definition at line 213 of file NodeArray.h.

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

Returns true iff the array is associated with a graph.

Definition at line 137 of file NodeArray.h.


Member Data Documentation

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

The default value for array elements.

Definition at line 116 of file NodeArray.h.


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