sbRunnableMethod2< ClassType, ReturnType, Arg1Type, Arg2Type > Class Template Reference

#include <sbThreadUtils.h>

Inheritance diagram for sbRunnableMethod2< ClassType, ReturnType, Arg1Type, Arg2Type >:
[legend]
Collaboration diagram for sbRunnableMethod2< ClassType, ReturnType, Arg1Type, Arg2Type >:
[legend]

Public Types

typedef sbRunnableMethod2
< ClassType, ReturnType,
Arg1Type, Arg2Type > 
SelfType
 
typedef sbRunnableMethod1
< ClassType, ReturnType,
Arg1Type > 
BaseType
 
typedef ReturnType(ClassType::* MethodType )(Arg1Type aArg1Value, Arg2Type aArg2Value)
 
- Public Types inherited from sbRunnableMethod1< ClassType, ReturnType, Arg1Type >
typedef sbRunnableMethod1
< ClassType, ReturnType,
Arg1Type > 
SelfType
 
typedef ReturnType(ClassType::* MethodType )(Arg1Type aArg1Value)
 

Public Member Functions

NS_IMETHOD Run ()
 
- Public Member Functions inherited from sbRunnableMethod1< ClassType, ReturnType, Arg1Type >
NS_IMETHOD Run ()
 
ReturnType GetReturnValue ()
 

Static Public Member Functions

static nsresult New (SelfType **aRunnable, ClassType *aObject, MethodType aMethod, ReturnType aFailureReturnValue, Arg1Type aArg1Value, Arg2Type aArg2Value)
 
static ReturnType InvokeOnMainThread (ClassType *aObject, MethodType aMethod, ReturnType aFailureReturnValue, Arg1Type aArg1Value, Arg2Type aArg2Value)
 
static ReturnType InvokeOnThread (ClassType *aObject, MethodType aMethod, ReturnType aFailureReturnValue, Arg1Type aArg1Value, Arg2Type aArg2Value, nsIEventTarget *aThread)
 
static nsresult InvokeOnMainThreadAsync (ClassType *aObject, MethodType aMethod, ReturnType aFailureReturnValue, Arg1Type aArg1Value, Arg2Type aArg2Value)
 
static nsresult InvokeOnThreadAsync (ClassType *aObject, MethodType aMethod, ReturnType aFailureReturnValue, Arg1Type aArg1Value, Arg2Type aArg2Value, nsIEventTarget *aThread)
 
- Static Public Member Functions inherited from sbRunnableMethod1< ClassType, ReturnType, Arg1Type >
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)
 

Protected Member Functions

 sbRunnableMethod2 (ClassType *aObject, MethodType aMethod, ReturnType aFailureReturnValue, Arg1Type aArg1Value, Arg2Type aArg2Value)
 
virtual ~sbRunnableMethod2 ()
 
- Protected Member Functions inherited from sbRunnableMethod1< ClassType, ReturnType, Arg1Type >
 sbRunnableMethod1 (ClassType *aObject, MethodType aMethod, ReturnType aFailureReturnValue, Arg1Type aArg1Value)
 
virtual ~sbRunnableMethod1 ()
 
nsresult Initialize ()
 

Protected Attributes

MethodType mMethod
 
Arg2Type mArg2Value
 
- Protected Attributes inherited from sbRunnableMethod1< ClassType, ReturnType, Arg1Type >
PRLock * mLock
 
nsRefPtr< ClassType > mObject
 
MethodType mMethod
 
ReturnType mReturnValue
 
ReturnType mFailureReturnValue
 
Arg1Type mArg1Value
 

Detailed Description

template<class ClassType, typename ReturnType, typename Arg1Type, typename Arg2Type>
class sbRunnableMethod2< ClassType, ReturnType, Arg1Type, Arg2Type >

This class is a two argument method sub-class of sbRunnableMethod1.

Definition at line 420 of file sbThreadUtils.h.

Member Typedef Documentation

