ATLAS Offline Software
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
Assert.h File Reference
#include <RootCoreUtils/Global.h>
Include dependency graph for Assert.h:

Go to the source code of this file.

Classes

struct  RCU::Check::TestInvariant
 

Namespaces

 RCU
 This module defines a variety of assert style macros.
 
 RCU::Check
 

Macros

#define ROOTCORE_PACKAGE   0
 
#define RCU_CHECK(type, condition, message)   (condition) ? (void) 0 : ::RCU::Check::fail (ROOTCORE_PACKAGE, __FILE__, __LINE__, ::RCU::Check::type, message)
 effects: perform a check guarantee: strong failures: !condition More...
 
#define RCU_CHECK_JOIN2(a, b)   RCU_CHECK_JOIN2_HIDDEN(a,b)
 effects: join together two tokens More...
 
#define RCU_CHECK_JOIN2_HIDDEN(a, b)   a ## b
 
#define RCU_REQUIRE_SOFT(x)   RCU_CHECK (require_soft, x, #x)
 
#define RCU_REQUIRE2_SOFT(x, y)   RCU_CHECK (require_soft, x, y)
 
#define RCU_REQUIRE0_SOFT(y)   RCU_CHECK (require_soft, 0, y)
 
#define RCU_PROVIDE_SOFT(x)   RCU_CHECK (provide_soft, x, #x)
 
#define RCU_PROVIDE2_SOFT(x, y)   RCU_CHECK (provide_soft, x, y)
 
#define RCU_PROVIDE0_SOFT(y)   RCU_CHECK (provide_soft, 0, y)
 
#define RCU_ASSERT_SOFT(x)   RCU_CHECK (assert_soft, x, #x)
 
#define RCU_ASSERT2_SOFT(x, y)   RCU_CHECK (assert_soft, x, y)
 
#define RCU_ASSERT0_SOFT(y)   RCU_CHECK (assert_soft, 0, y)
 
#define RCU_REQUIRE_NOIMP(x)   RCU_CHECK (require_noimp, x, #x)
 
#define RCU_REQUIRE2_NOIMP(x, y)   RCU_CHECK (require_noimp, x, y)
 
#define RCU_REQUIRE0_NOIMP(y)   RCU_CHECK (require_noimp, 0, y)
 
#define RCU_PROVIDE_NOIMP(x)   RCU_CHECK (provide_noimp, x, #x)
 
#define RCU_PROVIDE2_NOIMP(x, y)   RCU_CHECK (provide_noimp, x, y)
 
#define RCU_PROVIDE0_NOIMP(y)   RCU_CHECK (provide_noimp, 0, y)
 
#define RCU_ASSERT_NOIMP(x)   RCU_CHECK (assert_noimp, x, #x)
 
#define RCU_ASSERT2_NOIMP(x, y)   RCU_CHECK (assert_noimp, x, y)
 
#define RCU_ASSERT0_NOIMP(y)   RCU_CHECK (assert_noimp, 0, y)
 
#define RCU_INVARIANT(x)   RCU_CHECK (invariant, x, #x)
 
#define RCU_INVARIANT2(x, y)   RCU_CHECK (invariant, x, y)
 
#define RCU_INVARIANT0(y)   RCU_CHECK (invariant, 0, y)
 
#define RCU_REQUIRE(x)   RCU_CHECK (require_hard, x, #x)
 
#define RCU_REQUIRE2(x, y)   RCU_CHECK (require_hard, x, y)
 
#define RCU_REQUIRE0(y)   RCU_CHECK (require_hard, 0, y)
 
#define RCU_PROVIDE(x)   RCU_CHECK (provide_hard, x, #x)
 
#define RCU_PROVIDE2(x, y)   RCU_CHECK (provide_hard, x, y)
 
#define RCU_PROVIDE0(y)   RCU_CHECK (provide_hard, 0, y)
 
#define RCU_ASSERT(x)   RCU_CHECK (assert_hard, x, #x)
 
#define RCU_ASSERT2(x, y)   RCU_CHECK (assert_hard, x, y)
 
