lemon/concepts/digraph.h
changeset 627 2313edd0db0b
parent 576 f5bc148f7e1f
child 781 bd72f8d20f33
child 1081 f1398882a928
child 1257 3e711ee55d31
     1.1 --- a/lemon/concepts/digraph.h	Tue Apr 14 10:33:17 2009 +0200
     1.2 +++ b/lemon/concepts/digraph.h	Tue Apr 14 10:34:12 2009 +0200
     1.3 @@ -421,12 +421,11 @@
     1.4        /// Gives back the opposite node on the given arc.
     1.5        Node oppositeNode(const Node&, const Arc&) const { return INVALID; }
     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        public:
    1.17  
    1.18          ///\e
    1.19 @@ -436,7 +435,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 @@ -445,12 +445,11 @@
    1.30          }
    1.31        };
    1.32  
    1.33 -      /// \brief Read write map of the 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 arcs to type \c T.
    1.37 -      /// \sa Reference
    1.38        template<class T>
    1.39 -      class ArcMap : public ReadWriteMap<Arc,T> {
    1.40 +      class ArcMap : public ReferenceMap<Arc, T, T&, const T&> {
    1.41        public:
    1.42  
    1.43          ///\e
    1.44 @@ -459,7 +458,8 @@
    1.45          ArcMap(const Digraph&, T) { }
    1.46        private:
    1.47          ///Copy constructor
    1.48 -        ArcMap(const ArcMap& em) : ReadWriteMap<Arc,T>(em) { }
    1.49 +        ArcMap(const ArcMap& em) :
    1.50 +          ReferenceMap<Arc, T, T&, const T&>(em) { }
    1.51          ///Assignment operator
    1.52          template <typename CMap>
    1.53          ArcMap& operator=(const CMap&) {
    1.54 @@ -471,6 +471,7 @@
    1.55        template <typename _Digraph>
    1.56        struct Constraints {
    1.57          void constraints() {
    1.58 +          checkConcept<BaseDigraphComponent, _Digraph>();
    1.59            checkConcept<IterableDigraphComponent<>, _Digraph>();
    1.60            checkConcept<IDableDigraphComponent<>, _Digraph>();
    1.61            checkConcept<MappableDigraphComponent<>, _Digraph>();