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

RWTPtrMultiSet<T,C,A>

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


Does not inherit

Local Index

Members

Non-Members

Synopsis

#include <rw/tpmset.h>
RWTPtrMultiSet<T,C,A>  s;

Description

This class maintains a pointer-based collection of values, which are ordered according to a comparison object of type C. Class T is the type pointed to by the items in the collection. C must induce a total ordering on elements of type T via a public member

that returns true if x should precede y within the collection. The structure less<T> from the C++-standard header file <functional> is an example. Note that items in the collection will be dereferenced before being compared.

RWTPtrMultiSet<T,C,A> may contain multiple items that compare equal to each other. (RWTPtrSet<T,C,A> will not accept an item that compares equal to an item already in the collection.)

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

Persistence

Isomorphic.

Example

In this example, a multi-set of RWCStrings is exercised.

Program output:

Related Classes

Class RWTPtrSet<T,C,A> offers the same interface to a pointer-based collection that will not accept multiple items that compare equal to each other. RWTPtrMultiMap<K,T,C,A> maintains is a pointer-based collection of key-value pairs.

Class std::multiset<T*, rw_deref_compare<C,T>,A > is the C++-standard collection that serves as the underlying implementation for RWTPtrMultiSet<T,C,A>.

Public Typedefs

typedef rw_deref_compare<C,T> container_comp; 
typedef multiset<T*, container_comp,A>
                     container_type; 
typedef typename container_type::size_type size_type; 
typedef typename container_type::difference_type
  difference_type; 
typedef typename container_type::iterator iterator; 
typedef typename container_type::const_iterator
  const_iterator; 
typedef T* value_type; 
typedef T* const& reference; 
typedef T* const& const_reference; 

Public Constructors

RWTPtrMultiSet<T,C,A>(const container_comp& = container_comp());
RWTPtrMultiSet<T,C,A>(const RWTPtrMultiSet<T,C,A>& rws);
RWTPtrMultiSet<T,C,A>(const container_type>& ms);
RWTPtrMultiSet<T,C,A>(T* const* first,T* const* last,
                    const container_comp& = container_comp());

Public Member Operators

RWTPtrMultiSet<T,C,A>&
operator=(const container_type>& s); 
RWTPtrMultiSet<T,C,A>&
operator=(const RWTPtrMultiSet<T,C,A>& s);
bool
operator<(const RWTPtrMultiSet<T,C,A>& s) const; 
bool
operator==(const RWTPtrMultiSet<T,C,A>& s) const; 

Public Member Functions

void
apply(void (*fn)(const T*,void*), void* d) const; 
iterator
begin();
const_iterator
begin() const;
void
clear();
void
clearAndDestroy();
bool
contains(const T* a) const; 
bool
contains(bool (*fn)(const T*,void*), void* d) const;
void
difference(const RWTPtrMultiSet<T,C,A>& s); 
iterator
end();
const_iterator
end() const;
size_type
entries();
T*
find(const T* a);
const T*
find(const T* a) const; 
const T*
find(bool (*fn)(T*,void*), void* d);
const T*
find(bool (*fn)(const T*,void*), void* d) const;
bool
insert(T* a); 
void
intersection(const RWTPtrMultiSet<T,C,A>& s); 
bool
isEmpty() const; 
bool
isEquivalent(const RWTPtrMultiSet<T,C,A>& s) const; 
bool
isProperSubsetOf(const RWTPtrMultiSet<T,C,A>& s) const; 
bool
isSubsetOf(const RWTPtrMultiSet<T,C,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);
multiset<T*, container_comp,A>&
std();
const multiset<T*, container_comp,A>&
std() const;
void
symmetricDifference(const RWTPtrMultiSet<T,C,A>& s); 
void
Union(const RWTPtrMultiSet<T,C,A>& s); 

Related Global Operators

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