#define RCU_ASSERT0(y)   RCU_CHECK (assert_hard, 0, y)
 
#define RCU_READ_INVARIANT(x)   (x)->testInvariant ()
 
#define RCU_CHANGE_INVARIANT(x)   ::RCU::Check::TestInvariant RCU_CHECK_JOIN2 (invariant, __LINE__) = ::RCU::Check::invariant_tester (x);
 
#define RCU_NEW_INVARIANT(x)   (x)->testInvariant ()
 
#define RCU_DESTROY_INVARIANT(x)   (x)->testInvariant ()
 
#define RCU_REQUIRE_SLOW(x)   (void) 0
 
#define RCU_REQUIRE2_SLOW(x, y)   (void) 0
 
#define RCU_PROVIDE_SLOW(x)   (void) 0
 
#define RCU_PROVIDE2_SLOW(x, y)   (void) 0
 
#define RCU_ASSERT_SLOW(x)   (void) 0
 
#define RCU_ASSERT2_SLOW(x, y)   (void) 0
 
#define RCU_READ_INVARIANT_SLOW(x)   (void) 0
 
#define RCU_CHANGE_INVARIANT_SLOW(x)   (void) 0
 
#define RCU_NEW_INVARIANT_SLOW(x)   (void) 0
 
#define RCU_DESTROY_INVARIANT_SLOW(x)   (void) 0
 

Typedefs

typedef void(* RCU::Check::TestInvariantFunction) (const void *object)
 effects: apply the test invariant method on an object guarantee: no-fail availability: experts only rationale: this is a templated wrapper for the class specific invariant testers More...
 

Enumerations

enum  RCU::Check::Type {
  RCU::Check::assert_soft, RCU::Check::assert_hard, RCU::Check::assert_noimp, RCU::Check::require_soft,
  RCU::Check::require_hard, RCU::Check::require_noimp, RCU::Check::provide_soft, RCU::Check::provide_hard,
  RCU::Check::provide_noimp, RCU::Check::invariant
}
 

Functions

void RCU::Check::fail (const char *package, const char *file, unsigned line, Type type, const char *error)
 effects: report the error and abort either by exception or assert like guarantee: all-fail failures: as requested requires: file != 0 requires: line != 0 requires: type < typeNum requires: error != 0 availability: experts only More...
 
template<class T >
void RCU::Check::testInvariantVoid (const void *object)
 
template<class T >
TestInvariant RCU::Check::invariant_tester (T *object)
 effects: create the right invariant testing object returns: the tester More...
 

Variables

const int RCU::Check::typeNum = invariant + 1
 

Macro Definition Documentation

◆ RCU_ASSERT

#define RCU_ASSERT (   x)    RCU_CHECK (assert_hard, x, #x)

Definition at line 223 of file Assert.h.

◆ RCU_ASSERT0

#define RCU_ASSERT0 (   y)    RCU_CHECK (assert_hard, 0, y)

Definition at line 227 of file Assert.h.

◆ RCU_ASSERT0_NOIMP

#define RCU_ASSERT0_NOIMP (   y)    RCU_CHECK (assert_noimp, 0, y)

Definition at line 195 of file Assert.h.

◆ RCU_ASSERT0_SOFT

#define RCU_ASSERT0_SOFT (   y)    RCU_CHECK (assert_soft, 0, y)

Definition at line 172 of file Assert.h.

◆ RCU_ASSERT2

#define RCU_ASSERT2 (   x,
  y 
)    RCU_CHECK (assert_hard, x, y)

Definition at line 225 of file Assert.h.

◆ RCU_ASSERT2_NOIMP

#define RCU_ASSERT2_NOIMP (   x,
  y 
)    RCU_CHECK (assert_noimp, x, y)

Definition at line 193 of file Assert.h.

◆ RCU_ASSERT2_SLOW

#define RCU_ASSERT2_SLOW (   x,
  y 
)    (void) 0

Definition at line 317 of file Assert.h.

◆ RCU_ASSERT2_SOFT

