Workspace 6.21.5
Public Types | Static Public Member Functions | Protected Member Functions | List of all members
Assert Class Reference

#include <Workspace/Application/LanguageUtils/errorchecks.h>

Public Types

typedef std::function< FailBehaviour(FailType type, const char *condition, const char *message, const char *file, int line)> AssertHandler
 
enum  FailBehaviour { Halt , Continue }
 
enum  FailType { Logic , Runtime }
 

Static Public Member Functions

static QString generateDefaultErrorText (const QString &prefix, FailType type, const char *condition, const QString &message, const char *file, int line)
 
static QString generateDefaultErrorText (FailType type, const char *condition, const char *message, const char *file, int line)
 
static AssertHandler getHandler ()
 
static FailBehaviour reportFailure (FailType type, const char *condition, const char *file, int line, const char *message)
 
static void setHandler (AssertHandler handler)
 

Protected Member Functions

 Assert ()
 

Detailed Description

Class for wrapping assertion behaviour

Member Typedef Documentation

◆ AssertHandler

typedef std::function<FailBehaviour(FailType type, const char* condition, const char* message, const char* file, int line)> AssertHandler

Member Enumeration Documentation

◆ FailBehaviour

Enumerator
Halt 
Continue 

◆ FailType

enum FailType
Enumerator
Logic 
Runtime 

Constructor & Destructor Documentation

◆ Assert()

Assert ( )
protected

Member Function Documentation

◆ generateDefaultErrorText() [1/2]

QString generateDefaultErrorText ( const QString &  prefix,
FailType  type,
const char *  condition,
const QString &  message,
const char *  file,
int  line 
)
static

◆ generateDefaultErrorText() [2/2]

QString generateDefaultErrorText ( Assert::FailType  type,
const char *  condition,
const char *  message,
const char *  file,
int  line 
)
static

◆ getHandler()

Assert::AssertHandler getHandler ( )
static
Returns
The current assertion handling function.

◆ reportFailure()

Assert::FailBehaviour reportFailure ( FailType  type,
const char *  condition,
const char *  file,
int  line,
const char *  message 
)
static

◆ setHandler()

void setHandler ( AssertHandler  handler)
static
Parameters
handlerFunction for handling asserts.