Pivotal GemFire Native Client Cache Reference  9.0.6
gemfire::HashMapT< TKEY, TVAL > Class Template Reference

HashMap of TKEY to TVAL. More...

Inherited by gemfire::HashMapOfCacheable, and gemfire::HashMapOfException.

Public Member Functions

Iterator begin () const
 Get an iterator pointing to the start of hash_map. More...
 
int32_t bucket_count () const
 Returns the number of buckets used by the hash map. More...
 
void clear ()
 Erases all of the elements. More...
 
bool contains (const TKEY &k) const
 Check if a given key k exists in the hash map. More...
 
int32_t count (const SharedBasePtr &k) const
 Counts the number of elements whose key is k. More...
 
bool empty () const
 true if the hash map's size is 0. More...
 
Iterator end () const
 Get an iterator pointing to the end of hash_map. More...
 
int32_t erase (const TKEY &k)
 Erases the element whose key is k. More...
 
Iterator find (const TKEY &k) const
 Finds an element whose key is k. More...
 
 HashMapT ()
 Creates an empty hash map with hash function hasher<TKEY> and equal to function equal_to<TKEY>. More...
 
 HashMapT (int32_t n)
 Creates an empty hash map with at least n buckets and hash function hasher<TKEY> and equal to function equal_to<TKEY>. More...
 
 HashMapT (const HashMapT &other)
 Copy constructor. More...
 
bool insert (const TKEY &k, const TVAL &v)
 Inserts the <k, v> pair into the hash map, when k does not exist in the hash map. More...
 
int32_t max_size () const
 Returns the largest possible size of the hash map. More...
 
HashMapToperator= (const HashMapT &other)
 Assignment operator. More...
 
TVAL operator[] (const TKEY &k)
 Returns a copy of the object that is associated with a particular key. More...
 
void resize (int32_t n)
 Increases the bucket count to at least n. More...
 
int32_t size () const
 Returns the size of the hash map. More...
 
void swap (HashMapT &other)
 Swaps the contents of two hash maps. More...
 
void update (const TKEY &k, const TVAL &v)
 Updates a value whose key must exist. More...
 
 ~HashMapT ()
 Destructor: the destructor of m_map would do required stuff. More...
 

Detailed Description

template<typename TKEY, typename TVAL>
class gemfire::HashMapT< TKEY, TVAL >

HashMap of TKEY to TVAL.

Constructor & Destructor Documentation

template<typename TKEY, typename TVAL>
gemfire::HashMapT< TKEY, TVAL >::HashMapT ( )
inline

Creates an empty hash map with hash function hasher<TKEY> and equal to function equal_to<TKEY>.

template<typename TKEY, typename TVAL>
gemfire::HashMapT< TKEY, TVAL >::HashMapT ( int32_t  n)
inline

Creates an empty hash map with at least n buckets and hash function hasher<TKEY> and equal to function equal_to<TKEY>.

template<typename TKEY, typename TVAL>
gemfire::HashMapT< TKEY, TVAL >::HashMapT ( const HashMapT< TKEY, TVAL > &  other)
inline

Copy constructor.

template<typename TKEY, typename TVAL>
gemfire::HashMapT< TKEY, TVAL >::~HashMapT ( )
inline

Destructor: the destructor of m_map would do required stuff.

Member Function Documentation

template<typename TKEY, typename TVAL>
Iterator gemfire::HashMapT< TKEY, TVAL >::begin ( ) const
inline

Get an iterator pointing to the start of hash_map.

template<typename TKEY, typename TVAL>
int32_t gemfire::HashMapT< TKEY, TVAL >::bucket_count ( ) const
inline

Returns the number of buckets used by the hash map.

template<typename TKEY, typename TVAL>
void gemfire::HashMapT< TKEY, TVAL >::clear ( )
inline

Erases all of the elements.

template<typename TKEY, typename TVAL>
bool gemfire::HashMapT< TKEY, TVAL >::contains ( const TKEY &  k) const
inline

Check if a given key k exists in the hash map.

template<typename TKEY, typename TVAL>
int32_t gemfire::HashMapT< TKEY, TVAL >::count ( const SharedBasePtr k) const
inline

Counts the number of elements whose key is k.

template<typename TKEY, typename TVAL>
bool gemfire::HashMapT< TKEY, TVAL >::empty ( ) const
inline

true if the hash map's size is 0.

template<typename TKEY, typename TVAL>
Iterator gemfire::HashMapT< TKEY, TVAL >::end ( ) const
inline

Get an iterator pointing to the end of hash_map.

template<typename TKEY, typename TVAL>
int32_t gemfire::HashMapT< TKEY, TVAL >::erase ( const TKEY &  k)
inline

Erases the element whose key is k.

template<typename TKEY, typename TVAL>
Iterator gemfire::HashMapT< TKEY, TVAL >::find ( const TKEY &  k) const
inline

Finds an element whose key is k.

template<typename TKEY, typename TVAL>
bool gemfire::HashMapT< TKEY, TVAL >::insert ( const TKEY &  k,
const TVAL &  v 
)
inline

Inserts the <k, v> pair into the hash map, when k does not exist in the hash map.

template<typename TKEY, typename TVAL>
int32_t gemfire::HashMapT< TKEY, TVAL >::max_size ( ) const
inline

Returns the largest possible size of the hash map.

template<typename TKEY, typename TVAL>
HashMapT& gemfire::HashMapT< TKEY, TVAL >::operator= ( const HashMapT< TKEY, TVAL > &  other)
inline

Assignment operator.

template<typename TKEY, typename TVAL>
TVAL gemfire::HashMapT< TKEY, TVAL >::operator[] ( const TKEY &  k)
inline

Returns a copy of the object that is associated with a particular key.

template<typename TKEY, typename TVAL>
void gemfire::HashMapT< TKEY, TVAL >::resize ( int32_t  n)
inline

Increases the bucket count to at least n.

template<typename TKEY, typename TVAL>
int32_t gemfire::HashMapT< TKEY, TVAL >::size ( ) const
inline

Returns the size of the hash map.

template<typename TKEY, typename TVAL>
void gemfire::HashMapT< TKEY, TVAL >::swap ( HashMapT< TKEY, TVAL > &  other)
inline

Swaps the contents of two hash maps.

template<typename TKEY, typename TVAL>
void gemfire::HashMapT< TKEY, TVAL >::update ( const TKEY &  k,
const TVAL &  v 
)
inline

Updates a value whose key must exist.


GemFire C++ Cache API Documentation