Notifier | The AlterationNotifier that will notify this map. | |
Item | The item type of the graph items. | |
Value | The value type of the map. |
#include <lemon/bits/vector_map.h>
Public Types | |
typedef _Graph | Graph |
The graph type of the map. | |
typedef _Item | Item |
The item type of the map. | |
typedef True | ReferenceMapTag |
The reference map tag. | |
typedef _Item | Key |
The key type of the map. | |
typedef _Value | Value |
The value type of the map. | |
typedef ItemSetTraits< _Graph, _Item >::ItemNotifier | Notifier |
The notifier type. | |
typedef VectorMap | Map |
The map type. | |
typedef Notifier::ObserverBase | Parent |
The base class of the map. | |
typedef Container::reference | Reference |
The reference type of the map;. | |
typedef Container::const_reference | ConstReference |
The const reference type of the map;. | |
Public Member Functions | |
VectorMap (const Graph &graph) | |
Constructor to attach the new map into the notifier. | |
VectorMap (const Graph &graph, const Value &value) | |
Constructor uses given value to initialize the map. | |
VectorMap (const VectorMap &_copy) | |
VectorMap & | operator= (const VectorMap &cmap) |
Assign operator. | |
template<typename CMap > | |
VectorMap & | operator= (const CMap &cmap) |
Template assign operator. | |
Reference | operator[] (const Key &key) |
The subcript operator. | |
ConstReference | operator[] (const Key &key) const |
The const subcript operator. | |
void | set (const Key &key, const Value &value) |
The setter function of the map. | |
Protected Member Functions | |
virtual void | add (const Key &key) |
Adds a new key to the map. | |
virtual void | add (const std::vector< Key > &keys) |
Adds more new keys to the map. | |
virtual void | erase (const Key &key) |
Erase a key from the map. | |
virtual void | erase (const std::vector< Key > &keys) |
Erase more keys from the map. | |
virtual void | build () |
Buildes the map. | |
virtual void | clear () |
Clear the map. | |
Private Types | |
typedef std::vector< _Value > | Container |
The container type of the map. |
It constructs a map and attachs it into the notifier. It adds all the items of the graph to the map.
It constructs a map uses a given value to initialize the map. It adds all the items of the graph to the map.
This operator assigns for each item in the map the value mapped to the same item in the copied map. The parameter map should be indiced with the same itemset because this assign operator does not change the container of the map.
VectorMap& operator= | ( | const CMap & | cmap | ) | [inline] |
The given parameter should be conform to the ReadMap concecpt and could be indiced by the current item set of the NodeMap. In this case the value for each item is assigned by the value of the given ReadMap.
The subscript operator. The map can be subscripted by the actual items of the graph.
ConstReference operator[] | ( | const Key & | key | ) | const [inline] |
The const subscript operator. The map can be subscripted by the actual items of the graph.
It the same as operator[](key) = value expression.
virtual void add | ( | const Key & | key | ) | [inline, protected, virtual] |
It adds a new key to the map. It called by the observer notifier and it overrides the add() member function of the observer base.
virtual void add | ( | const std::vector< Key > & | keys | ) | [inline, protected, virtual] |
It adds more new keys to the map. It called by the observer notifier and it overrides the add() member function of the observer base.
virtual void erase | ( | const Key & | key | ) | [inline, protected, virtual] |
Erase a key from the map. It called by the observer notifier and it overrides the erase() member function of the observer base.
virtual void erase | ( | const std::vector< Key > & | keys | ) | [inline, protected, virtual] |
Erase more keys from the map. It called by the observer notifier and it overrides the erase() member function of the observer base.
virtual void build | ( | ) | [inline, protected, virtual] |
It buildes the map. It called by the observer notifier and it overrides the build() member function of the observer base.
virtual void clear | ( | ) | [inline, protected, virtual] |
It erase all items from the map. It called by the observer notifier and it overrides the clear() member function of the observer base.