javacommons/utils/functionserver/inc/fs_methodcall.h
branchRCL_3
changeset 14 04becd199f91
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef FS_METHODCALL_H
       
    20 #define FS_METHODCALL_H
       
    21 
       
    22 #include "fs_methodwrappers.h"
       
    23 
       
    24 namespace java
       
    25 {
       
    26 namespace util
       
    27 {
       
    28 class FunctionServer;
       
    29 }
       
    30 }
       
    31 
       
    32 
       
    33 // Disable bothersome warning
       
    34 //#pragma warning(disable: 4786) // 'identifier' : identifier was truncated to 'number' characters in the debug information
       
    35 
       
    36 
       
    37 /*
       
    38  * Note: Call() used for calling const methods cause errors in Lint and are
       
    39  * thus wrapped in a #ifndef / #endif clause to prevent Lint from seeing them.
       
    40  */
       
    41 
       
    42 
       
    43 /**
       
    44  * A functor executing object
       
    45  *
       
    46  * An executor is a function that takes a functor as argument and executes it
       
    47  * in the UI thread.
       
    48  */
       
    49 typedef void (*Executor)(const Functor& functor, java::util::FunctionServer* functionServer, int* leaveResult);
       
    50 
       
    51 class MethodCaller
       
    52 {
       
    53 public:
       
    54     OS_IMPORT static void ExecuteRegularFunctor(const Functor& functor, java::util::FunctionServer* functionServer, int* res);
       
    55     OS_IMPORT static void ExecuteLeavingFunctorL(const Functor& functor, java::util::FunctionServer* functionServer, int* res);
       
    56     OS_IMPORT static void ExecuteTrapingFunctorL(const Functor& functor, java::util::FunctionServer* functionServer, int* res);
       
    57 };
       
    58 
       
    59 
       
    60 /**
       
    61  * Utility class that constructs a method call wrapping object and
       
    62  *        passes it on to an executor.
       
    63  *
       
    64  * <b>Known limitations</b>:
       
    65  * - methods that return references are not handled.
       
    66  */
       
    67 template<Executor Execute>
       
    68 class MethodCall
       
    69 {
       
    70 public:
       
    71     /**
       
    72      * Calls a method with no argument and a return value
       
    73      */
       
    74     template<class S, class R, class C>
       
    75     static inline void Call(S& result, C* object, R(C::*method)(), java::util::FunctionServer* functionServer)
       
    76     {
       
    77         JELOG2(EUtils);
       
    78         Execute(MethodWrapperR0<S,R,C>(result, *object, method), functionServer, 0);
       
    79     }
       
    80 
       
    81 
       
    82 #ifndef _lint
       
    83     /**
       
    84      * Calls a const method with no argument and a return value
       
    85      */
       
    86     template<class S, class R, class C>
       
    87     static inline void Call(S& result, const C* object, R(C::*method)() const, java::util::FunctionServer* functionServer)
       
    88     {
       
    89         JELOG2(EUtils);
       
    90         Call(result, const_cast<C*>(object), reinterpret_cast<R(C::*)()>(method), functionServer);
       
    91     }
       
    92 #endif // _lint
       
    93 
       
    94 
       
    95     /**
       
    96      * Calls a method with no argument and no return value
       
    97      */
       
    98     template<class C>
       
    99     static inline void Call(C* object, void (C::*method)(), java::util::FunctionServer* functionServer)
       
   100     {
       
   101         JELOG2(EUtils);
       
   102         Execute(MethodWrapper0<C>(*object, method), functionServer, 0);
       
   103     }
       
   104 
       
   105 #ifndef _lint
       
   106     /**
       
   107      * Calls a const method with no argument and no return value
       
   108      */
       
   109     template<class C>
       
   110     static inline void Call(const C* object, void (C::*method)() const, java::util::FunctionServer* functionServer)
       
   111     {
       
   112         JELOG2(EUtils);
       
   113         Call(const_cast<C*>(object), reinterpret_cast<void (C::*)()>(method), functionServer);
       
   114     }
       
   115 #endif // _lint
       
   116 
       
   117 
       
   118     /**
       
   119      * Calls a method with 1 argument and a return value
       
   120      */
       
   121     template<class S, class R, class C, class A1, class B1>
       
   122     static inline void Call(S& result, C* object, R(C::*method)(A1), B1& arg1, java::util::FunctionServer* functionServer)
       
   123     {
       
   124         JELOG2(EUtils);
       
   125         Execute(MethodWrapperR1<S,R,C,A1>(result, *object, method, arg1), functionServer, 0);
       
   126     }
       
   127 
       
   128 
       
   129 #ifndef _lint
       
   130     /**
       
   131      * Calls a const method with 1 argument and a return value
       
   132      */
       
   133     template<class S, class R, class C, class A1, class B1>
       
   134     static inline void Call(S& result, const C* object, R(C::*method)(A1) const, B1& arg1, java::util::FunctionServer* functionServer)
       
   135     {
       
   136         JELOG2(EUtils);
       
   137         Call(result, const_cast<C*>(object), reinterpret_cast<R(C::*)(A1)>(method), arg1, functionServer);
       
   138     }
       
   139 #endif // _lint
       
   140 
       
   141 
       
   142     /**
       
   143      * Calls a method with 1 argument and no return value
       
   144      */
       
   145     template<class C, class A1, class B1>
       
   146     static inline void Call(C* object, void (C::*method)(A1), B1& arg1, java::util::FunctionServer* functionServer)
       
   147     {
       
   148         JELOG2(EUtils);
       
   149         Execute(MethodWrapper1<C,A1>(*object, method, arg1), functionServer, 0);
       
   150     }
       
   151 
       
   152 
       
   153 #ifndef _lint
       
   154     /**
       
   155      * Calls a const method with 1 argument and no return value
       
   156      */
       
   157     template<class C, class A1, class B1>
       
   158     static inline void Call(const C* object, void (C::*method)(A1) const, B1& arg1, java::util::FunctionServer* functionServer)
       
   159     {
       
   160         JELOG2(EUtils);
       
   161         Call(const_cast<C*>(object), reinterpret_cast<void (C::*)(A1)>(method), arg1, functionServer);
       
   162     }
       
   163 #endif // _lint
       
   164 
       
   165 
       
   166     /**
       
   167      * Calls a method with 2 arguments and no return value
       
   168      */
       
   169     template<class C, class A1, class A2, class B1, class B2>
       
   170     static inline void Call(C* object, void (C::*method)(A1,A2), B1& arg1, B2& arg2, java::util::FunctionServer* functionServer)
       
   171     {
       
   172         JELOG2(EUtils);
       
   173         Execute(MethodWrapper2<C,A1,A2>(*object, method, arg1, arg2), functionServer, 0);
       
   174     }
       
   175 
       
   176 
       
   177 #ifndef _lint
       
   178     /**
       
   179      * Calls a const method with 2 arguments and no return value
       
   180      */
       
   181     template<class C, class A1, class A2, class B1, class B2>
       
   182     static inline void Call(const C* object, void (C::*method)(A1,A2) const, B1& arg1, B2& arg2, java::util::FunctionServer* functionServer)
       
   183     {
       
   184         JELOG2(EUtils);
       
   185         Call(const_cast<C*>(object), reinterpret_cast<void (C::*)(A1,A2)>(method), arg1, arg2, functionServer);
       
   186     }
       
   187 #endif // _lint
       
   188 
       
   189 
       
   190     /**
       
   191      * Calls a method with 2 arguments and a return value
       
   192      */
       
   193     template<class S, class R, class C, class A1, class A2, class B1, class B2>
       
   194     static inline void Call(S& result, C* object, R(C::*method)(A1,A2), B1& arg1, B2& arg2, java::util::FunctionServer* functionServer)
       
   195     {
       
   196         JELOG2(EUtils);
       
   197         Execute(MethodWrapperR2<S,R,C,A1,A2>(result, *object, method, arg1, arg2), functionServer, 0);
       
   198     }
       
   199 
       
   200 
       
   201 #ifndef _lint
       
   202     /**
       
   203      * Calls a const method with 2 arguments and a return value
       
   204      */
       
   205     template<class S, class R, class C, class A1, class A2, class B1, class B2>
       
   206     static inline void Call(S& result, const C* object, R(C::*method)(A1,A2) const, B1& arg1, B2& arg2, java::util::FunctionServer* functionServer)
       
   207     {
       
   208         JELOG2(EUtils);
       
   209         Call(result, const_cast<C*>(object), reinterpret_cast<R(C::*)(A1,A2)>(method), arg1, arg2, functionServer);
       
   210     }
       
   211 #endif // _lint
       
   212 
       
   213 
       
   214     /**
       
   215      * Calls a method with 3 arguments and no return value
       
   216      */
       
   217     template<class C, class A1, class A2, class A3, class B1, class B2, class B3>
       
   218     static inline void Call(C* object, void (C::*method)(A1,A2,A3), B1& arg1, B2& arg2, B3& arg3, java::util::FunctionServer* functionServer)
       
   219     {
       
   220         JELOG2(EUtils);
       
   221         Execute(MethodWrapper3<C,A1,A2,A3>(*object, method, arg1, arg2, arg3), functionServer, 0);
       
   222     }
       
   223 
       
   224 
       
   225 #ifndef _lint
       
   226     /**
       
   227      * Calls a const method with 3 arguments and no return value
       
   228      */
       
   229     template<class C, class A1, class A2, class A3, class B1, class B2, class B3>
       
   230     static inline void Call(const C* object, void (C::*method)(A1,A2,A3) const, B1& arg1, B2& arg2, B3& arg3, java::util::FunctionServer* functionServer)
       
   231     {
       
   232         JELOG2(EUtils);
       
   233         Call(const_cast<C*>(object), reinterpret_cast<void (C::*)(A1,A2,A3)>(method), arg1, arg2, arg3, functionServer);
       
   234     }
       
   235 #endif // _lint
       
   236 
       
   237 
       
   238     /**
       
   239      * Calls a method with 3 arguments and a return value
       
   240      */
       
   241     template<class S, class R, class C, class A1, class A2, class A3, class B1, class B2, class B3>
       
   242     static inline void Call(S& result, C* object, R(C::*method)(A1,A2,A3), B1& arg1, B2& arg2, B3& arg3, java::util::FunctionServer* functionServer)
       
   243     {
       
   244         JELOG2(EUtils);
       
   245         Execute(MethodWrapperR3<S,R,C,A1,A2,A3>(result, *object, method, arg1, arg2, arg3), functionServer, 0);
       
   246     }
       
   247 
       
   248 
       
   249 #ifndef _lint
       
   250     /**
       
   251      * Calls a const method with 3 arguments and a return value
       
   252      */
       
   253     template<class S, class R, class C, class A1, class A2, class A3, class B1, class B2, class B3>
       
   254     static inline void Call(S& result, const C* object, R(C::*method)(A1,A2,A3) const, B1& arg1, B2& arg2, B3& arg3, java::util::FunctionServer* functionServer)
       
   255     {
       
   256         JELOG2(EUtils);
       
   257         Call(result, const_cast<C*>(object), reinterpret_cast<R(C::*)(A1,A2,A3)>(method), arg1, arg2, arg3, functionServer);
       
   258     }
       
   259 #endif // _lint
       
   260 
       
   261 
       
   262     /**
       
   263      * Calls a method with 4 arguments and no return value
       
   264      */
       
   265     template<class C, class A1, class A2, class A3, class A4, class B1, class B2, class B3, class B4>
       
   266     static inline void Call(C* object, void (C::*method)(A1,A2,A3,A4), B1& arg1, B2& arg2, B3& arg3, B4& arg4, java::util::FunctionServer* functionServer)
       
   267     {
       
   268         JELOG2(EUtils);
       
   269         Execute(MethodWrapper4<C,A1,A2,A3,A4>(*object, method, arg1, arg2, arg3, arg4), functionServer, 0);
       
   270     }
       
   271 
       
   272 
       
   273 #ifndef _lint
       
   274     /**
       
   275      * Calls a const method with 4 arguments and no return value
       
   276      */
       
   277     template<class C, class A1, class A2, class A3, class A4, class B1, class B2, class B3, class B4>
       
   278     static inline void Call(const C* object, void (C::*method)(A1,A2,A3,A4) const, B1& arg1, B2& arg2, B3& arg3, B4& arg4, java::util::FunctionServer* functionServer)
       
   279     {
       
   280         JELOG2(EUtils);
       
   281         Call(const_cast<C*>(object), reinterpret_cast<void (C::*)(A1, A2, A3, A4)>(method), arg1, arg2, arg3, arg4, functionServer);
       
   282     }
       
   283 #endif // _lint
       
   284 
       
   285 
       
   286     /**
       
   287      * Calls a method with 4 arguments and a return value
       
   288      */
       
   289     template<class S, class R, class C, class A1, class A2, class A3, class A4, class B1, class B2, class B3, class B4>
       
   290     static inline void Call(S& result, C* object, R(C::*method)(A1,A2,A3,A4), B1& arg1, B2& arg2, B3& arg3, B4& arg4, java::util::FunctionServer* functionServer)
       
   291     {
       
   292         JELOG2(EUtils);
       
   293         Execute(MethodWrapperR4<S,R,C,A1,A2,A3,A4>(result, *object, method, arg1, arg2, arg3, arg4), functionServer, 0);
       
   294     }
       
   295 
       
   296 
       
   297 #ifndef _lint
       
   298     /**
       
   299      * Calls a const method with 4 arguments and a return value
       
   300      */
       
   301     template<class S, class R, class C, class A1, class A2, class A3, class A4, class B1, class B2, class B3, class B4>
       
   302     static inline void Call(S& result, const C* object, R(C::*method)(A1,A2,A3,A4) const, B1& arg1, B2& arg2, B3& arg3, B4& arg4, java::util::FunctionServer* functionServer)
       
   303     {
       
   304         JELOG2(EUtils);
       
   305         Call(result, const_cast<C*>(object), reinterpret_cast<R(C::*)(A1,A2,A3,A4)>(method), arg1, arg2, arg3, arg4, functionServer);
       
   306     }
       
   307 #endif // _lint
       
   308 
       
   309 
       
   310     /**
       
   311      * Calls a method with 5 arguments and no return value
       
   312      */
       
   313     template<class C, class A1, class A2, class A3, class A4, class A5, class B1, class B2, class B3, class B4, class B5>
       
   314     static inline void Call(C* object, void (C::*method)(A1,A2,A3,A4,A5), B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, java::util::FunctionServer* functionServer)
       
   315     {
       
   316         JELOG2(EUtils);
       
   317         Execute(MethodWrapper5<C,A1,A2,A3,A4,A5>(*object, method, arg1, arg2, arg3, arg4, arg5), functionServer, 0);
       
   318     }
       
   319 
       
   320 
       
   321     /**
       
   322      * Calls a method with 5 arguments and a return value
       
   323      */
       
   324     template<class S, class R, class C, class A1, class A2, class A3, class A4, class A5, class B1, class B2, class B3, class B4, class B5>
       
   325     static inline void Call(S& result, C* object, R(C::*method)(A1,A2,A3,A4,A5), B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, java::util::FunctionServer* functionServer)
       
   326     {
       
   327         JELOG2(EUtils);
       
   328         Execute(MethodWrapperR5<S,R,C,A1,A2,A3,A4,A5>(result, *object, method, arg1, arg2, arg3, arg4, arg5), functionServer, 0);
       
   329     }
       
   330 
       
   331 
       
   332 #ifndef _lint
       
   333     /**
       
   334      * Calls a const method with 5 arguments and no return value
       
   335      */
       
   336     template<class C, class A1, class A2, class A3, class A4, class A5, class B1, class B2, class B3, class B4, class B5>
       
   337     static inline void Call(const C* object, void (C::*method)(A1,A2,A3,A4,A5) const, B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, java::util::FunctionServer* functionServer)
       
   338     {
       
   339         JELOG2(EUtils);
       
   340         Call(const_cast<C*>(object), reinterpret_cast<void (C::*)(A1, A2, A3, A4, A5)>(method), arg1, arg2, arg3, arg4, arg5, functionServer);
       
   341     }
       
   342 #endif // _lint
       
   343 
       
   344 
       
   345 #ifndef _lint
       
   346     /**
       
   347      * Calls a const method with 5 arguments and a return value
       
   348      */
       
   349     template<class S, class R, class C, class A1, class A2, class A3, class A4, class A5, class B1, class B2, class B3, class B4, class B5>
       
   350     static inline void Call(S& result, const C* object, R(C::*method)(A1,A2,A3,A4,A5) const, B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, java::util::FunctionServer* functionServer)
       
   351     {
       
   352         JELOG2(EUtils);
       
   353         Call(result, const_cast<C*>(object), reinterpret_cast<R(C::*)(A1,A2,A3,A4,A5)>(method), arg1, arg2, arg3, arg4, arg5, functionServer);
       
   354     }
       
   355 #endif // _lint
       
   356 
       
   357 
       
   358     /**
       
   359      * Calls a method with 6 arguments and no return value
       
   360      */
       
   361     template<class C, class A1, class A2, class A3, class A4, class A5, class A6, class B1, class B2, class B3, class B4, class B5, class B6>
       
   362     static inline void Call(C* object, void (C::*method)(A1,A2,A3,A4,A5,A6), B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, B6& arg6, java::util::FunctionServer* functionServer)
       
   363     {
       
   364         JELOG2(EUtils);
       
   365         Execute(MethodWrapper6<C,A1,A2,A3,A4,A5,A6>(*object, method, arg1, arg2, arg3, arg4, arg5, arg6), functionServer, 0);
       
   366     }
       
   367 
       
   368 
       
   369     /**
       
   370      * Calls a method with 6 arguments and a return value
       
   371      */
       
   372     template<class S, class R, class C, class A1, class A2, class A3, class A4, class A5, class A6, class B1, class B2, class B3, class B4, class B5, class B6>
       
   373     static inline void Call(S& result, C* object, R(C::*method)(A1,A2,A3,A4,A5,A6), B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, B6& arg6, java::util::FunctionServer* functionServer)
       
   374     {
       
   375         JELOG2(EUtils);
       
   376         Execute(MethodWrapperR6<S,R,C,A1,A2,A3,A4,A5,A6>(result, *object, method, arg1, arg2, arg3, arg4, arg5, arg6), functionServer, 0);
       
   377     }
       
   378 
       
   379 
       
   380 #ifndef _lint
       
   381     /**
       
   382      * Calls a const method with 6 arguments and a return value
       
   383      */
       
   384     template<class S, class R, class C, class A1, class A2, class A3, class A4, class A5, class A6, class B1, class B2, class B3, class B4, class B5, class B6>
       
   385     static inline void Call(S& result, const C* object, R(C::*method)(A1,A2,A3,A4,A5,A6) const, B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, B6& arg6, java::util::FunctionServer* functionServer)
       
   386     {
       
   387         JELOG2(EUtils);
       
   388         Call(result, const_cast<C*>(object), reinterpret_cast<R(C::*)(A1,A2,A3,A4,A5,A6)>(method), arg1, arg2, arg3, arg4, arg5, arg6, functionServer);
       
   389     }
       
   390 #endif // _lint
       
   391 
       
   392 
       
   393 #ifndef _lint
       
   394     /**
       
   395      * Calls a const method with 6 arguments and no return value
       
   396      */
       
   397     template<class C, class A1, class A2, class A3, class A4, class A5, class A6, class B1, class B2, class B3, class B4, class B5, class B6>
       
   398     static inline void Call(const C* object, void (C::*method)(A1,A2,A3,A4,A5,A6) const, B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, B6& arg6, java::util::FunctionServer* functionServer)
       
   399     {
       
   400         JELOG2(EUtils);
       
   401         Call(const_cast<C*>(object), reinterpret_cast<void (C::*)(A1, A2, A3, A4, A5, A6)>(method), arg1, arg2, arg3, arg4, arg5, arg6, functionServer);
       
   402     }
       
   403 #endif // _lint
       
   404 
       
   405 
       
   406     /**
       
   407      * Calls a method with 7 arguments and no return value
       
   408      */
       
   409     template<class C, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class B1, class B2, class B3, class B4, class B5, class B6, class B7>
       
   410     static inline void Call(C* object, void (C::*method)(A1,A2,A3,A4,A5,A6,A7), B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, B6& arg6, B7& arg7, java::util::FunctionServer* functionServer)
       
   411     {
       
   412         JELOG2(EUtils);
       
   413         Execute(MethodWrapper7<C,A1,A2,A3,A4,A5,A6,A7>(*object, method, arg1, arg2, arg3, arg4, arg5, arg6, arg7), functionServer, 0);
       
   414     }
       
   415 
       
   416 
       
   417     /**
       
   418      * Calls a method with 7 arguments and a return value
       
   419      */
       
   420     template<class S, class R, class C, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class B1, class B2, class B3, class B4, class B5, class B6, class B7>
       
   421     static inline void Call(S& result, C* object, R(C::*method)(A1,A2,A3,A4,A5,A6,A7), B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, B6& arg6, B7& arg7, java::util::FunctionServer* functionServer)
       
   422     {
       
   423         JELOG2(EUtils);
       
   424         Execute(MethodWrapperR7<S,R,C,A1,A2,A3,A4,A5,A6,A7>(result, *object, method, arg1, arg2, arg3, arg4, arg5, arg6, arg7), functionServer, 0);
       
   425     }
       
   426 
       
   427 
       
   428 #ifndef _lint
       
   429     /**
       
   430      * Calls a const method with 7 arguments and a return value
       
   431      */
       
   432     template<class S, class R, class C, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class B1, class B2, class B3, class B4, class B5, class B6, class B7>
       
   433     static inline void Call(S& result, const C* object, R(C::*method)(A1,A2,A3,A4,A5,A6,A7) const, B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, B6& arg6, B7& arg7, java::util::FunctionServer* functionServer)
       
   434     {
       
   435         JELOG2(EUtils);
       
   436         Call(result, const_cast<C*>(object), reinterpret_cast<R(C::*)(A1,A2,A3,A4,A5,A6,A7)>(method), arg1, arg2, arg3, arg4, arg5, arg6, arg7, functionServer);
       
   437     }
       
   438 #endif // _lint
       
   439 
       
   440 #ifndef _lint
       
   441     /**
       
   442      * Calls a const method with 7 arguments and no return value
       
   443      */
       
   444     template<class C, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class B1, class B2, class B3, class B4, class B5, class B6, class B7>
       
   445     static inline void Call(const C* object, void (C::*method)(A1,A2,A3,A4,A5,A6,A7) const, B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, B6& arg6, B7& arg7, java::util::FunctionServer* functionServer)
       
   446     {
       
   447         JELOG2(EUtils);
       
   448         Call(const_cast<C*>(object), reinterpret_cast<void (C::*)(A1, A2, A3, A4, A5, A6, A7)>(method), arg1, arg2, arg3, arg4, arg5, arg6, arg7, functionServer);
       
   449     }
       
   450 #endif // _lint
       
   451 
       
   452 
       
   453 
       
   454 //*****LOCAL CALLS*****************
       
   455 
       
   456     /********************************WITHOUT RETURN VALUE************************
       
   457     /**
       
   458      * Calls a local method with 0 arguments and no return value
       
   459      */
       
   460     static inline void Call(void (*method)(), java::util::FunctionServer* functionServer)
       
   461     {
       
   462         JELOG2(EUtils);
       
   463         Execute(MethodWrapperLocal0(method), functionServer, 0);
       
   464     }
       
   465 
       
   466 
       
   467     /**
       
   468      * Calls a local method with 1 arguments and no return value
       
   469      */
       
   470     template<class A1, class B1>
       
   471     static inline void Call(void (*method)(A1), B1& arg1, java::util::FunctionServer* functionServer)
       
   472     {
       
   473         JELOG2(EUtils);
       
   474         Execute(MethodWrapperLocal1<A1>(method, arg1), functionServer, 0);
       
   475     }
       
   476 
       
   477     /**
       
   478      * Calls a local method with 2 arguments and no return value
       
   479      */
       
   480     template<class A1, class A2, class B1, class B2>
       
   481     static inline void Call(void (*method)(A1, A2), B1& arg1, B2& arg2, java::util::FunctionServer* functionServer)
       
   482     {
       
   483         JELOG2(EUtils);
       
   484         Execute(MethodWrapperLocal2<A1,A2>(method, arg1, arg2), functionServer, 0);
       
   485     }
       
   486 
       
   487     /**
       
   488      * Calls a local method with 3 arguments and no return value
       
   489      */
       
   490     template<class A1, class A2, class A3, class B1, class B2, class B3>
       
   491     static inline void Call(void (*method)(A1,A2,A3), B1& arg1, B2& arg2, B3& arg3, java::util::FunctionServer* functionServer)
       
   492     {
       
   493         JELOG2(EUtils);
       
   494         Execute(MethodWrapperLocal3<A1,A2,A3>(method, arg1, arg2, arg3), functionServer, 0);
       
   495     }
       
   496 
       
   497     /**
       
   498      * Calls a local method with 4 arguments and no return value
       
   499      */
       
   500     template<class A1, class A2, class A3, class A4, class B1, class B2, class B3, class B4>
       
   501     static inline void Call(void (*method)(A1,A2,A3,A4), B1& arg1, B2& arg2, B3& arg3, B4& arg4, java::util::FunctionServer* functionServer)
       
   502     {
       
   503         JELOG2(EUtils);
       
   504         Execute(MethodWrapperLocal4<A1,A2,A3,A4>(method, arg1, arg2, arg3, arg4), functionServer, 0);
       
   505     }
       
   506 
       
   507     /**
       
   508      * Calls a local method with 5 arguments and no return value
       
   509      */
       
   510     template<class A1, class A2, class A3, class A4, class A5, class B1, class B2, class B3, class B4, class B5>
       
   511     static inline void Call(void (*method)(A1,A2,A3,A4,A5), B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, java::util::FunctionServer* functionServer)
       
   512     {
       
   513         JELOG2(EUtils);
       
   514         Execute(MethodWrapperLocal5<A1,A2,A3,A4,A5>(method, arg1, arg2, arg3, arg4, arg5), functionServer, 0);
       
   515     }
       
   516 
       
   517     /**
       
   518      * Calls a local method with 6 arguments and no return value
       
   519      */
       
   520     template<class A1, class A2, class A3, class A4, class A5, class A6, class B1, class B2, class B3, class B4, class B5, class B6>
       
   521     static inline void Call(void (*method)(A1,A2,A3,A4,A5,A6), B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, B6& arg6, java::util::FunctionServer* functionServer)
       
   522     {
       
   523         JELOG2(EUtils);
       
   524         Execute(MethodWrapperLocal6<A1,A2,A3,A4,A5,A6>(method, arg1, arg2, arg3, arg4, arg5, arg6), functionServer, 0);
       
   525     }
       
   526 
       
   527     /**
       
   528      * Calls a local method with 7 arguments and no return value
       
   529      */
       
   530     template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class B1, class B2, class B3, class B4, class B5, class B6, class B7>
       
   531     static inline void Call(void (*method)(A1,A2,A3,A4,A5,A6,A7), B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, B6& arg6, B7& arg7, java::util::FunctionServer* functionServer)
       
   532     {
       
   533         JELOG2(EUtils);
       
   534         Execute(MethodWrapperLocal7<A1,A2,A3,A4,A5,A6,A7>(method, arg1, arg2, arg3, arg4, arg5, arg6, arg7), functionServer, 0);
       
   535     }
       
   536 
       
   537     /**
       
   538      * Calls a local method with 8 arguments and no return value
       
   539      */
       
   540     template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8>
       
   541     static inline void Call(void (*method)(A1,A2,A3,A4,A5,A6,A7,A8), B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, B6& arg6, B7& arg7, B8& arg8, java::util::FunctionServer* functionServer)
       
   542     {
       
   543         JELOG2(EUtils);
       
   544         Execute(MethodWrapperLocal8<A1,A2,A3,A4,A5,A6,A7,A8>(method, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8), functionServer, 0);
       
   545     }
       
   546 
       
   547     /**
       
   548      * Calls a local method with 9 arguments and no return value
       
   549      */
       
   550     template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8, class B9>
       
   551     static inline void Call(void (*method)(A1,A2,A3,A4,A5,A6,A7,A8,A9), B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, B6& arg6, B7& arg7, B8& arg8, B9& arg9, java::util::FunctionServer* functionServer)
       
   552     {
       
   553         JELOG2(EUtils);
       
   554         Execute(MethodWrapperLocal9<A1,A2,A3,A4,A5,A6,A7,A8,A9>(method, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9), functionServer, 0);
       
   555     }
       
   556 
       
   557     /********************************WITH RETURN VALUE************************
       
   558 
       
   559     /**
       
   560      * Calls a local method with 0 arguments and a return value
       
   561      */
       
   562     template< class R>
       
   563     static inline R Call(R(*method)(), java::util::FunctionServer* functionServer)
       
   564     {
       
   565         JELOG2(EUtils);
       
   566         R result;
       
   567         Execute(MethodWrapperLocalR0<R>(result, method), functionServer, 0);
       
   568         return result;
       
   569     }
       
   570 
       
   571 
       
   572     /**
       
   573      * Calls a local method with 1 arguments and a return value
       
   574      */
       
   575     template< class R, class A1, class B1>
       
   576     static inline R Call(R(*method)(A1), B1& arg1, java::util::FunctionServer* functionServer)
       
   577     {
       
   578         JELOG2(EUtils);
       
   579         R result;
       
   580         Execute(MethodWrapperLocalR1<R,A1>(result, method, arg1), functionServer, 0);
       
   581         return result;
       
   582     }
       
   583 
       
   584     /**
       
   585      * Calls a local method with 2 arguments and a return value
       
   586      */
       
   587     template< class R, class A1, class A2, class B1, class B2>
       
   588     static inline R Call(R(*method)(A1, A2), B1& arg1, B2& arg2, java::util::FunctionServer* functionServer)
       
   589     {
       
   590         JELOG2(EUtils);
       
   591         R result;
       
   592         Execute(MethodWrapperLocalR2<R,A1,A2>(result, method, arg1, arg2), functionServer, 0);
       
   593         return result;
       
   594     }
       
   595 
       
   596     /**
       
   597      * Calls a local method with 3 arguments and a return value
       
   598      */
       
   599     template<class R, class A1, class A2, class A3, class B1, class B2, class B3>
       
   600     static inline R Call(R(*method)(A1,A2,A3), B1& arg1, B2& arg2, B3& arg3, java::util::FunctionServer* functionServer)
       
   601     {
       
   602         JELOG2(EUtils);
       
   603         R result;
       
   604         Execute(MethodWrapperLocalR3<R,A1,A2,A3>(result, method, arg1, arg2, arg3), functionServer, 0);
       
   605         return result;
       
   606     }
       
   607 
       
   608     /**
       
   609      * Calls a local method with 4 arguments and a return value
       
   610      */
       
   611     template<class R, class A1, class A2, class A3, class A4, class B1, class B2, class B3, class B4>
       
   612     static inline R Call(R(*method)(A1,A2,A3,A4), B1& arg1, B2& arg2, B3& arg3, B4& arg4, java::util::FunctionServer* functionServer)
       
   613     {
       
   614         JELOG2(EUtils);
       
   615         R result;
       
   616         Execute(MethodWrapperLocalR4<R,A1,A2,A3,A4>(result, method, arg1, arg2, arg3, arg4), functionServer, 0);
       
   617         return result;
       
   618     }
       
   619 
       
   620     /**
       
   621      * Calls a local method with 5 arguments and a return value
       
   622      */
       
   623     template<class R, class A1, class A2, class A3, class A4, class A5, class B1, class B2, class B3, class B4, class B5>
       
   624     static inline R Call(R(*method)(A1,A2,A3,A4,A5), B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, java::util::FunctionServer* functionServer)
       
   625     {
       
   626         JELOG2(EUtils);
       
   627         R result;
       
   628         Execute(MethodWrapperLocalR5<R,A1,A2,A3,A4,A5>(result, method, arg1, arg2, arg3, arg4, arg5), functionServer, 0);
       
   629         return result;
       
   630     }
       
   631 
       
   632     /**
       
   633      * Calls a local method with 6 arguments and a return value
       
   634      */
       
   635     template<class R, class A1, class A2, class A3, class A4, class A5, class A6, class B1, class B2, class B3, class B4, class B5, class B6>
       
   636     static inline R Call(R(*method)(A1,A2,A3,A4,A5,A6), B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, B6& arg6, java::util::FunctionServer* functionServer)
       
   637     {
       
   638         JELOG2(EUtils);
       
   639         R result;
       
   640         Execute(MethodWrapperLocalR6<R,A1,A2,A3,A4,A5,A6>(result, method, arg1, arg2, arg3, arg4, arg5, arg6), functionServer, 0);
       
   641         return result;
       
   642     }
       
   643 
       
   644     /**
       
   645      * Calls a local method with 7 arguments and a return value
       
   646      */
       
   647     template<class R, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class B1, class B2, class B3, class B4, class B5, class B6, class B7>
       
   648     static inline R Call(R(*method)(A1,A2,A3,A4,A5,A6,A7), B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, B6& arg6, B7& arg7, java::util::FunctionServer* functionServer)
       
   649     {
       
   650         JELOG2(EUtils);
       
   651         R result;
       
   652         Execute(MethodWrapperLocalR7<R,A1,A2,A3,A4,A5,A6,A7>(result, method, arg1, arg2, arg3, arg4, arg5, arg6, arg7), functionServer, 0);
       
   653         return result;
       
   654     }
       
   655 
       
   656     /**
       
   657      * Calls a local method with 8 arguments and a return value
       
   658      */
       
   659     template<class R, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8>
       
   660     static inline R Call(R(*method)(A1,A2,A3,A4,A5,A6,A7,A8), B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, B6& arg6, B7& arg7, B8& arg8, java::util::FunctionServer* functionServer)
       
   661     {
       
   662         JELOG2(EUtils);
       
   663         R result;
       
   664         Execute(MethodWrapperLocalR8<R,A1,A2,A3,A4,A5,A6,A7,A8>(result, method, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8), functionServer, 0);
       
   665         return result;
       
   666     }
       
   667 
       
   668     /**
       
   669      * Calls a local method with 9 arguments and a return value
       
   670      */
       
   671     template<class R, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8, class B9>
       
   672     static inline R Call(R(*method)(A1,A2,A3,A4,A5,A6,A7,A8,A9), B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, B6& arg6, B7& arg7, B8& arg8, B9& arg9, java::util::FunctionServer* functionServer)
       
   673     {
       
   674         JELOG2(EUtils);
       
   675         R result;
       
   676         Execute(MethodWrapperLocalR9<R,A1,A2,A3,A4,A5,A6,A7,A8,A9>(result, method, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9), functionServer, 0);
       
   677         return result;
       
   678     }
       
   679 
       
   680     /********************************TRAP************************
       
   681 
       
   682 
       
   683     /**
       
   684      * Calls a local method with 0 arguments and a TRAP result in return value
       
   685      */
       
   686     static inline int TrapCall(void (*method)(), java::util::FunctionServer* functionServer)
       
   687     {
       
   688         JELOG2(EUtils);
       
   689         int result;
       
   690         Execute(MethodWrapperLocal0(method), functionServer, &result);
       
   691         return result;
       
   692     }
       
   693 
       
   694 
       
   695     /**
       
   696      * Calls a local method with 1 arguments and a TRAP result in return value
       
   697      */
       
   698     template<class A1, class B1>
       
   699     static inline int TrapCall(void (*method)(A1), B1& arg1, java::util::FunctionServer* functionServer)
       
   700     {
       
   701         JELOG2(EUtils);
       
   702         int result;
       
   703         Execute(MethodWrapperLocal1<A1>(method, arg1), functionServer, &result);
       
   704         return result;
       
   705     }
       
   706 
       
   707     /**
       
   708      * Calls a local method with 2 arguments and a TRAP result in return value
       
   709      */
       
   710     template<class A1, class A2, class B1, class B2>
       
   711     static inline int TrapCall(void (*method)(A1, A2), B1& arg1, B2& arg2, java::util::FunctionServer* functionServer)
       
   712     {
       
   713         JELOG2(EUtils);
       
   714         int result;
       
   715         Execute(MethodWrapperLocal2<A1,A2>(method, arg1, arg2), functionServer, &result);
       
   716         return result;
       
   717     }
       
   718 
       
   719     /**
       
   720      * Calls a local method with 3 arguments and a TRAP result in return value
       
   721      */
       
   722     template<class A1, class A2, class A3, class B1, class B2, class B3>
       
   723     static inline int TrapCall(void (*method)(A1,A2,A3), B1& arg1, B2& arg2, B3& arg3, java::util::FunctionServer* functionServer)
       
   724     {
       
   725         JELOG2(EUtils);
       
   726         int result;
       
   727         Execute(MethodWrapperLocal3<A1,A2,A3>(method, arg1, arg2, arg3), functionServer, &result);
       
   728         return result;
       
   729     }
       
   730 
       
   731     /**
       
   732      * Calls a local method with 4 arguments and a TRAP result in return value
       
   733      */
       
   734     template<class A1, class A2, class A3, class A4, class B1, class B2, class B3, class B4>
       
   735     static inline int TrapCall(void (*method)(A1,A2,A3,A4), B1& arg1, B2& arg2, B3& arg3, B4& arg4, java::util::FunctionServer* functionServer)
       
   736     {
       
   737         JELOG2(EUtils);
       
   738         int result;
       
   739         Execute(MethodWrapperLocal4<A1,A2,A3,A4>(method, arg1, arg2, arg3, arg4), functionServer, &result);
       
   740         return result;
       
   741     }
       
   742 
       
   743     /**
       
   744      * Calls a local method with 5 arguments and a TRAP result in return value
       
   745      */
       
   746     template<class A1, class A2, class A3, class A4, class A5, class B1, class B2, class B3, class B4, class B5>
       
   747     static inline int TrapCall(void (*method)(A1,A2,A3,A4,A5), B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, java::util::FunctionServer* functionServer)
       
   748     {
       
   749         JELOG2(EUtils);
       
   750         int result;
       
   751         Execute(MethodWrapperLocal5<A1,A2,A3,A4,A5>(method, arg1, arg2, arg3, arg4, arg5), functionServer, &result);
       
   752         return result;
       
   753     }
       
   754 
       
   755     /**
       
   756      * Calls a local method with 6 arguments and a TRAP result in return value
       
   757      */
       
   758     template<class A1, class A2, class A3, class A4, class A5, class A6, class B1, class B2, class B3, class B4, class B5, class B6>
       
   759     static inline int TrapCall(void (*method)(A1,A2,A3,A4,A5,A6), B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, B6& arg6, java::util::FunctionServer* functionServer)
       
   760     {
       
   761         JELOG2(EUtils);
       
   762         int result;
       
   763         Execute(MethodWrapperLocal6<A1,A2,A3,A4,A5,A6>(method, arg1, arg2, arg3, arg4, arg5, arg6), functionServer, &result);
       
   764         return result;
       
   765     }
       
   766 
       
   767     /**
       
   768      * Calls a local method with 7 arguments and a TRAP result in return value
       
   769      */
       
   770     template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class B1, class B2, class B3, class B4, class B5, class B6, class B7>
       
   771     static inline int TrapCall(void (*method)(A1,A2,A3,A4,A5,A6,A7), B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, B6& arg6, B7& arg7, java::util::FunctionServer* functionServer)
       
   772     {
       
   773         JELOG2(EUtils);
       
   774         int result;
       
   775         Execute(MethodWrapperLocal7<A1,A2,A3,A4,A5,A6,A7>(method, arg1, arg2, arg3, arg4, arg5, arg6, arg7), functionServer, &result);
       
   776         return result;
       
   777     }
       
   778 
       
   779     /**
       
   780      * Calls a local method with 8 arguments and a TRAP result in return value
       
   781      */
       
   782     template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8>
       
   783     static inline int TrapCall(void (*method)(A1,A2,A3,A4,A5,A6,A7,A8), B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, B6& arg6, B7& arg7, B8& arg8, java::util::FunctionServer* functionServer)
       
   784     {
       
   785         JELOG2(EUtils);
       
   786         int result;
       
   787         Execute(MethodWrapperLocal8<A1,A2,A3,A4,A5,A6,A7,A8>(method, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8), functionServer, &result);
       
   788         return result;
       
   789     }
       
   790 
       
   791     /**
       
   792      * Calls a local method with 9 arguments and a TRAP result in return value
       
   793      */
       
   794     template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8, class B9>
       
   795     static inline int TrapCall(void (*method)(A1,A2,A3,A4,A5,A6,A7,A8,A9), B1& arg1, B2& arg2, B3& arg3, B4& arg4, B5& arg5, B6& arg6, B7& arg7, B8& arg8, B9& arg9, java::util::FunctionServer* functionServer)
       
   796     {
       
   797         JELOG2(EUtils);
       
   798         int result;
       
   799         Execute(MethodWrapperLocal9<A1,A2,A3,A4,A5,A6,A7,A8,A9>(method, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9), functionServer, &result);
       
   800         return result;
       
   801     }
       
   802 
       
   803 
       
   804 };
       
   805 
       
   806 
       
   807 
       
   808 /**
       
   809  * Specialisation of MethodCall for non-leaving methods
       
   810  */
       
   811 typedef MethodCall<MethodCaller::ExecuteRegularFunctor> RegularMethodCall;
       
   812 
       
   813 
       
   814 /**
       
   815  * Specialisation of MethodCall for leaving methods
       
   816  */
       
   817 typedef MethodCall<MethodCaller::ExecuteLeavingFunctorL> LeavingMethodCall;
       
   818 
       
   819 
       
   820 /**
       
   821  * Specialisation of MethodCall for traping methods
       
   822  */
       
   823 typedef MethodCall<MethodCaller::ExecuteTrapingFunctorL> TrapingMethodCall;
       
   824 
       
   825 
       
   826 /**
       
   827  * Helper macro to ease calling a regular method
       
   828  */
       
   829 #define CallMethod RegularMethodCall::Call
       
   830 
       
   831 
       
   832 /**
       
   833  * Helper macro to ease calling a leaving method
       
   834  */
       
   835 #define CallMethodL LeavingMethodCall::Call
       
   836 
       
   837 /**
       
   838  * Helper macro to ease calling a leaving method with trap
       
   839  */
       
   840 #define CallMethodTrap TrapingMethodCall::TrapCall
       
   841 
       
   842 
       
   843 #endif // FS_METHODCALL_H
       
   844