Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

AugmentationModule.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Graph.h>
35 #include <ogdf/basic/List.h>
36 #include <ogdf/basic/basic.h>
37 #include <ogdf/basic/memory.h>
38 
39 namespace ogdf {
40 
57 public:
59  AugmentationModule() : m_nAddedEdges(0) { }
60 
61  // destruction
62  virtual ~AugmentationModule() { }
63 
65  void call(Graph& G) {
66  List<edge> L;
67  call(G, L);
68  }
69 
71  void operator()(Graph& G) { call(G); }
72 
78  void call(Graph& G, List<edge>& L) {
79  doCall(G, L);
80  m_nAddedEdges = L.size();
81  }
82 
88  void operator()(Graph& G, List<edge>& L) { call(G, L); }
89 
91  int numberOfAddedEdges() const { return m_nAddedEdges; }
92 
93 protected:
99  virtual void doCall(Graph& G, List<edge>& L) = 0;
100 
101 private:
103 
105 };
106 
107 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
Graph.h
Includes declaration of graph class.
ogdf::AugmentationModule::~AugmentationModule
virtual ~AugmentationModule()
Definition: AugmentationModule.h:62
ogdf::AugmentationModule::numberOfAddedEdges
int numberOfAddedEdges() const
Returns the number of added edges.
Definition: AugmentationModule.h:91
ogdf::AugmentationModule::AugmentationModule
AugmentationModule()
Initializes an augmentation module.
Definition: AugmentationModule.h:59
OGDF_MALLOC_NEW_DELETE
#define OGDF_MALLOC_NEW_DELETE
Makes the class use malloc for memory allocation.
Definition: memory.h:92
ogdf::AugmentationModule::operator()
void operator()(Graph &G)
Calls the augmentation module for graph G.
Definition: AugmentationModule.h:71
ogdf::List< edge >
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:869
ogdf::AugmentationModule
The base class for graph augmentation algorithms.
Definition: AugmentationModule.h:56
ogdf::AugmentationModule::m_nAddedEdges
int m_nAddedEdges
Definition: AugmentationModule.h:102
ogdf::AugmentationModule::operator()
void operator()(Graph &G, List< edge > &L)
Calls the augmentation module for graph G.
Definition: AugmentationModule.h:88
basic.h
Basic declarations, included by all source files.
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
List.h
Declaration of doubly linked lists and iterators.
ogdf::List::size
int size() const
Returns the number of elements in the list.
Definition: List.h:1488
memory.h
Declaration of memory manager for allocating small pieces of memory.
ogdf::AugmentationModule::call
void call(Graph &G, List< edge > &L)
Calls the augmentation module for graph G.
Definition: AugmentationModule.h:78
ogdf::AugmentationModule::call
void call(Graph &G)
Calls the augmentation module for graph G.
Definition: AugmentationModule.h:65