lemon/concepts/graph_components.h
changeset 617 4137ef9aacc6
parent 584 33c6b6e755cd
child 666 1993af615e68
     1.1 --- a/lemon/concepts/graph_components.h	Fri Apr 24 10:15:33 2009 +0200
     1.2 +++ b/lemon/concepts/graph_components.h	Fri Apr 24 11:54:48 2009 +0200
     1.3 @@ -180,6 +180,9 @@
     1.4      /// to convert from arcs to edges and to get both direction of edges.
     1.5      class BaseGraphComponent : public BaseDigraphComponent {
     1.6      public:
     1.7 +
     1.8 +      typedef BaseGraphComponent Graph;
     1.9 +
    1.10        typedef BaseDigraphComponent::Node Node;
    1.11        typedef BaseDigraphComponent::Arc Arc;
    1.12  
    1.13 @@ -189,9 +192,9 @@
    1.14        /// Undirected graphs can be used as directed graphs, each edge is
    1.15        /// represented by two opposite directed arcs.
    1.16        class Edge : public GraphItem<'e'> {
    1.17 -      public:
    1.18          typedef GraphItem<'e'> Parent;
    1.19  
    1.20 +      public:
    1.21          /// \brief Default constructor.
    1.22          ///
    1.23          /// Default constructor.
    1.24 @@ -991,12 +994,10 @@
    1.25      /// The standard graph maps must conform to the ReferenceMap concept.
    1.26      template <typename GR, typename K, typename V>
    1.27      class GraphMap : public ReferenceMap<K, V, V&, const V&> {
    1.28 +      typedef ReferenceMap<K, V, V&, const V&> Parent;
    1.29 +
    1.30      public:
    1.31  
    1.32 -      typedef ReadWriteMap<K, V> Parent;
    1.33 -
    1.34 -      /// The graph type of the map.
    1.35 -      typedef GR Graph;
    1.36        /// The key type of the map.
    1.37        typedef K Key;
    1.38        /// The value type of the map.
    1.39 @@ -1012,11 +1013,11 @@
    1.40        /// \brief Construct a new map.
    1.41        ///
    1.42        /// Construct a new map for the graph.
    1.43 -      explicit GraphMap(const Graph&) {}
    1.44 +      explicit GraphMap(const GR&) {}
    1.45        /// \brief Construct a new map with default value.
    1.46        ///
    1.47        /// Construct a new map for the graph and initalize the values.
    1.48 -      GraphMap(const Graph&, const Value&) {}
    1.49 +      GraphMap(const GR&, const Value&) {}
    1.50  
    1.51      private:
    1.52        /// \brief Copy constructor.
    1.53 @@ -1057,7 +1058,7 @@
    1.54          }
    1.55  
    1.56          const _Map &m;
    1.57 -        const Graph &g;
    1.58 +        const GR &g;
    1.59          const typename GraphMap::Value &t;
    1.60        };
    1.61  
    1.62 @@ -1085,9 +1086,9 @@
    1.63        /// It conforms to the ReferenceMap concept.
    1.64        template <typename V>
    1.65        class NodeMap : public GraphMap<MappableDigraphComponent, Node, V> {
    1.66 -      public:
    1.67          typedef GraphMap<MappableDigraphComponent, Node, V> Parent;
    1.68  
    1.69 +      public:
    1.70          /// \brief Construct a new map.
    1.71          ///
    1.72          /// Construct a new map for the digraph.
    1.73 @@ -1123,9 +1124,9 @@
    1.74        /// It conforms to the ReferenceMap concept.
    1.75        template <typename V>
    1.76        class ArcMap : public GraphMap<MappableDigraphComponent, Arc, V> {
    1.77 -      public:
    1.78          typedef GraphMap<MappableDigraphComponent, Arc, V> Parent;
    1.79  
    1.80 +      public:
    1.81          /// \brief Construct a new map.
    1.82          ///
    1.83          /// Construct a new map for the digraph.
    1.84 @@ -1221,9 +1222,9 @@
    1.85        /// It conforms to the ReferenceMap concept.
    1.86        template <typename V>
    1.87        class EdgeMap : public GraphMap<MappableGraphComponent, Edge, V> {
    1.88 -      public:
    1.89          typedef GraphMap<MappableGraphComponent, Edge, V> Parent;
    1.90  
    1.91 +      public:
    1.92          /// \brief Construct a new map.
    1.93          ///
    1.94          /// Construct a new map for the graph.