From a1765d8a4850eff89523419fc0854ae1c003ce6d Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Fri, 1 Sep 2017 01:16:02 +0200 Subject: [PATCH] Remove unused fun_encapsulator --- include/deal.II/base/thread_management.h | 403 ----------------------- 1 file changed, 403 deletions(-) diff --git a/include/deal.II/base/thread_management.h b/include/deal.II/base/thread_management.h index cc7c192465..db54306777 100644 --- a/include/deal.II/base/thread_management.h +++ b/include/deal.II/base/thread_management.h @@ -1323,409 +1323,6 @@ namespace Threads - namespace internal - { - /** - * @internal - * - * General template declaration of a class that is used to encapsulate - * arguments to global and static member functions, make sure a new thread - * is created and that function being run on that thread. - * - * Although this general template is not implemented at all, the default - * template argument makes sure that whenever using the name of this - * class, the last template argument will be computed correctly from the - * previous arguments, and the correct specialization for this last - * template argument be used, even though we need to specify it. - */ - template - class fun_encapsulator; - - -// ----------- encapsulators for function objects - - /** - * @internal - * - * Encapsulator class for functions with no arguments. - */ - template - class fun_encapsulator - { - public: - fun_encapsulator (typename internal::fun_ptr::type *function) - : function (*function) - {} - - fun_encapsulator (const std::function::type> &function) - : function (function) - {} - - inline - Thread - operator() () - { - return Thread (function); - } - - private: - std::function::type> function; - }; - - /** - * @internal - * - * Encapsulator class for functions with 1 argument. - */ - template - class fun_encapsulator - { - public: - fun_encapsulator (typename internal::fun_ptr::type *function) - : function (*function) - {} - - fun_encapsulator (const std::function::type> &function) - : function (function) - {} - - inline - Thread - operator() (typename std::tuple_element<0,ArgList>::type arg1) - { - return - Thread - (std::bind (function, - internal::maybe_make_ref::type>::act(arg1))); - } - - private: - std::function::type> function; - }; - - /** - * @internal - * - * Encapsulator class for functions with 2 arguments. - */ - template - class fun_encapsulator - { - public: - fun_encapsulator (typename internal::fun_ptr::type *function) - : function (*function) - {} - - fun_encapsulator (const std::function::type> &function) - : function (function) - {} - - inline - Thread - operator() (typename std::tuple_element<0,ArgList>::type arg1, - typename std::tuple_element<1,ArgList>::type arg2) - { - return - Thread - (std::bind (function, - internal::maybe_make_ref::type>::act(arg1), - internal::maybe_make_ref::type>::act(arg2))); - } - - private: - std::function::type> function; - }; - - /** - * @internal - * - * Encapsulator class for functions with 3 arguments. - */ - template - class fun_encapsulator - { - public: - fun_encapsulator (typename internal::fun_ptr::type *function) - : function (*function) - {} - - fun_encapsulator (const std::function::type> &function) - : function (function) - {} - - inline - Thread - operator() (typename std::tuple_element<0,ArgList>::type arg1, - typename std::tuple_element<1,ArgList>::type arg2, - typename std::tuple_element<2,ArgList>::type arg3) - { - return - Thread - (std::bind (function, - internal::maybe_make_ref::type>::act(arg1), - internal::maybe_make_ref::type>::act(arg2), - internal::maybe_make_ref::type>::act(arg3))); - } - - private: - std::function::type> function; - }; - - /** - * @internal - * - * Encapsulator class for functions with 4 arguments. - */ - template - class fun_encapsulator - { - public: - fun_encapsulator (typename internal::fun_ptr::type *function) - : function (*function) - {} - - fun_encapsulator (const std::function::type> &function) - : function (function) - {} - - inline - Thread - operator() (typename std::tuple_element<0,ArgList>::type arg1, - typename std::tuple_element<1,ArgList>::type arg2, - typename std::tuple_element<2,ArgList>::type arg3, - typename std::tuple_element<3,ArgList>::type arg4) - { - return - Thread - (std::bind (function, - internal::maybe_make_ref::type>::act(arg1), - internal::maybe_make_ref::type>::act(arg2), - internal::maybe_make_ref::type>::act(arg3), - internal::maybe_make_ref::type>::act(arg4))); - } - - private: - std::function::type> function; - }; - - /** - * @internal - * - * Encapsulator class for functions with 5 arguments. - */ - template - class fun_encapsulator - { - public: - fun_encapsulator (typename internal::fun_ptr::type *function) - : function (*function) - {} - - fun_encapsulator (const std::function::type> &function) - : function (function) - {} - - inline - Thread - operator() (typename std::tuple_element<0,ArgList>::type arg1, - typename std::tuple_element<1,ArgList>::type arg2, - typename std::tuple_element<2,ArgList>::type arg3, - typename std::tuple_element<3,ArgList>::type arg4, - typename std::tuple_element<4,ArgList>::type arg5) - { - return - Thread - (std::bind (function, - internal::maybe_make_ref::type>::act(arg1), - internal::maybe_make_ref::type>::act(arg2), - internal::maybe_make_ref::type>::act(arg3), - internal::maybe_make_ref::type>::act(arg4), - internal::maybe_make_ref::type>::act(arg5))); - } - - private: - std::function::type> function; - }; - - /** - * @internal - * - * Encapsulator class for functions with 6 arguments. - */ - template - class fun_encapsulator - { - public: - fun_encapsulator (typename internal::fun_ptr::type *function) - : function (*function) - {} - - fun_encapsulator (const std::function::type> &function) - : function (function) - {} - - inline - Thread - operator() (typename std::tuple_element<0,ArgList>::type arg1, - typename std::tuple_element<1,ArgList>::type arg2, - typename std::tuple_element<2,ArgList>::type arg3, - typename std::tuple_element<3,ArgList>::type arg4, - typename std::tuple_element<4,ArgList>::type arg5, - typename std::tuple_element<5,ArgList>::type arg6) - { - return - Thread - (std::bind (function, - internal::maybe_make_ref::type>::act(arg1), - internal::maybe_make_ref::type>::act(arg2), - internal::maybe_make_ref::type>::act(arg3), - internal::maybe_make_ref::type>::act(arg4), - internal::maybe_make_ref::type>::act(arg5), - internal::maybe_make_ref::type>::act(arg6))); - } - - private: - std::function::type> function; - }; - - /** - * @internal - * - * Encapsulator class for functions with 7 arguments. - */ - template - class fun_encapsulator - { - public: - fun_encapsulator (typename internal::fun_ptr::type *function) - : function (*function) - {} - - fun_encapsulator (const std::function::type> &function) - : function (function) - {} - - inline - Thread - operator() (typename std::tuple_element<0,ArgList>::type arg1, - typename std::tuple_element<1,ArgList>::type arg2, - typename std::tuple_element<2,ArgList>::type arg3, - typename std::tuple_element<3,ArgList>::type arg4, - typename std::tuple_element<4,ArgList>::type arg5, - typename std::tuple_element<5,ArgList>::type arg6, - typename std::tuple_element<6,ArgList>::type arg7) - { - return - Thread - (std::bind (function, - internal::maybe_make_ref::type>::act(arg1), - internal::maybe_make_ref::type>::act(arg2), - internal::maybe_make_ref::type>::act(arg3), - internal::maybe_make_ref::type>::act(arg4), - internal::maybe_make_ref::type>::act(arg5), - internal::maybe_make_ref::type>::act(arg6), - internal::maybe_make_ref::type>::act(arg7))); - } - - private: - std::function::type> function; - }; - - /** - * @internal - * - * Encapsulator class for functions with 8 arguments. - */ - template - class fun_encapsulator - { - public: - fun_encapsulator (typename internal::fun_ptr::type *function) - : function (*function) - {} - - fun_encapsulator (const std::function::type> &function) - : function (function) - {} - - inline - Thread - operator() (typename std::tuple_element<0,ArgList>::type arg1, - typename std::tuple_element<1,ArgList>::type arg2, - typename std::tuple_element<2,ArgList>::type arg3, - typename std::tuple_element<3,ArgList>::type arg4, - typename std::tuple_element<4,ArgList>::type arg5, - typename std::tuple_element<5,ArgList>::type arg6, - typename std::tuple_element<6,ArgList>::type arg7, - typename std::tuple_element<7,ArgList>::type arg8) - { - return - Thread - (std::bind (function, - internal::maybe_make_ref::type>::act(arg1), - internal::maybe_make_ref::type>::act(arg2), - internal::maybe_make_ref::type>::act(arg3), - internal::maybe_make_ref::type>::act(arg4), - internal::maybe_make_ref::type>::act(arg5), - internal::maybe_make_ref::type>::act(arg6), - internal::maybe_make_ref::type>::act(arg7), - internal::maybe_make_ref::type>::act(arg8))); - } - - private: - std::function::type> function; - }; - - /** - * @internal - * - * Encapsulator class for functions with 9 arguments. - */ - template - class fun_encapsulator - { - public: - fun_encapsulator (typename internal::fun_ptr::type *function) - : function (*function) - {} - - fun_encapsulator (const std::function::type> &function) - : function (function) - {} - - inline - Thread - operator() (typename std::tuple_element<0,ArgList>::type arg1, - typename std::tuple_element<1,ArgList>::type arg2, - typename std::tuple_element<2,ArgList>::type arg3, - typename std::tuple_element<3,ArgList>::type arg4, - typename std::tuple_element<4,ArgList>::type arg5, - typename std::tuple_element<5,ArgList>::type arg6, - typename std::tuple_element<6,ArgList>::type arg7, - typename std::tuple_element<7,ArgList>::type arg8, - typename std::tuple_element<8,ArgList>::type arg9) - { - return - Thread - (std::bind (function, - internal::maybe_make_ref::type>::act(arg1), - internal::maybe_make_ref::type>::act(arg2), - internal::maybe_make_ref::type>::act(arg3), - internal::maybe_make_ref::type>::act(arg4), - internal::maybe_make_ref::type>::act(arg5), - internal::maybe_make_ref::type>::act(arg6), - internal::maybe_make_ref::type>::act(arg7), - internal::maybe_make_ref::type>::act(arg8), - internal::maybe_make_ref::type>::act(arg9))); - } - - private: - std::function::type> function; - }; - } - - - // ----------- thread starters for functions not taking any parameters /** -- 2.39.5