ATLAS Offline Software
Loading...
Searching...
No Matches
Assert.h File Reference

Go to the source code of this file.

Classes

struct  RCU::Check::TestInvariant

Namespaces

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

Macros

#define RCU_CHECK(type, condition, message)
 effects: perform a check guarantee: strong failures: !condition
#define RCU_CHECK_JOIN2(a, b)
 effects: join together two tokens
#define RCU_CHECK_JOIN2_HIDDEN(a, b)
#define RCU_REQUIRE_SOFT(x)
#define RCU_REQUIRE2_SOFT(x, y)
#define RCU_REQUIRE0_SOFT(y)
#define RCU_PROVIDE_SOFT(x)
#define RCU_PROVIDE2_SOFT(x, y)
#define RCU_PROVIDE0_SOFT(y)
#define RCU_ASSERT_SOFT(x)
#define RCU_ASSERT2_SOFT(x, y)
#define RCU_ASSERT0_SOFT(y)
#define RCU_REQUIRE_NOIMP(x)
#define RCU_REQUIRE2_NOIMP(x, y)
#define RCU_REQUIRE0_NOIMP(y)
#define RCU_PROVIDE_NOIMP(x)
#define RCU_PROVIDE2_NOIMP(x, y)
#define RCU_PROVIDE0_NOIMP(y)
#define RCU_ASSERT_NOIMP(x)
#define RCU_ASSERT2_NOIMP(x, y)
#define RCU_ASSERT0_NOIMP(y)
#define RCU_INVARIANT(x)
#define RCU_INVARIANT2(x, y)
#define RCU_INVARIANT0(y)
#define RCU_REQUIRE(x)
#define RCU_REQUIRE2(x, y)
#define RCU_REQUIRE0(y)
#define RCU_PROVIDE(x)
#define RCU_PROVIDE2(x, y)
#define RCU_PROVIDE0(y)
#define RCU_ASSERT(x)
#define RCU_ASSERT2(x, y)
#define RCU_ASSERT0(y)
#define RCU_READ_INVARIANT(x)
#define RCU_CHANGE_INVARIANT(x)
#define RCU_NEW_INVARIANT(x)
#define RCU_DESTROY_INVARIANT(x)
#define RCU_REQUIRE_SLOW(x)
#define RCU_REQUIRE2_SLOW(x, y)
#define RCU_PROVIDE_SLOW(x)
#define RCU_PROVIDE2_SLOW(x, y)
#define RCU_ASSERT_SLOW(x)
#define RCU_ASSERT2_SLOW(x, y)
#define RCU_READ_INVARIANT_SLOW(x)
#define RCU_CHANGE_INVARIANT_SLOW(x)
#define RCU_NEW_INVARIANT_SLOW(x)
#define RCU_DESTROY_INVARIANT_SLOW(x)

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

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 *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
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

Variables

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

Macro Definition Documentation

◆ RCU_ASSERT

