gravatar
kpeter (Peter Kovacs)
kpeter@inf.elte.hu
Standard graph maps are required to be reference maps (#190)
0 5 0
default
5 files changed with 44 insertions and 28 deletions:
↑ Collapse diff ↑
... ...
@@ -24,4 +24,2 @@
24 24

	
25
#include <lemon/bits/default_map.h>
26

	
27 25
namespace lemon {
Ignore white space 6 line context
... ...
@@ -49,2 +49,4 @@
49 49
    typedef typename Parent::Value Value;
50
    typedef typename Parent::Reference Reference;
51
    typedef typename Parent::ConstReference ConstReference;
50 52

	
... ...
@@ -189,2 +191,4 @@
189 191
    typedef typename Parent::Value Value;
192
    typedef typename Parent::Reference Reference;
193
    typedef typename Parent::ConstReference ConstReference;
190 194

	
Ignore white space 6 line context
... ...
@@ -423,8 +423,7 @@
423 423

	
424
      /// \brief Read write map of the nodes to type \c T.
424
      /// \brief Reference map of the nodes to type \c T.
425 425
      ///
426
      /// ReadWrite map of the nodes to type \c T.
427
      /// \sa Reference
426
      /// Reference map of the nodes to type \c T.
428 427
      template<class T>
429
      class NodeMap : public ReadWriteMap< Node, T > {
428
      class NodeMap : public ReferenceMap<Node, T, T&, const T&> {
430 429
      public:
... ...
@@ -438,3 +437,4 @@
438 437
        ///Copy constructor
439
        NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { }
438
        NodeMap(const NodeMap& nm) : 
439
          ReferenceMap<Node, T, T&, const T&>(nm) { }
440 440
        ///Assignment operator
... ...
@@ -447,8 +447,7 @@
447 447

	
448
      /// \brief Read write map of the arcs to type \c T.
448
      /// \brief Reference map of the arcs to type \c T.
449 449
      ///
450 450
      /// Reference map of the arcs to type \c T.
451
      /// \sa Reference
452 451
      template<class T>
453
      class ArcMap : public ReadWriteMap<Arc,T> {
452
      class ArcMap : public ReferenceMap<Arc, T, T&, const T&> {
454 453
      public:
... ...
@@ -461,3 +460,4 @@
461 460
        ///Copy constructor
462
        ArcMap(const ArcMap& em) : ReadWriteMap<Arc,T>(em) { }
461
        ArcMap(const ArcMap& em) :
462
          ReferenceMap<Arc, T, T&, const T&>(em) { }
463 463
        ///Assignment operator
... ...
@@ -473,2 +473,3 @@
473 473
        void constraints() {
474
          checkConcept<BaseDigraphComponent, _Digraph>();
474 475
          checkConcept<IterableDigraphComponent<>, _Digraph>();
Ignore white space 6 line context
... ...
@@ -499,8 +499,7 @@
499 499

	
500
      /// \brief Read write map of the nodes to type \c T.
500
      /// \brief Reference map of the nodes to type \c T.
501 501
      ///
502
      /// ReadWrite map of the nodes to type \c T.
503
      /// \sa Reference
502
      /// Reference map of the nodes to type \c T.
504 503
      template<class T>
505
      class NodeMap : public ReadWriteMap< Node, T >
504
      class NodeMap : public ReferenceMap<Node, T, T&, const T&>
506 505
      {
... ...
@@ -515,3 +514,4 @@
515 514
        ///Copy constructor
516
        NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { }
515
        NodeMap(const NodeMap& nm) :
516
          ReferenceMap<Node, T, T&, const T&>(nm) { }
517 517
        ///Assignment operator
... ...
@@ -524,8 +524,7 @@
524 524

	
525
      /// \brief Read write map of the directed arcs to type \c T.
525
      /// \brief Reference map of the arcs to type \c T.
526 526
      ///
527
      /// Reference map of the directed arcs to type \c T.
528
      /// \sa Reference
527
      /// Reference map of the arcs to type \c T.
529 528
      template<class T>
530
      class ArcMap : public ReadWriteMap<Arc,T>
529
      class ArcMap : public ReferenceMap<Arc, T, T&, const T&>
531 530
      {
... ...
@@ -539,3 +538,4 @@
539 538
        ///Copy constructor
540
        ArcMap(const ArcMap& em) : ReadWriteMap<Arc,T>(em) { }
539
        ArcMap(const ArcMap& em) :
540
          ReferenceMap<Arc, T, T&, const T&>(em) { }
541 541
        ///Assignment operator
... ...
@@ -548,8 +548,7 @@
548 548

	
549
      /// Read write map of the edges to type \c T.
549
      /// Reference map of the edges to type \c T.
550 550

	
551
      /// Reference map of the arcs to type \c T.
552
      /// \sa Reference
551
      /// Reference map of the edges to type \c T.
553 552
      template<class T>
554
      class EdgeMap : public ReadWriteMap<Edge,T>
553
      class EdgeMap : public ReferenceMap<Edge, T, T&, const T&>
555 554
      {
... ...
@@ -563,3 +562,4 @@
563 562
        ///Copy constructor
564
        EdgeMap(const EdgeMap& em) : ReadWriteMap<Edge,T>(em) {}
563
        EdgeMap(const EdgeMap& em) :
564
          ReferenceMap<Edge, T, T&, const T&>(em) {}
565 565
        ///Assignment operator
... ...
@@ -750,2 +750,3 @@
750 750
        void constraints() {
751
          checkConcept<BaseGraphComponent, _Graph>();
751 752
          checkConcept<IterableGraphComponent<>, _Graph>();
Show white space 6 line context
... ...
@@ -990,4 +990,5 @@
990 990
    /// graph types, which can be used for associating data to graph items.
991
    /// The standard graph maps must conform to the ReferenceMap concept.
991 992
    template <typename GR, typename K, typename V>
992
    class GraphMap : public ReadWriteMap<K, V> {
993
    class GraphMap : public ReferenceMap<K, V, V&, const V&> {
993 994
    public:
... ...
@@ -1002,2 +1003,9 @@
1002 1003
      typedef V Value;
1004
      /// The reference type of the map.
1005
      typedef Value& Reference;
1006
      /// The const reference type of the map.
1007
      typedef const Value& ConstReference;
1008

	
1009
      // The reference map tag.
1010
      typedef True ReferenceMapTag;
1003 1011

	
... ...
@@ -1033,3 +1041,4 @@
1033 1041
        void constraints() {
1034
          checkConcept<ReadWriteMap<Key, Value>, _Map >();
1042
          checkConcept
1043
            <ReferenceMap<Key, Value, Value&, const Value&>, _Map>();
1035 1044
          _Map m1(g);
... ...
@@ -1075,2 +1084,3 @@
1075 1084
      /// Standard graph map for the nodes.
1085
      /// It conforms to the ReferenceMap concept.
1076 1086
      template <typename V>
... ...
@@ -1112,2 +1122,3 @@
1112 1122
      /// Standard graph map for the arcs.
1123
      /// It conforms to the ReferenceMap concept.
1113 1124
      template <typename V>
... ...
@@ -1209,2 +1220,3 @@
1209 1220
      /// Standard graph map for the edges.
1221
      /// It conforms to the ReferenceMap concept.
1210 1222
      template <typename V>
0 comments (0 inline)