Commit add3d518 authored by Tiago Peixoto's avatar Tiago Peixoto

Remove any mention of boost::coroutine if HAVE_BOOST_COROUTINE is not defined

parent 1e051953
......@@ -20,7 +20,6 @@
#include <boost/python.hpp>
#include <boost/graph/astar_search.hpp>
#include <boost/coroutine/all.hpp>
#include "graph.hh"
#include "graph_selectors.hh"
......@@ -28,6 +27,10 @@
#include "graph_astar.hh"
#ifdef HAVE_BOOST_COROUTINE
#include <boost/coroutine/all.hpp>
#endif // HAVE_BOOST_COROUTINE
using namespace std;
using namespace boost;
using namespace graph_tool;
......@@ -100,6 +103,7 @@ void a_star_search(GraphInterface& g, size_t source, boost::any dist_map,
writable_vertex_properties())(dist_map);
}
#ifdef HAVE_BOOST_COROUTINE
typedef boost::coroutines::asymmetric_coroutine<boost::python::object> coro_t;
......@@ -143,6 +147,8 @@ private:
coro_t::pull_type::iterator _end;
};
#endif // HAVE_BOOST_COROUTINE
boost::python::object astar_search_generator(GraphInterface& g,
size_t source,
boost::any dist_map,
......@@ -166,7 +172,7 @@ boost::python::object astar_search_generator(GraphInterface& g,
};
return boost::python::object(AStarGenerator(dispatch));
#else
throw GraphException("This functionality is not available because boost::coroutine was not found at compile-time")
throw GraphException("This functionality is not available because boost::coroutine was not found at compile-time");
#endif
}
......@@ -191,7 +197,7 @@ boost::python::object astar_search_generator_fast(GraphInterface& g,
};
return boost::python::object(AStarGenerator(dispatch));
#else
throw GraphException("This functionality is not available because boost::coroutine was not found at compile-time")
throw GraphException("This functionality is not available because boost::coroutine was not found at compile-time");
#endif
}
......@@ -202,8 +208,10 @@ void export_astar()
def("astar_search", &a_star_search);
def("astar_generator", &astar_search_generator);
def("astar_generator_fast", &astar_search_generator_fast);
#ifdef HAVE_BOOST_COROUTINE
class_<AStarGenerator>("AStarGenerator", no_init)
.def("__iter__", objects::identity_function())
.def("next", &AStarGenerator::next)
.def("__next__", &AStarGenerator::next);
#endif
}
......@@ -20,12 +20,15 @@
#include <boost/python.hpp>
#include <boost/graph/breadth_first_search.hpp>
#include <boost/coroutine/all.hpp>
#include "graph.hh"
#include "graph_selectors.hh"
#include "graph_util.hh"
#ifdef HAVE_BOOST_COROUTINE
#include <boost/coroutine/all.hpp>
#endif // HAVE_BOOST_COROUTINE
using namespace std;
using namespace boost;
using namespace graph_tool;
......@@ -120,6 +123,8 @@ void bfs_search(GraphInterface& g, size_t s, python::object vis)
BFSVisitorWrapper(g, vis)))();
}
#ifdef HAVE_BOOST_COROUTINE
typedef boost::coroutines::asymmetric_coroutine<boost::python::object> coro_t;
class BFSGeneratorVisitor : public bfs_visitor<>
......@@ -162,6 +167,8 @@ private:
coro_t::pull_type::iterator _end;
};
#endif // HAVE_BOOST_COROUTINE
boost::python::object bfs_search_generator(GraphInterface& g, size_t s)
{
#ifdef HAVE_BOOST_COROUTINE
......@@ -173,7 +180,7 @@ boost::python::object bfs_search_generator(GraphInterface& g, size_t s)
};
return boost::python::object(BFSGenerator(dispatch));
#else
throw GraphException("This functionality is not available because boost::coroutine was not found at compile-time")
throw GraphException("This functionality is not available because boost::coroutine was not found at compile-time");
#endif
}
......@@ -182,8 +189,10 @@ void export_bfs()
using namespace boost::python;
def("bfs_search", &bfs_search);
def("bfs_search_generator", &bfs_search_generator);
#ifdef HAVE_BOOST_COROUTINE
class_<BFSGenerator>("BFSGenerator", no_init)
.def("__iter__", objects::identity_function())
.def("next", &BFSGenerator::next)
.def("__next__", &BFSGenerator::next);
#endif
}
......@@ -11,12 +11,15 @@
#include <boost/python.hpp>
#include <boost/graph/depth_first_search.hpp>
#include <boost/graph/undirected_dfs.hpp>
#include <boost/coroutine/all.hpp>
#include "graph.hh"
#include "graph_selectors.hh"
#include "graph_util.hh"
#ifdef HAVE_BOOST_COROUTINE
#include <boost/coroutine/all.hpp>
#endif // HAVE_BOOST_COROUTINE
using namespace std;
using namespace boost;
using namespace graph_tool;
......@@ -109,6 +112,7 @@ void dfs_search(GraphInterface& g, size_t s, python::object vis)
s, DFSVisitorWrapper(g, vis)))();
}
#ifdef HAVE_BOOST_COROUTINE
typedef boost::coroutines::asymmetric_coroutine<boost::python::object> coro_t;
......@@ -152,6 +156,9 @@ private:
coro_t::pull_type::iterator _end;
};
#endif // HAVE_BOOST_COROUTINE
boost::python::object dfs_search_generator(GraphInterface& g, size_t s)
{
#ifdef HAVE_BOOST_COROUTINE
......@@ -164,7 +171,7 @@ boost::python::object dfs_search_generator(GraphInterface& g, size_t s)
};
return boost::python::object(DFSGenerator(dispatch));
#else
throw GraphException("This functionality is not available because boost::coroutine was not found at compile-time")
throw GraphException("This functionality is not available because boost::coroutine was not found at compile-time");
#endif
}
......@@ -173,8 +180,10 @@ void export_dfs()
using namespace boost::python;
def("dfs_search", &dfs_search);
def("dfs_search_generator", &dfs_search_generator);
#ifdef HAVE_BOOST_COROUTINE
class_<DFSGenerator>("DFSGenerator", no_init)
.def("__iter__", objects::identity_function())
.def("next", &DFSGenerator::next)
.def("__next__", &DFSGenerator::next);
#endif
}
......@@ -20,12 +20,15 @@
#include <boost/python.hpp>
#include <boost/graph/dijkstra_shortest_paths_no_color_map.hpp>
#include <boost/coroutine/all.hpp>
#include "graph.hh"
#include "graph_selectors.hh"
#include "graph_util.hh"
#ifdef HAVE_BOOST_COROUTINE
#include <boost/coroutine/all.hpp>
#endif // HAVE_BOOST_COROUTINE
using namespace std;
using namespace boost;
using namespace graph_tool;
......@@ -179,6 +182,7 @@ void dijkstra_search(GraphInterface& g, size_t source, boost::any dist_map,
writable_vertex_properties())(dist_map);
}
#ifdef HAVE_BOOST_COROUTINE
typedef boost::coroutines::asymmetric_coroutine<boost::python::object> coro_t;
......@@ -222,6 +226,8 @@ private:
coro_t::pull_type::iterator _end;
};
#endif // HAVE_BOOST_COROUTINE
boost::python::object dijkstra_search_generator(GraphInterface& g,
size_t source,
boost::any dist_map,
......@@ -244,7 +250,7 @@ boost::python::object dijkstra_search_generator(GraphInterface& g,
};
return boost::python::object(DJKGenerator(dispatch));
#else
throw GraphException("This functionality is not available because boost::coroutine was not found at compile-time")
throw GraphException("This functionality is not available because boost::coroutine was not found at compile-time");
#endif
}
......@@ -267,7 +273,7 @@ boost::python::object dijkstra_search_generator_fast(GraphInterface& g,
};
return boost::python::object(DJKGenerator(dispatch));
#else
throw GraphException("This functionality is not available because boost::coroutine was not found at compile-time")
throw GraphException("This functionality is not available because boost::coroutine was not found at compile-time");
#endif
}
......@@ -277,8 +283,10 @@ void export_dijkstra()
def("dijkstra_search", &dijkstra_search);
def("dijkstra_generator", &dijkstra_search_generator);
def("dijkstra_generator_fast", &dijkstra_search_generator_fast);
#ifdef HAVE_BOOST_COROUTINE
class_<DJKGenerator>("DJKGenerator", no_init)
.def("__iter__", objects::identity_function())
.def("next", &DJKGenerator::next)
.def("__next__", &DJKGenerator::next);
#endif
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment