Declaration and implementation of embedded stack and list functionality which is useful for embedded chains of elements (classes with internal next and previous pointer).
More...
|
| class | ogdf::EList< L, E, numElem, first, last, next, prev > |
| | The embedded list template. More...
|
| |
| class | ogdf::EList< L, E, numElem, first, last, next, prev > |
| | The embedded list template. More...
|
| |
| class | ogdf::EListIterator< E, prev, next > |
| | Implementation of an embedded list iterator used by ogdf::EList. More...
|
| |
| class | ogdf::EListIterator< E, prev, next > |
| | Implementation of an embedded list iterator used by ogdf::EList. More...
|
| |
| class | ogdf::EStack< S, E, first, next > |
| | The embedded stack class template. More...
|
| |
| class | ogdf::EStack< S, E, first, next > |
| | The embedded stack class template. More...
|
| |
Declaration and implementation of embedded stack and list functionality which is useful for embedded chains of elements (classes with internal next and previous pointer).
- The templates declared in this file can be used whenever
- a so called embedded list has to be implemented. Example:
- Author
- Martin Gronemann
class MyNode
{
public:
...
private:
MyNode* prev;
MyNode* next;
};
class MyDataStructure
{
private:
MyNode* m_head;
MyNode* m_tail;
int m_numNodes;
MyNode* m_stackTop;
public:
typedef EList< MyDataStructure,
MyNode,
&MyDataStructure::m_numNodes,
&MyDataStructure::m_head,
&MyDataStructure::m_tail,
&MyNode::prev,
&MyNode::next> NodeChain;
typedef EStack< MyDataStructure,
MyNode,
&MyDataStructure::m_stackTop,
&MyNode::next> NodeStack;
};
...
MyDataStructure ds;
MyDataStructure::NodeChain.init(&ds);
MyDataStructure::NodeStack.init(&ds);
...
MyNode* ptr = new MyNode();
MyDataStructure::NodeChain.pushBack(&ds, ptr);
...
ptr = MyDataStructure::NodeChain.front(&ds);
MyDataStructure::NodeStack.push(&ds,ptr);
...
for (MyDataStructure::NodeChain::iterator it = MyDataStructure::NodeChain.begin(&ds);
it.valid(); it++)
{
ptr = *it;
}
- License:
- This file is part of the Open Graph Drawing Framework (OGDF).
- Copyright (C)
See README.md in the OGDF root directory for details.
- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License Version 2 or 3 as published by the Free Software Foundation; see the file LICENSE.txt included in the packaging of this file for details.
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/copyleft/gpl.html
Definition in file EList.h.