Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Essential Tools Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWTPtrHashMultiMap<K,T,H,EQ,A>

Module:  Essential Tools Module   Group:  STL Extension-based Collection Classes


Does not inherit

Local Index

Members

Non-Members

Synopsis

#include <rw/tphmmap.h> 
RWTPtrHashMultiMap<K,T,H,EQ,A> m;

Description

This class maintains a pointer-based collection of associations of type pair<K* const, T*>. These pairs are stored according to a hash object of type H. H must provide a const hash function on elements of type K via public member

Equivalent keys within the collection will be grouped together based on an equality object of type EQ. EQ must ensure this grouping via public member

which should return true if x and y are equivalent.

Note: Any two keys that are equivalent must hash to the same value.

RWTPtrHashMultiMap<K,T,H,EQ,A> may contain multiple keys that are equivalent to each other. (RWTPtrHashMap<K,T,H,EQ,A>will not accept a key that is equivalent to any key already in the collection.) Equality is based on the comparison object and not on the == operator.

The value type must have operator==() defined. This requirement is imposed by the C++ Standard Library.

Persistence

Isomorphic

Example

Program Output:

Related Classes

Class RWTPtrHashMap<K,T,H,EQ,A>offers the same interface to a pointer-based collection that will not accept multiple keys that compare equal to each other.

rw_hashmultimap<<K*,T*,rw_deref_hash<H,K>,rw_deref_compare<EQ,K>,A>

is the C++-standard style collection that serves as the underlying implementation for this collection.

Public Typedefs

typedef rw_deref_hash<H,K> container_hash;
typedef rw_deref_compare<EQ,K> container_eq; 
typedef rw_hashmultimap<K*,T*,container_hash,container_eq,A>
        container_type; 
typedef container_type::size_type size_type; 
typedef container_type::difference_type difference_type; 
typedef container_type::iterator iterator; 
typedef container_type::const_iterator const_iterator; 
typedef pair <K* const, T*> value_type; 
typedef pair <K* const, T*>& reference; 
typedef const pair <K* const, T*>& const_reference; 
typedef K* value_type_key; 
typedef T* value_type_data; 
typedef K*& reference_key; 
typedef T*& reference_data; 
typedef const K*const& const_reference_key; 
typedef const T*const& const_reference_data; 

Public Constructors

RWTPtrHashMultiMap<K,T,H,EQ,A>();
RWTPtrHashMultiMap<K,T,H,EQ,A>(const container_type& m);
RWTPtrHashMultiMap<K,T,H,EQ,A>
  (const RWTPtrHashMultiMap<K,T,H,EQ,A>& rwm);
RWTPtrHashMultiMap<K,T,H,EQ,A>
(value_type* first, value_type* last);
RWTPtrHashMultiMap<K,T,H,EQ,A>
(const H& h, size_type sz = RW_DEFAULT_CAPACITY);

Public Member Operators

RWTPtrHashMultiMap<K,T,H,EQ,A>&
operator=(const container_type&jjj m); 
RWTPtrHashMultiMap<K,T,H,EQ,A>&
operator=(const RWTPtrHashMultiMap<K,T,H,EQ,A>& m);
bool
operator==(const RWTPtrHashMultiMap<K,T,H,EQ,A>& m); 

Public Member Functions

void
apply(void (*fn)(const K*, T*&,void*),void* d); 
void
apply(void (*fn)(const K*, const T*, void*), void* d)
      const;
void
applyToKeyAndValue(void (*fn)(const K*,T*&,void*),void* d); 
void
applyToKeyAndValue
   (void (*fn)(const K*, const T*, void*), void* d) const;
iterator
begin();
const_iterator
begin() const;
size_type
capacity() const; 
void
clear();
void
clearAndDestroy();
bool
contains(const K* key) const; 
bool
contains(bool (*fn)(value_type,void*),void* d) const;
iterator
end();
const_iterator
end() const;
size_type
entries() const; 
float
fillRatio() const; 
const K*
find(const K* key) const; 
value_type
find(bool (*fn)(value_type,void*), void* d) const;
T*
findValue(const K* key); 
const T*
findValue(const K* key) const;
const K*
findKeyAndValue(const K* key, T*& tr); 
const K*
findKeyAndValue(const K* key, const T*& tr) const;
bool
insert(K* key,T* a); 
bool
insertKeyAndValue(K* key,T* a); 
bool
isEmpty() const; 
const K*
minElement() const;
const K*
maxElement() const;
size_type
occurrencesOf(const K* key) const; 
size_type
occurrencesOf
   (bool(*fn)(value_type,void*),void* d)const;
K*
remove(const K* key); 
K*
remove(bool (*fn)(value_type,void*), void* d); 
size_type
removeAll(const K* key); 
size_type
removeAll(bool (*fn)(value_type,void*), void* d);
void
resize(size_type sz); 
container_type&
std();
const container_type&
std() const;

Related Global Operators

RWvostream&
operator<<(RWvostream& strm, 
           const RWTPtrHashMultiMap<K,T,H,EQ,A>& coll);
RWFile&
operator<<(RWFile& strm, 
           const RWTPtrHashMultiMap<K,T,H,EQ,A>& coll);
RWvistream&
operator>>(RWvistream& strm, 
           RWTPtrHashMultiMap<K,T,H,EQ,A>& coll);
RWFile&
operator>>(RWFile& strm, 
           RWTPtrHashMultiMap<K,T,H,EQ,A>& coll);
RWvistream&
operator>>(RWvistream& strm, 
           RWTPtrHashMultiMap<K,T,H,EQ,A>*& p);
RWFile&
operator>>(RWFile& strm, 
           RWTPtrHashMultiMap<K,T,H,EQ,A>*& p);


Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.