The real return type is a masquerade reference
Values<Map>& referring to the originator map.
The real return type is a masquerade reference
Keys<Map>& referring to the originator map.
Either a functor class satisfying the extended requirements
for unary operations, or
an untyped template of such a class wrapped into BuildUnary or BuildUnaryIt
(preferably expressed via the convenience typedef from namespace polymake::operations.
This assertion is checked only in the AVL_CHECKS compilation mode.
Either a functor class satisfying the extended requirements
for binary operations, or
an untyped template of such a class wrapped into BuildBinary or BuildBinaryIt
(preferably expressed via the convenience typedef from namespace polymake::operations.
The real return type is a temporary object
pm::TransformedContainer< const KeyContainer&, operations::associative<Map> > .
It serves as a proxy object forwarding the lookup requests for single keys to the originator Map object.
Prerequisits
#include <Map.h>
using namespace polymake;
Introduction
template <typename Key, typename Data, typename KeyComparator=operations::cmp>
class Map;
An associative container in the STL sense.
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.
Create an empty map. Initialize the element comparator with its default constructor (the first variant)
or from a given prototype (the second variant).
The only purpose of the dummy argument end_sensitive is to signal that the first argument src
has to be treated as an end-sensitive iterator.
A template constructor with a single argument would shadow all other constructors away!
Give separate access to the key and data parts of the map entries. Since the keys are sorted, the key sequence
belongs to the GenericSet family.
The data parts (values) are visited in the same order as the keys.
The names of these functions are chosen deliberately identical to those of standard perl functions.
Find the data element associated with the given key. If it didn't exist so far, it will
be created with the default constructor of Data in the non-const variant,
while the const method will raise an exception, since it is not allowed to create new elements.
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.
Create a pseudo-container consisting of data elements associated with the given keys.
Non-existent elements are handled analogously to the single-key operator[].
The idea of this operator is leaned from perl, too.
Note that the implementation of the single-key and multi-key search operators is one and the same method;
they are explained separately with the only aim: to describe the result types as simple as possible.