44 #ifndef EPETRA_OBJECT_H
45 #define EPETRA_OBJECT_H
67 Epetra_Object(
int TracebackModeIn = -1,
bool set_label =
true);
72 Epetra_Object(
const char *
const Label,
int TracebackModeIn = -1);
91 virtual void SetLabel(
const char *
const Label);
96 virtual const char * Label()
const;
111 static void SetTracebackMode(
int TracebackModeValue);
114 static int GetTracebackMode();
117 static std::ostream& GetTracebackStream();
126 virtual void Print(std::ostream & os)
const;
129 virtual int ReportError(
const std::string Message,
int ErrorCode)
const;
147 snprintf(s,
sizeof(s),
"%d", x);
148 return std::string(s);
152 snprintf(s,
sizeof(s),
"%lld", x);
153 return std::string(s);
158 snprintf(s,
sizeof(s),
"%g", x);
159 return std::string(s);
165 SetLabel(src.
Label());
180 os << obj.
Label() << std::endl;
201 #define EPETRA_TEST_FOR_EXCEPTION(throw_exception_test,errCode,msg) \
203 const bool throw_exception = (throw_exception_test); \
204 if(throw_exception) { \
205 std::ostringstream omsg; \
207 << __FILE__ << ":" << __LINE__ << ":" \
208 << " Throw test that evaluated to true: "#throw_exception_test << ":" \
209 << "Error message : " << msg; \
210 throw ReportError(omsg.str(),errCode); \
216 #if defined(Epetra_SHOW_DEPRECATED_WARNINGS)
218 #warning "The Epetra package is deprecated"
virtual void Print(std::ostream &os) const
Print object to an output stream Print method.
std::string toString(const double &x) const
std::ostream & operator<<(std::ostream &os, const Epetra_Object &obj)
Epetra_Combine Mode enumerable type.
const bool Epetra_FormatStdout
virtual const char * Label() const
Epetra_Object Label access funtion.
std::string toString(const int &x) const
Epetra_Object & operator=(const Epetra_Object &src)
Epetra_Object: The base Epetra class.
std::string toString(const long long &x) const
Epetra_DataAccess Mode enumerable type.