18 int Object::tracebackMode = -1;
22 tracebackMode = (tracebackModeIn != -1) ? tracebackModeIn : tracebackMode;
28 tracebackMode = (tracebackModeIn != -1) ? tracebackModeIn : tracebackMode;
34 tracebackMode = (tracebackModeIn != -1) ? tracebackModeIn : tracebackMode;
37 void Object::setLabel (
const char* theLabel) {
38 label_ = std::string (theLabel);
43 if (tracebackModeValue < 0) {
44 tracebackModeValue = 0;
46 Object tempObject (tracebackModeValue);
51 int temp = Object::tracebackMode;
53 temp = Teuchos_DefaultTracebackMode;
78 if (tracebackMode == 1 && errorCode < 0) {
80 cerr << endl <<
"Error in Teuchos Object with label: " << label_
81 << endl <<
"Teuchos Error: " << message <<
" Error Code: "
85 if (tracebackMode == 2 && errorCode != 0) {
86 cerr << endl <<
"Error in Teuchos Object with label: " << label_
87 << endl <<
"Teuchos Error: " << message <<
" Error Code: "
96 return label_.c_str ();
101 os << obj.
label () << std::endl;
virtual const char * label() const
Access the object's label (LEGACY; return std::string instead).
virtual void print(std::ostream &os) const
Print the object to the given output stream.
Object(int tracebackModeIn=-1)
Default Constructor.
virtual int reportError(const std::string message, int errorCode) const
Report an error with this Object.
static int getTracebackMode()
Get the value of the Object error traceback report mode.
static void setTracebackMode(int tracebackModeValue)
Set the value of the Object error traceback report mode.