lemon/concept/ugraph.h
changeset 2125 2f2cbe4e78a8
parent 2120 a907fb95f1e0
child 2126 2c8adbee9fa6
equal deleted inserted replaced
9:fd2df36922a5 10:f9c471380c6b
   487       /// 
   487       /// 
   488       /// ReadWrite map of the nodes to type \c T.
   488       /// ReadWrite map of the nodes to type \c T.
   489       /// \sa Reference
   489       /// \sa Reference
   490       /// \warning Making maps that can handle bool type (NodeMap<bool>)
   490       /// \warning Making maps that can handle bool type (NodeMap<bool>)
   491       /// needs some extra attention!
   491       /// needs some extra attention!
   492       /// \todo Wrong documentation
       
   493       template<class T> 
   492       template<class T> 
   494       class NodeMap : public ReadWriteMap< Node, T >
   493       class NodeMap : public ReadWriteMap< Node, T >
   495       {
   494       {
   496       public:
   495       public:
   497 
   496 
   501         NodeMap(const UGraph&, T) { }
   500         NodeMap(const UGraph&, T) { }
   502 
   501 
   503         ///Copy constructor
   502         ///Copy constructor
   504         NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { }
   503         NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { }
   505         ///Assignment operator
   504         ///Assignment operator
   506         NodeMap& operator=(const NodeMap&) { return *this; }
   505         template <typename CMap>
   507         // \todo fix this concept
   506         NodeMap& operator=(const CMap&) { 
       
   507           checkConcept<ReadMap<Node, T>, CMap>();
       
   508           return *this; 
       
   509         }
   508       };
   510       };
   509 
   511 
   510       /// \brief Read write map of the directed edges to type \c T.
   512       /// \brief Read write map of the directed edges to type \c T.
   511       ///
   513       ///
   512       /// Reference map of the directed edges to type \c T.
   514       /// Reference map of the directed edges to type \c T.
   513       /// \sa Reference
   515       /// \sa Reference
   514       /// \warning Making maps that can handle bool type (EdgeMap<bool>)
   516       /// \warning Making maps that can handle bool type (EdgeMap<bool>)
   515       /// needs some extra attention!
   517       /// needs some extra attention!
   516       /// \todo Wrong documentation
       
   517       template<class T> 
   518       template<class T> 
   518       class EdgeMap : public ReadWriteMap<Edge,T>
   519       class EdgeMap : public ReadWriteMap<Edge,T>
   519       {
   520       {
   520       public:
   521       public:
   521 
   522 
   524         ///\e
   525         ///\e
   525         EdgeMap(const UGraph&, T) { }
   526         EdgeMap(const UGraph&, T) { }
   526         ///Copy constructor
   527         ///Copy constructor
   527         EdgeMap(const EdgeMap& em) : ReadWriteMap<Edge,T>(em) { }
   528         EdgeMap(const EdgeMap& em) : ReadWriteMap<Edge,T>(em) { }
   528         ///Assignment operator
   529         ///Assignment operator
   529         EdgeMap& operator=(const EdgeMap&) { return *this; }
   530         template <typename CMap>
   530         // \todo fix this concept    
   531         EdgeMap& operator=(const CMap&) { 
       
   532           checkConcept<ReadMap<Edge, T>, CMap>();
       
   533           return *this; 
       
   534         }
   531       };
   535       };
   532 
   536 
   533       /// Read write map of the undirected edges to type \c T.
   537       /// Read write map of the undirected edges to type \c T.
   534 
   538 
   535       /// Reference map of the edges to type \c T.
   539       /// Reference map of the edges to type \c T.
   536       /// \sa Reference
   540       /// \sa Reference
   537       /// \warning Making maps that can handle bool type (UEdgeMap<bool>)
   541       /// \warning Making maps that can handle bool type (UEdgeMap<bool>)
   538       /// needs some extra attention!
   542       /// needs some extra attention!
   539       /// \todo Wrong documentation
       
   540       template<class T> 
   543       template<class T> 
   541       class UEdgeMap : public ReadWriteMap<UEdge,T>
   544       class UEdgeMap : public ReadWriteMap<UEdge,T>
   542       {
   545       {
   543       public:
   546       public:
   544 
   547 
   547         ///\e
   550         ///\e
   548         UEdgeMap(const UGraph&, T) { }
   551         UEdgeMap(const UGraph&, T) { }
   549         ///Copy constructor
   552         ///Copy constructor
   550         UEdgeMap(const UEdgeMap& em) : ReadWriteMap<UEdge,T>(em) {}
   553         UEdgeMap(const UEdgeMap& em) : ReadWriteMap<UEdge,T>(em) {}
   551         ///Assignment operator
   554         ///Assignment operator
   552         UEdgeMap &operator=(const UEdgeMap&) { return *this; }
   555         template <typename CMap>
   553         // \todo fix this concept    
   556         UEdgeMap& operator=(const CMap&) { 
       
   557           checkConcept<ReadMap<UEdge, T>, CMap>();
       
   558           return *this; 
       
   559         }
   554       };
   560       };
   555 
   561 
   556       /// \brief Direct the given undirected edge.
   562       /// \brief Direct the given undirected edge.
   557       ///
   563       ///
   558       /// Direct the given undirected edge. The returned edge source
   564       /// Direct the given undirected edge. The returned edge source
   670       }
   676       }
   671 
   677 
   672       template <typename Graph>
   678       template <typename Graph>
   673       struct Constraints {
   679       struct Constraints {
   674 	void constraints() {
   680 	void constraints() {
   675 	  checkConcept<BaseIterableUGraphConcept, Graph>();
   681 	  checkConcept<BaseIterableUGraphComponent<>, Graph>();
   676 	  checkConcept<IterableUGraphConcept, Graph>();
   682 	  checkConcept<IterableUGraphComponent<>, Graph>();
   677 	  checkConcept<MappableUGraphConcept, Graph>();
   683 	  checkConcept<MappableUGraphComponent<>, Graph>();
   678 	}
   684 	}
   679       };
   685       };
   680 
   686 
   681     };
   687     };
   682 
   688