#define RCU_ASSERT ( x)
Value:
RCU_CHECK (assert_hard, x, #x)
#define RCU_CHECK(type, condition, message)
effects: perform a check guarantee: strong failures: !condition
Definition Assert.h:132
#define x

Definition at line 210 of file Assert.h.

210#define RCU_ASSERT(x) \
211 RCU_CHECK (assert_hard, x, #x)

◆ RCU_ASSERT0

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

Definition at line 214 of file Assert.h.

214#define RCU_ASSERT0(y) \
215 RCU_CHECK (assert_hard, 0, y)

◆ RCU_ASSERT0_NOIMP

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

Definition at line 182 of file Assert.h.

182#define RCU_ASSERT0_NOIMP(y) \
183 RCU_CHECK (assert_noimp, 0, y)

◆ RCU_ASSERT0_SOFT

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

Definition at line 159 of file Assert.h.

159#define RCU_ASSERT0_SOFT(y) \
160 RCU_CHECK (assert_soft, 0, y)

◆ RCU_ASSERT2

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

Definition at line 212 of file Assert.h.

212#define RCU_ASSERT2(x,y) \
213 RCU_CHECK (assert_hard, x, y)

◆ RCU_ASSERT2_NOIMP

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

Definition at line 180 of file Assert.h.

180#define RCU_ASSERT2_NOIMP(x,y) \
181 RCU_CHECK (assert_noimp, x, y)

◆ RCU_ASSERT2_SLOW

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

Definition at line 304 of file Assert.h.

304#define RCU_ASSERT2_SLOW(x,y) \
305 (void) 0

◆ RCU_ASSERT2_SOFT

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

Definition at line 157 of file Assert.h.

157#define RCU_ASSERT2_SOFT(x,y) \
158 RCU_CHECK (assert_soft, x, y)

◆ RCU_ASSERT_NOIMP

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

Definition at line 178 of file Assert.h.

178#define RCU_ASSERT_NOIMP(x) \
179 RCU_CHECK (assert_noimp, x, #x)

◆ RCU_ASSERT_SLOW

#define RCU_ASSERT_SLOW ( x)
Value:
(void) 0

Definition at line 302 of file Assert.h.

302#define RCU_ASSERT_SLOW(x) \
303 (void) 0

◆ RCU_ASSERT_SOFT

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

Definition at line 155 of file Assert.h.

155#define RCU_ASSERT_SOFT(x) \
156 RCU_CHECK (assert_soft, x, #x)

◆ RCU_CHANGE_INVARIANT

#define RCU_CHANGE_INVARIANT ( x)
Value:
#define RCU_CHECK_JOIN2(a, b)
effects: join together two tokens
Definition Assert.h:136
TestInvariant invariant_tester(T *object)
effects: create the right invariant testing object returns: the tester
Definition Assert.h:118

Definition at line 219 of file Assert.h.

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

◆ RCU_CHANGE_INVARIANT_SLOW

#define RCU_CHANGE_INVARIANT_SLOW ( x)
Value:
(void) 0

Definition at line 308 of file Assert.h.

308#define RCU_CHANGE_INVARIANT_SLOW(x) \
309 (void) 0

◆ RCU_CHECK

#define RCU_CHECK ( type,
condition,
message )
Value:
(condition) ? (void) 0 : ::RCU::Check::fail (__FILE__, __LINE__, ::RCU::Check::type, message)
void fail(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: ...
Definition Assert.cxx:64

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

Definition at line 132 of file Assert.h.

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

◆ RCU_CHECK_JOIN2

#define RCU_CHECK_JOIN2 ( a,
b )
Value:
#define RCU_CHECK_JOIN2_HIDDEN(a, b)
Definition Assert.h:137
static Double_t a

effects: join together two tokens

Definition at line 136 of file Assert.h.

◆ RCU_CHECK_JOIN2_HIDDEN

#define RCU_CHECK_JOIN2_HIDDEN ( a,
b )
Value:
a ## b

Definition at line 137 of file Assert.h.

◆ RCU_DESTROY_INVARIANT

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

Definition at line 223 of file Assert.h.

223#define RCU_DESTROY_INVARIANT(x) \
224 (x)->testInvariant ()

◆ RCU_DESTROY_INVARIANT_SLOW

#define RCU_DESTROY_INVARIANT_SLOW ( x)
Value:
(void) 0

Definition at line 312 of file Assert.h.

312#define RCU_DESTROY_INVARIANT_SLOW(x) \
313 (void) 0

◆ RCU_INVARIANT

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

Definition at line 189 of file Assert.h.

189#define RCU_INVARIANT(x) \
190 RCU_CHECK (invariant, x, #x)

◆ RCU_INVARIANT0

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

Definition at line 193 of file Assert.h.

193#define RCU_INVARIANT0(y) \
194 RCU_CHECK (invariant, 0, y)

◆ RCU_INVARIANT2

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

Definition at line 191 of file Assert.h.

191#define RCU_INVARIANT2(x,y) \
192 RCU_CHECK (invariant, x, y)

◆ RCU_NEW_INVARIANT

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

Definition at line 221 of file Assert.h.

221#define RCU_NEW_INVARIANT(x) \
222 (x)->testInvariant ()

◆ RCU_NEW_INVARIANT_SLOW

#define RCU_NEW_INVARIANT_SLOW ( x)
Value:
(void) 0

Definition at line 310 of file Assert.h.

310#define RCU_NEW_INVARIANT_SLOW(x) \
311 (void) 0

◆ RCU_PROVIDE

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

Definition at line 203 of file Assert.h.

203#define RCU_PROVIDE(x) \
204 RCU_CHECK (provide_hard, x, #x)

◆ RCU_PROVIDE0

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

Definition at line 207 of file Assert.h.

207#define RCU_PROVIDE0(y) \
208 RCU_CHECK (provide_hard, 0, y)

◆ RCU_PROVIDE0_NOIMP

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

Definition at line 175 of file Assert.h.

175#define RCU_PROVIDE0_NOIMP(y) \
176 RCU_CHECK (provide_noimp, 0, y)

◆ RCU_PROVIDE0_SOFT

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

Definition at line 152 of file Assert.h.

152#define RCU_PROVIDE0_SOFT(y) \
153 RCU_CHECK (provide_soft, 0, y)

◆ RCU_PROVIDE2

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

Definition at line 205 of file Assert.h.

205#define RCU_PROVIDE2(x,y) \
206 RCU_CHECK (provide_hard, x, y)

◆ RCU_PROVIDE2_NOIMP

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

Definition at line 173 of file Assert.h.

173#define RCU_PROVIDE2_NOIMP(x,y) \
174 RCU_CHECK (provide_noimp, x, y)

◆ RCU_PROVIDE2_SLOW

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

Definition at line 300 of file Assert.h.

300#define RCU_PROVIDE2_SLOW(x,y) \
301 (void) 0

◆ RCU_PROVIDE2_SOFT

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

Definition at line 150 of file Assert.h.

150#define RCU_PROVIDE2_SOFT(x,y) \
151 RCU_CHECK (provide_soft, x, y)

◆ RCU_PROVIDE_NOIMP

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

Definition at line 171 of file Assert.h.

171#define RCU_PROVIDE_NOIMP(x) \
172 RCU_CHECK (provide_noimp, x, #x)

◆ RCU_PROVIDE_SLOW

#define RCU_PROVIDE_SLOW ( x)
Value:
(void) 0

Definition at line 298 of file Assert.h.

298#define RCU_PROVIDE_SLOW(x) \
299 (void) 0

◆ RCU_PROVIDE_SOFT

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

Definition at line 148 of file Assert.h.

148#define RCU_PROVIDE_SOFT(x) \
149 RCU_CHECK (provide_soft, x, #x)

◆ RCU_READ_INVARIANT

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

Definition at line 217 of file Assert.h.

217#define RCU_READ_INVARIANT(x) \
218 (x)->testInvariant ()

◆ RCU_READ_INVARIANT_SLOW

#define RCU_READ_INVARIANT_SLOW ( x)
Value:
(void) 0

Definition at line 306 of file Assert.h.

306#define RCU_READ_INVARIANT_SLOW(x) \
307 (void) 0

◆ RCU_REQUIRE

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

Definition at line 196 of file Assert.h.

196#define RCU_REQUIRE(x) \
197 RCU_CHECK (require_hard, x, #x)

◆ RCU_REQUIRE0

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

Definition at line 200 of file Assert.h.

200#define RCU_REQUIRE0(y) \
201 RCU_CHECK (require_hard, 0, y)

◆ RCU_REQUIRE0_NOIMP

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

Definition at line 168 of file Assert.h.

168#define RCU_REQUIRE0_NOIMP(y) \
169 RCU_CHECK (require_noimp, 0, y)

◆ RCU_REQUIRE0_SOFT

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

Definition at line 145 of file Assert.h.

145#define RCU_REQUIRE0_SOFT(y) \
146 RCU_CHECK (require_soft, 0, y)

◆ RCU_REQUIRE2

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

Definition at line 198 of file Assert.h.

198#define RCU_REQUIRE2(x,y) \
199 RCU_CHECK (require_hard, x, y)

◆ RCU_REQUIRE2_NOIMP

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

Definition at line 166 of file Assert.h.

166#define RCU_REQUIRE2_NOIMP(x,y) \
167 RCU_CHECK (require_noimp, x, y)

◆ RCU_REQUIRE2_SLOW

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

Definition at line 296 of file Assert.h.

296#define RCU_REQUIRE2_SLOW(x,y) \
297 (void) 0

◆ RCU_REQUIRE2_SOFT

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

Definition at line 143 of file Assert.h.

143#define RCU_REQUIRE2_SOFT(x,y) \
144 RCU_CHECK (require_soft, x, y)

◆ RCU_REQUIRE_NOIMP

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

Definition at line 164 of file Assert.h.

164#define RCU_REQUIRE_NOIMP(x) \
165 RCU_CHECK (require_noimp, x, #x)

◆ RCU_REQUIRE_SLOW

#define RCU_REQUIRE_SLOW ( x)
Value:
(void) 0

Definition at line 294 of file Assert.h.

294#define RCU_REQUIRE_SLOW(x) \
295 (void) 0

◆ RCU_REQUIRE_SOFT

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

Definition at line 141 of file Assert.h.

141#define RCU_REQUIRE_SOFT(x) \
142 RCU_CHECK (require_soft, x, #x)