BOSS 6.6.4.p03
BESIII Offline Software System
Loading...
Searching...
No Matches
Precondition.h File Reference
#include <stdio.h>
#include "ers/Assertion.h"

Go to the source code of this file.

Classes

class  ers::Precondition
 Precondition issue. More...
 

Namespaces

namespace  ers
 

Macros

#define ERS_PRECONDITION(expr, ...)   { if(!(expr)) { char precondition_buffer[256] ; snprintf(precondition_buffer,256, __VA_ARGS__) ; ers::Precondition failed_precondition(ERS_HERE,ers::error,#expr,precondition_buffer,false) ; throw failed_precondition ; } }
 

Macro Definition Documentation

◆ ERS_PRECONDITION

#define ERS_PRECONDITION (   expr,
  ... 
)    { if(!(expr)) { char precondition_buffer[256] ; snprintf(precondition_buffer,256, __VA_ARGS__) ; ers::Precondition failed_precondition(ERS_HERE,ers::error,#expr,precondition_buffer,false) ; throw failed_precondition ; } }

if e is not true, then an issue of type ers::Asertion is thrown with message m. If the compiler is gcc, then the transient field of the assertion is set according to the transcience of the expression. This means that if the expression is detected by the compiler as being constant. If the macro N_DEBUG is defined then the macros are disabled.

Definition at line 48 of file Precondition.h.