pm::Map< K, D, Comparator > Class Template Reference

Associative array based on AVL::tree. More...

Inherits pm::modified_tree< pm::Map< K, D, Comparator >, list(Container< AVL::tree< AVL::traits< K, D, Comparator > > >, Operation< pm::BuildUnary< AVL::node_accessor > >) >.

List of all members.


Public Member Functions

 Map ()
 Create an empty Map. Initialize the element comparator with its default constructor.
 Map (const Comparator &cmp_arg)
 Create an empty Map with non-default comparator.
template<typename Iterator>
 Map (Iterator src, Iterator src_end)
 Construct from an iterator.
void clear ()
 Clear all contents.
void swap (Map &m)
 Swap content with another Map in an efficient way.
template<typename Key>
assoc_helper< Map, Key >::type operator[] (const Key &k)
 Associative search.
template<typename Key>
assoc_helper< Map, Key >
::const_type 
operator[] (const Key &k) const
 Associative search (const). Find the data element associated with the given key. If it doesn't exist so far, it will raise an exception.

Detailed Description

template<typename K, typename D, typename Comparator = operations::cmp>
class pm::Map< K, D, Comparator >

Associative array based on AVL::tree.

It differs from the standard std::map in the implementation: it uses an AVL::tree instead of the red-black tree. The tree is attached via a smart pointer with reference counting.


Member Function Documentation

template<typename K, typename D, typename Comparator = operations::cmp>
void pm::Map< K, D, Comparator >::swap ( Map< K, D, Comparator > &  m  )  [inline]

Swap content with another Map in an efficient way.

Parameters:
m the other Map

template<typename K, typename D, typename Comparator = operations::cmp>
template<typename Key>
assoc_helper<Map,Key>::type pm::Map< K, D, Comparator >::operator[] ( const Key &  k  )  [inline]

Associative search.

Find the data element associated with the given key. If it doesn't exist so far, it will be created with the default constructor.

Note that the type of the search key is not necessarily the same as of the map entries. It suffices that both are comparable with each other.

template<typename K, typename D, typename Comparator = operations::cmp>
template<typename Key>
assoc_helper<Map,Key>::const_type pm::Map< K, D, Comparator >::operator[] ( const Key &  k  )  const [inline]

Associative search (const). Find the data element associated with the given key. If it doesn't exist so far, it will raise an exception.

Note that the type of the search key is not necessarily the same as of the map entries. It suffices that both are comparable with each other.


The documentation for this class was generated from the following file:
  • include/core/polymake/Map.h
Generated on Wed Mar 30 23:31:46 2011 for Polymake Template Library (PTL) by doxygen 1.5.6