Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

PQInternalNode.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/pqtree/PQInternalKey.h> // IWYU pragma: keep
37 
38 namespace ogdf {
39 template<class T, class X, class Y>
40 class PQLeafKey;
41 template<class T, class X, class Y>
42 class PQNodeKey;
43 
81 template<class T, class X, class Y>
82 class PQInternalNode : public PQNode<T, X, Y> {
83 public:
85  PQInternalKey<T, X, Y>* internalPtr, PQNodeKey<T, X, Y>* infoPtr)
86  : PQNode<T, X, Y>(count, infoPtr) {
87  m_type = typ;
88  m_status = stat;
90 
91  m_pointerToInternal = internalPtr;
92  internalPtr->setNodePointer(this);
93  }
94 
96  PQInternalKey<T, X, Y>* internalPtr)
97  : PQNode<T, X, Y>(count) {
98  m_type = typ;
99  m_status = stat;
101  m_pointerToInternal = internalPtr;
102  internalPtr->setNodePointer(this);
103  }
104 
106  PQNodeKey<T, X, Y>* infoPtr)
107  : PQNode<T, X, Y>(count, infoPtr) {
108  m_type = typ;
109  m_status = stat;
112  }
113 
115  : PQNode<T, X, Y>(count) {
116  m_type = typ;
117  m_status = stat;
119  m_pointerToInternal = nullptr;
120  }
121 
134 
136  virtual PQLeafKey<T, X, Y>* getKey() const { return nullptr; }
137 
150  virtual bool setKey(PQLeafKey<T, X, Y>* pointerToKey) { return pointerToKey == nullptr; }
151 
154 
166  virtual bool setInternal(PQInternalKey<T, X, Y>* pointerToInternal) {
167  m_pointerToInternal = pointerToInternal;
168  if (pointerToInternal != nullptr) {
169  m_pointerToInternal->setNodePointer(this);
170  return true;
171  } else {
172  return false;
173  }
174  }
175 
177 
183  virtual PQNodeRoot::PQNodeMark mark() const { return m_mark; }
184 
186  virtual void mark(PQNodeRoot::PQNodeMark m) { m_mark = m; }
187 
189 
198  virtual PQNodeRoot::PQNodeStatus status() const { return m_status; }
199 
201  virtual void status(PQNodeRoot::PQNodeStatus s) { m_status = s; }
202 
204 
208  virtual PQNodeRoot::PQNodeType type() const { return m_type; }
209 
211  virtual void type(PQNodeRoot::PQNodeType t) { m_type = t; }
212 
213 private:
220 
221 
232 
239 
246 };
247 
248 }
ogdf::PQInternalNode::PQInternalNode
PQInternalNode(int count, PQNodeRoot::PQNodeType typ, PQNodeRoot::PQNodeStatus stat, PQInternalKey< T, X, Y > *internalPtr)
Definition: PQInternalNode.h:95
ogdf::PQInternalNode
The class template PQInternalNode is used to present P-nodes and Q-nodes in the PQ-Tree.
Definition: PQInternalNode.h:82
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
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:219
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:198
ogdf::PQLeafKey
The class template PQLeafKey is a derived class of class template PQBasicKey.
Definition: PQInternalNode.h:40
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:136
ogdf::PQInternalNode::type
virtual void type(PQNodeRoot::PQNodeType t)
Sets the variable m_type in the derived class PQInternalNode.
Definition: PQInternalNode.h:211
ogdf::PQInternalNode::getInternal
virtual PQInternalKey< T, X, Y > * getInternal() const
Returns a pointer to the PQInternalKey information.
Definition: PQInternalNode.h:153
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:166
ogdf::PQNodeRoot::PQNodeMark::Unmarked
@ Unmarked
PQNodeRoot.h
Declaration and implementation of the class PQNodeRoot.
ogdf::PQInternalNode::status
virtual void status(PQNodeRoot::PQNodeStatus s)
Sets the variable m_status in the derived class PQInternalNode.
Definition: PQInternalNode.h:201
ogdf::PQNodeRoot::PQNodeType
PQNodeType
Definition: PQNodeRoot.h:45
ogdf::PQInternalKey
The class template PQInternalKey is a derived class of class template PQBasicKey.
Definition: PQInternalKey.h:55
ogdf::PQNodeRoot::PQNodeMark
PQNodeMark
Definition: PQNodeRoot.h:72
ogdf::PQBasicKey::setNodePointer
void setNodePointer(PQNode< T, X, Y > *pqNode)
The function setNodePointer() sets the private member m_nodePointer.
Definition: PQBasicKey.h:156
ogdf::PQInternalNode::m_type
PQNodeRoot::PQNodeType m_type
m_status is a variable storing the status of a PQInternalNode.
Definition: PQInternalNode.h:245
ogdf::PQInternalNode::~PQInternalNode
~PQInternalNode()
The destructor does not delete any accompanying information class as PQLeafKey, PQNodeKey and PQInter...
Definition: PQInternalNode.h:133
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:84
ogdf::PQInternalNode::mark
virtual void mark(PQNodeRoot::PQNodeMark m)
Sets the variable m_mark.
Definition: PQInternalNode.h:186
ogdf::PQInternalNode::PQInternalNode
PQInternalNode(int count, PQNodeRoot::PQNodeType typ, PQNodeRoot::PQNodeStatus stat, PQNodeKey< T, X, Y > *infoPtr)
Definition: PQInternalNode.h:105
ogdf::PQNodeKey
The class template PQNodeKey is a derived class of class template PQBasicKey.
Definition: PQInternalNode.h:42
ogdf::PQInternalNode::mark
virtual PQNodeRoot::PQNodeMark mark() const
Returns the variable m_mark.
Definition: PQInternalNode.h:183
ogdf::PQInternalNode::type
virtual PQNodeRoot::PQNodeType type() const
Returns the variable m_type in the derived class PQInternalNode.
Definition: PQInternalNode.h:208
ogdf::PQInternalNode::m_status
PQNodeRoot::PQNodeStatus m_status
m_status is a variable storing the status of a PQInternalNode.
Definition: PQInternalNode.h:238
ogdf::PQNodeRoot::PQNodeStatus
PQNodeStatus
Definition: PQNodeRoot.h:50
ogdf::PQInternalNode::m_pointerToInternal
PQInternalKey< T, X, Y > * m_pointerToInternal
m_pointerToInternal stores the adress of the corresponding internal information.
Definition: PQInternalNode.h:231
PQInternalKey.h
Declaration and implementation of the class PQInternalKey.
ogdf::PQInternalNode::PQInternalNode
PQInternalNode(int count, PQNodeRoot::PQNodeType typ, PQNodeRoot::PQNodeStatus stat)
Definition: PQInternalNode.h:114
ogdf::PQInternalNode::setKey
virtual bool setKey(PQLeafKey< T, X, Y > *pointerToKey)
Accepts only pointers pointerToKey = 0.
Definition: PQInternalNode.h:150
ogdf::PQNode
The class template PQBasicKey is an abstract base class.
Definition: PQBasicKey.h:111