template<class ClassType , typename ReturnType , typename Arg1Type , typename Arg2Type >
typedef sbRunnableMethod1<ClassType, ReturnType, Arg1Type> sbRunnableMethod2< ClassType, ReturnType, Arg1Type, Arg2Type >::BaseType

Definition at line 438 of file sbThreadUtils.h.

template<class ClassType , typename ReturnType , typename Arg1Type , typename Arg2Type >
typedef ReturnType(ClassType::* sbRunnableMethod2< ClassType, ReturnType, Arg1Type, Arg2Type >::MethodType)(Arg1Type aArg1Value, Arg2Type aArg2Value)

Definition at line 439 of file sbThreadUtils.h.

template<class ClassType , typename ReturnType , typename Arg1Type , typename Arg2Type >
typedef sbRunnableMethod2<ClassType, ReturnType, Arg1Type, Arg2Type> sbRunnableMethod2< ClassType, ReturnType, Arg1Type, Arg2Type >::SelfType

Definition at line 437 of file sbThreadUtils.h.

Constructor & Destructor Documentation

template<class ClassType , typename ReturnType , typename Arg1Type , typename Arg2Type >
sbRunnableMethod2< ClassType, ReturnType, Arg1Type, Arg2Type >::sbRunnableMethod2 ( ClassType *  aObject,
MethodType  aMethod,
ReturnType  aFailureReturnValue,
Arg1Type  aArg1Value,
Arg2Type  aArg2Value 
)
inlineprotected

Construct 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.

Parameters
aObjectObject for which to create a Songbird runnable method.
aMethodMethod to be invoked.
aFailureReturnValueValue to which to set runnable method return value on internal failures.
aArg1ValueValue of first method argument.

Definition at line 703 of file sbThreadUtils.h.

template<class ClassType , typename ReturnType , typename Arg1Type , typename Arg2Type >
virtual sbRunnableMethod2< ClassType, ReturnType, Arg1Type, Arg2Type >::~sbRunnableMethod2 ( )
inlineprotectedvirtual

Dispose of the Songbird runnable method.

Definition at line 719 of file sbThreadUtils.h.

Member Function Documentation

template<class ClassType , typename ReturnType , typename Arg1Type , typename Arg2Type >
static ReturnType sbRunnableMethod2< ClassType, ReturnType, Arg1Type, Arg2Type >::InvokeOnMainThread ( ClassType *  aObject,
MethodType  aMethod,
ReturnType  aFailureReturnValue,
Arg1Type  aArg1Value,
Arg2Type  aArg2Value 
)
inlinestatic

Invoke the method specified by aMethod of the object specified by aObject on the main thread. Invoke the method with the arguments specified by aArg1Value and aArg2Value. Return the value returned by the invoked method. If any error occurs, return aFailureReturnValue.

Parameters
aObjectObject for which to invoke method.
aMethodMethod to invoke.
aFailureReturnValueValue to return on failure.
aArg1ValueValue of first method argument.
aArg2ValueValue of second method argument.
Returns
Value returned by invoked method or aFailureReturnValue on failure.

Definition at line 533 of file sbThreadUtils.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class ClassType , typename ReturnType , typename Arg1Type , typename Arg2Type >
static nsresult sbRunnableMethod2< ClassType, ReturnType, Arg1Type, Arg2Type >::InvokeOnMainThreadAsync ( ClassType *  aObject,
MethodType  aMethod,
ReturnType  aFailureReturnValue,
Arg1Type  aArg1Value,
Arg2Type  aArg2Value 
)
inlinestatic

Asynchronously, invoke the method specified by aMethod of the object specified by aObject on the main thread. Invoke the method with the arguments specified by aArg1Value and aArg2Value. 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
aObjectObject for which to invoke method.
aMethodMethod to invoke.
aFailureReturnValueValue to return on failure.
aArg1ValueValue of first method argument.
aArg2ValueValue of second method argument.

