H:/gfcppsancout/product/include/gfcpp/SharedBase.hpp

Go to the documentation of this file.
00001 #ifndef _GEMFIRE_SHAREDBASE_HPP_
00002 #define _GEMFIRE_SHAREDBASE_HPP_
00003 
00004 
00005 // SharedBase.hpp     -*- mode: c++ -*-
00006 
00007 
00008 /*=========================================================================
00009  * (c) Copyright 2004-2007, GemStone Systems, Inc. All Rights Reserved.
00010  * 1260 NW Waterhouse Ave Suite 200, Beaverton OR 97006.
00011  *=========================================================================
00012  */
00013 
00014 
00015 #include "gfcpp_globals.hpp"
00016 
00020 namespace gemfire {
00021 
00022 
00029 class CPPCACHE_EXPORT SharedBase {
00030 
00031 public:
00032 
00034   SharedBase( )
00035   : m_refCount( 0 )
00036   {
00037   }
00038 
00040   void preserveSB() const;
00042   void releaseSB() const;
00043 
00045   inline int32_t refCount()
00046   {
00047     return m_refCount;
00048   }
00049 
00050 protected:
00051 
00052   virtual ~SharedBase()
00053     {}
00054 
00055 
00056 private:
00057 
00058   volatile int32_t m_refCount;
00059 
00060   void operator = (const SharedBase& rhs);
00061 
00062 };
00063 
00064 }
00065 
00066 #endif //#define _GEMFIRE_SHAREDBASE_HPP_

GemFire C++ Cache API Documentation