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

RWTPtrHashMultiSet<T,H,EQ,A>

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


Does not inherit

Local Index

Members

Non-Members

Synopsis

#include <rw/tphasht.h>
RWTPtrHashMultiSet<T,H,EQ,A> hmset;

Description

This class maintains a pointer-based collection of values, which are stored according to a hash object of type H. Class T is the type pointed to by the items in the collection. H must provide a const hash function on elements of type T via public member

Objects 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, FALSE otherwise.

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

RWTPtrHashMultiSet<T,H,EQ,A> may contain multiple items that are equivalent to each other. (RWTPtrHashSet<T,H,EQ,A> will not accept an item that is equivalent to an item already in the collection.)

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

Persistence

Isomorphic

Examples

Related Classes

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

Class rw_hashmultiset<T*,rw_deref_hash<H,T>,rw_deref_compare<EQ,T>,A> is the C++-standard collection that serves as the underlying implementation for RWTPtrHashMultiSet<T,H,EQ,A>.

Public Typedefs

typedef rw_deref_compare<EQ,T> container_eq;
typedef rw_deref_hash<H,T> container_hash; 
typedef rw_hashmultiset<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 T* value_type; 
typedef T* const& reference; 
typedef T* const& const_reference; 

Public Constructors

RWTPtrHashMultiSet<T,H,EQ,A>(size_type sz=1024,
     const H& h = H(),const EQ& eq = EQ());
RWTPtrHashMultiSet<T,H,EQ,A>
  (const RWTPtrHashMultiSet<T,H,EQ,A>& rws);
RWTPtrHashMultiSet<T,H,EQ,A>
  (const rw_hashmultiset<T*,container_hash, 
   container_eq,A>& s);
RWTPtrHashMultiSet<T,H,EQ,A>
  (const H& h,size_type sz = RWDEFAULT_CAPACITY);
RWTPtrHashMultiSet<T,H,EQ,A>(T*const* first,T*const* last, 
  size_type sz=1024,const H& h = H(),const EQ& eq = EQ());

Public Member Operators

RWTPtrHashMultiSet<T,H,EQ,A>&
operator=(const RWTPtrHashMultiSet<T,H,EQ,A>& s); 
bool
operator==(const RWTPtrHashMultiSet<T,H,EQ,A>& s) const; 

Public Member Functions

void
apply(void (*fn)(const T*,void*), void* d) const; 
iterator
begin();
const_iterator
begin() const;
size_type
capacity() const; 
void
clear();
void
clearAndDestroy();
bool
contains(const T* a) const; 
bool
contains(bool (*fn)(const T*,void*), void* d) const;
void
difference(const RWTPtrHashMultiSet<T,H,EQ,A>& s); 
iterator
end();
const_iterator
end() const;
size_type
entries() const; 
float
fillRatio() const; 
const T*
find(const T* a) const; 
const T*
find(bool (*fn)(const T*,void*), void* d) const; 
bool
insert(T* a); 
void
intersection(const RWTPtrHashMultiSet<T,H,EQ,A>& s); 
bool
isEmpty() const; 
bool
isEquivalent(const RWTPtrHashMultiSet<T,H,EQ,A>& s) const; 
bool
isProperSubsetOf(const RWTPtrHashMultiSet<T,H,EQ,A>& s) const; 
bool
isSubsetOf(const RWTPtrHashMultiSet<T,H,EQ,A>& s) const; 
size_type
occurrencesOf(const T* a) const; 
size_type
occurrencesOf(bool (*fn)(const T*,void*), void* d) const;
T*
remove(const T* a); 
T*
remove(bool (*fn)(const T*,void*), void* d);
size_type
removeAll(const T* a); 
size_type
removeAll(bool (*fn)(const T*,void*), void* d);
void
resize(size_type sz); 
rw_hashset<T*,container_hash,container_eq,A>&
std();
const rw_hashset<T*,container_hash,container_eq,A>&
std() const;
void
symmetricDifference(const RWTPtrHashMultiSet<T,H,EQ,A>& rhs); 
void
Union(const RWTPtrHashMultiSet<T,H,EQ,A>& rhs); 

Related Global Operators

RWvostream&
operator<<(RWvostream& strm, const RWTPtrHashMultiSet<T,H,EQ,A>& coll);
RWFile&
operator<<(RWFile& strm, const RWTPtrHashMultiSet<T,H,EQ,A>& coll);
RWvistream&
operator>>(RWvistream& strm, RWTPtrHashMultiSet<T,H,EQ,A>& coll);
RWFile&
operator>>(RWFile& strm, RWTPtrHashMultiSet<T,H,EQ,A>& coll);
RWvistream&
operator>>(RWvistream& strm, RWTPtrHashMultiSet<T,H,EQ,A>*& p);
RWFile&
operator>>(RWFile& strm, RWTPtrHashMultiSet<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.