#define RCU_ASSERT2_SOFT (   x,
  y 
)    RCU_CHECK (assert_soft, x, y)

Definition at line 170 of file Assert.h.

◆ RCU_ASSERT_NOIMP

#define RCU_ASSERT_NOIMP (   x)    RCU_CHECK (assert_noimp, x, #x)

Definition at line 191 of file Assert.h.

◆ RCU_ASSERT_SLOW

#define RCU_ASSERT_SLOW (   x)    (void) 0

Definition at line 315 of file Assert.h.

◆ RCU_ASSERT_SOFT

#define RCU_ASSERT_SOFT (   x)    RCU_CHECK (assert_soft, x, #x)

Definition at line 168 of file Assert.h.

◆ RCU_CHANGE_INVARIANT

#define RCU_CHANGE_INVARIANT (   x)    ::RCU::Check::TestInvariant RCU_CHECK_JOIN2 (invariant, __LINE__) = ::RCU::Check::invariant_tester (x);

Definition at line 232 of file Assert.h.

◆ RCU_CHANGE_INVARIANT_SLOW

#define RCU_CHANGE_INVARIANT_SLOW (   x)    (void) 0

Definition at line 321 of file Assert.h.

◆ RCU_CHECK

#define RCU_CHECK (   type,
  condition,
  message 
)    (condition) ? (void) 0 : ::RCU::Check::fail (ROOTCORE_PACKAGE, __FILE__, __LINE__, ::RCU::Check::type, message)

effects: perform a check guarantee: strong failures: !condition

Definition at line 145 of file Assert.h.

◆ RCU_CHECK_JOIN2

#define RCU_CHECK_JOIN2 (   a,
 
)    RCU_CHECK_JOIN2_HIDDEN(a,b)

effects: join together two tokens

Definition at line 149 of file Assert.h.

◆ RCU_CHECK_JOIN2_HIDDEN

#define RCU_CHECK_JOIN2_HIDDEN (   a,
 
)    a ## b

Definition at line 150 of file Assert.h.

◆ RCU_DESTROY_INVARIANT

#define RCU_DESTROY_INVARIANT (   x)    (x)->testInvariant ()

Definition at line 236 of file Assert.h.

◆ RCU_DESTROY_INVARIANT_SLOW

#define RCU_DESTROY_INVARIANT_SLOW (   x)    (void) 0

Definition at line 325 of file Assert.h.

◆ RCU_INVARIANT

#define RCU_INVARIANT (   x)    RCU_CHECK (invariant, x, #x)

Definition at line 202 of file Assert.h.

◆ RCU_INVARIANT0

#define RCU_INVARIANT0 (   y)    RCU_CHECK (invariant, 0, y)

Definition at line 206 of file Assert.h.

◆ RCU_INVARIANT2

#define RCU_INVARIANT2 (   x,
  y 
)    RCU_CHECK (invariant, x, y)

Definition at line 204 of file Assert.h.

◆ RCU_NEW_INVARIANT

#define RCU_NEW_INVARIANT (   x)    (x)->testInvariant ()

Definition at line 234 of file Assert.h.

◆ RCU_NEW_INVARIANT_SLOW

#define RCU_NEW_INVARIANT_SLOW (   x)    (void) 0

Definition at line 323 of file Assert.h.

◆ RCU_PROVIDE

#define RCU_PROVIDE (   x)    RCU_CHECK (provide_hard, x, #x)

Definition at line 216 of file Assert.h.

◆ RCU_PROVIDE0

#define RCU_PROVIDE0 (   y)    RCU_CHECK (provide_hard, 0, y)

Definition at line 220 of file Assert.h.

◆ RCU_PROVIDE0_NOIMP

#define RCU_PROVIDE0_NOIMP (   y)    RCU_CHECK (provide_noimp, 0, y)

Definition at line 188 of file Assert.h.

◆ RCU_PROVIDE0_SOFT

#define RCU_PROVIDE0_SOFT (   y)    RCU_CHECK (provide_soft, 0, y)

