1 #ifndef _GEMFIRE_HASHSETT_HPP_ 2 #define _GEMFIRE_HASHSETT_HPP_ 12 #include "gfcpp_globals.hpp" 50 inline const TKEY operator * ( )
const 52 return staticCast<TKEY>( *m_iter );
55 inline bool isEnd( )
const 57 return m_iter.isEnd( );
66 inline void operator ++ (
int )
71 inline bool operator == (
const Iterator& other )
const 73 return ( m_iter == other.m_iter );
76 inline bool operator != (
const Iterator& other )
const 78 return ( m_iter != other.m_iter );
93 return gemfire::hashFunction< TKEY >( staticCast<TKEY>( p ) );
98 return gemfire::equalToFunction< TKEY >( staticCast<TKEY>( x ),
99 staticCast<TKEY>( y ) );
117 return m_set.
empty( );
135 m_set.
swap( other.m_set );
147 inline int32_t
erase(
const TKEY& k )
149 return m_set.
erase( k );
165 int32_t
count(
const TKEY& k )
const 167 return m_set.
count( k );
193 : m_set( hasher, equal_to )
201 : m_set( n, hasher, equal_to )
207 : m_set( other.m_set )
225 public _HashSetOfCacheableKey,
public SharedBase 233 _HashSetOfCacheableKey() { }
237 _HashSetOfCacheableKey(n) { }
241 _HashSetOfCacheableKey(other) { }
Iterator end() const
Get an iterator pointing to the end of hash_set.
bool contains(const TKEY &k) const
Check if a given key k exists in the hash set.
Definition: HashSetT.hpp:159
void clear()
Erases all of the elements.
void resize(int32_t n)
Increases the bucket count to at least n.
int32_t size() const
Returns the size of the hash_set.
int32_t erase(const TKEY &k)
Erases the element whose key is k.
Definition: HashSetT.hpp:147
int32_t count(const TKEY &k) const
Counts the number of elements whose key is k.
Definition: HashSetT.hpp:165
void clear()
Erases all of the elements.
Definition: HashSetT.hpp:153
HashSetOfCacheableKey(const HashSetOfCacheableKey &other)
Copy constructor.
Definition: HashSetT.hpp:240
void swap(HashSetT &other)
Swaps the contents of two hash sets.
Definition: HashSetT.hpp:133
void resize(int32_t n)
Increases the bucket count to at least n.
Definition: HashSetT.hpp:127
bool insert(const TKEY &k)
Inserts the key k into the hash set, when k does not exist in the hash set.
Definition: HashSetT.hpp:141
bool empty() const
true if the hash_set's size is 0.
bool contains(const SharedBasePtr &k) const
Check if a given key k exists in the hash_set.
int32_t size() const
Returns the size of the hash set.
Definition: HashSetT.hpp:103
int32_t max_size() const
Returns the largest possible size of the hash set.
Definition: HashSetT.hpp:109
int32_t bucket_count() const
Returns the number of buckets used by the hash_set.
This namespace contains all the GemFire C++ API classes, enumerations and globals.
Definition: Assert.hpp:19
int32_t count(const SharedBasePtr &k) const
Counts the number of elements whose key is k.
Iterator begin() const
Get an iterator pointing to the start of hash_set.
HashSetT & operator=(const HashSetT &other)
Assignment operator.
Definition: HashSetT.hpp:183
~HashSetT()
Destructor: the destructor of m_set would do required stuff.
Definition: HashSetT.hpp:212
A hash set of CacheableKey objects that also extends SharedBase for smart pointers.
Definition: HashSetT.hpp:224
HashSetOfCacheableKey()
Create an empty HashSet.
Definition: HashSetT.hpp:232
Iterator end() const
Get an iterator pointing to the end of hash_set.
Definition: HashSetT.hpp:177
Iterator begin() const
Get an iterator pointing to the start of hash_set.
Definition: HashSetT.hpp:171
HashSetT(int32_t n)
Creates an empty hash set with at least n buckets and hash function hasher<TKEY> and equal to functio...
Definition: HashSetT.hpp:200
void swap(HashSetOfSharedBase &other)
Swaps the contents of two hash_sets.
int32_t max_size() const
Returns the largest possible size of the hash_set.
Interface of an iterator for HashSetT.
Definition: HashSetT.hpp:34
bool insert(const SharedBasePtr &k)
Inserts the key k into the hash_set.
HashSetT(const HashSetT &other)
Copy constructor.
Definition: HashSetT.hpp:206
Interface of an iterator for HashSetOfSharedBase.
Definition: HashSetOfSharedBase.hpp:51
#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
HashSetT()
Creates an empty hash set with hash function hasher<TKEY> and equal to function equal_to<TKEY>.
Definition: HashSetT.hpp:192
bool empty() const
true if the hash set's size is 0.
Definition: HashSetT.hpp:115
int32_t erase(const SharedBasePtr &k)
Erases the element whose key is k.
Represents a HashSet of SharedBase
Definition: HashSetOfSharedBase.hpp:38
_HashSetOfCacheableKey::Iterator Iterator
Iterator class for the hash set.
Definition: HashSetT.hpp:229
Defines a reference counted shared pointer.
Definition: SharedPtr.hpp:35
int32_t bucket_count() const
Returns the number of buckets used by the hash set.
Definition: HashSetT.hpp:121
HashSetOfCacheableKey(int32_t n)
Creates an empty hash set with at least n buckets.
Definition: HashSetT.hpp:236
HashSet of TKEY.
Definition: HashSetT.hpp:24