OpendTect  6.6
errmsg.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: Bert
8  Date: Sep 2013
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 */
13 
14 #include "commondefs.h"
15 
16 class uiString;
17 
18 mGlobal(Basic) void ErrMsg(const char*,bool progr=false);
19 mGlobal(Basic) void ErrMsg(const uiString&);
20 
21 #include <typeinfo>
22 template <class T>
23 inline const char* className( const T& t )
24 {
25  const char* nm = typeid(t).name();
26  while ( *nm >= '0' && *nm <= '9' ) nm++;
27  return nm;
28 }
29 
30 
31 namespace OD {
32  mGlobal(Basic) void programmerErrMsg(const char* msg,const char* cname,
33  const char* fnm,int linenr);
34  mGlobal(Basic) void SetGlobalLogFile(const char*);
35 }
36 
37 # define pErrMsg(msg) \
38  OD::programmerErrMsg(msg,::className(*this),__FILE__,__LINE__)
39 
41 #define pErrMsgOnce(msg) \
42 { \
43  mDefineStaticLocalObject( bool, __message_shown__, = false ); \
44  if ( !__message_shown__ ) \
45  { \
46  __message_shown__ = true; \
47  pErrMsg(msg); \
48  } \
49 }
50 
51 
52 # define pFreeFnErrMsg(msg) \
53  OD::programmerErrMsg( msg, __func__, __FILE__, __LINE__ )
54 
OD::programmerErrMsg
void programmerErrMsg(const char *msg, const char *cname, const char *fnm, int linenr)
OD::SetGlobalLogFile
void SetGlobalLogFile(const char *)
mGlobal
#define mGlobal(module)
Definition: commondefs.h:180
commondefs.h
ErrMsg
void ErrMsg(const char *, bool progr=false)
OD
OpendTect.
Definition: commontypes.h:28
uiString
String that is able to hold international (UTF-8) strings for the user interface.
Definition: uistring.h:121
className
const char * className(const T &t)
Definition: errmsg.h:23

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2021