src/lemon/default_map.h
changeset 1004 b94037830dc8
parent 980 0f1044b7a3af
child 1022 567f392d1d2e
equal deleted inserted replaced
4:70eb45d12049 5:b0640be60ee8
    31 /// \addtogroup graphmaps
    31 /// \addtogroup graphmaps
    32 /// @{
    32 /// @{
    33 
    33 
    34   /** The ArrayMap template class is graph map structure what
    34   /** The ArrayMap template class is graph map structure what
    35    *  automatically updates the map when a key is added to or erased from
    35    *  automatically updates the map when a key is added to or erased from
    36    *  the map. This map uses the VectorMap if the ValueType is a primitive
    36    *  the map. This map uses the VectorMap if the Value is a primitive
    37    *  type and the ArrayMap for the other cases.
    37    *  type and the ArrayMap for the other cases.
    38    *
    38    *
    39    *  The template parameter is the MapRegistry that the maps
    39    *  The template parameter is the MapRegistry that the maps
    40    *  will belong to and the ValueType.
    40    *  will belong to and the Value.
    41    */
    41    */
    42 
    42 
    43 
    43 
    44 
    44 
    45   template <typename _Graph, typename _Item, typename _ItemIt, typename _Value>
    45   template <typename _Graph, typename _Item, typename _ItemIt, typename _Value>
   145   public:
   145   public:
   146     typedef typename DefaultMapSelector<_Graph, _Item, _ItemIt, _Value>::Map Parent;
   146     typedef typename DefaultMapSelector<_Graph, _Item, _ItemIt, _Value>::Map Parent;
   147     typedef DefaultMap<_Graph, _Item, _ItemIt, _Value> Map;
   147     typedef DefaultMap<_Graph, _Item, _ItemIt, _Value> Map;
   148     
   148     
   149     typedef typename Parent::Graph Graph;
   149     typedef typename Parent::Graph Graph;
   150     typedef typename Parent::ValueType ValueType;
   150     typedef typename Parent::Value Value;
   151 
   151 
   152     DefaultMap(const Graph& _g) : Parent(_g) {}
   152     DefaultMap(const Graph& _g) : Parent(_g) {}
   153     DefaultMap(const Graph& _g, const ValueType& _v) : Parent(_g, _v) {}
   153     DefaultMap(const Graph& _g, const Value& _v) : Parent(_g, _v) {}
   154   };
   154   };
   155 
   155 
   156 
   156 
   157 
   157 
   158   template <typename _Base> 
   158   template <typename _Base> 
   178       typedef typename Graph::NodeIt NodeIt;
   178       typedef typename Graph::NodeIt NodeIt;
   179 
   179 
   180       typedef DefaultMap<Graph, Node, NodeIt, _Value> Parent;
   180       typedef DefaultMap<Graph, Node, NodeIt, _Value> Parent;
   181 
   181 
   182       //typedef typename Parent::Graph Graph;
   182       //typedef typename Parent::Graph Graph;
   183       typedef typename Parent::ValueType ValueType;
   183       typedef typename Parent::Value Value;
   184 
   184 
   185       NodeMap(const Graph& _g) 
   185       NodeMap(const Graph& _g) 
   186 	: Parent(_g) {}
   186 	: Parent(_g) {}
   187       NodeMap(const Graph& _g, const ValueType& _v) 
   187       NodeMap(const Graph& _g, const Value& _v) 
   188 	: Parent(_g, _v) {}
   188 	: Parent(_g, _v) {}
   189 
   189 
   190     };
   190     };
   191 
   191 
   192     template <typename _Value>
   192     template <typename _Value>
   198       typedef typename Graph::EdgeIt EdgeIt;
   198       typedef typename Graph::EdgeIt EdgeIt;
   199 
   199 
   200       typedef DefaultMap<Graph, Edge, EdgeIt, _Value> Parent;
   200       typedef DefaultMap<Graph, Edge, EdgeIt, _Value> Parent;
   201 
   201 
   202       //typedef typename Parent::Graph Graph;
   202       //typedef typename Parent::Graph Graph;
   203       typedef typename Parent::ValueType ValueType;
   203       typedef typename Parent::Value Value;
   204 
   204 
   205       EdgeMap(const Graph& _g) 
   205       EdgeMap(const Graph& _g) 
   206 	: Parent(_g) {}
   206 	: Parent(_g) {}
   207       EdgeMap(const Graph& _g, const ValueType& _v) 
   207       EdgeMap(const Graph& _g, const Value& _v) 
   208 	: Parent(_g, _v) {}
   208 	: Parent(_g, _v) {}
   209 
   209 
   210     };
   210     };
   211     
   211     
   212   };
   212   };