From 708ed94ab7144b47eaaf934873f0cbed691faf90 Mon Sep 17 00:00:00 2001 From: wolf Date: Wed, 11 Oct 2000 09:54:17 +0000 Subject: [PATCH] Add collect_args functions that do not take pointers but references to objects. They are only for convenience, as one always forgets that we need `this', but `&object'. git-svn-id: https://svn.dealii.org/trunk@3402 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/thread_management.h | 210 +++++++++++++++++- 1 file changed, 204 insertions(+), 6 deletions(-) diff --git a/deal.II/base/include/base/thread_management.h b/deal.II/base/include/base/thread_management.h index 7a0d984ab2..d5ef6ab2aa 100644 --- a/deal.II/base/include/base/thread_management.h +++ b/deal.II/base/include/base/thread_management.h @@ -1130,6 +1130,20 @@ namespace Threads * from that. */ FunEncapsulation collect_args (Class *object); + + /** + * Same as above, but take + * a reference instead of a + * pointer. This allows us + * to be a little + * convenient, as we can + * use @p{object} or + * @p{this}, without taking + * care that one is a + * reference and the other + * a pointer. + */ + FunEncapsulation collect_args (Class &object); private: /** @@ -1239,8 +1253,23 @@ namespace Threads * from that. */ FunEncapsulation collect_args (Class *object, - Arg1 arg1); - + Arg1 arg1); + + /** + * Same as above, but take + * a reference instead of a + * pointer. This allows us + * to be a little + * convenient, as we can + * use @p{object} or + * @p{this}, without taking + * care that one is a + * reference and the other + * a pointer. + */ + FunEncapsulation collect_args (Class &object, + Arg1 arg1); + private: /** * Space to temporarily store @@ -1353,6 +1382,22 @@ namespace Threads FunEncapsulation collect_args (Class *object, Arg1 arg1, Arg2 arg2); + + /** + * Same as above, but take + * a reference instead of a + * pointer. This allows us + * to be a little + * convenient, as we can + * use @p{object} or + * @p{this}, without taking + * care that one is a + * reference and the other + * a pointer. + */ + FunEncapsulation collect_args (Class &object, + Arg1 arg1, + Arg2 arg2); private: /** @@ -1469,6 +1514,23 @@ namespace Threads Arg2 arg2, Arg3 arg3); + /** + * Same as above, but take + * a reference instead of a + * pointer. This allows us + * to be a little + * convenient, as we can + * use @p{object} or + * @p{this}, without taking + * care that one is a + * reference and the other + * a pointer. + */ + FunEncapsulation collect_args (Class &object, + Arg1 arg1, + Arg2 arg2, + Arg3 arg3); + private: /** * Space to temporarily store @@ -1588,6 +1650,23 @@ namespace Threads Arg3 arg3, Arg4 arg4); + /** + * Same as above, but take + * a reference instead of a + * pointer. This allows us + * to be a little + * convenient, as we can + * use @p{object} or + * @p{this}, without taking + * care that one is a + * reference and the other + * a pointer. + */ + FunEncapsulation collect_args (Class &object, + Arg1 arg1, + Arg2 arg2, + Arg3 arg3, + Arg4 arg4); private: /** * Space to temporarily store @@ -1710,6 +1789,24 @@ namespace Threads Arg4 arg4, Arg5 arg5); + /** + * Same as above, but take + * a reference instead of a + * pointer. This allows us + * to be a little + * convenient, as we can + * use @p{object} or + * @p{this}, without taking + * care that one is a + * reference and the other + * a pointer. + */ + FunEncapsulation collect_args (Class &object, + Arg1 arg1, + Arg2 arg2, + Arg3 arg3, + Arg4 arg4, + Arg5 arg5); private: /** * Space to temporarily store @@ -1835,6 +1932,25 @@ namespace Threads Arg5 arg5, Arg6 arg6); + /** + * Same as above, but take + * a reference instead of a + * pointer. This allows us + * to be a little + * convenient, as we can + * use @p{object} or + * @p{this}, without taking + * care that one is a + * reference and the other + * a pointer. + */ + FunEncapsulation collect_args (Class &object, + Arg1 arg1, + Arg2 arg2, + Arg3 arg3, + Arg4 arg4, + Arg5 arg5, + Arg6 arg6); private: /** * Space to temporarily store @@ -2904,6 +3020,16 @@ namespace Threads + template + inline + FunEncapsulation + MemFunData0::ArgCollector::collect_args (Class &object) + { + return collect_args (&object); + }; + + + /* ---------------------- MemFunData1 implementation ------------------------ */ template @@ -2986,7 +3112,16 @@ namespace Threads + template + inline + FunEncapsulation + MemFunData1::ArgCollector::collect_args (Class &object, + Arg1 arg1) + { + return collect_args (&object, arg1); + }; + /* ---------------------- MemFunData2 implementation ------------------------ */ template @@ -3074,6 +3209,17 @@ namespace Threads }; + template + inline + FunEncapsulation + MemFunData2::ArgCollector::collect_args (Class &object, + Arg1 arg1, + Arg2 arg2) + { + return collect_args (&object, arg1, arg2); + }; + + /* ---------------------- MemFunData3 implementation ------------------------ */ @@ -3169,6 +3315,18 @@ namespace Threads }; + + template + inline + FunEncapsulation + MemFunData3::ArgCollector::collect_args (Class &object, + Arg1 arg1, + Arg2 arg2, + Arg3 arg3) + { + return collect_args (&object, arg1, arg2, arg3); + }; + /* ---------------------- MemFunData4 implementation ------------------------ */ @@ -3270,6 +3428,18 @@ namespace Threads + template + inline + FunEncapsulation + MemFunData4::ArgCollector::collect_args (Class &object, + Arg1 arg1, + Arg2 arg2, + Arg3 arg3, + Arg4 arg4) + { + return collect_args (&object, arg1, arg2, arg3, arg4); + }; + /* ---------------------- MemFunData5 implementation ------------------------ */ @@ -3373,6 +3543,20 @@ namespace Threads arg1, arg2, arg3, arg4, arg5); }; + + + template + inline + FunEncapsulation + MemFunData5::ArgCollector::collect_args (Class &object, + Arg1 arg1, + Arg2 arg2, + Arg3 arg3, + Arg4 arg4, + Arg5 arg5) + { + return collect_args (&object, arg1, arg2, arg3, arg4, arg5); + }; @@ -3478,14 +3662,28 @@ namespace Threads Arg4 arg4, Arg5 arg5, Arg6 arg6) - { - return new MemFunData6(fun_ptr, object, - arg1, arg2, arg3, arg4, arg5, arg6); + { + return new MemFunData6(fun_ptr, object, + arg1, arg2, arg3, arg4, arg5, arg6); }; - + template + inline + FunEncapsulation + MemFunData6::ArgCollector::collect_args (Class &object, + Arg1 arg1, + Arg2 arg2, + Arg3 arg3, + Arg4 arg4, + Arg5 arg5, + Arg6 arg6) + { + return collect_args (&object, arg1, arg2, arg3, arg4, arg5, arg6); + }; + + /* ---------------------------------------------------------------- */ inline -- 2.39.5