Mesh Oriented datABase  (version 5.5.0)
An array-based unstructured mesh library
moab::Error Class Reference

#include <Error.hpp>

+ Collaboration diagram for moab::Error:

Public Member Functions

 Error ()
 
 ~Error ()
 
ErrorCode set_last_error (const std::string &error)
 
ErrorCode set_last_error (const char *fmt,...) MB_PRINTF(1)
 
ErrorCode set_last_error (const char *fmt, va_list args)
 
ErrorCode get_last_error (std::string &error) const
 

Private Attributes

std::string mLastError
 string to hold the last error that occurred in MB More...
 

Detailed Description

Definition at line 52 of file Error.hpp.

Constructor & Destructor Documentation

◆ Error()

moab::Error::Error ( )
inline

Definition at line 58 of file Error.hpp.

58 {}

◆ ~Error()

moab::Error::~Error ( )
inline

Definition at line 59 of file Error.hpp.

59 {}

Member Function Documentation

◆ get_last_error()

ErrorCode moab::Error::get_last_error ( std::string &  error) const
inline

Definition at line 77 of file Error.hpp.

78  {
79  error = mLastError;
80  return MB_SUCCESS;
81  }

References moab::error(), MB_SUCCESS, and mLastError.

◆ set_last_error() [1/3]

ErrorCode moab::Error::set_last_error ( const char *  fmt,
va_list  args 
)
inline

Definition at line 69 of file Error.hpp.

70  {
71  char text[1024];
72  VSNPRINTF( text, sizeof( text ), fmt, args );
73  mLastError = text;
74  return MB_SUCCESS;
75  }

References MB_SUCCESS, mLastError, and VSNPRINTF.

◆ set_last_error() [2/3]

ErrorCode moab::Error::set_last_error ( const char *  fmt,
  ... 
)
inline

Definition at line 84 of file Error.hpp.

85 {
86  ErrorCode result = MB_FAILURE;
87  if( fmt )
88  {
89  va_list args;
90  va_start( args, fmt );
91  result = set_last_error( fmt, args );
92  va_end( args );
93  }
94  return result;
95 }

References ErrorCode, and set_last_error().

◆ set_last_error() [3/3]

ErrorCode moab::Error::set_last_error ( const std::string &  error)
inline

Definition at line 61 of file Error.hpp.

62  {
63  mLastError = error;
64  return MB_SUCCESS;
65  }

References moab::error(), MB_SUCCESS, and mLastError.

Referenced by set_last_error().

Member Data Documentation

◆ mLastError

std::string moab::Error::mLastError
private

string to hold the last error that occurred in MB

Definition at line 55 of file Error.hpp.

Referenced by get_last_error(), and set_last_error().


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