debug.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define JRLQP_PP_ID(x)   x
 
#define JRLQP_PP_APPLY(macro, ...)   JRLQP_PP_ID(macro(__VA_ARGS__))
 
#define JRLQP_PP_NARG(...)   JRLQP_PP_ID(JRLQP_PP_NARG_(__VA_ARGS__, JRLQP_PP_RSEQ_N()))
 
#define JRLQP_PP_NARG_(...)   JRLQP_PP_ID(JRLQP_PP_ARG_N(__VA_ARGS__))
 
#define JRLQP_PP_ARG_N(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...)   N
 
#define JRLQP_PP_RSEQ_N()   10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
 
#define JRLQP_CHOOSE_AUTO_NAME_START(count)   JRLQP_AUTO_NAME_ARG##count
 
#define JRLQP_AUTO_NAME_ARG(...)   JRLQP_PP_ID(JRLQP_PP_APPLY(JRLQP_CHOOSE_AUTO_NAME_START, JRLQP_PP_NARG(__VA_ARGS__))(__VA_ARGS__))
 
#define JRLQP_AUTO_NAME_ARG1(x)   #x, x
 
#define JRLQP_AUTO_NAME_ARG2(x, ...)   #x, x, JRLQP_PP_ID(JRLQP_AUTO_NAME_ARG1(__VA_ARGS__))
 
#define JRLQP_AUTO_NAME_ARG3(x, ...)   #x, x, JRLQP_PP_ID(JRLQP_AUTO_NAME_ARG2(__VA_ARGS__))
 
#define JRLQP_AUTO_NAME_ARG4(x, ...)   #x, x, JRLQP_PP_ID(JRLQP_AUTO_NAME_ARG3(__VA_ARGS__))
 
#define JRLQP_AUTO_NAME_ARG5(x, ...)   #x, x, JRLQP_PP_ID(JRLQP_AUTO_NAME_ARG4(__VA_ARGS__))
 
#define JRLQP_AUTO_NAME_ARG6(x, ...)   #x, x, JRLQP_PP_ID(JRLQP_AUTO_NAME_ARG5(__VA_ARGS__))
 
#define JRLQP_AUTO_NAME_ARG7(x, ...)   #x, x, JRLQP_PP_ID(JRLQP_AUTO_NAME_ARG6(__VA_ARGS__))
 
#define JRLQP_AUTO_NAME_ARG8(x, ...)   #x, x, JRLQP_PP_ID(JRLQP_AUTO_NAME_ARG7(__VA_ARGS__))
 
#define JRLQP_AUTO_NAME_ARG9(x, ...)   #x, x, JRLQP_PP_ID(JRLQP_AUTO_NAME_ARG8(__VA_ARGS__))
 
#define JRLQP_AUTO_NAME_ARG10(x, ...)   #x, x, JRLQP_PP_ID(JRLQP_AUTO_NAME_ARG9(__VA_ARGS__))
 
#define JRLQP_ENABLE_LOG_(macro, ...)
 
#define JRLQP_ENABLE_DEBUG_(macro, ...)
 
#define JRLQP_LOG_(logger, flags, ...)   JRLQP_PP_ID(logger.log(static_cast<uint32_t>(flags), JRLQP_PP_ID(JRLQP_AUTO_NAME_ARG(__VA_ARGS__))))
 
#define JRLQP_LOG_AS_(logger, flags, ...)   JRLQP_PP_ID(logger.log(static_cast<uint32_t>(flags), __VA_ARGS__))
 
#define JRLQP_LOG(...)   JRLQP_PP_ID(JRLQP_ENABLE_LOG_(JRLQP_LOG_, __VA_ARGS__))
 
#define JRLQP_DBG(...)   JRLQP_PP_ID(JRLQP_ENABLE_DEBUG_(JRLQP_LOG_, __VA_ARGS__))
 
#define JRLQP_LOG_AS(...)   JRLQP_PP_ID(JRLQP_ENABLE_LOG_(JRLQP_LOG_AS_, __VA_ARGS__))
 
#define JRLQP_DBG_AS(...)   JRLQP_PP_ID(JRLQP_ENABLE_DEBUG_(JRLQP_LOG_AS_, __VA_ARGS__))
 
#define JRLQP_LOG_COMMENT(logger, flag, ...)   JRLQP_PP_ID(JRLQP_ENABLE_LOG_(logger.comment, static_cast<uint32_t>(flag), __VA_ARGS__))
 
