Skip to content
Snippets Groups Projects
Commit ccb31802 authored by Tobias Leibner's avatar Tobias Leibner
Browse files

[python.functions] replace more usages of try_register

parent 5d00a009
No related branches found
No related tags found
No related merge requests found
...@@ -42,8 +42,8 @@ void addbind_for_Grid(pybind11::module& m) ...@@ -42,8 +42,8 @@ void addbind_for_Grid(pybind11::module& m)
template <class Tuple = Dune::XT::Grid::AvailableGridTypes> template <class Tuple = Dune::XT::Grid::AvailableGridTypes>
void all_grids(pybind11::module& m) void all_grids(pybind11::module& m)
{ {
Dune::XT::Common::bindings::try_register(m, [](auto& m_) { // different grids but same entity Dune::XT::Common::bindings::guarded_bind([&]() { // different grids but same entity
addbind_for_Grid<typename Tuple::head_type>(m_); addbind_for_Grid<typename Tuple::head_type>(m);
}); });
all_grids<typename Tuple::tail_type>(m); all_grids<typename Tuple::tail_type>(m);
} // ... addbind_for_Grid(...) } // ... addbind_for_Grid(...)
......
...@@ -42,8 +42,8 @@ void addbind_for_Grid(pybind11::module& m) ...@@ -42,8 +42,8 @@ void addbind_for_Grid(pybind11::module& m)
template <class Tuple = Dune::XT::Grid::AvailableGridTypes> template <class Tuple = Dune::XT::Grid::AvailableGridTypes>
void all_grids(pybind11::module& m) void all_grids(pybind11::module& m)
{ {
Dune::XT::Common::bindings::try_register(m, [](auto& m_) { // different grids but same entity Dune::XT::Common::bindings::guarded_bind([&]() { // different grids but same entity
addbind_for_Grid<typename Tuple::head_type>(m_); addbind_for_Grid<typename Tuple::head_type>(m);
}); });
all_grids<typename Tuple::tail_type>(m); all_grids<typename Tuple::tail_type>(m);
} // ... addbind_for_Grid(...) } // ... addbind_for_Grid(...)
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
template <class Tuple = Dune::XT::Grid::Available1dGridTypes> template <class Tuple = Dune::XT::Grid::Available1dGridTypes>
void bind_all_1d_grids(pybind11::module& m) void bind_all_1d_grids(pybind11::module& m)
{ {
Dune::XT::Common::bindings::try_register(m, [](auto& m_) { // different grids but same entity Dune::XT::Common::bindings::guarded_bind([&]() { // different grids but same entity
Dune::XT::Functions::bindings::addbind_GridFunctionInterface_all_dims<typename Tuple::head_type>(m_); Dune::XT::Functions::bindings::addbind_GridFunctionInterface_all_dims<typename Tuple::head_type>(m);
}); });
bind_all_1d_grids<typename Tuple::tail_type>(m); bind_all_1d_grids<typename Tuple::tail_type>(m);
} }
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
template <class Tuple = Dune::XT::Grid::Available2dGridTypes> template <class Tuple = Dune::XT::Grid::Available2dGridTypes>
void bind_all_2d_grids(pybind11::module& m) void bind_all_2d_grids(pybind11::module& m)
{ {
Dune::XT::Common::bindings::try_register(m, [](auto& m_) { // different grids but same entity Dune::XT::Common::bindings::guarded_bind([&]() { // different grids but same entity
Dune::XT::Functions::bindings::addbind_GridFunctionInterface_all_dims<typename Tuple::head_type>(m_); Dune::XT::Functions::bindings::addbind_GridFunctionInterface_all_dims<typename Tuple::head_type>(m);
}); });
bind_all_2d_grids<typename Tuple::tail_type>(m); bind_all_2d_grids<typename Tuple::tail_type>(m);
} }
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
template <class Tuple = Dune::XT::Grid::Available3dGridTypes> template <class Tuple = Dune::XT::Grid::Available3dGridTypes>
void bind_all_3d_grids(pybind11::module& m) void bind_all_3d_grids(pybind11::module& m)
{ {
Dune::XT::Common::bindings::try_register(m, [](auto& m_) { // different grids but same entity Dune::XT::Common::bindings::guarded_bind([&]() { // different grids but same entity
Dune::XT::Functions::bindings::addbind_GridFunctionInterface_all_dims<typename Tuple::head_type>(m_); Dune::XT::Functions::bindings::addbind_GridFunctionInterface_all_dims<typename Tuple::head_type>(m);
}); });
bind_all_3d_grids<typename Tuple::tail_type>(m); bind_all_3d_grids<typename Tuple::tail_type>(m);
} }
......
...@@ -42,8 +42,8 @@ void addbind_for_Grid(pybind11::module& m) ...@@ -42,8 +42,8 @@ void addbind_for_Grid(pybind11::module& m)
template <class Tuple = Dune::XT::Grid::AvailableGridTypes> template <class Tuple = Dune::XT::Grid::AvailableGridTypes>
void all_grids(pybind11::module& m) void all_grids(pybind11::module& m)
{ {
Dune::XT::Common::bindings::try_register(m, [](auto& m_) { // different grids but same entity Dune::XT::Common::bindings::guarded_bind([&]() { // different grids but same entity
addbind_for_Grid<typename Tuple::head_type>(m_); addbind_for_Grid<typename Tuple::head_type>(m);
}); });
all_grids<typename Tuple::tail_type>(m); all_grids<typename Tuple::tail_type>(m);
} // ... addbind_for_Grid(...) } // ... addbind_for_Grid(...)
......
...@@ -39,8 +39,8 @@ void addbind_for_Grid(pybind11::module& m) ...@@ -39,8 +39,8 @@ void addbind_for_Grid(pybind11::module& m)
template <class Tuple = Dune::XT::Grid::AvailableGridTypes> template <class Tuple = Dune::XT::Grid::AvailableGridTypes>
void all_grids(pybind11::module& m) void all_grids(pybind11::module& m)
{ {
Dune::XT::Common::bindings::try_register(m, [](auto& m_) { // different grids but same entity Dune::XT::Common::bindings::guarded_bind([&]() { // different grids but same entity
addbind_for_Grid<typename Tuple::head_type>(m_); addbind_for_Grid<typename Tuple::head_type>(m);
}); });
all_grids<typename Tuple::tail_type>(m); all_grids<typename Tuple::tail_type>(m);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment