build-artifacts/win/product/include/gfcpp/HashSetOfSharedBase.hpp

Go to the documentation of this file.
00001 #ifndef _GEMFIRE_HASHSETOFSHAREDBASE_HPP_
00002 #define _GEMFIRE_HASHSETOFSHAREDBASE_HPP_
00003 
00004 
00005 /*=========================================================================
00006  * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
00007  * This product is protected by U.S. and international copyright
00008  * and intellectual property laws. Pivotal products are covered by
00009  * more patents listed at http://www.pivotal.io/patents.
00010  *========================================================================
00011  */
00012 
00013 #include "gfcpp_globals.hpp"
00014 #include "SharedPtr.hpp"
00015 #include "HashFunction.hpp"
00016 #ifdef BUILD_CPPCACHE
00017 #include <hash_set>
00018 #endif
00019 
00020 
00024 namespace gemfire
00025 {
00026 
00027 #ifdef BUILD_CPPCACHE
00028   typedef std::hash_set< SharedBasePtr, HashSB, EqualToSB > HSofSBP;
00029   typedef HSofSBP::const_iterator HSofSBPIterator;
00030 #else
00031   class HSofSBP;
00032   class HSofSBPIterator;
00033 #endif
00034 
00035 
00038    class CPPCACHE_EXPORT HashSetOfSharedBase 
00039   {
00040     private:
00041 
00042       HSofSBP* m_stdHashSet;
00043 
00044       // Never defined.
00045       HashSetOfSharedBase( );
00046 
00047 
00048     public:
00049 
00051       class CPPCACHE_EXPORT Iterator 
00052       {
00053         private:
00054 
00055           const HashSetOfSharedBase& m_set;
00056           HSofSBPIterator* m_iter;
00057 
00058           Iterator( const HSofSBPIterator& iter,
00059               const HashSetOfSharedBase& set );
00060 
00061           // Never defined.
00062           Iterator( );
00063 
00064 
00065         public:
00066 
00067           Iterator( const Iterator& other );
00068 
00069           const SharedBasePtr operator * ( ) const;
00070 
00071           bool isEnd( ) const;
00072 
00073           Iterator& operator ++ ( );
00074 
00075           void operator ++ ( int );
00076 
00077           bool operator == ( const Iterator& other ) const;
00078 
00079           bool operator != ( const Iterator& other ) const;
00080 
00081           void reset( );
00082 
00083           ~Iterator( );
00084 
00085 
00086           friend class HashSetOfSharedBase;
00087       private:
00088         const Iterator& operator=( const Iterator& );
00089 
00090       };
00091 
00092 
00094       int32_t size( ) const;
00095 
00097       int32_t max_size( ) const;
00098 
00100       bool empty( ) const;
00101 
00103       int32_t bucket_count( ) const;
00104 
00106       void resize( int32_t n );
00107 
00109       void swap( HashSetOfSharedBase& other );
00110 
00112       bool insert( const SharedBasePtr& k );
00113 
00115       int32_t erase( const SharedBasePtr& k );
00116 
00118       void clear( );
00119 
00121       bool contains( const SharedBasePtr& k ) const;
00122 
00124       int32_t count( const SharedBasePtr& k ) const;
00125 
00127       Iterator begin( ) const;
00128 
00130       Iterator end( ) const;
00131 
00133       HashSetOfSharedBase& operator = ( const HashSetOfSharedBase& other );
00134 
00138       HashSetOfSharedBase( const Hasher h, const EqualTo k );
00139 
00143       HashSetOfSharedBase( int32_t n, const Hasher h, const EqualTo k );
00144 
00146       HashSetOfSharedBase( const HashSetOfSharedBase& other );
00147 
00149       ~HashSetOfSharedBase( );
00150 
00151   };
00152 
00153 }
00154 
00155 
00156 #endif

GemFire C++ Cache API Documentation