Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray::cExceptionHolder Class Reference

#include <cException.h>

Inheritance diagram for Gray::cExceptionHolder:
Gray::cPtrFacade< cExceptionBase >

Public Member Functions

 cExceptionHolder () noexcept
 
 cExceptionHolder (cExceptionBase *pEx, bool bDeleteEx=true) noexcept
 
 cExceptionHolder (cExceptionBase &ex) noexcept
 
 ~cExceptionHolder () noexcept
 
void AttachException (cExceptionBase *pEx, bool bDeleteEx)
 
cExceptionget_Ex () const
 
BOOL GetErrorMessage (LOGCHAR_t *lpszError, StrLen_t nLenMaxError=k_MSG_MAX_SIZE) const
 
cStringL get_ErrorStr () const
 
LOGLEV_TYPE get_Severity () const
 
- Public Member Functions inherited from Gray::cPtrFacade< cExceptionBase >
 cPtrFacade (cExceptionBase *p=nullptr) noexcept
 
 cPtrFacade (THIS_t &&ref) noexcept
 
bool isValidPtr () const noexcept
 
cExceptionBase ** get_PPtr ()
 
cExceptionBaseget_Ptr () const noexcept
 
void put_Ptr (cExceptionBase *p) noexcept
 
void ReleasePtr () noexcept
 
void AttachPtr (cExceptionBase *p) noexcept
 
cExceptionBaseDetachPtr () noexcept
 
THIS_toperator= (cExceptionBase *p) noexcept
 
THIS_toperator= (THIS_t &&ref) noexcept
 
 operator cExceptionBase * () const noexcept
 
cExceptionBaseget_Ref () const
 
cExceptionBaseoperator* () const
 
cExceptionBaseoperator-> () const
 
bool operator! () const noexcept
 Comparison ops. More...
 
bool operator!= (cExceptionBase *p2) const noexcept
 
bool operator== (cExceptionBase *p2) const noexcept
 

Static Public Attributes

static const StrLen_t k_MSG_MAX_SIZE = 1024
 arbitrary max message size. More...
 

Additional Inherited Members

- Protected Attributes inherited from Gray::cPtrFacade< cExceptionBase >
cExceptionBasem_p
 Pointer to some object of TYPE. More...
 

Detailed Description

Holds/Wraps an exception in a uniform way, and hides the fact that it is a pointer (MFC) or a reference (STL). make sure we call Delete() when we are done with this. ONLY useful because MFC passes all exceptions by pointer and STL does not.

Constructor & Destructor Documentation

◆ cExceptionHolder() [1/3]

Gray::cExceptionHolder::cExceptionHolder ( )
inlinenoexcept

◆ cExceptionHolder() [2/3]

Gray::cExceptionHolder::cExceptionHolder ( cExceptionBase pEx,
bool  bDeleteEx = true 
)
inlineexplicitnoexcept

Normal usage for _MFC_VER.

◆ cExceptionHolder() [3/3]

Gray::cExceptionHolder::cExceptionHolder ( cExceptionBase ex)
inlineexplicitnoexcept

Normal STL usage.

◆ ~cExceptionHolder()

Gray::cExceptionHolder::~cExceptionHolder ( )
inlinenoexcept

basically an auto_ptr

Member Function Documentation

◆ AttachException()

void Gray::cExceptionHolder::AttachException ( cExceptionBase pEx,
bool  bDeleteEx 
)
inline

◆ get_ErrorStr()

cStringL Gray::cExceptionHolder::get_ErrorStr ( ) const

◆ get_Ex()

cException * Gray::cExceptionHolder::get_Ex ( ) const

Get the cException version of the exception if it is based on it. Use dynamic_cast.

Returns
nullptr if a native MFC "::CException" or STL "stl::exception".

◆ get_Severity()

LOGLEV_TYPE Gray::cExceptionHolder::get_Severity ( ) const

◆ GetErrorMessage()

BOOL Gray::cExceptionHolder::GetErrorMessage ( LOGCHAR_t lpszError,
StrLen_t  nLenMaxError = k_MSG_MAX_SIZE 
) const

Member Data Documentation

◆ k_MSG_MAX_SIZE

const StrLen_t Gray::cExceptionHolder::k_MSG_MAX_SIZE = 1024
static

arbitrary max message size.


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