From: wolf Date: Wed, 16 Feb 2000 17:40:01 +0000 (+0000) Subject: Extend formalism of void functions to Mem_Fun_Data[56]. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d58511d46ba76dc7093716497b54d69d2b7a4c7e;p=dealii-svn.git Extend formalism of void functions to Mem_Fun_Data[56]. git-svn-id: https://svn.dealii.org/trunk@2421 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/thread_manager.h b/deal.II/base/include/base/thread_manager.h index cdc48b3689..00b90840d5 100644 --- a/deal.II/base/include/base/thread_manager.h +++ b/deal.II/base/include/base/thread_manager.h @@ -610,13 +610,15 @@ class ThreadManager : public ACE_Thread_Manager struct Mem_Fun_Data5 { typedef void * (Class::*MemFun) (Arg1, Arg2, Arg3, Arg4, Arg5); - Class *object; - Arg1 arg1; - Arg2 arg2; - Arg3 arg3; - Arg4 arg4; - Arg5 arg5; - MemFun mem_fun; + typedef void (Class::*VoidMemFun) (Arg1, Arg2, Arg3, Arg4, Arg5); + Class *object; + Arg1 arg1; + Arg2 arg2; + Arg3 arg3; + Arg4 arg4; + Arg5 arg5; + MemFun mem_fun; + VoidMemFun void_mem_fun; Mem_Fun_Data5 (Class *object, Arg1 arg1, @@ -631,7 +633,24 @@ class ThreadManager : public ACE_Thread_Manager arg3 (arg3), arg4 (arg4), arg5 (arg5), - mem_fun (mem_fun) {}; + mem_fun (mem_fun), + void_mem_fun (0) {}; + + Mem_Fun_Data5 (Class *object, + Arg1 arg1, + Arg2 arg2, + Arg3 arg3, + Arg4 arg4, + Arg5 arg5, + VoidMemFun void_mem_fun) : + object (object), + arg1 (arg1), + arg2 (arg2), + arg3 (arg3), + arg4 (arg4), + arg5 (arg5), + mem_fun (0), + void_mem_fun (void_mem_fun) {}; }; @@ -653,14 +672,17 @@ class ThreadManager : public ACE_Thread_Manager struct Mem_Fun_Data6 { typedef void * (Class::*MemFun) (Arg1, Arg2, Arg3, Arg4, Arg5, Arg6); - Class *object; - Arg1 arg1; - Arg2 arg2; - Arg3 arg3; - Arg4 arg4; - Arg5 arg5; - Arg6 arg6; - MemFun mem_fun; + typedef void (Class::*VoidMemFun) (Arg1, Arg2, Arg3, Arg4, Arg5, Arg6); + + Class *object; + Arg1 arg1; + Arg2 arg2; + Arg3 arg3; + Arg4 arg4; + Arg5 arg5; + Arg6 arg6; + MemFun mem_fun; + VoidMemFun void_mem_fun; Mem_Fun_Data6 (Class *object, Arg1 arg1, @@ -677,7 +699,26 @@ class ThreadManager : public ACE_Thread_Manager arg4 (arg4), arg5 (arg5), arg6 (arg6), - mem_fun (mem_fun) {}; + mem_fun (mem_fun), + void_mem_fun (0) {}; + + Mem_Fun_Data6 (Class *object, + Arg1 arg1, + Arg2 arg2, + Arg3 arg3, + Arg4 arg4, + Arg5 arg5, + Arg6 arg6, + VoidMemFun void_mem_fun) : + object (object), + arg1 (arg1), + arg2 (arg2), + arg3 (arg3), + arg4 (arg4), + arg5 (arg5), + arg6 (arg6), + mem_fun (0), + void_mem_fun (void_mem_fun) {}; }; /** @@ -3709,11 +3750,21 @@ void * ThreadManager::thread_entry_point5 (void *_arg) // extract function pointer, object // and argument and dispatch the // call - return (arg->object->*(arg->mem_fun))(arg->arg1, - arg->arg2, - arg->arg3, - arg->arg4, - arg->arg5); + if (arg->mem_fun != 0) + return (arg->object->*(arg->mem_fun))(arg->arg1, + arg->arg2, + arg->arg3, + arg->arg4, + arg->arg5); + else + { + (arg->object->*(arg->void_mem_fun))(arg->arg1, + arg->arg2, + arg->arg3, + arg->arg4, + arg->arg5); + return; + }; }; @@ -3733,12 +3784,23 @@ void * ThreadManager::thread_entry_point6 (void *_arg) // extract function pointer, object // and argument and dispatch the // call - return (arg->object->*(arg->mem_fun))(arg->arg1, - arg->arg2, - arg->arg3, - arg->arg4, - arg->arg5, - arg->arg6); + if (arg->mem_fun != 0) + return (arg->object->*(arg->mem_fun))(arg->arg1, + arg->arg2, + arg->arg3, + arg->arg4, + arg->arg5, + arg->arg6); + else + { + (arg->object->*(arg->void_mem_fun))(arg->arg1, + arg->arg2, + arg->arg3, + arg->arg4, + arg->arg5, + arg->arg6); + return 0; + }; };