error.hpp
Go to the documentation of this file.
1 /*------------------------------- phasicFlow ---------------------------------
2  O C enter of
3  O O E ngineering and
4  O O M ultiscale modeling of
5  OOOOOOO F luid flow
6 ------------------------------------------------------------------------------
7  Copyright (C): www.cemf.ir
8  email: hamid.r.norouzi AT gmail.com
9 ------------------------------------------------------------------------------
10 Licence:
11  This file is part of phasicFlow code. It is a free software for simulating
12  granular and multiphase flows. You can redistribute it and/or modify it under
13  the terms of GNU General Public License v3 or any other later versions.
14 
15  phasicFlow is distributed to help others in their research in the field of
16  granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
17  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 
19 -----------------------------------------------------------------------------*/
20 
21 
22 #ifndef __error_hpp__
23 #define __error_hpp__
24 
25 
26 #include "builtinTypes.hpp"
27 
28 
29 namespace pFlow
30 {
31  class iOstream;
32 }
33 
34 
35 // reports a fatal error and exit the applicaiton
36 #define fatalError \
37  fatalErrorMessage(__FILE__, __LINE__)
38 
39 #define fatalErrorIn( functionName ) \
40  fatalErrorInMessage((functionName), __FILE__, __LINE__ )
41 
42 #define fatalErrorInFunction fatalErrorIn(FUNCTION_NAME)
43 
44 #define Not_Implemented(functionName) \
45  notImplementedErrorMessage ((functionName), __FILE__, __LINE__ )
46 
47 #define notImplementedFunction Not_Implemented(FUNCTION_NAME);
48 
49 #define ioErrorInFile( fileName, lineNumber) \
50  ioErrorMessage( fileName, lineNumber, FUNCTION_NAME, __FILE__, __LINE__ )
51 
52 #define warningIn( functionName ) \
53  warningMessage((functionName), __FILE__, __LINE__ )
54 
55 #define warningInFunction warningIn(FUNCTION_NAME)
56 
57 #define fatalExit \
58  reportAndExit()
59 
60 pFlow::iOstream& fatalErrorMessage(const char* fileName, int linNumber );
61 pFlow::iOstream& fatalErrorInMessage(const char* fnName, const char* fileName, int linNumber );
62 pFlow::iOstream& notImplementedErrorMessage(const char*fnName, const char* fileName, int lineNumber);
63 pFlow::iOstream& ioErrorMessage(const pFlow::word& fileName, int fileLineNumber, const char* fnName, const char* fName, int lNumber);
64 pFlow::iOstream& ioErrorMessage(const char* fileName, int fileLineNumber, const char* fnName, const char* fName, int lNumber);
65 pFlow::iOstream& warningMessage(const char* fnName, const char* fileName, int linNumber );
67 
68 #endif
fatalErrorMessage
pFlow::iOstream & fatalErrorMessage(const char *fileName, int linNumber)
Definition: error.cpp:31
reportAndExit
pFlow::iOstream & reportAndExit()
Definition: error.cpp:89
pFlow::word
std::string word
Definition: builtinTypes.hpp:63
ioErrorMessage
pFlow::iOstream & ioErrorMessage(const pFlow::word &fileName, int fileLineNumber, const char *fnName, const char *fName, int lNumber)
Definition: error.cpp:73
pFlow
Definition: demComponent.hpp:28
fatalErrorInMessage
pFlow::iOstream & fatalErrorInMessage(const char *fnName, const char *fileName, int linNumber)
Definition: error.cpp:41
warningMessage
pFlow::iOstream & warningMessage(const char *fnName, const char *fileName, int linNumber)
Definition: error.cpp:79
notImplementedErrorMessage
pFlow::iOstream & notImplementedErrorMessage(const char *fnName, const char *fileName, int lineNumber)
Definition: error.cpp:51
builtinTypes.hpp
pFlow::iOstream
Definition: iOstream.hpp:53