lemon/concepts/graph_components.h
changeset 580 2313edd0db0b
parent 579 d11bf7998905
child 584 33c6b6e755cd
     1.1 --- a/lemon/concepts/graph_components.h	Tue Apr 14 10:33:17 2009 +0200
     1.2 +++ b/lemon/concepts/graph_components.h	Tue Apr 14 10:34:12 2009 +0200
     1.3 @@ -988,8 +988,9 @@
     1.4      /// This class describes the concept of standard graph maps, i.e.
     1.5      /// the \c NodeMap, \c ArcMap and \c EdgeMap subtypes of digraph and 
     1.6      /// graph types, which can be used for associating data to graph items.
     1.7 +    /// The standard graph maps must conform to the ReferenceMap concept.
     1.8      template <typename GR, typename K, typename V>
     1.9 -    class GraphMap : public ReadWriteMap<K, V> {
    1.10 +    class GraphMap : public ReferenceMap<K, V, V&, const V&> {
    1.11      public:
    1.12  
    1.13        typedef ReadWriteMap<K, V> Parent;
    1.14 @@ -1000,6 +1001,13 @@
    1.15        typedef K Key;
    1.16        /// The value type of the map.
    1.17        typedef V Value;
    1.18 +      /// The reference type of the map.
    1.19 +      typedef Value& Reference;
    1.20 +      /// The const reference type of the map.
    1.21 +      typedef const Value& ConstReference;
    1.22 +
    1.23 +      // The reference map tag.
    1.24 +      typedef True ReferenceMapTag;
    1.25  
    1.26        /// \brief Construct a new map.
    1.27        ///
    1.28 @@ -1031,7 +1039,8 @@
    1.29        template<typename _Map>
    1.30        struct Constraints {
    1.31          void constraints() {
    1.32 -          checkConcept<ReadWriteMap<Key, Value>, _Map >();
    1.33 +          checkConcept
    1.34 +            <ReferenceMap<Key, Value, Value&, const Value&>, _Map>();
    1.35            _Map m1(g);
    1.36            _Map m2(g,t);
    1.37            
    1.38 @@ -1073,6 +1082,7 @@
    1.39        /// \brief Standard graph map for the nodes.
    1.40        ///
    1.41        /// Standard graph map for the nodes.
    1.42 +      /// It conforms to the ReferenceMap concept.
    1.43        template <typename V>
    1.44        class NodeMap : public GraphMap<MappableDigraphComponent, Node, V> {
    1.45        public:
    1.46 @@ -1110,6 +1120,7 @@
    1.47        /// \brief Standard graph map for the arcs.
    1.48        ///
    1.49        /// Standard graph map for the arcs.
    1.50 +      /// It conforms to the ReferenceMap concept.
    1.51        template <typename V>
    1.52        class ArcMap : public GraphMap<MappableDigraphComponent, Arc, V> {
    1.53        public:
    1.54 @@ -1207,6 +1218,7 @@
    1.55        /// \brief Standard graph map for the edges.
    1.56        ///
    1.57        /// Standard graph map for the edges.
    1.58 +      /// It conforms to the ReferenceMap concept.
    1.59        template <typename V>
    1.60        class EdgeMap : public GraphMap<MappableGraphComponent, Edge, V> {
    1.61        public: