#include <LOCA_ErrorCheck.H>
Public Types | |
enum | ActionType { ThrowError, PrintWarning } |
Type for the action to be taken if the ReturnType is not Ok. More... | |
Public Member Functions | |
ErrorCheck (const Teuchos::RCP< LOCA::GlobalData > &global_data) | |
Constructor. | |
~ErrorCheck () | |
Destructor. | |
void | throwError (const string &callingFunction="<Unknown Method>", const string &message="", const string &throwLabel="LOCA Error") |
Generic call to throw that prints info to the screen. | |
void | printWarning (const string &callingFunction="<Unknown Method>", const string &message="") |
Generic printing algorithm for sending warnings to the screen. | |
void | checkReturnType (const NOX::Abstract::Group::ReturnType &status, const string &callingFunction=string("<Unknown Method>")) |
Checks the supplied return type and performs an appropriate action. | |
void | checkReturnType (const NOX::Abstract::Group::ReturnType &status, const ActionType &action, const string &callingFunction=string("<Unknown Method>"), const string &message=string("")) |
Checks the return type for the NOX::AbstractGroup and may throw an error or print a warning to the screen based on the ActionType requested. | |
NOX::Abstract::Group::ReturnType | combineReturnTypes (const NOX::Abstract::Group::ReturnType &status1, const NOX::Abstract::Group::ReturnType &status2) |
Combines two return types. | |
NOX::Abstract::Group::ReturnType | combineAndCheckReturnTypes (const NOX::Abstract::Group::ReturnType &status1, const NOX::Abstract::Group::ReturnType &status2, const string &callingFunction=string("<Unknown Method>")) |
Combines two return types and checks the first. | |
Protected Member Functions | |
string | getReturnTypeString (NOX::Abstract::Group::ReturnType status) |
Converts the NOX::Abstract::Group::ReturnType to a string. | |
Protected Attributes | |
Teuchos::RCP< LOCA::GlobalData > | globalData |
Global data. |
This object will check the return types on objects and print a warning or throw an error if appropriate
Definition at line 63 of file LOCA_ErrorCheck.H.
Type for the action to be taken if the ReturnType is not Ok.
Definition at line 74 of file LOCA_ErrorCheck.H.
LOCA::ErrorCheck::ErrorCheck | ( | const Teuchos::RCP< LOCA::GlobalData > & | global_data | ) |
LOCA::ErrorCheck::~ErrorCheck | ( | ) |
void LOCA::ErrorCheck::throwError | ( | const string & | callingFunction = "<Unknown Method>" , |
|
const string & | message = "" , |
|||
const string & | throwLabel = "LOCA Error" | |||
) |
Generic call to throw that prints info to the screen.
Definition at line 57 of file LOCA_ErrorCheck.C.
References NOX::Utils::Error, and globalData.
Referenced by checkReturnType().
void LOCA::ErrorCheck::printWarning | ( | const string & | callingFunction = "<Unknown Method>" , |
|
const string & | message = "" | |||
) |
Generic printing algorithm for sending warnings to the screen.
Definition at line 72 of file LOCA_ErrorCheck.C.
References globalData, and NOX::Utils::Warning.
Referenced by checkReturnType().
void LOCA::ErrorCheck::checkReturnType | ( | const NOX::Abstract::Group::ReturnType & | status, | |
const string & | callingFunction = string("<Unknown Method>") | |||
) |
Checks the supplied return type and performs an appropriate action.
This routine performs the following actions depending on the value of status
Definition at line 84 of file LOCA_ErrorCheck.C.
References NOX::Abstract::Group::BadDependency, NOX::Abstract::Group::Failed, NOX::Abstract::Group::NotConverged, NOX::Abstract::Group::NotDefined, NOX::Abstract::Group::Ok, PrintWarning, throwError(), and ThrowError.
Referenced by combineAndCheckReturnTypes().
void LOCA::ErrorCheck::checkReturnType | ( | const NOX::Abstract::Group::ReturnType & | status, | |
const ActionType & | action, | |||
const string & | callingFunction = string("<Unknown Method>") , |
|||
const string & | message = string("") | |||
) |
Checks the return type for the NOX::AbstractGroup and may throw an error or print a warning to the screen based on the ActionType requested.
Definition at line 101 of file LOCA_ErrorCheck.C.
References getReturnTypeString(), NOX::Abstract::Group::Ok, printWarning(), PrintWarning, throwError(), and ThrowError.
NOX::Abstract::Group::ReturnType LOCA::ErrorCheck::combineReturnTypes | ( | const NOX::Abstract::Group::ReturnType & | status1, | |
const NOX::Abstract::Group::ReturnType & | status2 | |||
) |
Combines two return types.
If either return type is NOX::Abstract::Group::NotDefined, returns NotDefined. Otherwise if either is BadDependcy, returns BadDependency, if either is Failed, returns Failed, if either is NotConverged, returns NotConverged, and otherwise returns Ok.
Definition at line 132 of file LOCA_ErrorCheck.C.
References NOX::Abstract::Group::BadDependency, NOX::Abstract::Group::Failed, NOX::Abstract::Group::NotConverged, NOX::Abstract::Group::NotDefined, and NOX::Abstract::Group::Ok.
Referenced by combineAndCheckReturnTypes().
NOX::Abstract::Group::ReturnType LOCA::ErrorCheck::combineAndCheckReturnTypes | ( | const NOX::Abstract::Group::ReturnType & | status1, | |
const NOX::Abstract::Group::ReturnType & | status2, | |||
const string & | callingFunction = string("<Unknown Method>") | |||
) |
Combines two return types and checks the first.
First combines status1 and status2 using combineReturnTypes() and checks the first using checkReturnType().
Definition at line 153 of file LOCA_ErrorCheck.C.
References checkReturnType(), and combineReturnTypes().
string LOCA::ErrorCheck::getReturnTypeString | ( | NOX::Abstract::Group::ReturnType | status | ) | [protected] |
Converts the NOX::Abstract::Group::ReturnType to a string.
Definition at line 164 of file LOCA_ErrorCheck.C.
References NOX::Abstract::Group::BadDependency, NOX::Abstract::Group::Failed, NOX::Abstract::Group::NotConverged, NOX::Abstract::Group::NotDefined, and NOX::Abstract::Group::Ok.
Referenced by checkReturnType().
Teuchos::RCP<LOCA::GlobalData> LOCA::ErrorCheck::globalData [protected] |
Global data.
Definition at line 145 of file LOCA_ErrorCheck.H.
Referenced by printWarning(), and throwError().