DATRW++ library: seismic data I/O with multiple formats
report.h
Go to the documentation of this file.
1 /*! \file report.h
2  * \brief report errors and warnings (prototypes)
3  *
4  * ----------------------------------------------------------------------------
5  *
6  * \author Thomas Forbriger
7  * \date 08/07/2016
8  *
9  * report errors and warnings (prototypes)
10  *
11  * \ingroup group_error
12  *
13  * Copyright (c) 2016 by Thomas Forbriger (BFO Schiltach)
14  *
15  * ----
16  * This program is free software; you can redistribute it and/or modify
17  * it under the terms of the GNU General Public License as published by
18  * the Free Software Foundation; either version 2 of the License, or
19  * (at your option) any later version.
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24  * GNU General Public License for more details.
25  *
26  * You should have received a copy of the GNU General Public License
27  * along with this program. If not, see <http://www.gnu.org/licenses/>.
28 
29  * ----
30  *
31  * REVISIONS and CHANGES
32  * - 08/07/2016 V1.0 Thomas Forbriger
33  *
34  * ============================================================================
35  */
36 
37 // include guard
38 #ifndef DATRW_REPORT_H_VERSION
39 
40 #define DATRW_REPORT_H_VERSION \
41  "DATRW_REPORT_H V1.0"
42 
43 #include <string>
44 
45 namespace datrw {
46 
47  namespace util {
48 
49  /*! \brief report categories
50  * \ingroup group_error
51  */
52  enum Ereport {
53  //! just a warning; processing can proceeed
55  //! an error, but non-fatal; processing will proceed
57  //! a fatal error; processing wil abort as a consequence
59  }; // enum Ereport
60 
61  /* ---------------------------------------------------------------------- */
62 
63  /*! \brief report violation of condition
64  *
65  * \ingroup group_error
66  * \param message message of type char*
67  * \param file name of source code file
68  * \param line source code line number
69  * \param condition assert condition
70  * \param t type of incident to be reported
71  */
72  void report_violation(const Ereport& t,
73  const std::string& message,
74  const std::string& file,
75  const int& line,
76  const std::string& condition);
77 
78  /* ---------------------------------------------------------------------- */
79 
80  /*! \brief report deprecation of a function
81  *
82  * \ingroup group_error
83  * \param function name of deprecated function
84  * \param reason the reason for deprecating the function
85  * should finish a sentence which started with
86  * "because"
87  */
88  void report_deprecated(const std::string& function,
89  const std::string& reason);
90 
91  } // namespace util
92 
93 } // namespace datrw
94 
95 #endif // DATRW_REPORT_H_VERSION (includeguard)
96 
97 /* ----- END OF report.h ----- */
void report_deprecated(const std::string &function, const std::string &reason)
report deprecated function
Definition: report.cc:113
a fatal error; processing wil abort as a consequence
Definition: report.h:58
Ereport
report categories
Definition: report.h:52
just a warning; processing can proceeed
Definition: report.h:54
Root namespace of library.
Definition: aalibdatrwxx.cc:16
an error, but non-fatal; processing will proceed
Definition: report.h:56
void report_violation(const Ereport &t, const std::string &message, const std::string &file, const int &line, const std::string &condition)
report violation of assertion
Definition: report.cc:52