OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
Classes | Macros | Functions
PAssert.h File Reference
#include <exception>
#include <stdexcept>
#include <string>
Include dependency graph for PAssert.h:

Go to the source code of this file.

Classes

struct  IpplCTAssert< B >
 
struct  IpplCTAssert< true >
 
class  assertion
 

Macros

#define CTAssert(c)   IpplCTAssert<(c)>::test()
 
#define PAssert(c)   if (!(c)) toss_cookies( #c, __FILE__, __LINE__ );
 
#define PAssert_CMP(cmp, a, b)   if (!(cmp)) toss_cookies(#cmp, #a, #b, a, b, __FILE__, __LINE__);
 
#define PAssert_EQ(a, b)   PAssert_CMP(a == b, a, b)
 
#define PAssert_NE(a, b)   PAssert_CMP(a != b, a, b)
 
#define PAssert_LT(a, b)   PAssert_CMP(a < b, a, b)
 
#define PAssert_LE(a, b)   PAssert_CMP(a <= b, a, b)
 
#define PAssert_GT(a, b)   PAssert_CMP(a > b, a, b)
 
#define PAssert_GE(a, b)   PAssert_CMP(a >= b, a, b)
 
#define PInsist(c, m)   if (!(c)) insist( #c, m, __FILE__, __LINE__ );
 

Functions

void toss_cookies (const char *cond, const char *file, int line)
 
template<class S , class T >
void toss_cookies (const char *cond, const char *astr, const char *bstr, S a, T b, const char *file, int line)
 
void insist (const char *cond, const char *msg, const char *file, int line)
 

Macro Definition Documentation

◆ CTAssert

#define CTAssert (   c)    IpplCTAssert<(c)>::test()

Definition at line 35 of file PAssert.h.

◆ PAssert

#define PAssert (   c)    if (!(c)) toss_cookies( #c, __FILE__, __LINE__ );

Definition at line 102 of file PAssert.h.

◆ PAssert_CMP

#define PAssert_CMP (   cmp,
  a,
 
)    if (!(cmp)) toss_cookies(#cmp, #a, #b, a, b, __FILE__, __LINE__);

Definition at line 103 of file PAssert.h.

◆ PAssert_EQ

#define PAssert_EQ (   a,
 
)    PAssert_CMP(a == b, a, b)

Definition at line 104 of file PAssert.h.

◆ PAssert_GE

#define PAssert_GE (   a,
 
)    PAssert_CMP(a >= b, a, b)

Definition at line 109 of file PAssert.h.

◆ PAssert_GT

#define PAssert_GT (   a,
 
)    PAssert_CMP(a > b, a, b)

Definition at line 108 of file PAssert.h.

◆ PAssert_LE

#define PAssert_LE (   a,
 
)    PAssert_CMP(a <= b, a, b)

Definition at line 107 of file PAssert.h.

◆ PAssert_LT

#define PAssert_LT (   a,
 
)    PAssert_CMP(a < b, a, b)

Definition at line 106 of file PAssert.h.

◆ PAssert_NE

#define PAssert_NE (   a,
 
)    PAssert_CMP(a != b, a, b)

Definition at line 105 of file PAssert.h.

◆ PInsist

#define PInsist (   c,
 
)    if (!(c)) insist( #c, m, __FILE__, __LINE__ );

Definition at line 120 of file PAssert.h.

Function Documentation

◆ insist()

void insist ( const char *  cond,
const char *  msg,
const char *  file,
int  line 
)

Definition at line 91 of file PAssert.cpp.

◆ toss_cookies() [1/2]

template<class S , class T >
void toss_cookies ( const char *  cond,
const char *  astr,
const char *  bstr,
a,
b,
const char *  file,
int  line 
)

Definition at line 71 of file PAssert.h.

References a.

◆ toss_cookies() [2/2]

void toss_cookies ( const char *  cond,
const char *  file,
int  line 
)

Definition at line 78 of file PAssert.cpp.