www.cemf.ir
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 #ifndef __error_hpp__
22 #define __error_hpp__
23 
24 #include "builtinTypes.hpp"
25 
26 //- Forward decleartions
27 namespace pFlow
28 {
29 class iOstream;
30 }
31 
32 //- Decleartions
33 
35 int
36 fatalExitPhasicFlow(int errorCode = EXIT_FAILURE);
37 
39 fatalErrorMessage(const char* fileName, int linNumber);
41 fatalErrorInMessage(const char* fnName, const char* fileName, int linNumber);
44  const char* fnName,
45  const char* fileName,
46  int lineNumber
47 );
50  const pFlow::word& fileName,
51  int fileLineNumber,
52  const char* fnName,
53  const char* fName,
54  int lNumber
55 );
58  const char* fileName,
59  int fileLineNumber,
60  const char* fnName,
61  const char* fName,
62  int lNumber
63 );
65 warningMessage(const char* fnName, const char* fileName, int linNumber);
67 reportAndExit(int errorCode = EXIT_FAILURE);
68 
70 #define fatalError fatalErrorMessage(__FILE__, __LINE__)
71 
73 #define fatalErrorIn(functionName) \
74  fatalErrorInMessage((functionName), __FILE__, __LINE__)
75 
77 #define fatalErrorInFunction fatalErrorIn(FUNCTION_NAME)
78 
80 #define Not_Implemented(functionName) \
81  notImplementedErrorMessage((functionName), __FILE__, __LINE__)
82 
84 #define notImplementedFunction Not_Implemented(FUNCTION_NAME)
85 
87 #define ioErrorInFile(fileName, lineNumber) \
88  ioErrorMessage(fileName, lineNumber, FUNCTION_NAME, __FILE__, __LINE__)
89 
91 #define warningIn(functionName) \
92  warningMessage((functionName), __FILE__, __LINE__)
93 
95 #define warningInFunction warningIn(FUNCTION_NAME)
96 
98 #define fatalExit reportAndExit()
99 
100 #endif
reportAndExit
pFlow::iOstream & reportAndExit(int errorCode=EXIT_FAILURE)
Definition: error.cpp:111
fatalErrorMessage
pFlow::iOstream & fatalErrorMessage(const char *fileName, int linNumber)
Definition: error.cpp:35
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
ioErrorMessage
pFlow::iOstream & ioErrorMessage(const pFlow::word &fileName, int fileLineNumber, const char *fnName, const char *fName, int lNumber)
Definition: error.cpp:87
pFlow
Definition: demGeometry.hpp:27
fatalErrorInMessage
pFlow::iOstream & fatalErrorInMessage(const char *fnName, const char *fileName, int linNumber)
Definition: error.cpp:44
warningMessage
pFlow::iOstream & warningMessage(const char *fnName, const char *fileName, int linNumber)
Definition: error.cpp:101
fatalExitPhasicFlow
int fatalExitPhasicFlow(int errorCode=EXIT_FAILURE)
Take actions to fatal exit phasicFlow.
Definition: error.cpp:119
notImplementedErrorMessage
pFlow::iOstream & notImplementedErrorMessage(const char *fnName, const char *fileName, int lineNumber)
Definition: error.cpp:54
builtinTypes.hpp
pFlow::iOstream
Interface class for any output stream.
Definition: iOstream.hpp:59