Open
Graph Drawing
Framework

 v.2012.05
 

ogdf::PQLeaf< T, X, Y > Class Template Reference

#include <ogdf/internal/planarity/PQLeaf.h>

Inheritance diagram for ogdf::PQLeaf< T, X, Y >:
ogdf::PQNode< T, X, Y > ogdf::PQNodeRoot

List of all members.

Public Member Functions

 PQLeaf (int count, int stat, PQLeafKey< T, X, Y > *keyPtr, PQNodeKey< T, X, Y > *infoPtr)
 PQLeaf (int count, int stat, PQLeafKey< T, X, Y > *keyPtr)
virtual ~PQLeaf ()
virtual PQLeafKey< T, X, Y > * getKey () const
virtual bool setKey (PQLeafKey< T, X, Y > *pointerToKey)
virtual PQInternalKey< T, X, Y > * getInternal () const
virtual bool setInternal (PQInternalKey< T, X, Y > *pointerToInternal)
virtual int mark () const
 Returns the variable m_mark.
virtual void mark (int m)
 Sets the variable m_mark.
virtual int status () const
 Returns the variable m_status in the derived class PQLeaf.
virtual void status (int s)
 Sets the variable m_status in the derived class PQLeaf.
virtual PQNodeRoot::PQNodeType type () const
 Returns the variable m_type in the derived class PQLeaf.
virtual void type (PQNodeRoot::PQNodeType)
 Sets the variable m_type in the derived class PQLeaf.

Private Attributes

int m_mark
PQLeafKey< T, X, Y > * m_pointerToKey
int m_status

Detailed Description

template<class T, class X, class Y>
class ogdf::PQLeaf< T, X, Y >

The datastructure PQ-tree was designed to present a set of permutations on an arbitrary set of elements. These elements are the leafs of a PQ-tree. The client has to specify, what kind of elements he uses. The element of a node is stored in the PQLeafKey of a PQLeaf. The PQLeaf is the only concrete class template of the abstract base class template PQNode that is allowed to have a key.

Definition at line 69 of file PQLeaf.h.


Constructor & Destructor Documentation

template<class T, class X, class Y>
ogdf::PQLeaf< T, X, Y >::PQLeaf ( int  count,
int  stat,
PQLeafKey< T, X, Y > *  keyPtr,
PQNodeKey< T, X, Y > *  infoPtr 
) [inline]

The client may choose between two different constructors. In both cases the constructor expects an integer value count, setting the value of the variable m_identificationNumber in the base class, an integer value status setting the variable m_status of PQLeaf and a pointer to an element of type PQLeafKey.

One of the constructors expects additional information of type PQNodeKey and will automatically set the m_nodePointer (see basicKey) of the element of type PQNodeKey to the newly allocated PQLeaf (see also PQNode). The second constructor is called, if no information for the PQLeaf is available or necessary. Both constructors will automatically set the m_nodePointer of the keyPtr to the newly allocated PQLeaf.

Definition at line 89 of file PQLeaf.h.

template<class T, class X, class Y>
ogdf::PQLeaf< T, X, Y >::PQLeaf ( int  count,
int  stat,
PQLeafKey< T, X, Y > *  keyPtr 
) [inline]

Definition at line 103 of file PQLeaf.h.

template<class T, class X, class Y>
virtual ogdf::PQLeaf< T, X, Y >::~PQLeaf ( ) [inline, virtual]

The destructor does not delete any accompanying information class as PQLeafKey, PQNodeKey and PQInternalKey. This has been avoided, since applications may need the existence of these information classes after the corresponding node has been deleted. If the deletion of an accompanying information class should be performed with the deletion of a node, either derive a new class with an appropriate destructor, or make use of the function CleanNode() of the class template PQTree.

Definition at line 126 of file PQLeaf.h.


Member Function Documentation

template<class T, class X, class Y>
virtual PQInternalKey<T,X,Y>* ogdf::PQLeaf< T, X, Y >::getInternal ( ) const [inline, virtual]

getInternal() returns 0. The function is designed to return a pointer to the PQInternalKey information of a node, in case that the node is supposed to have internal information. The class template PQLeaf does not have PQInternalKey information.

Implements ogdf::PQNode< T, X, Y >.

Definition at line 168 of file PQLeaf.h.

template<class T, class X, class Y>
virtual PQLeafKey<T,X,Y>* ogdf::PQLeaf< T, X, Y >::getKey ( ) const [inline, virtual]

getKey() returns a pointer to the PQLeafKey of PQLeaf. The adress of the PQLeafKey is stored in the private variable m_pointerToKey. The key contains informations of the element that is represented by the PQLeaf in the PQ-tree and is of type PQLeafKey.

Implements ogdf::PQNode< T, X, Y >.

Definition at line 135 of file PQLeaf.h.

