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...
Go to the source code of this file.
Classes | |
| class | ogdf::EStack< S, E, first, next > |
| The embedded stack class template. More... | |
| class | ogdf::EListIterator< E, prev, next > |
| Implementation of an embedded list iterator used by EList. More... | |
| class | ogdf::EList< L, E, numElem, first, last, next, prev > |
| The embedded list template. More... | |
Namespaces | |
| namespace | ogdf |
| The namespace for all OGDF objects. | |
Defines | |
| #define | OGDF_ELIST_H |
Declaration and implementation of embedded stack and list functionality which is useful for embedded chains of elements (classes with internal next and previous pointer).
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; }
Copyright (C). All rights reserved. See README.txt in the root directory of the OGDF installation for details.
Definition in file EList.h.
| #define OGDF_ELIST_H |