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

#include <cDebugAssert.h>

Static Public Member Functions

static bool CALLBACK Assert_System (const char *pszExp, const cDebugSourceLine &src)
 
static bool __stdcall Assert_Fail (const char *pszExp, const cDebugSourceLine src)
 
static __attribute__ ((noreturn)) void __stdcall Assert_Throw(const char *pszExp
 
static bool __stdcall Debug_Fail (const char *pszExp, const cDebugSourceLine src) noexcept
 

Public Attributes

static const cDebugSourceLine src
 

Static Public Attributes

static AssertCallback_t * sm_pAssertCallback = cDebugAssert::Assert_System
 redirect callback on Assert_Fail usually used for unit tests. More...
 
static bool sm_bAssertTest = false
 Just testing. not a real assert. More...
 

Detailed Description

Log assert events before handling as normal system assert(). like M$ Assert.IsTrue()

Member Function Documentation

◆ __attribute__()

static Gray::cDebugAssert::__attribute__ ( (noreturn)  ) const
static

◆ Assert_Fail()

bool GRAYCALL Gray::cDebugAssert::Assert_Fail ( const char *  pszExp,
const cDebugSourceLine  src 
)
static

like _assert() is M$ code. Put something in the log after (or before?) doing normal assert processing. is this too dangerous?

Returns
false to indicate something failed. stop. (for macro)
true = continue and ignore the assert.

◆ Assert_System()

bool CALLBACK Gray::cDebugAssert::Assert_System ( const char *  pszExp,
const cDebugSourceLine src 
)
static

AssertCallback_t to use the system assert dialog. Use with sm_pAssertCallback.

Returns
true = continue and ignore the assert.

◆ Debug_Fail()

bool GRAYCALL Gray::cDebugAssert::Debug_Fail ( const char *  pszExp,
const cDebugSourceLine  src 
)
staticnoexcept

A 'softer' version of assert. non-fatal checks. for use in constructors, etc.

Note
: always return false to indicate something failed. (for macro)

Member Data Documentation

◆ sm_bAssertTest

bool Gray::cDebugAssert::sm_bAssertTest = false
static

Just testing. not a real assert.

◆ sm_pAssertCallback

AssertCallback_t * Gray::cDebugAssert::sm_pAssertCallback = cDebugAssert::Assert_System
static

redirect callback on Assert_Fail usually used for unit tests.

◆ src

const cDebugSourceLine Gray::cDebugAssert::src

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