Mesh Oriented datABase  (version 5.4.1)
Array-based unstructured mesh datastructure
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

Detailed Description

Definition at line 52 of file Error.hpp.


Constructor & Destructor Documentation

moab::Error::Error ( ) [inline]

Definition at line 58 of file Error.hpp.

{}
moab::Error::~Error ( ) [inline]

Definition at line 59 of file Error.hpp.

{}

Member Function Documentation

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

Definition at line 77 of file Error.hpp.

References MB_SUCCESS, and mLastError.

    {
        error = mLastError;
        return MB_SUCCESS;
    }
ErrorCode moab::Error::set_last_error ( const std::string &  error) [inline]

Definition at line 61 of file Error.hpp.

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

Referenced by set_last_error().

    {
        mLastError = error;
        return MB_SUCCESS;
    }
ErrorCode moab::Error::set_last_error ( const char *  fmt,
  ... 
) [inline]

Definition at line 84 of file Error.hpp.

References ErrorCode, and set_last_error().

{
    ErrorCode result = MB_FAILURE;
    if( fmt )
    {
        va_list args;
        va_start( args, fmt );
        result = set_last_error( fmt, args );
        va_end( args );
    }
    return result;
}
ErrorCode moab::Error::set_last_error ( const char *  fmt,
va_list  args 
) [inline]

Definition at line 69 of file Error.hpp.

References MB_SUCCESS, mLastError, and VSNPRINTF.

    {
        char text[1024];
        VSNPRINTF( text, sizeof( text ), fmt, args );
        mLastError = text;
        return MB_SUCCESS;
    }

Member Data Documentation

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().

List of all members.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines