Pivotal GemFire Native Client Cache Reference  9.0.6
SharedBase.hpp
Go to the documentation of this file.
1 #ifndef _GEMFIRE_SHAREDBASE_HPP_
2 #define _GEMFIRE_SHAREDBASE_HPP_
3 
4 
5 // SharedBase.hpp -*- mode: c++ -*-
6 
7 
8 /*=========================================================================
9  * Copyright (c) 2004-2014 Pivotal Software, Inc. All Rights Reserved.
10  * This product is protected by U.S. and international copyright
11  * and intellectual property laws. Pivotal products are covered by
12  * more patents listed at http://www.pivotal.io/patents.
13  *=========================================================================
14  */
15 
16 
17 #include "gfcpp_globals.hpp"
18 
22 namespace gemfire {
23 
24 
32 
33 public:
34 
36  inline SharedBase() :
37  m_refCount(0)
38  {
39  }
40 
42  void preserveSB() const;
43 
48  void releaseSB() const;
49 
51  inline int32_t refCount()
52  {
53  return m_refCount;
54  }
55 
56 protected:
57 
58  inline SharedBase(bool noInit)
59  {}
60 
61  virtual ~SharedBase()
62  {}
63 
64 
65 private:
66 
67  mutable volatile int32_t m_refCount;
68 
69  void operator = (const SharedBase& rhs);
70 
71 };
72 
79  {
80  public:
81  static const NullSharedBase* const s_instancePtr;
82 
83  private:
84  NullSharedBase() { }
85  // never defined
87  NullSharedBase& operator =(const NullSharedBase&);
88 
89  friend class SharedBase; // just to get rid of warning with gcc3.x
90  };
91 
92 }
93 
94 #define NULLPTR gemfire::NullSharedBase::s_instancePtr
95 
96 #endif //#define _GEMFIRE_SHAREDBASE_HPP_
Class encapsulating a NULL SharedBase smart pointer.
Definition: SharedBase.hpp:78
This namespace contains all the GemFire C++ API classes, enumerations and globals.
Definition: Assert.hpp:19
SharedBase()
Constructor.
Definition: SharedBase.hpp:36
#define CPPCACHE_EXPORT
Defines a GemFire CPPCACHE export.
Definition: gf_base.hpp:51
This abstract base class is the base class of all user objects that have the shared capability of ref...
Definition: SharedBase.hpp:31
int32_t refCount()
Definition: SharedBase.hpp:51

GemFire C++ Cache API Documentation