Open
Graph Drawing
Framework

 v.2012.05
 

AugmentationModule.h
Go to the documentation of this file.
00001 /*
00002  * $Revision: 2299 $
00003  * 
00004  * last checkin:
00005  *   $Author: gutwenger $ 
00006  *   $Date: 2012-05-07 15:57:08 +0200 (Mon, 07 May 2012) $ 
00007  ***************************************************************/
00008  
00042 #ifdef _MSC_VER
00043 #pragma once
00044 #endif
00045 
00046 #ifndef OGDF_AUGMENTATION_MODULE_H
00047 #define OGDF_AUGMENTATION_MODULE_H
00048 
00049 
00050 
00051 #include <ogdf/basic/Graph.h>
00052 
00053 namespace ogdf {
00054 
00070 class OGDF_EXPORT AugmentationModule {
00071 public:
00073     AugmentationModule() { }
00074     // destruction
00075     virtual ~AugmentationModule() { }
00076 
00078     void call(Graph& G) {
00079         List<edge> L;
00080         call(G,L);
00081     }
00082 
00084     void operator()(Graph& G) { call(G); }
00085 
00091     void call(Graph& G, List<edge> &L) {
00092         doCall(G,L);
00093         m_nAddedEdges = L.size();
00094     }
00095     
00101     void operator()(Graph& G, List<edge> &L) { call(G,L); }
00102     
00104     int numberOfAddedEdges() const {
00105         return m_nAddedEdges;
00106     }
00107 
00108 protected:
00114     virtual void doCall(Graph& G, List<edge> &L) = 0;
00115 
00116 private:
00117     int m_nAddedEdges;
00118 
00119     OGDF_MALLOC_NEW_DELETE
00120 };
00121 
00122 } // end namespace ogdf
00123 
00124 #endif