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

RWTValHashSet<T,H,EQ,A>

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


Does not inherit

Local Index

Members

Non-Members

Synopsis

#include <rw/tvhset.h> 
RWTValHashSet<T,H,EQ,A> s;

Description

This class maintains a collection of values, which are stored according to a hash object of type H. H must offer a const hash function for 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.

RWTValHashSet<T,H,EQ,A> will not accept an item that is equivalent to an item already in the collection. (RWTValHashMultiSet<T,H,EQ,A> may contain multiple items that are equivalent to each other.) Equality is based on the equality object and not on the == operator.

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

Persistence

Isomorphic

Example

Related Classes

Class RWTValHashMultiSet<T,H,EQ,A> offers the same interface to a collection that accepts multiple items that compare equal to each other.

Class rw_hashset<T,H,EQ,A> is the C++-standard compliant collection that serves as the underlying implementation for RWTValHashSet<T,H,EQ,A>.

Public Typedefs

typedef rw_hashset<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 T value_type; 
typedef T& reference; 
typedef const T& const_reference; 

Public Constructors

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

Public Member Operators

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

Public Member Functions

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

Related Global Operators

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