sbRunnableMethod1_< ResultType, TargetType, Param1Type, Arg1Type, MethodType > Class Template Reference

#include <sbThreadUtils.h>

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

Public Types

typedef sbRunnableMethod_
< ResultType, TargetType,
MethodType > 
BaseType
 

Public Member Functions

 sbRunnableMethod1_ (TargetType &aTarget, MethodType aMethod, Param1Type aArg1, 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 Arg1Type = Param1Type, typename MethodType = ResultType (TargetType::*) (Param1Type)>
class sbRunnableMethod1_< ResultType, TargetType, Param1Type, Arg1Type, MethodType >

A subclass template of sbRunnableMethod_<> for methods that take one argument. Use the optional Arg1Type to specify the type used to curry the argument if it should differ from Param1Type.

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

Definition at line 921 of file sbThreadUtils.h.

Member Typedef Documentation

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

Definition at line 925 of file sbThreadUtils.h.

Constructor & Destructor Documentation

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

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

Definition at line 931 of file sbThreadUtils.h.

Member Function Documentation

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

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

Implements sbRunnableMethod_< ResultType, TargetType, MethodType >.

Definition at line 947 of file sbThreadUtils.h.


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