00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef LOCA_ERRORCHECK_H
00043 #define LOCA_ERRORCHECK_H
00044
00045 #include "Teuchos_RCP.hpp"
00046
00047 #include "NOX_Common.H"
00048 #include "NOX_Abstract_Group.H"
00049
00050
00051 namespace LOCA {
00052 class GlobalData;
00053 }
00054
00055 namespace LOCA {
00056
00058
00063 class ErrorCheck {
00064
00065 public:
00066
00068 ErrorCheck(const Teuchos::RCP<LOCA::GlobalData>& global_data);
00069
00071 ~ErrorCheck();
00072
00074 enum ActionType {
00075 ThrowError,
00076 PrintWarning
00077 };
00078
00080 void throwError(const string& callingFunction = "<Unknown Method>",
00081 const string& message = "",
00082 const string& throwLabel = "LOCA Error");
00083
00085 void printWarning(const string& callingFunction = "<Unknown Method>",
00086 const string& message = "");
00087
00089
00100 void checkReturnType(
00101 const NOX::Abstract::Group::ReturnType& status,
00102 const string& callingFunction = string("<Unknown Method>"));
00103
00109 void checkReturnType(
00110 const NOX::Abstract::Group::ReturnType& status,
00111 const ActionType& action,
00112 const string& callingFunction = string("<Unknown Method>"),
00113 const string& message = string(""));
00114
00116
00122 NOX::Abstract::Group::ReturnType
00123 combineReturnTypes(const NOX::Abstract::Group::ReturnType& status1,
00124 const NOX::Abstract::Group::ReturnType& status2);
00125
00127
00131 NOX::Abstract::Group::ReturnType
00132 combineAndCheckReturnTypes(
00133 const NOX::Abstract::Group::ReturnType& status1,
00134 const NOX::Abstract::Group::ReturnType& status2,
00135 const string& callingFunction = string("<Unknown Method>"));
00136
00137 protected:
00138
00140 string getReturnTypeString(NOX::Abstract::Group::ReturnType status);
00141
00142 protected:
00143
00145 Teuchos::RCP<LOCA::GlobalData> globalData;
00146
00147 };
00148 }
00149
00150 #endif