lemon/concepts/graph.h
changeset 599 f63e87b9748e
parent 559 c5fd2d996909
child 657 bf7928412136
     1.1 --- a/lemon/concepts/graph.h	Sat Apr 18 21:54:30 2009 +0200
     1.2 +++ b/lemon/concepts/graph.h	Tue Apr 21 10:34:49 2009 +0100
     1.3 @@ -497,12 +497,11 @@
     1.4          InArcIt& operator++() { return *this; }
     1.5        };
     1.6  
     1.7 -      /// \brief Read write map of the nodes to type \c T.
     1.8 +      /// \brief Reference map of the nodes to type \c T.
     1.9        ///
    1.10 -      /// ReadWrite map of the nodes to type \c T.
    1.11 -      /// \sa Reference
    1.12 +      /// Reference map of the nodes to type \c T.
    1.13        template<class T>
    1.14 -      class NodeMap : public ReadWriteMap< Node, T >
    1.15 +      class NodeMap : public ReferenceMap<Node, T, T&, const T&>
    1.16        {
    1.17        public:
    1.18  
    1.19 @@ -513,7 +512,8 @@
    1.20  
    1.21        private:
    1.22          ///Copy constructor
    1.23 -        NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { }
    1.24 +        NodeMap(const NodeMap& nm) :
    1.25 +          ReferenceMap<Node, T, T&, const T&>(nm) { }
    1.26          ///Assignment operator
    1.27          template <typename CMap>
    1.28          NodeMap& operator=(const CMap&) {
    1.29 @@ -522,12 +522,11 @@
    1.30          }
    1.31        };
    1.32  
    1.33 -      /// \brief Read write map of the directed arcs to type \c T.
    1.34 +      /// \brief Reference map of the arcs to type \c T.
    1.35        ///
    1.36 -      /// Reference map of the directed arcs to type \c T.
    1.37 -      /// \sa Reference
    1.38 +      /// Reference map of the arcs to type \c T.
    1.39        template<class T>
    1.40 -      class ArcMap : public ReadWriteMap<Arc,T>
    1.41 +      class ArcMap : public ReferenceMap<Arc, T, T&, const T&>
    1.42        {
    1.43        public:
    1.44  
    1.45 @@ -537,7 +536,8 @@
    1.46          ArcMap(const Graph&, T) { }
    1.47        private:
    1.48          ///Copy constructor
    1.49 -        ArcMap(const ArcMap& em) : ReadWriteMap<Arc,T>(em) { }
    1.50 +        ArcMap(const ArcMap& em) :
    1.51 +          ReferenceMap<Arc, T, T&, const T&>(em) { }
    1.52          ///Assignment operator
    1.53          template <typename CMap>
    1.54          ArcMap& operator=(const CMap&) {
    1.55 @@ -546,12 +546,11 @@
    1.56          }
    1.57        };
    1.58  
    1.59 -      /// Read write map of the edges to type \c T.
    1.60 +      /// Reference map of the edges to type \c T.
    1.61  
    1.62 -      /// Reference map of the arcs to type \c T.
    1.63 -      /// \sa Reference
    1.64 +      /// Reference map of the edges to type \c T.
    1.65        template<class T>
    1.66 -      class EdgeMap : public ReadWriteMap<Edge,T>
    1.67 +      class EdgeMap : public ReferenceMap<Edge, T, T&, const T&>
    1.68        {
    1.69        public:
    1.70  
    1.71 @@ -561,7 +560,8 @@
    1.72          EdgeMap(const Graph&, T) { }
    1.73        private:
    1.74          ///Copy constructor
    1.75 -        EdgeMap(const EdgeMap& em) : ReadWriteMap<Edge,T>(em) {}
    1.76 +        EdgeMap(const EdgeMap& em) :
    1.77 +          ReferenceMap<Edge, T, T&, const T&>(em) {}
    1.78          ///Assignment operator
    1.79          template <typename CMap>
    1.80          EdgeMap& operator=(const CMap&) {
    1.81 @@ -748,6 +748,7 @@
    1.82        template <typename _Graph>
    1.83        struct Constraints {
    1.84          void constraints() {
    1.85 +          checkConcept<BaseGraphComponent, _Graph>();
    1.86            checkConcept<IterableGraphComponent<>, _Graph>();
    1.87            checkConcept<IDableGraphComponent<>, _Graph>();
    1.88            checkConcept<MappableGraphComponent<>, _Graph>();