mace::map< Key, Data, Serial, Compare, Alloc > Class Template Reference
[Collections]

#include <m_map.h>

Inheritance diagram for mace::map< Key, Data, Serial, Compare, Alloc >:

Inheritance graph
[legend]
Collaboration diagram for mace::map< Key, Data, Serial, Compare, Alloc >:

Collaboration graph
[legend]

List of all members.


Detailed Description

template<class Key, class Data, class Serial = SerializeMap<Key, Data>, class Compare = std::less<Key>, class Alloc = std::allocator<std::pair<const Key, Data> >>
class mace::map< Key, Data, Serial, Compare, Alloc >

mace::map extends std::map, but has support for printing and serialization, random element retrieval, and containsKey

For most documentation, you should refer to the SGI STL documentation http://www.sgi.com/tech/stl

Definition at line 64 of file m_map.h.


Public Member Functions

void clear ()
 remove all elements from the map.
size_t size () const
 number of elements in the map.
bool containsKey (const Key &k) const
 whether key k is in the map. Equivalent to find(k) != end() (Mace extension)
const Data & get (const Key &k) const
 retrieve data from key k. Requires k already in map
Data & get (const Key &k)
 retrieve data from key k. Requires k already in map (Mace extension)
bool get (const Key &k, Data &d) const
 fills in data at key k, returns true if data found (Mace extension)
void put (const Key &k, const Data &d)
 put (k, d) into map. (Mace extension)
const_iterator erase (const_iterator i)
 Support removal of elements from a const_iterator by re-looking up k. (Called when the map is non-const but iterator is const). (Mace extension).
void erase (iterator i)
 erase iterator i
size_t erase (Key k)
 erases any values with key k, returns the number of entries erased
const std::string & getTypeName () const
 Return the template parameter string Key->Data for actual template parameters. (Mace extension).
const_iterator random () const
 return a random element, or end() if none. (Mace extension)
iterator random ()
 return a random element, or end() if none. (Mace extension)

The documentation for this class was generated from the following file:

Generated on Sat Oct 4 21:30:38 2008 for Mace Library by  doxygen 1.5.5