Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

PQInternalNode.h
Go to the documentation of this file.
1 
32 #pragma once
33 
35 
36 namespace ogdf {
37 
75 template<class T, class X, class Y>
76 class PQInternalNode : public PQNode<T, X, Y> {
77 public:
79  PQInternalKey<T, X, Y>* internalPtr, PQNodeKey<T, X, Y>* infoPtr)
80  : PQNode<T, X, Y>(count, infoPtr) {
81  m_type = typ;
82  m_status = stat;
84 
85  m_pointerToInternal = internalPtr;
86  internalPtr->setNodePointer(this);
87  }
88 
90  PQInternalKey<T, X, Y>* internalPtr)
91  : PQNode<T, X, Y>(count) {
92  m_type = typ;
93  m_status = stat;
95  m_pointerToInternal = internalPtr;
96  internalPtr->setNodePointer(this);
97  }
98 
100  PQNodeKey<T, X, Y>* infoPtr)
101  : PQNode<T, X, Y>(count, infoPtr) {
102  m_type = typ;
103  m_status = stat;
106  }
107 
109  : PQNode<T, X, Y>(count) {
110  m_type = typ;
111  m_status = stat;
113  m_pointerToInternal = nullptr;
114  }
115 
128 
130  virtual PQLeafKey<T, X, Y>* getKey() const { return nullptr; }
131 
144  virtual bool setKey(PQLeafKey<T, X, Y>* pointerToKey) { return pointerToKey == nullptr; }
145 
148 
160  virtual bool setInternal(PQInternalKey<T, X, Y>* pointerToInternal) {
161  m_pointerToInternal = pointerToInternal;
162  if (pointerToInternal != nullptr) {
163  m_pointerToInternal->setNodePointer(this);
164  return true;
165  } else {
166  return false;
167  }
168  }
169 
171 
177  virtual PQNodeRoot::PQNodeMark mark() const { return m_mark; }
178 
180  virtual void mark(PQNodeRoot::PQNodeMark m) { m_mark = m; }
181 
183 
192  virtual PQNodeRoot::PQNodeStatus status() const { return m_status; }
193 
195  virtual void status(PQNodeRoot::PQNodeStatus s) { m_status = s; }
196 
198 
202  virtual PQNodeRoot::PQNodeType type() const { return m_type; }
203 
205  virtual void type(PQNodeRoot::PQNodeType t) { m_type = t; }
206 
207 private:
214 
215 
226 
233 
240 };
241 
242 }
ogdf::PQInternalNode::PQInternalNode
PQInternalNode(int count, PQNodeRoot::PQNodeType typ, PQNodeRoot::PQNodeStatus stat, PQInternalKey< T, X, Y > *internalPtr)
Definition: PQInternalNode.h:89
ogdf::PQInternalNode
The class template PQInternalNode is used to present P-nodes and Q-nodes in the PQ-Tree.
Definition: PQInternalNode.h:76
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::PQInternalNode::m_mark
PQNodeRoot::PQNodeMark m_mark
#m_mark is a variable, storing if a PQInternalNode is QUEUEUD, BLOCKED or UNBLOCKED (see PQNode) duri...
Definition: PQInternalNode.h:213
PQNode.h
Declaration and implementation of the class PQNode.
ogdf::PQInternalNode::status
virtual PQNodeRoot::PQNodeStatus status() const
Returns the variable m_status in the derived class PQInternalNode.
Definition: PQInternalNode.h:192
ogdf::PQLeafKey
The class template PQLeafKey is a derived class of class template PQBasicKey.
Definition: PQLeafKey.h:87
ogdf::PQInternalNode::getKey
virtual PQLeafKey< T, X, Y > * getKey() const
Returns 0. An element of type PQInternalNode does not have a PQLeafKey.
Definition: PQInternalNode.h:130
ogdf::PQInternalNode::type
virtual void type(PQNodeRoot::PQNodeType t)
Sets the variable m_type in the derived class PQInternalNode.
Definition: PQInternalNode.h:205
ogdf::PQInternalNode::getInternal
virtual PQInternalKey< T, X, Y > * getInternal() const
Returns a pointer to the PQInternalKey information.
Definition: PQInternalNode.h:147
ogdf::PQInternalNode::setInternal
virtual bool setInternal(PQInternalKey< T, X, Y > *pointerToInternal)
setInternal() sets the pointer variable m_pointerToInternal to the specified adress of pointerToInter...
Definition: PQInternalNode.h:160
ogdf::PQNodeRoot::PQNodeMark::Unmarked
@ Unmarked
ogdf::PQInternalNode::status
virtual void status(PQNodeRoot::PQNodeStatus s)
Sets the variable m_status in the derived class PQInternalNode.
Definition: PQInternalNode.h:195
ogdf::PQNodeRoot::PQNodeType
PQNodeType
Definition: PQNodeRoot.h:46
ogdf::PQInternalKey
The class template PQInternalKey is a derived class of class template PQBasicKey.
Definition: PQInternalKey.h:58
ogdf::PQNodeRoot::PQNodeMark
PQNodeMark
Definition: PQNodeRoot.h:73
ogdf::PQBasicKey::setNodePointer
void setNodePointer(PQNode< T, X, Y > *pqNode)
The function setNodePointer() sets the private member m_nodePointer.
Definition: PQBasicKey.h:154
ogdf::PQInternalNode::m_type
PQNodeRoot::PQNodeType m_type
m_status is a variable storing the status of a PQInternalNode.
Definition: PQInternalNode.h:239
ogdf::PQInternalNode::~PQInternalNode
~PQInternalNode()
The destructor does not delete any accompanying information class as PQLeafKey, PQNodeKey and PQInter...
Definition: PQInternalNode.h:127
ogdf::PQInternalNode::PQInternalNode
PQInternalNode(int count, PQNodeRoot::PQNodeType typ, PQNodeRoot::PQNodeStatus stat, PQInternalKey< T, X, Y > *internalPtr, PQNodeKey< T, X, Y > *infoPtr)
Definition: PQInternalNode.h:78
ogdf::PQInternalNode::mark
virtual void mark(PQNodeRoot::PQNodeMark m)
Sets the variable m_mark.
Definition: PQInternalNode.h:180
ogdf::PQInternalNode::PQInternalNode
PQInternalNode(int count, PQNodeRoot::PQNodeType typ, PQNodeRoot::PQNodeStatus stat, PQNodeKey< T, X, Y > *infoPtr)
Definition: PQInternalNode.h:99
ogdf::PQNodeKey
The class template PQNodeKey is a derived class of class template PQBasicKey.
Definition: PQNode.h:50
ogdf::PQInternalNode::mark
virtual PQNodeRoot::PQNodeMark mark() const
Returns the variable m_mark.
Definition: PQInternalNode.h:177
ogdf::PQInternalNode::type
virtual PQNodeRoot::PQNodeType type() const
Returns the variable m_type in the derived class PQInternalNode.
Definition: PQInternalNode.h:202
ogdf::PQInternalNode::m_status
PQNodeRoot::PQNodeStatus m_status
m_status is a variable storing the status of a PQInternalNode.
Definition: PQInternalNode.h:232
ogdf::PQNodeRoot::PQNodeStatus
PQNodeStatus
Definition: PQNodeRoot.h:51
ogdf::PQInternalNode::m_pointerToInternal
PQInternalKey< T, X, Y > * m_pointerToInternal
m_pointerToInternal stores the adress of the corresponding internal information.
Definition: PQInternalNode.h:225
ogdf::PQInternalNode::PQInternalNode
PQInternalNode(int count, PQNodeRoot::PQNodeType typ, PQNodeRoot::PQNodeStatus stat)
Definition: PQInternalNode.h:108
ogdf::PQInternalNode::setKey
virtual bool setKey(PQLeafKey< T, X, Y > *pointerToKey)
Accepts only pointers pointerToKey = 0.
Definition: PQInternalNode.h:144
ogdf::PQNode
The class template PQBasicKey is an abstract base class.
Definition: PQBasicKey.h:109