#define JRLQP_DBG_COMMENT(logger, flag, ...)   JRLQP_PP_ID(JRLQP_ENABLE_DEBUG_(logger.comment, static_cast<uint32_t>(flag), __VA_ARGS__))
 
#define JRLQP_LOG_NEW_ITER(logger, it)   JRLQP_ENABLE_LOG_(logger.startIter, it)
 
#define JRLQP_DBG_NEW_ITER(logger, it)   JRLQP_ENABLE_DEBUG_(logger.startIter, it)
 
#define JRLQP_LOG_RESET(logger)   JRLQP_ENABLE_LOG_(logger.startIter, -1)
 
#define JRLQP_DBG_RESET(logger)   JRLQP_ENABLE_DEBUG_(logger.startIter, -1)
 
#define JRLQP_DEBUG_ONLY(expr)
 

Variables

constexpr bool NO_LOG_ = 0
 
constexpr bool DEBUG_OUTPUT = 1
 

Macro Definition Documentation

◆ JRLQP_AUTO_NAME_ARG

#define JRLQP_AUTO_NAME_ARG (   ...)    JRLQP_PP_ID(JRLQP_PP_APPLY(JRLQP_CHOOSE_AUTO_NAME_START, JRLQP_PP_NARG(__VA_ARGS__))(__VA_ARGS__))

◆ JRLQP_AUTO_NAME_ARG1

#define JRLQP_AUTO_NAME_ARG1 (   x)    #x, x

◆ JRLQP_AUTO_NAME_ARG10

#define JRLQP_AUTO_NAME_ARG10 (   x,
  ... 
)    #x, x, JRLQP_PP_ID(JRLQP_AUTO_NAME_ARG9(__VA_ARGS__))

◆ JRLQP_AUTO_NAME_ARG2

#define JRLQP_AUTO_NAME_ARG2 (   x,
  ... 
)    #x, x, JRLQP_PP_ID(JRLQP_AUTO_NAME_ARG1(__VA_ARGS__))

◆ JRLQP_AUTO_NAME_ARG3

#define JRLQP_AUTO_NAME_ARG3 (   x,
  ... 
)    #x, x, JRLQP_PP_ID(JRLQP_AUTO_NAME_ARG2(__VA_ARGS__))

◆ JRLQP_AUTO_NAME_ARG4

#define JRLQP_AUTO_NAME_ARG4 (   x,
  ... 
)    #x, x, JRLQP_PP_ID(JRLQP_AUTO_NAME_ARG3(__VA_ARGS__))

◆ JRLQP_AUTO_NAME_ARG5

#define JRLQP_AUTO_NAME_ARG5 (   x,
  ... 
)    #x, x, JRLQP_PP_ID(JRLQP_AUTO_NAME_ARG4(__VA_ARGS__))

◆ JRLQP_AUTO_NAME_ARG6

#define JRLQP_AUTO_NAME_ARG6 (   x,
  ... 
)    #x, x, JRLQP_PP_ID(JRLQP_AUTO_NAME_ARG5(__VA_ARGS__))

◆ JRLQP_AUTO_NAME_ARG7

#define JRLQP_AUTO_NAME_ARG7 (   x,
  ... 
)    #x, x, JRLQP_PP_ID(JRLQP_AUTO_NAME_ARG6(__VA_ARGS__))

◆ JRLQP_AUTO_NAME_ARG8

#define JRLQP_AUTO_NAME_ARG8 (   x,
  ... 
)    #x, x, JRLQP_PP_ID(JRLQP_AUTO_NAME_ARG7(__VA_ARGS__))

◆ JRLQP_AUTO_NAME_ARG9

#define JRLQP_AUTO_NAME_ARG9 (   x,
  ... 
)    #x, x, JRLQP_PP_ID(JRLQP_AUTO_NAME_ARG8(__VA_ARGS__))

◆ JRLQP_CHOOSE_AUTO_NAME_START

#define JRLQP_CHOOSE_AUTO_NAME_START (   count)    JRLQP_AUTO_NAME_ARG##count

◆ JRLQP_DBG

#define JRLQP_DBG (   ...)    JRLQP_PP_ID(JRLQP_ENABLE_DEBUG_(JRLQP_LOG_, __VA_ARGS__))

◆ JRLQP_DBG_AS

#define JRLQP_DBG_AS (   ...)    JRLQP_PP_ID(JRLQP_ENABLE_DEBUG_(JRLQP_LOG_AS_, __VA_ARGS__))

◆ JRLQP_DBG_COMMENT