Definition at line 615 of file sbThreadUtils.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class ClassType , typename ReturnType , typename Arg1Type , typename Arg2Type >
static ReturnType sbRunnableMethod2< ClassType, ReturnType, Arg1Type, Arg2Type >::InvokeOnThread ( ClassType *  aObject,
MethodType  aMethod,
ReturnType  aFailureReturnValue,
Arg1Type  aArg1Value,
Arg2Type  aArg2Value,
nsIEventTarget *  aThread 
)
inlinestatic

Invoke the method specified by aMethod of the object specified by aObject on the supplied thread. Invoke the method with the arguments specified by aArg1Value and aArg2Value. Return the value returned by the invoked method. If any error occurs, return aFailureReturnValue.

Parameters
aObjectObject for which to invoke method.
aMethodMethod to invoke.
aFailureReturnValueValue to return on failure.
aArg1ValueValue of first method argument.
aArg2ValueValue of second method argument.
aThreadThread to run on.
Returns
Value returned by invoked method or aFailureReturnValue on failure.

Definition at line 575 of file sbThreadUtils.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class ClassType , typename ReturnType , typename Arg1Type , typename Arg2Type >
static nsresult sbRunnableMethod2< ClassType, ReturnType, Arg1Type, Arg2Type >::InvokeOnThreadAsync ( ClassType *  aObject,
MethodType  aMethod,
ReturnType  aFailureReturnValue,
Arg1Type  aArg1Value,
Arg2Type  aArg2Value,
nsIEventTarget *  aThread 
)
inlinestatic

Asynchronously, invoke the method specified by aMethod of the object specified by aObject on the main thread. Invoke the method with the arguments specified by aArg1Value and aArg2Value. 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
aObjectObject for which to invoke method.
aMethodMethod to invoke.
aFailureReturnValueValue to return on failure.
aArg1ValueValue of first method argument.
aArg2ValueValue of second method argument.
aThreadThread to run on.

Definition at line 655 of file sbThreadUtils.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class ClassType , typename ReturnType , typename Arg1Type , typename Arg2Type >
static nsresult sbRunnableMethod2< ClassType, ReturnType, Arg1Type, Arg2Type >::New ( SelfType **  aRunnable,
ClassType *  aObject,
MethodType  aMethod,
ReturnType  aFailureReturnValue,
Arg1Type  aArg1Value,
Arg2Type  aArg2Value 
)
inlinestatic

Create and initialize a Songbird runnable method for the object specified by aObject. Call the object method specified by aMethod with the arguments specified by aArg1Value and aArg2Value. Use the value specified by aFailureReturnValue as the failure return value. Return the new Songbird runnable method in aRunnable.

Parameters
aRunnableReturned created Songbird runnable method.
aObjectObject for which to create a Songbird runnable method.
aMethodMethod to be invoked.
aFailureReturnValueValue to which to set runnable method return value on internal failures.
aArg1ValueValue of first method argument.
aArg2ValueValue of second method argument.

Definition at line 483 of file sbThreadUtils.h.

Here is the caller graph for this function:

template<class ClassType , typename ReturnType , typename Arg1Type , typename Arg2Type >
NS_IMETHOD sbRunnableMethod2< ClassType, ReturnType, Arg1Type, Arg2Type >::Run ( )
inline

nsIRunnable run method. Invoke the Songbird runnable method.

Definition at line 447 of file sbThreadUtils.h.

Member Data Documentation

template<class ClassType , typename ReturnType , typename Arg1Type , typename Arg2Type >
Arg2Type sbRunnableMethod2< ClassType, ReturnType, Arg1Type, Arg2Type >::mArg2Value
protected

Definition at line 730 of file sbThreadUtils.h.

template<class ClassType , typename ReturnType , typename Arg1Type , typename Arg2Type >
MethodType sbRunnableMethod2< ClassType, ReturnType, Arg1Type, Arg2Type >::mMethod
protected

Definition at line 729 of file sbThreadUtils.h.


The documentation for this class was generated from the following file: