// // gapbind14 // Copyright (C) 2020-2022 James D. Mitchell // // 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 <https://www.gnu.org/licenses/>. //
template <typename Wild> auto wild_mem_fn(size_t i) { return all_wild_mem_fns<Wild>().at(i);
}
//////////////////////////////////////////////////////////////////////// // Tame member functions returning void ////////////////////////////////////////////////////////////////////////
template <size_t N, typename Wild, typename TSFINAE = Obj> auto tame_mem_fn(Obj self, Obj arg0)
-> std::enable_if_t<returns_void<Wild>::value
&& arg_count<Wild>::value == 0,
TSFINAE> { // arg0 is checked in obj_cpp_ptr using class_type = typename CppFunction<Wild>::class_type;
class_type *ptr = detail::obj_cpp_ptr<class_type>(arg0);
using class_type = typename CppFunction<Wild>::class_type;
class_type *ptr = detail::obj_cpp_ptr<class_type>(arg0);
using to_cpp_1_type = typename CppFunction<Wild>::params_type::template get<0>; using to_cpp_2_type = typename CppFunction<Wild>::params_type::template get<1>; using to_cpp_3_type = typename CppFunction<Wild>::params_type::template get<2>; using to_cpp_4_type = typename CppFunction<Wild>::params_type::template get<3>; using to_cpp_5_type = typename CppFunction<Wild>::params_type::template get<4>; using to_cpp_6_type = typename CppFunction<Wild>::params_type::template get<5>; using to_cpp_7_type = typename CppFunction<Wild>::params_type::template get<6>;
GAPBIND14_TRY(CppFunction<Wild>()(wild_mem_fn<Wild>(N),
ptr,
to_cpp<to_cpp_1_type>()(arg1),
to_cpp<to_cpp_2_type>()(arg2),
to_cpp<to_cpp_3_type>()(arg3),
to_cpp<to_cpp_4_type>()(arg4),
to_cpp<to_cpp_5_type>()(arg5),
to_cpp<to_cpp_6_type>()(arg6),
to_cpp<to_cpp_7_type>()(arg7))); return 0L;
}
//////////////////////////////////////////////////////////////////////// // Tame member functions NOT returning void ////////////////////////////////////////////////////////////////////////
template <size_t N, typename Wild, typename TSFINAE = Obj> auto tame_mem_fn(Obj self, Obj arg0)
-> std::enable_if_t<!returns_void<Wild>::value
&& arg_count<Wild>::value == 0,
TSFINAE> { // arg0 is checked in obj_cpp_ptr
using class_type = typename CppFunction<Wild>::class_type;
class_type *ptr = detail::obj_cpp_ptr<class_type>(arg0);
using to_gap_type = to_gap<typename CppFunction<Wild>::return_type>;
GAPBIND14_TRY( return to_gap_type()(CppFunction<Wild>()(wild_mem_fn<Wild>(N), ptr)));
}
template <size_t N, typename Wild, typename TSFINAE = Obj> auto tame_mem_fn(Obj self, Obj arg0, Obj arg1)
-> std::enable_if_t<!returns_void<Wild>::value
&& arg_count<Wild>::value == 1,
TSFINAE> { // arg0 is checked in obj_cpp_ptr
using class_type = typename CppFunction<Wild>::class_type;
class_type *ptr = detail::obj_cpp_ptr<class_type>(arg0);
using to_cpp_1_type = typename CppFunction<Wild>::params_type::template get<0>; using to_gap_type = to_gap<typename CppFunction<Wild>::return_type>;
GAPBIND14_TRY(return to_gap_type()(CppFunction<Wild>()(
wild_mem_fn<Wild>(N), ptr, to_cpp<to_cpp_1_type>()(arg1))));
}
template <size_t N, typename Wild, typename TSFINAE = Obj> auto tame_mem_fn(Obj self, Obj arg0, Obj arg1, Obj arg2)
-> std::enable_if_t<!returns_void<Wild>::value
&& arg_count<Wild>::value == 2,
TSFINAE> { // arg0 is checked in obj_cpp_ptr
using class_type = typename CppFunction<Wild>::class_type;
class_type *ptr = detail::obj_cpp_ptr<class_type>(arg0);
using to_cpp_1_type = typename CppFunction<Wild>::params_type::template get<0>; using to_cpp_2_type = typename CppFunction<Wild>::params_type::template get<1>; using to_gap_type = to_gap<typename CppFunction<Wild>::return_type>;
GAPBIND14_TRY(return to_gap_type()(
CppFunction<Wild>()(wild_mem_fn<Wild>(N),
ptr,
to_cpp<to_cpp_1_type>()(arg1),
to_cpp<to_cpp_2_type>()(arg2))));
}
template <size_t N, typename Wild, typename TSFINAE = Obj> auto tame_mem_fn(Obj self, Obj arg0, Obj arg1, Obj arg2, Obj arg3)
-> std::enable_if_t<!returns_void<Wild>::value
&& arg_count<Wild>::value == 3,
TSFINAE> { // arg0 is checked in obj_cpp_ptr
using class_type = typename CppFunction<Wild>::class_type;
class_type *ptr = detail::obj_cpp_ptr<class_type>(arg0);
using to_cpp_1_type = typename CppFunction<Wild>::params_type::template get<0>; using to_cpp_2_type = typename CppFunction<Wild>::params_type::template get<1>; using to_cpp_3_type = typename CppFunction<Wild>::params_type::template get<2>; using to_gap_type = to_gap<typename CppFunction<Wild>::return_type>;
GAPBIND14_TRY(return to_gap_type()(
CppFunction<Wild>()(wild_mem_fn<Wild>(N),
ptr,
to_cpp<to_cpp_1_type>()(arg1),
to_cpp<to_cpp_2_type>()(arg2),
to_cpp<to_cpp_3_type>()(arg3))));
}
template <size_t N, typename Wild, typename TSFINAE = Obj> auto tame_mem_fn(Obj self, Obj arg0, Obj arg1, Obj arg2, Obj arg3, Obj arg4)
-> std::enable_if_t<!returns_void<Wild>::value
&& arg_count<Wild>::value == 4,
TSFINAE> { // arg0 is checked in obj_cpp_ptr
using class_type = typename CppFunction<Wild>::class_type;
class_type *ptr = detail::obj_cpp_ptr<class_type>(arg0);
using to_cpp_1_type = typename CppFunction<Wild>::params_type::template get<0>; using to_cpp_2_type = typename CppFunction<Wild>::params_type::template get<1>; using to_cpp_3_type = typename CppFunction<Wild>::params_type::template get<2>; using to_cpp_4_type = typename CppFunction<Wild>::params_type::template get<3>; using to_gap_type = to_gap<typename CppFunction<Wild>::return_type>;
GAPBIND14_TRY(return to_gap_type()(
CppFunction<Wild>()(wild_mem_fn<Wild>(N),
ptr,
to_cpp<to_cpp_1_type>()(arg1),
to_cpp<to_cpp_2_type>()(arg2),
to_cpp<to_cpp_3_type>()(arg3),
to_cpp<to_cpp_4_type>()(arg4))));
}
template <size_t N, typename Wild, typename TSFINAE = Obj> auto tame_mem_fn(Obj self,
Obj arg0,
Obj arg1,
Obj arg2,
Obj arg3,
Obj arg4,
Obj arg5)
-> std::enable_if_t<!returns_void<Wild>::value
&& arg_count<Wild>::value == 5,
TSFINAE> { // arg0 is checked in obj_cpp_ptr
using class_type = typename CppFunction<Wild>::class_type;
class_type *ptr = detail::obj_cpp_ptr<class_type>(arg0);
using to_cpp_1_type = typename CppFunction<Wild>::params_type::template get<0>; using to_cpp_2_type = typename CppFunction<Wild>::params_type::template get<1>; using to_cpp_3_type = typename CppFunction<Wild>::params_type::template get<2>; using to_cpp_4_type = typename CppFunction<Wild>::params_type::template get<3>; using to_cpp_5_type = typename CppFunction<Wild>::params_type::template get<4>; using to_gap_type = to_gap<typename CppFunction<Wild>::return_type>;
GAPBIND14_TRY(return to_gap_type()(
CppFunction<Wild>()(wild_mem_fn<Wild>(N),
ptr,
to_cpp<to_cpp_1_type>()(arg1),
to_cpp<to_cpp_2_type>()(arg2),
to_cpp<to_cpp_3_type>()(arg3),
to_cpp<to_cpp_4_type>()(arg4),
to_cpp<to_cpp_5_type>()(arg5))));
}
template <size_t N, typename Wild, typename TSFINAE = Obj> auto tame_mem_fn(Obj self,
Obj arg0,
Obj arg1,
Obj arg2,
Obj arg3,
Obj arg4,
Obj arg5,
Obj arg6)
-> std::enable_if_t<!returns_void<Wild>::value
&& arg_count<Wild>::value == 6,
TSFINAE> { // arg0 is checked in obj_cpp_ptr
using class_type = typename CppFunction<Wild>::class_type;
class_type *ptr = detail::obj_cpp_ptr<class_type>(arg0);
using to_cpp_1_type = typename CppFunction<Wild>::params_type::template get<0>; using to_cpp_2_type = typename CppFunction<Wild>::params_type::template get<1>; using to_cpp_3_type = typename CppFunction<Wild>::params_type::template get<2>; using to_cpp_4_type = typename CppFunction<Wild>::params_type::template get<3>; using to_cpp_5_type = typename CppFunction<Wild>::params_type::template get<4>; using to_cpp_6_type = typename CppFunction<Wild>::params_type::template get<5>; using to_gap_type = to_gap<typename CppFunction<Wild>::return_type>;
GAPBIND14_TRY(return to_gap_type()(
CppFunction<Wild>()(wild_mem_fn<Wild>(N),
ptr,
to_cpp<to_cpp_1_type>()(arg1),
to_cpp<to_cpp_2_type>()(arg2),
to_cpp<to_cpp_3_type>()(arg3),
to_cpp<to_cpp_4_type>()(arg4),
to_cpp<to_cpp_5_type>()(arg5),
to_cpp<to_cpp_6_type>()(arg6))));
}
using class_type = typename CppFunction<Wild>::class_type;
class_type *ptr = detail::obj_cpp_ptr<class_type>(arg0);
using to_cpp_1_type = typename CppFunction<Wild>::params_type::template get<0>; using to_cpp_2_type = typename CppFunction<Wild>::params_type::template get<1>; using to_cpp_3_type = typename CppFunction<Wild>::params_type::template get<2>; using to_cpp_4_type = typename CppFunction<Wild>::params_type::template get<3>; using to_cpp_5_type = typename CppFunction<Wild>::params_type::template get<4>; using to_cpp_6_type = typename CppFunction<Wild>::params_type::template get<5>; using to_cpp_7_type = typename CppFunction<Wild>::params_type::template get<6>; using to_gap_type = to_gap<typename CppFunction<Wild>::return_type>;
GAPBIND14_TRY(return to_gap_type()(
CppFunction<Wild>()(wild_mem_fn<Wild>(N),
ptr,
to_cpp<to_cpp_1_type>()(arg1),
to_cpp<to_cpp_2_type>()(arg2),
to_cpp<to_cpp_3_type>()(arg3),
to_cpp<to_cpp_4_type>()(arg4),
to_cpp<to_cpp_5_type>()(arg5),
to_cpp<to_cpp_6_type>()(arg6),
to_cpp<to_cpp_7_type>()(arg7))));
}
//////////////////////////////////////////////////////////////////////// // Create a vector of tame member functions ////////////////////////////////////////////////////////////////////////
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.