sbRunnableMethod2_< ResultType, TargetType, Param1Type, Param2Type, Arg1Type, Arg2Type, MethodType > Class Template Reference

#include <sbThreadUtils.h>

Inheritance diagram for sbRunnableMethod2_< ResultType, TargetType, Param1Type, Param2Type, Arg1Type, Arg2Type, MethodType >:
[legend]
Collaboration diagram for sbRunnableMethod2_< ResultType, TargetType, Param1Type, Param2Type, Arg1Type, Arg2Type, MethodType >:
[legend]

Public Types

typedef sbRunnableMethod_
< ResultType, TargetType,
MethodType > 
BaseType
 

Public Member Functions

 sbRunnableMethod2_ (TargetType &aTarget, MethodType aMethod, Param1Type aArg1, Param2Type aArg2, const char *aName=NULL)
 
- Public Member Functions inherited from sbRunnableMethod_< ResultType, TargetType, MethodType >
 sbRunnableMethod_ (TargetType &aTarget, MethodType aMethod, const char *aName)
 
- Public Member Functions inherited from sbRunnable_< ResultType >
 sbRunnable_ (const char *aName)
 
NS_IMETHOD Run ()
 
ResultType Wait ()
 
PRBool Wait (PRIntervalTime aTimeout, ResultType &aResult)
 
- Public Member Functions inherited from sbRunnable
 sbRunnable (const char *aName)
 
NS_IMETHOD Run ()
 
PRBool Wait (PRIntervalTime aTimeout)
 

Protected Member Functions

virtual ResultType OnRun ()
 

Additional Inherited Members

- Protected Attributes inherited from sbRunnableMethod_< ResultType, TargetType, MethodType >
nsRefPtr< TargetType > mTarget
 
MethodType mMethod
 

Detailed Description

template<typename ResultType, typename TargetType, typename Param1Type, typename Param2Type, typename Arg1Type = Param1Type, typename Arg2Type = Param2Type, typename MethodType = ResultType (TargetType::*) (Param1Type, Param2Type)>
class sbRunnableMethod2_< ResultType, TargetType, Param1Type, Param2Type, Arg1Type, Arg2Type, MethodType >

A subclass template of sbRunnableMethod_<> for methods that take two arguments. Use the optional Arg*Types to specify the types used to curry arguments if any should differ from the corresponding Param*Type.

For example, if Param2Type is nsISupports *, Arg2Type can be set to nsRefPtr<nsISupports> to ensure that the runnable retains a reference to the argument for the life of the runnable.

Definition at line 976 of file sbThreadUtils.h.

Member Typedef Documentation

template<typename ResultType , typename TargetType , typename Param1Type , typename Param2Type , typename Arg1Type = Param1Type, typename Arg2Type = Param2Type, typename MethodType = ResultType (TargetType::*) (Param1Type, Param2Type)>
typedef sbRunnableMethod_<ResultType, TargetType, MethodType> sbRunnableMethod2_< ResultType, TargetType, Param1Type, Param2Type, Arg1Type, Arg2Type, MethodType >::BaseType

Definition at line 980 of file sbThreadUtils.h.

Constructor & Destructor Documentation

template<typename ResultType , typename TargetType , typename Param1Type , typename Param2Type , typename Arg1Type = Param1Type, typename Arg2Type = Param2Type, typename MethodType = ResultType (TargetType::*) (Param1Type, Param2Type)>
sbRunnableMethod2_< ResultType, TargetType, Param1Type, Param2Type, Arg1Type, Arg2Type, MethodType >::sbRunnableMethod2_ ( TargetType &  aTarget,
MethodType  aMethod,
Param1Type  aArg1,
Param2Type  aArg2,
const char *  aName = NULL 
)
inline

Capture the object and method to call and the arguments to pass

Definition at line 986 of file sbThreadUtils.h.

Member Function Documentation

template<typename ResultType , typename TargetType , typename Param1Type , typename Param2Type , typename Arg1Type = Param1Type, typename Arg2Type = Param2Type, typename MethodType = ResultType (TargetType::*) (Param1Type, Param2Type)>
virtual ResultType sbRunnableMethod2_< ResultType, TargetType, Param1Type, Param2Type, Arg1Type, Arg2Type, MethodType >::OnRun ( )
inlineprotectedvirtual

Invokes the captured method on the captured object with the captured arguments and returns its result. A subclass that overrides this function should eventually delegate to it.

Implements sbRunnableMethod_< ResultType, TargetType, MethodType >.

Definition at line 1004 of file sbThreadUtils.h.


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