Add creator functions for IdMap and RangeIdMap (#302)
authorPeter Kovacs <kpeter@inf.elte.hu>
Fri, 25 Sep 2009 12:24:16 +0200
changeset 77211404088d1a5
parent 771 d8073df341f6
child 773 3fc2a801c39e
Add creator functions for IdMap and RangeIdMap (#302)
lemon/maps.h
     1.1 --- a/lemon/maps.h	Fri Sep 25 12:22:42 2009 +0200
     1.2 +++ b/lemon/maps.h	Fri Sep 25 12:24:16 2009 +0200
     1.3 @@ -1899,6 +1899,14 @@
     1.4      InverseMap inverse() const { return InverseMap(*_graph);}
     1.5    };
     1.6  
     1.7 +  /// \brief Returns an \c IdMap class.
     1.8 +  ///
     1.9 +  /// This function just returns an \c IdMap class.
    1.10 +  /// \relates IdMap
    1.11 +  template <typename K, typename GR>
    1.12 +  inline IdMap<GR, K> idMap(const GR& graph) {
    1.13 +    return IdMap<GR, K>(graph);
    1.14 +  }
    1.15  
    1.16    /// \brief General cross reference graph map type.
    1.17  
    1.18 @@ -2362,6 +2370,15 @@
    1.19      }
    1.20    };
    1.21  
    1.22 +  /// \brief Returns a \c RangeIdMap class.
    1.23 +  ///
    1.24 +  /// This function just returns an \c RangeIdMap class.
    1.25 +  /// \relates RangeIdMap
    1.26 +  template <typename K, typename GR>
    1.27 +  inline RangeIdMap<GR, K> rangeIdMap(const GR& graph) {
    1.28 +    return RangeIdMap<GR, K>(graph);
    1.29 +  }
    1.30 +  
    1.31    /// \brief Dynamic iterable \c bool map.
    1.32    ///
    1.33    /// This class provides a special graph map type which can store a