OKlibrary  0.2.1.6
Concepts_Graphs.hpp
Go to the documentation of this file.
00001 // Oliver Kullmann, 8.9.2003 (Swansea)
00002 /* Copyright 2003 - 2007 Oliver Kullmann
00003 This file is part of the OKlibrary. OKlibrary is free software; you can redistribute
00004 it and/or modify it under the terms of the GNU General Public License as published by
00005 the Free Software Foundation and included in this library; either version 3 of the
00006 License, or any later version. */
00007 
00008 #ifndef CONCEPTSGRAPHSWAECHTER
00009 #define CONCEPTSGRAPHSWAECHTER
00010 
00011 #include <boost/graph/graph_traits.hpp>
00012 #include <boost/graph/graph_concepts.hpp>
00013 
00014 #include <boost/concept_check.hpp>
00015 
00016 namespace Concepts_Graphs {
00017 
00018   template <class G>
00019   struct VertexListSizeConstructibleGraphConcept {
00020     VertexListSizeConstructibleGraphConcept();
00021     typedef typename boost::graph_traits<G>::vertices_size_type vertices_size_type;
00022     void constraints() {
00023       boost::function_requires<boost::VertexListGraphConcept<G> >();
00024       G(s);
00025     }
00026     const vertices_size_type s;
00027   };
00028 
00029   template <class G>
00030   struct EdgeDescriptorGraphConcept {
00031     EdgeDescriptorGraphConcept();
00032     typedef typename boost::graph_traits<G>::vertex_descriptor vertex_descriptor;
00033     typedef typename boost::graph_traits<G>::edge_descriptor edge_descriptor;
00034     void constraints() {
00035       boost::function_requires<boost::GraphConcept<G> >();
00036       static_cast<vertex_descriptor>(source(e, g));
00037       static_cast<vertex_descriptor>(target(e, g));
00038     }
00039     const G g;
00040     const edge_descriptor e;
00041   };
00042 }
00043 
00044 #endif