#define JRLQP_DBG_COMMENT (   logger,
  flag,
  ... 
)    JRLQP_PP_ID(JRLQP_ENABLE_DEBUG_(logger.comment, static_cast<uint32_t>(flag), __VA_ARGS__))

◆ JRLQP_DBG_NEW_ITER

#define JRLQP_DBG_NEW_ITER (   logger,
  it 
)    JRLQP_ENABLE_DEBUG_(logger.startIter, it)

◆ JRLQP_DBG_RESET

#define JRLQP_DBG_RESET (   logger)    JRLQP_ENABLE_DEBUG_(logger.startIter, -1)

◆ JRLQP_DEBUG_ONLY

#define JRLQP_DEBUG_ONLY (   expr)
Value:
do \
{ \
{ \
expr; \
} \
} while(0)

◆ JRLQP_ENABLE_DEBUG_

#define JRLQP_ENABLE_DEBUG_ (   macro,
  ... 
)
Value:
do \
{ \
{ \
JRLQP_PP_ID(macro(__VA_ARGS__)); \
} \
} while(0)

◆ JRLQP_ENABLE_LOG_

#define JRLQP_ENABLE_LOG_ (   macro,
  ... 
)
Value:
do \
{ \
if(!NO_LOG_) \
{ \
JRLQP_PP_ID(macro(__VA_ARGS__)); \
} \
} while(0)

◆ JRLQP_LOG

#define JRLQP_LOG (   ...)    JRLQP_PP_ID(JRLQP_ENABLE_LOG_(JRLQP_LOG_, __VA_ARGS__))

◆ JRLQP_LOG_

#define JRLQP_LOG_ (   logger,
  flags,
  ... 
)    JRLQP_PP_ID(logger.log(static_cast<uint32_t>(flags), JRLQP_PP_ID(JRLQP_AUTO_NAME_ARG(__VA_ARGS__))))

◆ JRLQP_LOG_AS

#define JRLQP_LOG_AS (   ...)    JRLQP_PP_ID(JRLQP_ENABLE_LOG_(JRLQP_LOG_AS_, __VA_ARGS__))

◆ JRLQP_LOG_AS_

#define JRLQP_LOG_AS_ (   logger,
  flags,
  ... 
)    JRLQP_PP_ID(logger.log(static_cast<uint32_t>(flags), __VA_ARGS__))

◆ JRLQP_LOG_COMMENT

#define JRLQP_LOG_COMMENT (   logger,
  flag,
  ... 
)    JRLQP_PP_ID(JRLQP_ENABLE_LOG_(logger.comment, static_cast<uint32_t>(flag), __VA_ARGS__))

◆ JRLQP_LOG_NEW_ITER

#define JRLQP_LOG_NEW_ITER (   logger,
  it 
)    JRLQP_ENABLE_LOG_(logger.startIter, it)

◆ JRLQP_LOG_RESET

#define JRLQP_LOG_RESET (   logger)    JRLQP_ENABLE_LOG_(logger.startIter, -1)

◆ JRLQP_PP_APPLY

#define JRLQP_PP_APPLY (   macro,
  ... 
)    JRLQP_PP_ID(macro(__VA_ARGS__))

◆ JRLQP_PP_ARG_N

#define JRLQP_PP_ARG_N (   _1,
  _2,
  _3,
  _4,
  _5,
  _6,
  _7,
  _8,
  _9,
  _10,
  N,
  ... 
)    N

◆ JRLQP_PP_ID

#define JRLQP_PP_ID (   x)    x

◆ JRLQP_PP_NARG

#define JRLQP_PP_NARG (   ...)    JRLQP_PP_ID(JRLQP_PP_NARG_(__VA_ARGS__, JRLQP_PP_RSEQ_N()))

Count the number of argument passed to it.

◆ JRLQP_PP_NARG_

#define JRLQP_PP_NARG_ (   ...)    JRLQP_PP_ID(JRLQP_PP_ARG_N(__VA_ARGS__))

◆ JRLQP_PP_RSEQ_N

#define JRLQP_PP_RSEQ_N ( )    10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0

Variable Documentation

◆ DEBUG_OUTPUT

constexpr bool DEBUG_OUTPUT = 1
inlineconstexpr

◆ NO_LOG_

constexpr bool NO_LOG_ = 0
inlineconstexpr
DEBUG_OUTPUT
constexpr bool DEBUG_OUTPUT
Definition: debug.h:14
NO_LOG_
constexpr bool NO_LOG_
Definition: debug.h:6