template<class T, class X, class Y>
virtual int ogdf::PQLeaf< T, X, Y >::mark ( ) const [inline, virtual]

Returns the variable m_mark.

The variable m_mark describes the designation used in the first pass of Booth and Luekers algorithm called Bubble(). A PQLeaf is either marked BLOCKED, UNBLOCKED or QUEUED (see PQNode).

Implements ogdf::PQNode< T, X, Y >.

Definition at line 199 of file PQLeaf.h.

template<class T, class X, class Y>
virtual void ogdf::PQLeaf< T, X, Y >::mark ( int  m) [inline, virtual]

Sets the variable m_mark.

Implements ogdf::PQNode< T, X, Y >.

Definition at line 202 of file PQLeaf.h.

template<class T, class X, class Y>
virtual bool ogdf::PQLeaf< T, X, Y >::setInternal ( PQInternalKey< T, X, Y > *  pointerToInternal) [inline, virtual]

setInternal() accepts only pointers pointerToInternal = 0.

The function setInternal() is designed to set a specified pointer variable in a derived class of PQNode to the adress stored in pointerToInternal. which is of type PQInternalKey. The class template PQLeaf does not store informations of type PQInternalKey.

setInternal() ignores the informations as long as pointerToInternal = 0. The return value then is 1. In case that pointerToInternal != 0, the return value is 0.

Implements ogdf::PQNode< T, X, Y >.

Definition at line 184 of file PQLeaf.h.

template<class T, class X, class Y>
virtual bool ogdf::PQLeaf< T, X, Y >::setKey ( PQLeafKey< T, X, Y > *  pointerToKey) [inline, virtual]

setKey() sets the pointer variable m_pointerToKey to the specified address of pointerToKey that is of type PQLeafKey.

Observe that pointerToKey has to be instantiated by the client. The function setKey() does not instantiate the corresponding variable in the derived class. Using this function will automatically set the m_nodePointer of the element of type key (see PQLeafKey) to this PQLeaf. The return value is always 1 unless pointerKey was equal to 0.

Implements ogdf::PQNode< T, X, Y >.

Definition at line 149 of file PQLeaf.h.

template<class T, class X, class Y>
virtual int ogdf::PQLeaf< T, X, Y >::status ( ) const [inline, virtual]

Returns the variable m_status in the derived class PQLeaf.

The functions manage the status of a node in the PQ-tree. A status is any kind of information of the current situation in the frontier of a node (the frontier of a node are all descendant leaves of the node). A status can be anything such as EMPTY, FULL or PARTIAL (see PQNode). Since there might be more than those three possibilities, (e.g. in computing planar subgraphs) this function may to be overloaded by the client.

Implements ogdf::PQNode< T, X, Y >.

Definition at line 215 of file PQLeaf.h.

template<class T, class X, class Y>
virtual void ogdf::PQLeaf< T, X, Y >::status ( int  s) [inline, virtual]

Sets the variable m_status in the derived class PQLeaf.

Implements ogdf::PQNode< T, X, Y >.

Definition at line 218 of file PQLeaf.h.

template<class T, class X, class Y>
virtual PQNodeRoot::PQNodeType ogdf::PQLeaf< T, X, Y >::type ( ) const [inline, virtual]

Returns the variable m_type in the derived class PQLeaf.

The type of a node is either PNode, QNode or leaf (see PQNodeRoot). Since the type of an element of type PQLeaf is leaf every input is ignored and the return value will always be leaf.

Implements ogdf::PQNode< T, X, Y >.

Definition at line 227 of file PQLeaf.h.

template<class T, class X, class Y>
virtual void ogdf::PQLeaf< T, X, Y >::type ( PQNodeRoot::PQNodeType  ) [inline, virtual]

Sets the variable m_type in the derived class PQLeaf.

Implements ogdf::PQNode< T, X, Y >.

Definition at line 230 of file PQLeaf.h.


Member Data Documentation

template<class T, class X, class Y>
int ogdf::PQLeaf< T, X, Y >::m_mark [private]

m_mark is a variable, storing if the PQLeaf is QUEUEUD, BLOCKED or UNBLOCKED (see PQNode) during the first phase of the procedure Bubble().

Definition at line 239 of file PQLeaf.h.

template<class T, class X, class Y>
PQLeafKey<T,X,Y>* ogdf::PQLeaf< T, X, Y >::m_pointerToKey [private]

m_pointerToKey stores the adress of the corresponding PQLeafKey. This PQLeafKey can be overloaded by the client in order to represent different sets of elements, where possible permutations have to be examined by the PQ-tree.

Definition at line 248 of file PQLeaf.h.

template<class T, class X, class Y>
int ogdf::PQLeaf< T, X, Y >::m_status [private]

m_status is a variable storing the status of a PQLeaf. A PQLeaf can be either FULL or EMPTY (see PQNode).

Definition at line 254 of file PQLeaf.h.


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