#include <ogdf/internal/planarity/PQLeaf.h>
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 |
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.
| 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.
| ogdf::PQLeaf< T, X, Y >::PQLeaf | ( | int | count, |
| int | stat, | ||
| PQLeafKey< T, X, Y > * | keyPtr | ||
| ) | [inline] |
| 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.
| 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 >.
| virtual PQLeafKey<T,X,Y>* ogdf::PQLeaf< T, X, Y >::getKey | ( | ) | const [inline, virtual] |
| 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 >.
| virtual void ogdf::PQLeaf< T, X, Y >::mark | ( | int | m | ) | [inline, virtual] |
Sets the variable m_mark.
Implements ogdf::PQNode< T, X, 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 >.
| 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 >.
| 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 >.
| 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 >.
| 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 >.
| 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 >.
int ogdf::PQLeaf< T, X, Y >::m_mark [private] |
PQLeafKey<T,X,Y>* ogdf::PQLeaf< T, X, Y >::m_pointerToKey [private] |
int ogdf::PQLeaf< T, X, Y >::m_status [private] |