6 * $Date: 2012-07-02 20:59:27 +0200 (Mon, 02 Jul 2012) $
7 ***************************************************************/
10 * \brief Declares base class for all module types.
12 * \author Carsten Gutwenger
15 * This file is part of the Open Graph Drawing Framework (OGDF).
19 * See README.txt in the root directory of the OGDF installation for details.
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
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.
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 ***************************************************************/
52 #include <ogdf/basic/basic.h>
58 * \brief Base class for modules.
60 * A module represents an algorithm that implements a certain interface.
61 * There are various specific module types present in the OGDF, which all
62 * inherit Module as a base class. These module types define the interface
63 * implemented by the module.
67 class OGDF_EXPORT Module
70 //! The return type of a module.
72 retFeasible
, //!< The solution is feasible.
73 retOptimal
, //!< The solution is optimal
74 retNoFeasibleSolution
, //!< There exists no feasible solution.
75 retTimeoutFeasible
, //!< The solution is feasible, but there was a timeout.
76 retTimeoutInfeasible
, //!< The solution is not feasible due to a timeout.
77 retError
//! Computation was aborted due to an error.
80 //! Initializes a module.
85 //! Returns true iff \a retVal indicates that the module returned a feasible solution.
86 static bool isSolution(ReturnType ret
) {
87 return ret
== retFeasible
|| ret
== retOptimal
|| ret
== retTimeoutFeasible
;
92 } // end namespace ogdf