Tools.h++ Class Reference

Table Of Contents
Persistence
Isomorphic.
Examples
In this example, a multi-set of RWCStrings is exercised.
//
// tpmset.cpp
//
#include <rw/tpmset.h>
#include <rw/cstring.h>
#include <iostream.h>
#include <function.h>
main(){
RWTPtrMultiSet<RWCString, less<RWCString> > set;
set.insert(new RWCString("one"));
set.insert(new RWCString("two"));
set.insert(new RWCString("three"));
set.insert(new RWCString("one")); // OK: duplicates allowd
cout << set.entries() << endl; // Prints "4"
set.clearAndDestroy();
cout << set.entries() << endl; // Prints "0"
return 0;
}
Related Classes
Class RWTPtrSet<T,C> 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> maintains is a pointer-based collection of
key-value pairs.
Class multiset<T*, rw_deref_compare<C,T>,allocator > is the C++-standard collection that serves as the
underlying implementation for RWTPtrMultiSet<T,C>.
Public Typedefs
typedef rw_deref_compare<C,T> container_comp;
typedef multiset<T*, container_comp,allocator> 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;