JPL Spatial
Sound spatialization and propagation library
Loading...
Searching...
No Matches
ErrorReporting.h File Reference
#include "Core.h"
#include <format>
#include <source_location>

Go to the source code of this file.

Namespaces

namespace  JPL
 

Macros

#define JPL_ERROR_REPORTING_DEFINED
 
#define JPL_ENABLE_ASSERTS
 
#define JPL_ENABLE_ENSURE
 
#define JPL_ASSERT(inExpression, ...)
 Main assert macro, usage: JPL_ASSERT(condition, message) or JPL_ASSERT(condition)
 
#define JPL_IF_ENABLE_ASSERTS(...)
 
#define JPL_ENSURE(inExpression, ...)
 Define ENSURE.
 
#define JPL_TRACE_TAG(tag, message)
 
#define JPL_INFO_TAG(tag, message)
 
#define JPL_WARN_TAG(tag, message)
 
#define JPL_ERROR_TAG(tag, message)
 

Typedefs

using JPL::TraceFunction = void (*)(const char* message)
 Trace function, needs to be overridden by application. This should output a line of text to the log / TTY.
 
using JPL::AssertFailedFunction = bool(*)(const char* inExpression, const char* inMessage, const std::source_location)
 Function called when an assertion fails. This function should return true if a breakpoint needs to be triggered.
 

Functions

bool JPL::AssertFailedParamHelper (const char *inExpression, const std::source_location location)
 
bool JPL::AssertFailedParamHelper (const char *inExpression, const std::source_location location, const char *inMessage)
 

Variables

JPL_EXPORT TraceFunction JPL::SpatialTrace
 
JPL_EXPORT AssertFailedFunction JPL::AssertFailed
 

Macro Definition Documentation

◆ JPL_ASSERT

#define JPL_ASSERT ( inExpression,
... )
Value:
do { if (!(inExpression) && ::JPL::AssertFailedParamHelper(#inExpression, std::source_location::current(), ##__VA_ARGS__)) JPL_BREAKPOINT; } while (false)
bool AssertFailedParamHelper(const char *inExpression, const std::source_location location)
Definition ErrorReporting.h:67

Main assert macro, usage: JPL_ASSERT(condition, message) or JPL_ASSERT(condition)

◆ JPL_ENABLE_ASSERTS

#define JPL_ENABLE_ASSERTS

◆ JPL_ENABLE_ENSURE

#define JPL_ENABLE_ENSURE

◆ JPL_ENSURE

#define JPL_ENSURE ( inExpression,
... )
Value:
[&]{ if(!(inExpression) && ::JPL::AssertFailedParamHelper(#inExpression, std::source_location::current(), ##__VA_ARGS__)) { JPL_BREAKPOINT; } return (inExpression); }()

Define ENSURE.

◆ JPL_ERROR_REPORTING_DEFINED

#define JPL_ERROR_REPORTING_DEFINED

◆ JPL_ERROR_TAG

#define JPL_ERROR_TAG ( tag,
message )
Value:
SpatialTrace(std::format("[{}]: Error: {}", tag, message).c_str())

◆ JPL_IF_ENABLE_ASSERTS

#define JPL_IF_ENABLE_ASSERTS ( ...)
Value:
__VA_ARGS__

◆ JPL_INFO_TAG

#define JPL_INFO_TAG ( tag,
message )
Value:
SpatialTrace(std::format("[{}]: Info: {}", tag, message).c_str())

◆ JPL_TRACE_TAG

#define JPL_TRACE_TAG ( tag,
message )
Value:
SpatialTrace(std::format("[{}]: Trace: {}", tag, message).c_str())

◆ JPL_WARN_TAG

#define JPL_WARN_TAG ( tag,
message )
Value:
SpatialTrace(std::format("[{}]: Warning: {}", tag, message).c_str())