gemfire::HashMapOfSharedBase Class Reference


Detailed Description

Represents a HashMap of SharedBase.

Public Member Functions

Iterator begin () const
 Get an iterator pointing to the start of hash_map.
int32_t bucket_count () const
 Returns the number of buckets used by the hash_map.
void clear ()
 Erases all of the elements.
bool contains (const SharedBasePtr &k) const
 Check if a given key k exists in the hash_map.
int32_t count (const SharedBasePtr &k) const
 Counts the number of elements whose key is k.
bool empty () const
 true if the hash_map's size is 0.
Iterator end () const
 Get an iterator pointing to the end of hash_map.
int32_t erase (const SharedBasePtr &k)
 Erases the element whose key is k.
Iterator find (const SharedBasePtr &k) const
 Finds an element whose key is k.
 HashMapOfSharedBase (const HashMapOfSharedBase &other)
 Copy constructor.
 HashMapOfSharedBase (int32_t n, const Hasher h, const EqualTo k)
 Creates an empty hash_map with at least n buckets, using h as the hash function and k as the key equal function.
 HashMapOfSharedBase (const Hasher h, const EqualTo k)
 Creates an empty hash_map using h as the hash function and k as the key equal function.
bool insert (const SharedBasePtr &k, const SharedBasePtr &v)
 Inserts the <k, v> pair into the hash_map, when k does not exist in the hash_map.
int32_t max_size () const
 Returns the largest possible size of the hash_map.
HashMapOfSharedBaseoperator= (const HashMapOfSharedBase &other)
 Assignment operator.
SharedBasePtroperator[] (const SharedBasePtr &k)
 Returns a reference to the object that is associated with a particular key.
void resize (int32_t n)
 Increases the bucket count to at least n.
int32_t size () const
 Returns the size of the hash_map.
void swap (HashMapOfSharedBase &other)
 Swaps the contents of two hash_maps.
 ~HashMapOfSharedBase ()
 Destructor, sets all SharedPtr elements to NULLPTR.

Data Structures

class  Iterator
 Interface of an iterator for HashMapOfSharedBase. More...

Constructor & Destructor Documentation

gemfire::HashMapOfSharedBase::HashMapOfSharedBase ( const Hasher  h,
const EqualTo  k 
)

Creates an empty hash_map using h as the hash function and k as the key equal function.

gemfire::HashMapOfSharedBase::HashMapOfSharedBase ( int32_t  n,
const Hasher  h,
const EqualTo  k 
)

Creates an empty hash_map with at least n buckets, using h as the hash function and k as the key equal function.

gemfire::HashMapOfSharedBase::HashMapOfSharedBase ( const HashMapOfSharedBase other  ) 

Copy constructor.

gemfire::HashMapOfSharedBase::~HashMapOfSharedBase (  ) 

Destructor, sets all SharedPtr elements to NULLPTR.


Member Function Documentation

Iterator gemfire::HashMapOfSharedBase::begin (  )  const

Get an iterator pointing to the start of hash_map.

int32_t gemfire::HashMapOfSharedBase::bucket_count (  )  const

Returns the number of buckets used by the hash_map.

void gemfire::HashMapOfSharedBase::clear (  ) 

Erases all of the elements.

bool gemfire::HashMapOfSharedBase::contains ( const SharedBasePtr k  )  const

Check if a given key k exists in the hash_map.

int32_t gemfire::HashMapOfSharedBase::count ( const SharedBasePtr k  )  const

Counts the number of elements whose key is k.

bool gemfire::HashMapOfSharedBase::empty (  )  const

true if the hash_map's size is 0.

Iterator gemfire::HashMapOfSharedBase::end (  )  const

Get an iterator pointing to the end of hash_map.

int32_t gemfire::HashMapOfSharedBase::erase ( const SharedBasePtr k  ) 

Erases the element whose key is k.

Iterator gemfire::HashMapOfSharedBase::find ( const SharedBasePtr k  )  const

Finds an element whose key is k.

bool gemfire::HashMapOfSharedBase::insert ( const SharedBasePtr k,
const SharedBasePtr v 
)

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

int32_t gemfire::HashMapOfSharedBase::max_size (  )  const

Returns the largest possible size of the hash_map.

HashMapOfSharedBase& gemfire::HashMapOfSharedBase::operator= ( const HashMapOfSharedBase other  ) 

Assignment operator.

SharedBasePtr& gemfire::HashMapOfSharedBase::operator[] ( const SharedBasePtr k  ) 

Returns a reference to the object that is associated with a particular key.

void gemfire::HashMapOfSharedBase::resize ( int32_t  n  ) 

Increases the bucket count to at least n.

int32_t gemfire::HashMapOfSharedBase::size (  )  const

Returns the size of the hash_map.

void gemfire::HashMapOfSharedBase::swap ( HashMapOfSharedBase other  ) 

Swaps the contents of two hash_maps.


GemFire C++ Cache API Documentation