|
static nsresult | New (SelfType **aRunnable, ClassType *aObject, MethodType aMethod, ReturnType aFailureReturnValue, Arg1Type aArg1Value) |
|
static ReturnType | InvokeOnMainThread (ClassType *aObject, MethodType aMethod, ReturnType aFailureReturnValue, Arg1Type aArg1Value) |
|
static ReturnType | InvokeOnThread (ClassType *aObject, MethodType aMethod, ReturnType aFailureReturnValue, Arg1Type aArg1Value, nsIEventTarget *aThread) |
|
static nsresult | InvokeOnMainThreadAsync (ClassType *aObject, MethodType aMethod, ReturnType aFailureReturnValue, Arg1Type aArg1Value) |
|
static nsresult | InvokeOnThreadAsync (ClassType *aObject, MethodType aMethod, ReturnType aFailureReturnValue, Arg1Type aArg1Value, nsIEventTarget *aThread) |
|
template<class ClassType, typename ReturnType, typename Arg1Type>
class sbRunnableMethod1< ClassType, ReturnType, Arg1Type >
This class provides an nsIRunnable interface, like nsRunnableMethod, that invokes a provided class method from nsIRunnable::Run. This class passes a single argument to the method and collects the return value. The method return value may be read using GetReturnValue. If any error occurs attempting to invoke the method, a failure value may be specified to be used as the return value.
XXXeps need specialization for methods returning void.
Definition at line 74 of file sbThreadUtils.h.
template<class ClassType , typename ReturnType , typename Arg1Type >
static ReturnType sbRunnableMethod1< ClassType, ReturnType, Arg1Type >::InvokeOnMainThread |
( |
ClassType * |
aObject, |
|
|
MethodType |
aMethod, |
|
|
ReturnType |
aFailureReturnValue, |
|
|
Arg1Type |
aArg1Value |
|
) |
| |
|
inlinestatic |
Invoke the method specified by aMethod of the object specified by aObject on the main thread. Invoke the method with the argument specified by aArg1Value. Return the value returned by the invoked method. If any error occurs, return aFailureReturnValue.
- Parameters
-
aObject | Object for which to invoke method. |
aMethod | Method to invoke. |
aFailureReturnValue | Value to return on failure. |
aArg1Value | Value of first method argument. |
- Returns
- Value returned by invoked method or aFailureReturnValue on failure.
Definition at line 180 of file sbThreadUtils.h.
template<class ClassType , typename ReturnType , typename Arg1Type >
static nsresult sbRunnableMethod1< ClassType, ReturnType, Arg1Type >::InvokeOnMainThreadAsync |
( |
ClassType * |
aObject, |
|
|
MethodType |
aMethod, |
|
|
ReturnType |
aFailureReturnValue, |
|
|
Arg1Type |
aArg1Value |
|
) |
| |
|
inlinestatic |
Asynchronously, invoke the method specified by aMethod of the object specified by aObject on the main thread. Invoke the method with the argument specified by aArg1Value. Use the value specified by aFailureReturnValue as the runnable method failure return value. XXXeps the return value is only needed to properly create the object.
- Parameters
-
aObject | Object for which to invoke method. |
aMethod | Method to invoke. |
aFailureReturnValue | Value to return on failure. |
aArg1Value | Value of first method argument. |
Definition at line 257 of file sbThreadUtils.h.
template<class ClassType , typename ReturnType , typename Arg1Type >
static ReturnType sbRunnableMethod1< ClassType, ReturnType, Arg1Type >::InvokeOnThread |
( |
ClassType * |
aObject, |
|
|
MethodType |
aMethod, |
|
|
ReturnType |
aFailureReturnValue, |
|
|
Arg1Type |
aArg1Value, |
|
|
nsIEventTarget * |
aThread |
|
) |
| |
|
inlinestatic |
Invoke the method specified by aMethod of the object specified by aObject on the supplied thread. Invoke the method with the argument specified by aArg1Value. Return the value returned by the invoked method. If any error occurs, return aFailureReturnValue.
- Parameters
-
aObject | Object for which to invoke method. |
aMethod | Method to invoke. |
aFailureReturnValue | Value to return on failure. |
aArg1Value | Value of first method argument. |
aThread | Thread to run on. |
- Returns
- Value returned by invoked method or aFailureReturnValue on failure.
Definition at line 219 of file sbThreadUtils.h.
template<class ClassType , typename ReturnType , typename Arg1Type >
static nsresult sbRunnableMethod1< ClassType, ReturnType, Arg1Type >::InvokeOnThreadAsync |
( |
ClassType * |
aObject, |
|
|
MethodType |
aMethod, |
|
|
ReturnType |
aFailureReturnValue, |
|
|
Arg1Type |
aArg1Value, |
|
|
nsIEventTarget * |
aThread |
|
) |
| |
|
inlinestatic |
Asynchronously, invoke the method specified by aMethod of the object specified by aObject on the supplied thread. Invoke the method with the argument specified by aArg1Value. Use the value specified by aFailureReturnValue as the runnable method failure return value. XXXeps the return value is only needed to properly create the object.
- Parameters
-
aObject | Object for which to invoke method. |
aMethod | Method to invoke. |
aFailureReturnValue | Value to return on failure. |
aArg1Value | Value of first method argument. |
aThread | Thread to run on. |
Definition at line 294 of file sbThreadUtils.h.
template<class ClassType , typename ReturnType , typename Arg1Type >
static nsresult sbRunnableMethod1< ClassType, ReturnType, Arg1Type >::New |
( |
SelfType ** |
aRunnable, |
|
|
ClassType * |
aObject, |
|
|
MethodType |
aMethod, |
|
|
ReturnType |
aFailureReturnValue, |
|
|
Arg1Type |
aArg1Value |
|
) |
| |
|
inlinestatic |
Create and initialize a Songbird runnable method for the object specified by aObject. Call the object method specified by aMethod with the argument specified by aArg1Value. Use the value specified by aFailureReturnValue as the failure return value. Return the new Songbird runnable method in aRunnable.
- Parameters
-
aRunnable | Returned created Songbird runnable method. |
aObject | Object for which to create a Songbird runnable method. |
aMethod | Method to be invoked. |
aFailureReturnValue | Value to which to set runnable method return value on internal failures. |
aArg1Value | Value of first method argument. |
Definition at line 133 of file sbThreadUtils.h.