Add tests for UpdateCrypto
[TortoiseGit.git] / ext / OGDF / ogdf / module / AugmentationModule.h
blobd80bfcebde6329741e6a8dda7431d701c9a3763b
1 /*
2 * $Revision: 2523 $
4 * last checkin:
5 * $Author: gutwenger $
6 * $Date: 2012-07-02 20:59:27 +0200 (Mon, 02 Jul 2012) $
7 ***************************************************************/
9 /** \file
10 * \brief Declaration of interface for graph augmentation algorithms
12 * \author Carsten Gutwenger
14 * \par License:
15 * This file is part of the Open Graph Drawing Framework (OGDF).
17 * \par
18 * Copyright (C)<br>
19 * See README.txt in the root directory of the OGDF installation for details.
21 * \par
22 * This program is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU General Public License
24 * Version 2 or 3 as published by the Free Software Foundation;
25 * see the file LICENSE.txt included in the packaging of this file
26 * for details.
28 * \par
29 * This program is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU General Public License for more details.
34 * \par
35 * You should have received a copy of the GNU General Public
36 * License along with this program; if not, write to the Free
37 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
38 * Boston, MA 02110-1301, USA.
40 * \see http://www.gnu.org/copyleft/gpl.html
41 ***************************************************************/
43 #ifdef _MSC_VER
44 #pragma once
45 #endif
47 #ifndef OGDF_AUGMENTATION_MODULE_H
48 #define OGDF_AUGMENTATION_MODULE_H
52 #include <ogdf/basic/Graph.h>
54 namespace ogdf {
56 /**
57 * \brief The base class for graph augmentation algorithms.
59 * The class \a AugmentationModule is the base class for augmentation modules.
60 * An augmentation module transforms an input graph \a G into an output
61 * graph \a G' by adding edges, such that \a G' has a certain
62 * property, e.g., biconnected.
64 * <H3>Implementation of Augmentation Algorithms</H3>
65 * An implementation of an augmentation module must override
66 * the protected method doCall(G,L), which gets as
67 * input a graph reference \a G. It then adds the augmented edges
68 * to \a G and returns the list of added edges in \a L.
71 class OGDF_EXPORT AugmentationModule {
72 public:
73 //! Initializes an augmentation module.
74 AugmentationModule() { }
75 // destruction
76 virtual ~AugmentationModule() { }
78 //! Calls the augmentation module for graph \a G.
79 void call(Graph& G) {
80 List<edge> L;
81 call(G,L);
84 //! Calls the augmentation module for graph \a G.
85 void operator()(Graph& G) { call(G); }
87 /**
88 * \brief Calls the augmentation module for graph \a G.
90 * Returns the list of added edges in \a L.
92 void call(Graph& G, List<edge> &L) {
93 doCall(G,L);
94 m_nAddedEdges = L.size();
97 /**
98 * \brief Calls the augmentation module for graph \a G.
100 * Returns the list of added edges in \a L.
102 void operator()(Graph& G, List<edge> &L) { call(G,L); }
104 //! Returns the number of added edges.
105 int numberOfAddedEdges() const {
106 return m_nAddedEdges;
109 protected:
111 * \brief Implements the augmentation algorithm for graph \a G.
113 * Returns the list of added edges in \a L.
115 virtual void doCall(Graph& G, List<edge> &L) = 0;
117 private:
118 int m_nAddedEdges;
120 OGDF_MALLOC_NEW_DELETE
123 } // end namespace ogdf
125 #endif