Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MsqPrintError Class Reference

Utility class for printing error data - used in Mesquite tests. More...

#include <MsqError.hpp>

Inheritance diagram for MsqPrintError:
Collaboration diagram for MsqPrintError:

Public Member Functions

 MsqPrintError (msq_stdio::ostream &stream)
 Initialize with ostream to print error data to. More...
 
virtual ~MsqPrintError ()
 On destruction, conditionally prints error data. More...
 
 MsqPrintError (msq_stdio::ostream &stream)
 Initialize with ostream to print error data to. More...
 
virtual ~MsqPrintError ()
 On destruction, conditionally prints error data. More...
 
- Public Member Functions inherited from MsqError
void clear ()
 resets error object to non-active state (no error). More...
 
bool error () const
 Check if an error has occured. More...
 
 operator bool () const
 Check if an error has occured. More...
 
 MsqError ()
 Initialize to cleared state. More...
 
virtual ~MsqError ()
 Destructor - empty but must declar virtual destrucor if virtual functions. More...
 
ErrorCode error_code () const
 Get error code. More...
 
const char * error_message () const
 Get error message. More...
 
const StackTracestack () const
 Get stack trace. More...
 
virtual bool push (const char *function, const char *file, int line)
 Add to back-trace of call stack. More...
 
virtual bool set_error (ErrorCode num, const char *msg=0)
 Initialize the error object with the passed data. More...
 
void clear ()
 resets error object to non-active state (no error). More...
 
bool error () const
 Check if an error has occured. More...
 
 operator bool () const
 Check if an error has occured. More...
 
 MsqError ()
 Initialize to cleared state. More...
 
virtual ~MsqError ()
 Destructor - empty but must declar virtual destrucor if virtual functions. More...
 
ErrorCode error_code () const
 Get error code. More...
 
const char * error_message () const
 Get error message. More...
 
const StackTracestack () const
 Get stack trace. More...
 
virtual bool push (const char *function, const char *file, int line)
 Add to back-trace of call stack. More...
 
virtual bool set_error (ErrorCode num, const char *msg=0)
 Initialize the error object with the passed data. More...
 

Private Attributes

msq_std::ostream & outputStream
 

Additional Inherited Members

- Public Types inherited from MsqError
enum  ErrorCode {
  NO_ERROR = 0, UNKNOWN_ERROR, OUT_OF_MEMORY, INVALID_ARG,
  NOT_INITIALIZED, INVALID_STATE, FILE_ACCESS, FILE_FORMAT,
  PARSE_ERROR, IO_ERROR, INVALID_MESH, NO_PD_STORAGE_MODE,
  NOT_IMPLEMENTED, INTERNAL_ERROR, INTERRUPTED, TAG_ALREADY_EXISTS,
  TAG_NOT_FOUND, LAST_ERROR_CODE, NO_ERROR = 0, UNKNOWN_ERROR,
  OUT_OF_MEMORY, INVALID_ARG, NOT_INITIALIZED, INVALID_STATE,
  FILE_ACCESS, FILE_FORMAT, PARSE_ERROR, IO_ERROR,
  INVALID_MESH, NO_PD_STORAGE_MODE, NOT_IMPLEMENTED, INTERNAL_ERROR,
  INTERRUPTED, TAG_ALREADY_EXISTS, TAG_NOT_FOUND, LAST_ERROR_CODE
}
 Error codes. More...
 
enum  ErrorCode {
  NO_ERROR = 0, UNKNOWN_ERROR, OUT_OF_MEMORY, INVALID_ARG,
  NOT_INITIALIZED, INVALID_STATE, FILE_ACCESS, FILE_FORMAT,
  PARSE_ERROR, IO_ERROR, INVALID_MESH, NO_PD_STORAGE_MODE,
  NOT_IMPLEMENTED, INTERNAL_ERROR, INTERRUPTED, TAG_ALREADY_EXISTS,
  TAG_NOT_FOUND, LAST_ERROR_CODE, NO_ERROR = 0, UNKNOWN_ERROR,
  OUT_OF_MEMORY, INVALID_ARG, NOT_INITIALIZED, INVALID_STATE,
  FILE_ACCESS, FILE_FORMAT, PARSE_ERROR, IO_ERROR,
  INVALID_MESH, NO_PD_STORAGE_MODE, NOT_IMPLEMENTED, INTERNAL_ERROR,
  INTERRUPTED, TAG_ALREADY_EXISTS, TAG_NOT_FOUND, LAST_ERROR_CODE
}
 Error codes. More...
 
typedef msq_std::list< TraceStackTrace
 Container type used to store stack trace. More...
 
typedef msq_std::list< TraceStackTrace
 Container type used to store stack trace. More...
 
- Static Public Member Functions inherited from MsqError
static Setter setter (MsqError &err, const char *function, const char *file, int line)
 
static Setter setter (MsqError &err, const char *function, const char *file, int line)
 

Detailed Description

Utility class for printing error data - used in Mesquite tests.

Author
Jason Kraftcheck
Date
2004-10-11

A subclass of MsqError. Behaves the same as MsqError, except that it will automatically print itself to the specified ostream upon destruction if an error occured. For objections of this type declared on the stack (not new'd), this means that the error will be printed when the function returns (if an error occured.)

Definition at line 241 of file includeLinks/MsqError.hpp.

Constructor & Destructor Documentation

MsqPrintError ( msq_stdio::ostream &  stream)
inline

Initialize with ostream to print error data to.

Definition at line 245 of file includeLinks/MsqError.hpp.

246  : outputStream(stream) {}
~MsqPrintError ( )
virtual

On destruction, conditionally prints error data.

Definition at line 181 of file Misc/MsqError.cpp.

References MsqError::error().

182  { if (error()) outputStream << *this << msq_stdio::endl; }
bool error() const
Check if an error has occured.

Here is the call graph for this function:

MsqPrintError ( msq_stdio::ostream &  stream)
inline

Initialize with ostream to print error data to.

Definition at line 245 of file src/Misc/MsqError.hpp.

246  : outputStream(stream) {}
virtual ~MsqPrintError ( )
virtual

On destruction, conditionally prints error data.

Member Data Documentation

msq_std::ostream & outputStream
private

Definition at line 253 of file includeLinks/MsqError.hpp.


The documentation for this class was generated from the following files: