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

RWTValMultiSet<T,C,A>

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


Does not inherit

Local Index

Members

Non-Members

Synopsis

#include <rw/tvmset.h>
RWTValMultiSet<T,C,A>

Description

This class maintains a collection of values, which are ordered according to a comparison object of type C. C must induce a total ordering on elements of type T via a public member

which returns true if x should precede y within the collection. The structure less<T> from the C++-standard header file <functional> is an example.

RWTValMultiSet<T,C,A> may contain multiple items that compare equal to each other. (RWTValSet<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 RWTValSet<T,C,A> offers the same interface to a collection that will not accept multiple items that compare equal to each other. RWTValMultiMap<K,T,C,A> maintains a collection of key-value pairs.

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

Public Typedefs

typedef multiset<T,C,A<T> > 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 const T& const_reference; 

Public Constructors

RWTValMultiSet<T,C,A>(const C& cmp = C());
RWTValMultiSet<T,C,A>(const container_type& s);
RWTValMultiSet<T,C,A>(const RWTValMultiSet<T,C,A>& rws);
RWTValMultiSet<T,C,A>
  (const T* first,const T* last,const C& cmp = C());

Public Member Operators

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

Public Member Functions

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

Related Global Operators

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