Proto
Proto_MayDay.H
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
7  * Please refer to Copyright.txt, in Chombo's root directory.
8  */
9 #endif
10 
11 #ifndef _Proto_MAYDAY_H_
12 #define _Proto_MAYDAY_H_
13 #include "Proto_parstream.H"
14 
15 #define CH_DEFAULT_ERROR_CODE 255
16 namespace Proto
17 {
19 
27  template <typename T=void>
28  class MayDay
29  {
30  public:
31 
32  static bool s_debugSpew;
34  [[noreturn]] inline static void Error(const char * const a_msg = m_nullString, int m_exitCode = CH_DEFAULT_ERROR_CODE);
35 
37 
39  inline static void Abort(const char * const a_msg = m_nullString);
40 
42  inline static void Warning(const char * const a_msg = m_nullString);
43 
44  static const char * const version;
45 
46 protected:
48  static const char * const m_nullString;
49 };
50 #include "implem/Proto_MayDayImplem.H"
51 } // end Proto namespace.
52 #endif
static void Abort(const char *const a_msg=m_nullString)
Print out message to cerr and exit via abort() (if serial) or MPI_Abort() (if parallel).
Definition: Proto_MayDay.H:80
static void Warning(const char *const a_msg=m_nullString)
Print out message to cerr and continue.
Definition: Proto_MayDay.H:93
static const char *const m_nullString
A null string used as a default argument by the other member functions.
Definition: Proto_MayDay.H:48
Error-reporting Functions.
Definition: Proto_MayDay.H:28
static void Error(const char *const a_msg=m_nullString, int m_exitCode=CH_DEFAULT_ERROR_CODE)
Print out message to cerr and exit with the specified exit code.
Definition: Proto_MayDay.H:67
Definition: Proto_Box.H:11