44 #ifndef EPETRA_OBJECT_H
45 #define EPETRA_OBJECT_H
47 #if defined(Epetra_SHOW_DEPRECATED_WARNINGS)
49 #warning "The Epetra package is deprecated"
75 Epetra_Object(
int TracebackModeIn = -1,
bool set_label =
true);
80 Epetra_Object(
const char *
const Label,
int TracebackModeIn = -1);
99 virtual void SetLabel(
const char *
const Label);
104 virtual const char * Label()
const;
119 static void SetTracebackMode(
int TracebackModeValue);
122 static int GetTracebackMode();
125 static std::ostream& GetTracebackStream();
134 virtual void Print(std::ostream & os)
const;
137 virtual int ReportError(
const std::string Message,
int ErrorCode)
const;
155 snprintf(s,
sizeof(s),
"%d", x);
156 return std::string(s);
160 snprintf(s,
sizeof(s),
"%lld", x);
161 return std::string(s);
166 snprintf(s,
sizeof(s),
"%g", x);
167 return std::string(s);
173 SetLabel(src.
Label());
188 os << obj.
Label() << std::endl;
209 #define EPETRA_TEST_FOR_EXCEPTION(throw_exception_test,errCode,msg) \
211 const bool throw_exception = (throw_exception_test); \
212 if(throw_exception) { \
213 std::ostringstream omsg; \
215 << __FILE__ << ":" << __LINE__ << ":" \
216 << " Throw test that evaluated to true: "#throw_exception_test << ":" \
217 << "Error message : " << msg; \
218 throw ReportError(omsg.str(),errCode); \
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.