Commit cd45a52e authored by Tiago Peixoto's avatar Tiago Peixoto

Use boost::coroutines2 if available (boost >= 1.62)

parent 709320ad
......@@ -50,6 +50,7 @@ libgraph_tool_core_la_includedir = $(MOD_DIR)/include
libgraph_tool_core_la_include_HEADERS = \
../../config.h \
base64.hh \
coroutine.hh \
demangle.hh \
fast_vector_property_map.hh \
gml.hh \
......
// graph-tool -- a general graph modification and manipulation thingy
//
// Copyright (C) 2006-2016 Tiago de Paula Peixoto <tiago@skewed.de>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 3
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef COROUTINE_HH
#define COROUTINE_HH
#include "config.h"
#include <boost/version.hpp>
#ifdef HAVE_BOOST_COROUTINE
# if (BOOST_VERSION >= 106200)
# include <atomic>
# include <boost/coroutine2/all.hpp>
namespace graph_tool
{
namespace coroutines = boost::coroutines2;
}
# else
# include <boost/coroutine/all.hpp>
namespace graph_tool
{
namespace coroutines = boost::coroutines;
}
# endif
#endif // HAVE_BOOST_COROUTINE
#endif // COROUTINE_HH
......@@ -46,10 +46,7 @@ namespace std
#include "graph_selectors.hh"
#include "demangle.hh"
#include "numpy_bind.hh"
#ifdef HAVE_BOOST_COROUTINE
#include <boost/coroutine/all.hpp>
#endif // HAVE_BOOST_COROUTINE
#include "coroutine.hh"
// This file includes a simple python interface for the internally kept
// graph. It defines a PythonVertex, PythonEdge and PythonIterator template
......@@ -85,7 +82,8 @@ private:
// generic coroutine generator adaptor
typedef boost::coroutines::asymmetric_coroutine<boost::python::object> coro_t;
typedef graph_tool::coroutines::asymmetric_coroutine<boost::python::object>
coro_t;
class CoroGenerator
{
......
......@@ -26,11 +26,8 @@
#include "exhaustive_loop.hh"
#include "numpy_bind.hh"
#ifdef HAVE_BOOST_COROUTINE
#include "coroutine.hh"
#include "graph_python_interface.hh"
#include <boost/coroutine/all.hpp>
#endif // HAVE_BOOST_COROUTINE
using namespace boost;
using namespace graph_tool;
......
......@@ -28,11 +28,8 @@
#include "exhaustive_loop.hh"
#include "numpy_bind.hh"
#ifdef HAVE_BOOST_COROUTINE
#include "coroutine.hh"
#include "graph_python_interface.hh"
#include <boost/coroutine/all.hpp>
#endif // HAVE_BOOST_COROUTINE
using namespace boost;
using namespace graph_tool;
......
......@@ -28,11 +28,8 @@
#include "exhaustive_loop.hh"
#include "numpy_bind.hh"
#ifdef HAVE_BOOST_COROUTINE
#include "coroutine.hh"
#include "graph_python_interface.hh"
#include <boost/coroutine/all.hpp>
#endif // HAVE_BOOST_COROUTINE
using namespace boost;
using namespace graph_tool;
......
......@@ -26,11 +26,8 @@
#include "exhaustive_loop.hh"
#include "numpy_bind.hh"
#ifdef HAVE_BOOST_COROUTINE
#include "coroutine.hh"
#include "graph_python_interface.hh"
#include <boost/coroutine/all.hpp>
#endif // HAVE_BOOST_COROUTINE
using namespace boost;
using namespace graph_tool;
......
......@@ -27,9 +27,8 @@
#include "graph_astar.hh"
#ifdef HAVE_BOOST_COROUTINE
#include <boost/coroutine/all.hpp>
#endif // HAVE_BOOST_COROUTINE
#include "coroutine.hh"
#include "graph_python_interface.hh"
using namespace std;
using namespace boost;
......
......@@ -25,9 +25,8 @@
#include "graph_selectors.hh"
#include "graph_util.hh"
#ifdef HAVE_BOOST_COROUTINE
#include <boost/coroutine/all.hpp>
#endif // HAVE_BOOST_COROUTINE
#include "coroutine.hh"
#include "graph_python_interface.hh"
using namespace std;
using namespace boost;
......
......@@ -16,9 +16,8 @@
#include "graph_selectors.hh"
#include "graph_util.hh"
#ifdef HAVE_BOOST_COROUTINE
#include <boost/coroutine/all.hpp>
#endif // HAVE_BOOST_COROUTINE
#include "coroutine.hh"
#include "graph_python_interface.hh"
using namespace std;
using namespace boost;
......
......@@ -25,9 +25,8 @@
#include "graph_selectors.hh"
#include "graph_util.hh"
#ifdef HAVE_BOOST_COROUTINE
#include <boost/coroutine/all.hpp>
#endif // HAVE_BOOST_COROUTINE
#include "coroutine.hh"
#include "graph_python_interface.hh"
using namespace std;
using namespace boost;
......
......@@ -19,13 +19,9 @@
#include "graph_tool.hh"
#include "numpy_bind.hh"
#include "coroutine.hh"
#include "graph_python_interface.hh"
#ifdef HAVE_BOOST_COROUTINE
#include <boost/coroutine/all.hpp>
#endif // HAVE_BOOST_COROUTINE
using namespace std;
using namespace graph_tool;
......
......@@ -22,6 +22,8 @@
#include "graph_python_interface.hh"
#include "numpy_bind.hh"
#include "hash_map_wrap.hh"
#include "coroutine.hh"
#include "graph_python_interface.hh"
#include <boost/graph/breadth_first_search.hpp>
#include <boost/graph/dijkstra_shortest_paths_no_color_map.hpp>
......@@ -29,10 +31,6 @@
#include <boost/python/stl_iterator.hpp>
#include <boost/python.hpp>
#ifdef HAVE_BOOST_COROUTINE
#include <boost/coroutine/all.hpp>
#endif // HAVE_BOOST_COROUTINE
using namespace std;
using namespace boost;
using namespace graph_tool;
......
......@@ -17,16 +17,12 @@
#include "graph.hh"
#include "graph_filtering.hh"
#include "random.hh"
#include "coroutine.hh"
#include <boost/graph/vf2_sub_graph_iso.hpp>
#include <graph_python_interface.hh>
#ifdef HAVE_BOOST_COROUTINE
#include <boost/coroutine/all.hpp>
#endif // HAVE_BOOST_COROUTINE
using namespace graph_tool;
using namespace boost;
using namespace std;
......@@ -79,7 +75,7 @@ struct ListMatch
#ifdef HAVE_BOOST_COROUTINE
typedef boost::coroutines::asymmetric_coroutine<boost::python::object> coro_t;
typedef graph_tool::coroutines::asymmetric_coroutine<boost::python::object> coro_t;
struct GenMatch
{
......
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