Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Essential Tools Module Reference Guide

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

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


Does not inherit

Local Index

Members

Non-Members

Synopsis

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

Description

This class maintains a collection of keys, each with an associated item of type 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.

RWTValHashMultiMap<K,T,H,EQ,A> may contain multiple keys that are equivalent to each other. (RWTValHashMap<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 Standard C++ Library.

Persistence

Isomorphic.

Examples

Program Output:

Related Classes

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

Class rw_hashmultimap<K,T,H,EQ,A> is the C++-standard collection that serves as the underlying implementation for this collection.

Public Typedefs

typedef rw_hashmultimap<K,T,H,EQ,A> container_type; 
typedef typename container_type::iterator iterator;
typedef typename container_type::const_iterator
  const_iterator;
typedef typename container_type::size_type  size_type;
typedef std::pair <const K,T> value_type; 
typedef std::pair <const K,T>& reference; 
typedef const pair<const K,T>& const_reference; 

Public Constructors

RWTValHashMultiMap<K,T,H,EQ,A>();
RWTValHashMultiMap<K,T,H,EQ,A>
  (const rw_hashmultimap<K,T,H,EQ,A>& m);
RWTValHashMultiMap<K,T,H,EQ,A>
  (const RWTValHashMultiMap<K,T,H,EQ,A>& rwm);
RWTValHashMultiMap<K,T,H,EQ,A>
  (const value_type* first, const value_type* last);

Public Member Operators

RWTValHashMultiMap<K,T,H,EQ,A>&
operator=(const RWTValHashMultiMap<K,T,H,EQ,A>& m); 
RWTValHashMultiMap<K,T,H,EQ,A>&
operator=(const rw_hashmultimap<K,T,H,EQ,A>& m);
bool
operator==(const RWTValHashMultiMap<K,T,H,EQ,A>& m) const; 
bool
operator==(const rw_hashmultimap<K,T,H,EQ,A>& m) const;

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;
iterator
begin();
const_iterator
begin() const;
size_type
capacity() const; 
void
clear();
bool
contains(const K& key) const; 
bool
contains
  (bool (*fn)(const_reference,void*), void* d) const;
iterator
end();
const_iterator
end() const;
size_type
entries() const; 
float
fillRatio() const; 
bool
find(const K& key, Key& r) const; 
bool
find (bool (*fn)(const_reference,void*),
      void* d,std::pair<K,T>& r) const;
bool
findValue(const K& key, T& r) const; 
bool
findKeyValue(const K& key, K& kr, T& tr) const; 
bool
insert(const K& key, const 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)(const_reference,void*),void* d) const;
bool
remove(const K& key); 
bool
remove(bool (*fn)(const_reference,void*), void* d); 
size_type
removeAll(const K& key); 
size_type
removeAll(bool (*fn)(const_reference,void*), void* d);
void
resize(size_type sz); 
rw_hashmultimap<K,T,H,EQ,A>&
std();
const rw_hashmultimap<K,T,H,EQ,A>&
std() const;

Related Global Operators

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


Previous fileTop of DocumentContentsIndex pageNext file

©2004 Copyright Quovadx, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Quovadx, 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.