src/lemon/concept/graph_component.h
changeset 1022 567f392d1d2e
parent 1021 fd1d073b6557
child 1030 c8a41699e613
equal deleted inserted replaced
8:7b696ca4cfb2 9:5decf2c21a91
   404     /// An empty clearable base graph class.
   404     /// An empty clearable base graph class.
   405   
   405   
   406     /// This class provides beside the core graph features
   406     /// This class provides beside the core graph features
   407     /// core clear functions for the graph structure.
   407     /// core clear functions for the graph structure.
   408     /// The most of the base graphs should be conform to this concept.
   408     /// The most of the base graphs should be conform to this concept.
   409     class BaseClearableGraphComponent : virtual public BaseGraphComponent {
   409     class ClearableGraphComponent : virtual public BaseGraphComponent {
   410     public:
   410     public:
   411 
   411 
   412       /// Erase all the Nodes and Edges from the graph.
   412       /// Erase all the Nodes and Edges from the graph.
   413 
   413 
   414       /// Erase all the Nodes and Edges from the graph.
   414       /// Erase all the Nodes and Edges from the graph.
   416       void clear() {}    
   416       void clear() {}    
   417 
   417 
   418       template <typename _Graph>
   418       template <typename _Graph>
   419       struct Constraints {
   419       struct Constraints {
   420 	void constraints() {
   420 	void constraints() {
   421 	  checkConcept< BaseGraphComponent, _Graph>();
   421 	  checkConcept<BaseGraphComponent, _Graph>();
   422 	  graph.clear();
   422 	  graph.clear();
   423 	}
   423 	}
   424 
   424 
   425 	_Graph& graph;
   425 	_Graph graph;
   426       };
   426       };
   427     };
   427     };
   428 
   428 
   429 
   429 
   430     /// Skeleton class for graph NodeIt and EdgeIt
   430     /// Skeleton class for graph NodeIt and EdgeIt
   802 
   802 
   803 	_Graph& graph;
   803 	_Graph& graph;
   804       };
   804       };
   805     };
   805     };
   806 
   806 
   807     class ClearableGraphComponent : virtual public BaseGraphComponent {
       
   808     public:
       
   809 
       
   810       typedef ClearableGraphComponent Graph;
       
   811 
       
   812       typedef BaseGraphComponent::Node Node;
       
   813       typedef BaseGraphComponent::Edge Edge;
       
   814 
       
   815       void clear() {}    
       
   816 
       
   817 
       
   818       template <typename _Graph>
       
   819       struct ClearableGraphComponentConcept {
       
   820 	void constraints() {
       
   821 	  checkConcept< BaseGraphComponent, _Graph >();
       
   822 	  graph.clear();
       
   823 	}
       
   824 	_Graph& graph;
       
   825       };
       
   826     };
       
   827 
       
   828   }
   807   }
   829 
   808 
   830 }
   809 }
   831 
   810 
   832 #endif
   811 #endif