Merge "Merge fatalerror into utility."
[alexxy/gromacs.git] / src / gromacs / utility.h
1 /*
2  *
3  *                This source code is part of
4  *
5  *                 G   R   O   M   A   C   S
6  *
7  *          GROningen MAchine for Chemical Simulations
8  *
9  * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
10  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
11  * Copyright (c) 2001-2009, The GROMACS development team,
12  * check out http://www.gromacs.org for more information.
13  *
14  * This program is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU General Public License
16  * as published by the Free Software Foundation; either version 2
17  * of the License, or (at your option) any later version.
18  *
19  * If you want to redistribute modifications, please consider that
20  * scientific software is very special. Version control is crucial -
21  * bugs must be traceable. We will be happy to consider code for
22  * inclusion in the official distribution, but derived work must not
23  * be called official GROMACS. Details are found in the README & COPYING
24  * files - if they are missing, get the official version at www.gromacs.org.
25  *
26  * To help us fund GROMACS development, we humbly ask that you cite
27  * the papers on the package - you can find them in the top README file.
28  *
29  * For more info, check our website at http://www.gromacs.org
30  */
31 /*! \defgroup module_utility Low-level Utility Module
32  * \ingroup group_utilitymodules
33  * \brief
34  * Provides various low-level utilities.
35  *
36  * <H3>Handling fatal errors</H3>
37  *
38  * Exception classes used in the library are defined in the exceptions.h header
39  * file.  This header also declares a ::GMX_THROW macro that should be used for
40  * throwing exceptions.  It also declares helper functions formatErrorMessage()
41  * and translateException() for creating standard error messages and
42  * translating exceptions to error return codes.
43  *
44  * Use of error return codes should be avoided in new code except in C wrappers
45  * and similar, but for compatibility, facilities for handling them are
46  * provided by the errorcodes.h header file.  It provides a set of error codes
47  * (the enum \ref gmx::ErrorCode) that should be used for return codes in functions.
48  * It also provides macros ::GMX_ERROR and ::GMX_ERROR_NORET that should be
49  * used for returning an error code.  setFatalErrorHandler() is provided to
50  * alter the behavior of ::GMX_ERROR and ::GMX_ERROR_NORET.  The default
51  * handler prints the reason of the error to standard error and aborts the
52  * execution.
53  *
54  * Header file gmxassert.h is also provided for assertions.  It declares macros
55  * ::GMX_ASSERT and ::GMX_RELEASE_ASSERT that should be used for assertions.
56  *
57  * \author Teemu Murtola <teemu.murtola@cbr.su.se>
58  */
59 /*! \file
60  * \brief
61  * Public API convenience header for low-level utilities.
62  *
63  * \author Teemu Murtola <teemu.murtola@cbr.su.se>
64  * \inpublicapi
65  * \ingroup module_utility
66  */
67 #ifndef GMX_UTILITY_H
68 #define GMX_UTILITY_H
69
70 #include "utility/errorcodes.h"
71 #include "utility/exceptions.h"
72 #include "utility/gmxassert.h"
73
74 #endif