Open
Graph Drawing
Framework

 v.2007.11
 

HeapBase.h

Go to the documentation of this file.
00001 /*
00002  * $Revision: 1.2 $
00003  * 
00004  * last checkin:
00005  *   $Author:klein $ 
00006  *   $Date:2007-10-18 17:23:28 +0200 (Thu, 18 Oct 2007) $ 
00007  ***************************************************************/
00008  
00052 #ifdef _MSC_VER
00053 #pragma once
00054 #endif
00055 
00056 #ifndef OREAS_HEAP_BASE_H
00057 #define OREAS_HEAP_BASE_H
00058 
00059 
00060 
00061 #include <ogdf/basic/GraphCopy.h>
00062 
00063 
00064 
00065 
00066 namespace ogdf {
00067 
00068 
00091 class HeapEntry;
00092 
00093 class HeapEntryPointer;
00094 
00095 template <class Priority, class HeapObject>
00096 class  HeapBase {
00097 
00098 public:
00100        HeapBase() {};
00101        
00102        virtual ~HeapBase() {}
00103 
00104       
00106        virtual void makeHeap() = 0;
00107 
00108        HeapObject minRet() {}
00109 
00110        //*******************************************************
00111        //Modification
00112 
00114        virtual void insert(HeapObject, Priority /* key */) {};
00115         //extractMin
00116        //derived classes should decide themselves if they have 
00117        //a specific delete function
00118        //virtual void delete() = 0;
00119         
00121        //TODO: Does not make much sense without an object parameter
00122        virtual void decreaseKey() {};
00123 
00124        //*******************************************************
00125        //constant functions
00126        int size() const {return m_size;}
00127 
00128        bool empty() const {return m_size==0;}
00129 
00130 
00131 protected:
00132     int m_size; //number of elements stored in heap
00133 
00134 };
00135 
00136 
00137 
00138 } //namespace oreas
00139 
00140 #endif
00141 /*
00142        //return and deletes the object with minimum priority
00143        objects extractMin()
00144        {
00145          objects theMin = minRet();
00146          deleteMin();
00147          return theMin;
00148        }
00149 
00150        //deletes the object with minimum priority
00151        void deleteMin() {deleteObject(minPointer); size--;}
00152 */


© 1999-2007 by oreas GmbH, © 2005-2007 by University Dortmund and University Cologne.

Generated on Thu Nov 22 19:40:01 2007 by doxygen 1.5.4.