VMware GemFire Native C++ Reference  9.1
apache::geode::client::HashMapOfCacheable Class Reference

A map of CacheableKey objects to Cacheable that also extends SharedBase for smart pointers. More...

Inherits apache::geode::client::HashMapT< TKEY, TVAL >, and apache::geode::client::SharedBase.

Public Types

typedef _HashMapOfCacheable::Iterator Iterator
 Iterator class for the hash map. More...
 

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...
 
 HashMapOfCacheable ()
 Creates an empty hash map. More...
 
 HashMapOfCacheable (int32_t n)
 Creates an empty hash map with at least n buckets. More...
 
 HashMapOfCacheable (const HashMapOfCacheable &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...
 
TVAL operator[] (const TKEY &k)
 Returns a copy of the object that is associated with a particular key. More...
 
void preserveSB () const
 Atomically increment reference count. More...
 
int32_t refCount ()
 
void releaseSB () const
 Atomically decrement reference count, the SharedBase object is automatically deleted when its reference count goes to zero. 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...
 

Detailed Description

A map of CacheableKey objects to Cacheable that also extends SharedBase for smart pointers.

Member Typedef Documentation

typedef _HashMapOfCacheable::Iterator apache::geode::client::HashMapOfCacheable::Iterator

Iterator class for the hash map.

Constructor & Destructor Documentation

apache::geode::client::HashMapOfCacheable::HashMapOfCacheable ( )
inline

Creates an empty hash map.

apache::geode::client::HashMapOfCacheable::HashMapOfCacheable ( int32_t  n)
inline

Creates an empty hash map with at least n buckets.

apache::geode::client::HashMapOfCacheable::HashMapOfCacheable ( const HashMapOfCacheable other)
inline

Copy constructor.

Member Function Documentation

template<typename TKEY, typename TVAL>
Iterator apache::geode::client::HashMapT< TKEY, TVAL >::begin ( ) const
inlineinherited

Get an iterator pointing to the start of hash_map.

template<typename TKEY, typename TVAL>
int32_t apache::geode::client::HashMapT< TKEY, TVAL >::bucket_count ( ) const
inlineinherited

Returns the number of buckets used by the hash map.

template<typename TKEY, typename TVAL>
void apache::geode::client::HashMapT< TKEY, TVAL >::clear ( )
inlineinherited

Erases all of the elements.

template<typename TKEY, typename TVAL>
bool apache::geode::client::HashMapT< TKEY, TVAL >::contains ( const TKEY &  k) const
inlineinherited

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

template<typename TKEY, typename TVAL>
int32_t apache::geode::client::HashMapT< TKEY, TVAL >::count ( const SharedBasePtr k) const
inlineinherited

Counts the number of elements whose key is k.

template<typename TKEY, typename TVAL>
bool apache::geode::client::HashMapT< TKEY, TVAL >::empty ( ) const
inlineinherited

true if the hash map's size is 0.

template<typename TKEY, typename TVAL>
Iterator apache::geode::client::HashMapT< TKEY, TVAL >::end ( ) const
inlineinherited

Get an iterator pointing to the end of hash_map.

template<typename TKEY, typename TVAL>
int32_t apache::geode::client::HashMapT< TKEY, TVAL >::erase ( const TKEY &  k)
inlineinherited

Erases the element whose key is k.

template<typename TKEY, typename TVAL>
Iterator apache::geode::client::HashMapT< TKEY, TVAL >::find ( const TKEY &  k) const
inlineinherited

Finds an element whose key is k.

template<typename TKEY, typename TVAL>
bool apache::geode::client::HashMapT< TKEY, TVAL >::insert ( const TKEY &  k,
const TVAL &  v 
)
inlineinherited

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 apache::geode::client::HashMapT< TKEY, TVAL >::max_size ( ) const
inlineinherited

Returns the largest possible size of the hash map.

template<typename TKEY, typename TVAL>
TVAL apache::geode::client::HashMapT< TKEY, TVAL >::operator[] ( const TKEY &  k)
inlineinherited

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

void apache::geode::client::SharedBase::preserveSB ( ) const
inherited

Atomically increment reference count.

int32_t apache::geode::client::SharedBase::refCount ( )
inlineinherited
Returns
the reference count
void apache::geode::client::SharedBase::releaseSB ( ) const
inherited

Atomically decrement reference count, the SharedBase object is automatically deleted when its reference count goes to zero.

template<typename TKEY, typename TVAL>
void apache::geode::client::HashMapT< TKEY, TVAL >::resize ( int32_t  n)
inlineinherited

Increases the bucket count to at least n.

template<typename TKEY, typename TVAL>
int32_t apache::geode::client::HashMapT< TKEY, TVAL >::size ( ) const
inlineinherited

Returns the size of the hash map.

template<typename TKEY, typename TVAL>
void apache::geode::client::HashMapT< TKEY, TVAL >::swap ( HashMapT< TKEY, TVAL > &  other)
inlineinherited

Swaps the contents of two hash maps.

template<typename TKEY, typename TVAL>
void apache::geode::client::HashMapT< TKEY, TVAL >::update ( const TKEY &  k,
const TVAL &  v 
)
inlineinherited

Updates a value whose key must exist.


Pivotal GemFire C++ Cache API Documentation