3 #include <pybind11/pybind11.h>
20 Ex::iterator it = ex->begin();
21 if (ex->is_valid(it)) {
23 algo.set_progress_monitor(pm);
25 ex->update_state(algo.apply_pre_order(repeat));
27 ex->update_state(algo.apply_generic(it, deep, repeat, depth));
41 template <
class Algo,
typename Arg1>
48 template <
class Algo,
typename Arg1,
typename Arg2>
55 template <
class Algo,
typename Arg1,
typename Arg2,
typename Arg3>
71 template<
class Algo,
typename... Args,
typename... PyArgs>
72 void def_algo(pybind11::module& m,
const char* name,
bool deep,
bool repeat,
unsigned int depth, PyArgs... pyargs)
75 &apply_algo<Algo, Args...>,
77 std::forward<PyArgs>(pyargs)...,
78 pybind11::arg(
"deep") = deep,
79 pybind11::arg(
"repeat") = repeat,
80 pybind11::arg(
"depth") = depth,
81 pybind11::doc(
read_manual(
"algorithms", name).c_str()),
82 pybind11::return_value_policy::reference_internal);
92 template <
class Algo,
typename Arg1>
99 template <
class Algo,
typename Arg1,
typename Arg2>
113 template<
class Algo,
typename... Args,
typename... PyArgs>
114 void def_algo_preorder(pybind11::module& m,
const char* name,
bool deep,
bool repeat,
unsigned int depth, PyArgs... pyargs)
117 &apply_algo_preorder<Algo, Args...>,
119 std::forward<PyArgs>(pyargs)...,
120 pybind11::arg(
"deep") = deep,
121 pybind11::arg(
"repeat") = repeat,
122 pybind11::arg(
"depth") = depth,
123 pybind11::doc(
read_manual(
"algorithms", name).c_str()),
124 pybind11::return_value_policy::reference_internal);