Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

PQLeaf.h
Go to the documentation of this file.
1 
32 #pragma once
33 
35 
36 namespace ogdf {
37 
47 template<class T,class X,class Y>
48 class PQLeaf : public PQNode<T,X,Y>
49 {
50 public:
68  int count,
70  PQLeafKey<T,X,Y>* keyPtr,
71  PQNodeKey<T,X,Y>* infoPtr)
72  : PQNode<T,X,Y>(count,infoPtr)
73  {
74  m_status = stat;
75  m_pointerToKey = keyPtr;
77  keyPtr->setNodePointer(this);
78  }
79 
80  // Constructor
82  int count,
84  PQLeafKey<T,X,Y>* keyPtr)
85  : PQNode<T,X,Y>(count)
86  {
87  m_status = stat;
88  m_pointerToKey = keyPtr;
90  keyPtr->setNodePointer(this);
91  }
92 
104  virtual ~PQLeaf() {}
105 
113  virtual PQLeafKey<T,X,Y>* getKey() const { return m_pointerToKey; }
114 
127  virtual bool setKey(PQLeafKey<T,X,Y>* pointerToKey)
128  {
129  m_pointerToKey = pointerToKey;
130  if (pointerToKey != nullptr)
131  {
132  m_pointerToKey->setNodePointer(this);
133  return true;
134  }
135  else
136  return false;
137  }
138 
146  virtual PQInternalKey<T,X,Y>* getInternal() const { return nullptr; }
147 
162  virtual bool setInternal(PQInternalKey<T,X,Y>* pointerToInternal)
163  {
164  if (pointerToInternal != nullptr)
165  return false;
166  else
167  return true;
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 
193  virtual PQNodeRoot::PQNodeStatus status() const { return m_status; }
194 
196  virtual void status(PQNodeRoot::PQNodeStatus s) { m_status = s; }
197 
199 
206 
208  virtual void type(PQNodeRoot::PQNodeType) { }
209 
210 private:
211 
218 
227 
233 };
234 
235 }
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 PQLeaf.
Definition: PQLeaf.h:232
virtual bool setInternal(PQInternalKey< T, X, Y > *pointerToInternal)
setInternal() accepts only pointers pointerToInternal = 0.
Definition: PQLeaf.h:162
PQNodeRoot::PQNodeMark m_mark
m_mark is a variable, storing if the PQLeaf is QUEUEUD, BLOCKED or UNBLOCKED (see PQNode) during the ...
Definition: PQLeaf.h:217
virtual void status(PQNodeRoot::PQNodeStatus s)
Sets the variable m_status in the derived class PQLeaf.
Definition: PQLeaf.h:196
virtual PQNodeRoot::PQNodeMark mark() const
Returns the variable m_mark.
Definition: PQLeaf.h:177
virtual PQLeafKey< T, X, Y > * getKey() const
getKey() returns a pointer to the PQLeafKey of PQLeaf.
Definition: PQLeaf.h:113
virtual PQNodeRoot::PQNodeType type() const
Returns the variable PQInternalNode::m_type in the derived class PQLeaf.
Definition: PQLeaf.h:205
virtual bool setKey(PQLeafKey< T, X, Y > *pointerToKey)
setKey() sets the pointer variable m_pointerToKey to the specified address of pointerToKey that is of...
Definition: PQLeaf.h:127
PQLeaf(int count, PQNodeRoot::PQNodeStatus stat, PQLeafKey< T, X, Y > *keyPtr, PQNodeKey< T, X, Y > *infoPtr)
The client may choose between two different constructors.
Definition: PQLeaf.h:67
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
PQLeaf(int count, PQNodeRoot::PQNodeStatus stat, PQLeafKey< T, X, Y > *keyPtr)
Definition: PQLeaf.h:81
PQLeafKey< T, X, Y > * m_pointerToKey
m_pointerToKey stores the adress of the corresponding PQLeafKey.
Definition: PQLeaf.h:226
The datastructure PQ-tree was designed to present a set of permutations on an arbitrary set of elemen...
Definition: PQLeaf.h:48
virtual ~PQLeaf()
The destructor does not delete any accompanying information class as PQLeafKey, PQNodeKey and PQInter...
Definition: PQLeaf.h:104
virtual void type(PQNodeRoot::PQNodeType)
Sets the variable PQInternalNode::m_type in the derived class PQLeaf.
Definition: PQLeaf.h:208
void setNodePointer(PQNode< T, X, Y > *pqNode)
The function setNodePointer() sets the private member m_nodePointer.
Definition: PQBasicKey.h:153
virtual PQNodeRoot::PQNodeStatus status() const
Returns the variable m_status in the derived class PQLeaf.
Definition: PQLeaf.h:193
The namespace for all OGDF objects.
Declaration and implementation of the class PQNode.
virtual void mark(PQNodeRoot::PQNodeMark m)
Sets the variable m_mark.
Definition: PQLeaf.h:180
virtual PQInternalKey< T, X, Y > * getInternal() const
getInternal() returns 0.
Definition: PQLeaf.h:146