lemon/bits/array_map.h
changeset 1807 5f2f3d982eba
parent 1703 eb90e3d6bddc
child 1810 474d093466a5
equal deleted inserted replaced
4:81821d2b5640 5:d800c7c995b1
    46 	    typename _Value>
    46 	    typename _Value>
    47   class ArrayMap : public AlterationNotifier<_Item>::ObserverBase {
    47   class ArrayMap : public AlterationNotifier<_Item>::ObserverBase {
    48 
    48 
    49     typedef _Item Item;
    49     typedef _Item Item;
    50   public:
    50   public:
    51     typedef True AdaptibleTag;
       
    52 		
       
    53     /// The graph type of the maps. 
    51     /// The graph type of the maps. 
    54     typedef _Graph Graph;
    52     typedef _Graph Graph;
       
    53     /// The reference map tag.
       
    54     typedef True ReferenceMapTag;
       
    55 
    55     /// The key type of the maps.
    56     /// The key type of the maps.
    56     typedef _Item Key;
    57     typedef _Item Key;
       
    58     /// The value type of the map.
       
    59     typedef _Value Value;
       
    60     /// The const reference type of the map.
       
    61     typedef const _Value& ConstReference;
       
    62     /// The reference type of the map.
       
    63     typedef _Value& Reference;
       
    64 
       
    65     typedef const Value ConstValue;
       
    66     typedef Value* Pointer;
       
    67     typedef const Value* ConstPointer;
    57 
    68 
    58     typedef AlterationNotifier<_Item> Registry;
    69     typedef AlterationNotifier<_Item> Registry;
    59 
    70 
    60     /// The MapBase of the Map which imlements the core regisitry function.
    71     /// The MapBase of the Map which imlements the core regisitry function.
    61     typedef typename Registry::ObserverBase Parent;
    72     typedef typename Registry::ObserverBase Parent;
    62 		
    73 		
    63     /// The value type of the map.
       
    64     typedef _Value Value;
       
    65 
    74 
    66 
    75 
    67   private:
    76   private:
    68     typedef std::allocator<Value> Allocator;
    77     typedef std::allocator<Value> Allocator;
    69 
    78 
    70 
    79 
    71   public:
    80   public:
    72 
    81 
    73     /// \brief Graph and Registry initialized map constructor.
    82     /// \brief Graph initialized map constructor.
    74     ///
    83     ///
    75     /// Graph and Registry initialized map constructor.
    84     /// Graph initialized map constructor.
    76     ArrayMap(const Graph& _g) : graph(&_g) {
    85     ArrayMap(const Graph& _g) : graph(&_g) {
    77       Item it;
    86       Item it;
    78       attach(_g.getNotifier(Item()));
    87       attach(_g.getNotifier(Item()));
    79       allocate_memory();
    88       allocate_memory();
    80       for (graph->first(it); it != INVALID; graph->next(it)) {
    89       for (graph->first(it); it != INVALID; graph->next(it)) {