SPH
Classes | Public Types | Static Public Member Functions | Static Public Attributes | List of all members
Assert Struct Reference

#include <Assert.h>

Classes

class  Exception
 
struct  ScopedAssertExceptionEnabler
 

Public Types

typedef bool(* Handler) (const std::string &message)
 

Static Public Member Functions

template<typename T0 , typename... TArgs>
static void stringify (std::stringstream &ss, T0 &&t0, TArgs &&... rest)
 
static void stringify (std::stringstream &UNUSED(ss))
 
template<typename... TArgs>
static void fire (const char *message, const char *file, const char *func, const int line, TArgs &&... args)
 
static void fireParams (const char *message, const char *file, const char *func, const int line, const char *params="")
 
static void todo (const char *message, const char *func, const int line)
 

Static Public Attributes

static bool isTest = false
 
static bool throwAssertException = false
 If true, assert throws an exception. More...
 
static Handler handler = nullptr
 Custom assert handler. More...
 

Detailed Description

Definition at line 14 of file Assert.h.

Member Typedef Documentation

◆ Handler

typedef bool(* Assert::Handler) (const std::string &message)

Definition at line 20 of file Assert.h.

Member Function Documentation

◆ fire()

template<typename... TArgs>
static void Assert::fire ( const char *  message,
const char *  file,
const char *  func,
const int  line,
TArgs &&...  args 
)
inlinestatic

Definition at line 65 of file Assert.h.

◆ fireParams()

void Assert::fireParams ( const char *  message,
const char *  file,
const char *  func,
const int  line,
const char *  params = "" 
)
static

Definition at line 36 of file Assert.cpp.

◆ stringify() [1/2]

template<typename T0 , typename... TArgs>
static void Assert::stringify ( std::stringstream &  ss,
T0 &&  t0,
TArgs &&...  rest 
)
inlinestatic

Definition at line 54 of file Assert.h.

◆ stringify() [2/2]

static void Assert::stringify ( std::stringstream &  UNUSEDss)
inlinestatic

Definition at line 62 of file Assert.h.

◆ todo()

void Assert::todo ( const char *  message,
const char *  func,
const int  line 
)
static

Definition at line 94 of file Assert.cpp.

Member Data Documentation

◆ handler

Assert::Handler Assert::handler = nullptr
static

Custom assert handler.

Assert message is passed as an argument. If it returns false, the assert is ignored and the program continues. Note that assert can be fired from any thread, so it has to be thread-safe.

Definition at line 26 of file Assert.h.

◆ isTest

bool Assert::isTest = false
static

Definition at line 15 of file Assert.h.

◆ throwAssertException

bool Assert::throwAssertException = false
static

If true, assert throws an exception.

Definition at line 18 of file Assert.h.


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