Changeset 2121:09a07a851506 in lemon0.x for lemon/concept/graph.h
 Timestamp:
 07/10/06 21:04:17 (18 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@2834
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

lemon/concept/graph.h
r2120 r2121 33 33 namespace concept { 34 34 35 36 /**************** The fullfeatured graph concepts ****************/37 38 39 // \brief Modular static graph class.40 //41 // It should be the same as the \c Graph class.42 class _Graph43 : virtual public BaseGraphComponent,44 public IterableGraphComponent, public MappableGraphComponent {45 public:46 47 typedef BaseGraphComponent::Node Node;48 typedef BaseGraphComponent::Edge Edge;49 50 template <typename _Graph>51 struct Constraints {52 void constraints() {53 checkConcept<IterableGraphComponent, _Graph>();54 checkConcept<MappableGraphComponent, _Graph>();55 }56 };57 };58 59 35 /// \addtogroup graph_concepts 60 36 /// @{ … … 411 387 /// \warning Making maps that can handle bool type (NodeMap<bool>) 412 388 /// needs some extra attention! 413 /// \todo Wrong documentation414 389 template<class T> 415 class NodeMap : public ReadWriteMap< Node, T > 416 { 390 class NodeMap : public ReadWriteMap< Node, T > { 417 391 public: 418 392 … … 425 399 NodeMap(const NodeMap& nm) : ReadWriteMap< Node, T >(nm) { } 426 400 ///Assignment operator 427 NodeMap& operator=(const NodeMap&) { return *this; } 428 // \todo fix this concept 401 template <typename CMap> 402 NodeMap& operator=(const CMap&) { 403 checkConcept<ReadMap<Node, T>, CMap>(); 404 return *this; 405 } 429 406 }; 430 407 … … 435 412 /// \warning Making maps that can handle bool type (EdgeMap<bool>) 436 413 /// needs some extra attention! 437 /// \todo Wrong documentation438 414 template<class T> 439 class EdgeMap : public ReadWriteMap<Edge,T> 440 { 415 class EdgeMap : public ReadWriteMap<Edge,T> { 441 416 public: 442 417 … … 448 423 EdgeMap(const EdgeMap& em) : ReadWriteMap<Edge,T>(em) { } 449 424 ///Assignment operator 450 EdgeMap& operator=(const EdgeMap&) { return *this; } 451 // \todo fix this concept 425 template <typename CMap> 426 EdgeMap& operator=(const CMap&) { 427 checkConcept<ReadMap<Edge, T>, CMap>(); 428 return *this; 429 } 452 430 }; 453 431 454 432 template <typename RGraph> 455 struct Constraints : public _Graph::Constraints<RGraph> {}; 433 struct Constraints { 434 void constraints() { 435 checkConcept<BaseIterableGraphComponent<>, Graph>(); 436 checkConcept<IterableGraphComponent<>, Graph>(); 437 checkConcept<MappableGraphComponent<>, Graph>(); 438 } 439 }; 456 440 457 441 };
Note: See TracChangeset
for help on using the changeset viewer.