Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

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 {
78 public:
80  int count,
83  PQInternalKey<T,X,Y>* internalPtr,
84  PQNodeKey<T,X,Y>* infoPtr)
85  : PQNode<T,X,Y>(count,infoPtr)
86  {
87  m_type = typ;
88  m_status = stat;
90 
91  m_pointerToInternal = internalPtr;
92  internalPtr->setNodePointer(this);
93  }
94 
96  int count,
99  PQInternalKey<T,X,Y>* internalPtr)
100  : PQNode<T,X,Y>(count)
101  {
102  m_type = typ;
103  m_status = stat;
105  m_pointerToInternal = internalPtr;
106  internalPtr->setNodePointer(this);
107  }
108 
110  int count,
113  PQNodeKey<T,X,Y>* infoPtr)
114  : PQNode<T,X,Y>(count,infoPtr)
115  {
116  m_type = typ;
117  m_status = stat;
120  }
121 
123  int count,
126  : PQNode<T,X,Y>(count)
127  {
128  m_type = typ;
129  m_status = stat;
131  m_pointerToInternal = nullptr;
132 
133  }
134 
147 
148 
150  virtual PQLeafKey<T,X,Y>* getKey() const { return nullptr; }
151 
164  virtual bool setKey(PQLeafKey<T,X,Y>* pointerToKey)
165  {
166  return pointerToKey == nullptr;
167  }
168 
171 
183  virtual bool setInternal(PQInternalKey<T,X,Y>* pointerToInternal)
184  {
185  m_pointerToInternal = pointerToInternal;
186  if (pointerToInternal != nullptr)
187  {
188  m_pointerToInternal->setNodePointer(this);
189  return true;
190  }
191  else
192  return false;
193  }
194 
196 
202  virtual PQNodeRoot::PQNodeMark mark() const { return m_mark; }
203 
205  virtual void mark(PQNodeRoot::PQNodeMark m) { m_mark = m; }
206 
208 
217  virtual PQNodeRoot::PQNodeStatus status() const { return m_status; }
218 
220  virtual void status(PQNodeRoot::PQNodeStatus s) { m_status = s; }
221 
223 
227  virtual PQNodeRoot::PQNodeType type() const { return m_type; }
228 
230  virtual void type(PQNodeRoot::PQNodeType t) { m_type = t; }
231 
232 private:
233 
240 
241 
252 
259 
266 };
267 
268 }
The class template PQNodeKey is a derived class of class template PQBasicKey.
Definition: PQNode.h:47
PQNodeRoot::PQNodeStatus m_status
m_status is a variable storing the status of a PQInternalNode.
virtual PQLeafKey< T, X, Y > * getKey() const
Returns 0. An element of type PQInternalNode does not have a PQLeafKey.
PQInternalKey< T, X, Y > * m_pointerToInternal
m_pointerToInternal stores the adress of the corresponding internal information.
PQInternalNode(int count, PQNodeRoot::PQNodeType typ, PQNodeRoot::PQNodeStatus stat, PQNodeKey< T, X, Y > *infoPtr)
virtual PQNodeRoot::PQNodeStatus status() const
Returns the variable m_status in the derived class PQInternalNode.
PQInternalNode(int count, PQNodeRoot::PQNodeType typ, PQNodeRoot::PQNodeStatus stat, PQInternalKey< T, X, Y > *internalPtr, PQNodeKey< T, X, Y > *infoPtr)
virtual PQNodeRoot::PQNodeMark mark() const
Returns the variable m_mark.
virtual bool setInternal(PQInternalKey< T, X, Y > *pointerToInternal)
setInternal() sets the pointer variable m_pointerToInternal to the specified adress of pointerToInter...
virtual bool setKey(PQLeafKey< T, X, Y > *pointerToKey)
Accepts only pointers pointerToKey = 0.
virtual void mark(PQNodeRoot::PQNodeMark m)
Sets the variable m_mark.
The class template PQInternalKey is a derived class of class template PQBasicKey. ...
Definition: PQInternalKey.h:57
The class template PQLeafKey is a derived class of class template PQBasicKey.
Definition: PQLeafKey.h:86
The class template PQBasicKey is an abstract base class.
Definition: PQBasicKey.h:108
The class template PQInternalNode is used to present P-nodes and Q-nodes in the PQ-Tree.
PQNodeRoot::PQNodeMark m_mark
#m_mark is a variable, storing if a PQInternalNode is QUEUEUD, BLOCKED or UNBLOCKED (see PQNode) duri...
virtual void status(PQNodeRoot::PQNodeStatus s)
Sets the variable m_status in the derived class PQInternalNode.
PQInternalNode(int count, PQNodeRoot::PQNodeType typ, PQNodeRoot::PQNodeStatus stat)
virtual PQNodeRoot::PQNodeType type() const
Returns the variable m_type in the derived class PQInternalNode.
PQNodeRoot::PQNodeType m_type
m_status is a variable storing the status of a PQInternalNode.
void setNodePointer(PQNode< T, X, Y > *pqNode)
The function setNodePointer() sets the private member m_nodePointer.
Definition: PQBasicKey.h:153
The namespace for all OGDF objects.
Declaration and implementation of the class PQNode.
virtual PQInternalKey< T, X, Y > * getInternal() const
Returns a pointer to the PQInternalKey information.
PQInternalNode(int count, PQNodeRoot::PQNodeType typ, PQNodeRoot::PQNodeStatus stat, PQInternalKey< T, X, Y > *internalPtr)
~PQInternalNode()
The destructor does not delete any accompanying information class as PQLeafKey, PQNodeKey and PQInter...
virtual void type(PQNodeRoot::PQNodeType t)
Sets the variable m_type in the derived class PQInternalNode.