VMware GemFire Native Client Cache Reference  9.0.6
Assert.hpp
Go to the documentation of this file.
1 #ifndef _GEMFIRE_ASSERT_HPP_
2 #define _GEMFIRE_ASSERT_HPP_
3 /*=========================================================================
4  * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
5  * This product is protected by U.S. and international copyright
6  * and intellectual property laws. Pivotal products are covered by
7  * more patents listed at http://www.pivotal.io/patents.
8  *=========================================================================
9  */
10 
11 #include "gfcpp_globals.hpp"
12 
19 namespace gemfire {
20 
27 {
28  public:
29 
33  inline static void assertTrue( bool expression, const char* expressionText, const char* file, int line )
34  {
35  if ( ! expression ) {
36  throwAssertion( expressionText, file, line );
37  }
38  }
39 
42  static void throwAssertion( const char* expressionText, const char* file, int line );
43 };
44 
45 }
46 
48 #define GF_R_ASSERT(x) gemfire::Assert::assertTrue( x, #x, __FILE__, __LINE__ )
49 
50 #ifndef GF_DEBUG_ASSERTS
51 
52 #define GF_DEBUG_ASSERTS 0
53 #endif
54 
55 #ifndef GF_DEVEL_ASSERTS
56 #define GF_DEVEL_ASSERTS 0
57 #endif
58 
59 #if GF_DEVEL_ASSERTS == 1
60 #undef GF_DEBUG_ASSERTS
61 #define GF_DEBUG_ASSERTS 1
62 #endif
63 
64 #if GF_DEBUG_ASSERTS == 1
65 #undef GF_DEVEL_ASSERTS
66 #define GF_DEVEL_ASSERTS 1
67 #endif
68 
70 #if GF_DEBUG_ASSERTS == 1
71 #define GF_D_ASSERT(x) gemfire::Assert::assertTrue( x, #x, __FILE__, __LINE__ )
72 #else
73 #define GF_D_ASSERT(x)
74 #endif
75 
77 #if GF_DEVEL_ASSERTS == 1
78 #define GF_DEV_ASSERT(x) gemfire::Assert::assertTrue( x, #x, __FILE__, __LINE__ )
79 #else
80 #define GF_DEV_ASSERT(x)
81 #endif
82 
83 
84 #endif
This namespace contains all the GemFire C++ API classes, enumerations and globals.
Definition: Assert.hpp:19
static void assertTrue(bool expression, const char *expressionText, const char *file, int line)
If the given expression is true, does nothing, otherwise calls throwAssertion .
Definition: Assert.hpp:33
#define CPPCACHE_EXPORT
Defines a GemFire CPPCACHE export.
Definition: gf_base.hpp:51
Declares debugging assertion reporting functions.
Definition: Assert.hpp:26

GemFire C++ Cache API Documentation