Definition at line 165 of file Assert.h.

◆ RCU_PROVIDE2

#define RCU_PROVIDE2 (   x,
  y 
)    RCU_CHECK (provide_hard, x, y)

Definition at line 218 of file Assert.h.

◆ RCU_PROVIDE2_NOIMP

#define RCU_PROVIDE2_NOIMP (   x,
  y 
)    RCU_CHECK (provide_noimp, x, y)

Definition at line 186 of file Assert.h.

◆ RCU_PROVIDE2_SLOW

#define RCU_PROVIDE2_SLOW (   x,
  y 
)    (void) 0

Definition at line 313 of file Assert.h.

◆ RCU_PROVIDE2_SOFT

#define RCU_PROVIDE2_SOFT (   x,
  y 
)    RCU_CHECK (provide_soft, x, y)

Definition at line 163 of file Assert.h.

◆ RCU_PROVIDE_NOIMP

#define RCU_PROVIDE_NOIMP (   x)    RCU_CHECK (provide_noimp, x, #x)

Definition at line 184 of file Assert.h.

◆ RCU_PROVIDE_SLOW

#define RCU_PROVIDE_SLOW (   x)    (void) 0

Definition at line 311 of file Assert.h.

◆ RCU_PROVIDE_SOFT

#define RCU_PROVIDE_SOFT (   x)    RCU_CHECK (provide_soft, x, #x)

Definition at line 161 of file Assert.h.

◆ RCU_READ_INVARIANT

#define RCU_READ_INVARIANT (   x)    (x)->testInvariant ()

Definition at line 230 of file Assert.h.

◆ RCU_READ_INVARIANT_SLOW

#define RCU_READ_INVARIANT_SLOW (   x)    (void) 0

Definition at line 319 of file Assert.h.

◆ RCU_REQUIRE

#define RCU_REQUIRE (   x)    RCU_CHECK (require_hard, x, #x)

Definition at line 209 of file Assert.h.

◆ RCU_REQUIRE0

#define RCU_REQUIRE0 (   y)    RCU_CHECK (require_hard, 0, y)

Definition at line 213 of file Assert.h.

◆ RCU_REQUIRE0_NOIMP

#define RCU_REQUIRE0_NOIMP (   y)    RCU_CHECK (require_noimp, 0, y)

Definition at line 181 of file Assert.h.

◆ RCU_REQUIRE0_SOFT

#define RCU_REQUIRE0_SOFT (   y)    RCU_CHECK (require_soft, 0, y)

Definition at line 158 of file Assert.h.

◆ RCU_REQUIRE2

#define RCU_REQUIRE2 (   x,
  y 
)    RCU_CHECK (require_hard, x, y)

Definition at line 211 of file Assert.h.

◆ RCU_REQUIRE2_NOIMP

#define RCU_REQUIRE2_NOIMP (   x,
  y 
)    RCU_CHECK (require_noimp, x, y)

Definition at line 179 of file Assert.h.

◆ RCU_REQUIRE2_SLOW

#define RCU_REQUIRE2_SLOW (   x,
  y 
)    (void) 0

Definition at line 309 of file Assert.h.

◆ RCU_REQUIRE2_SOFT

#define RCU_REQUIRE2_SOFT (   x,
  y 
)    RCU_CHECK (require_soft, x, y)

Definition at line 156 of file Assert.h.

◆ RCU_REQUIRE_NOIMP

#define RCU_REQUIRE_NOIMP (   x)    RCU_CHECK (require_noimp, x, #x)

Definition at line 177 of file Assert.h.

◆ RCU_REQUIRE_SLOW

#define RCU_REQUIRE_SLOW (   x)    (void) 0

Definition at line 307 of file Assert.h.

◆ RCU_REQUIRE_SOFT

#define RCU_REQUIRE_SOFT (   x)    RCU_CHECK (require_soft, x, #x)

Definition at line 154 of file Assert.h.

◆ ROOTCORE_PACKAGE

#define ROOTCORE_PACKAGE   0

Definition at line 139 of file Assert.h.