6 * $Date: 2012-07-07 00:03:48 +0200 (Sa, 07. Jul 2012) $
7 ***************************************************************/
10 * \brief Declaration and implementation of the class PQNodeKey.
12 * \author Sebastian Leipert
15 * This file is part of the Open Graph Drawing Framework (OGDF).
19 * See README.txt in the root directory of the OGDF installation for details.
22 * This program is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU General Public License
24 * Version 2 or 3 as published by the Free Software Foundation;
25 * see the file LICENSE.txt included in the packaging of this file
29 * This program is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU General Public License for more details.
35 * You should have received a copy of the GNU General Public
36 * License along with this program; if not, write to the Free
37 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
38 * Boston, MA 02110-1301, USA.
40 * \see http://www.gnu.org/copyleft/gpl.html
41 ***************************************************************/
49 #ifndef OGDF_PQ_NODE_KEY_H
50 #define OGDF_PQ_NODE_KEY_H
55 #include <ogdf/internal/planarity/PQBasicKey.h>
60 template<class T
,class X
,class Y
> class PQNode
;
63 * The class template PQNodeKey is a derived class of class template
64 * PQBasicKey. PQNodeKey is a concrete class.
65 * It is constructed to store any kind of information of nodes of the
66 * PQ-tree. It may be used for both internal nodes as well as leaves.
68 * The information is stored in \a m_userStructInfo and
69 * is assigned to a unique node in the PQ-tree. This
70 * unique node can be identified with the \a m_nodePointer of the
71 * astract base class PQBasicKey. The
72 * maintainance of this pointer is left to the user. By keeping the
73 * responsibillity by the user, nodes with certain informations can
74 * be identified and accessed by her in constant time. This makes
75 * the adaption of algorithms fast and easy.
78 template<class T
,class X
,class Y
>
79 class PQNodeKey
: public PQBasicKey
<T
,X
,Y
>
83 //! Stores the information. Has to be overloaded by the client.
87 PQNodeKey(X info
):PQBasicKey
<T
,X
,Y
>() { m_userStructInfo
= info
; }
90 virtual ~PQNodeKey() { }
93 virtual T
userStructKey() { return 0; }
95 //! Returns \a m_userStructInfo.
96 virtual X
userStructInfo() { return m_userStructInfo
; }
99 virtual Y
userStructInternal() { return 0; }