|
||
class CAsyncOneShot : public CActive;
An active object that performs processing that is only performed once.
The active object is intended to be given a low priority, so that it runs only when no higher-priority active objects are ready to run. In addition, the class ensures that the current thread cannot be closed until the active object is destroyed.
The class needs to be derived from to make use of its behaviour, in particular, it needs to define and implement a CActive::RunL()
function.
NB: the constructor creates a process-relative handle to the current thread and this is stored within this object. If the thread subsequently dies abnormally, then this handle will not be closed, and the thread will not be destroyed until the process terminates.
NB: if CAsyncOneShot::Call()
is called from a different thread (for example, to implement a kind of inter-thread communication), a client-specific mechanism
must be used to ensure that the thread that created this object is still alive.
NB: if the thread that created this object has its own heap and terminates abnormally, then the handle stored within this object is lost.
CBase
-
Base class for all classes to be instantiated on the heap.
CActive
-
The core class of the active object abstraction.
CAsyncOneShot
-
An active object that performs processing that is only performed once.
Defined in CAsyncOneShot
:
CAsyncOneShot(TInt)
Constructor taking a priority value.Call()
Queues this active object to be run once.DoCancel()
Implements cancellation of an outstanding request.Thread()
Gets a handle to the current thread.~CAsyncOneShot()
Frees resources prior to destruction.Inherited from CActive
:
CActive(TInt)
Constructs the active object with the specified priority.Cancel()
Cancels the wait for completion of an outstanding request.Deque()
Removes the active object from the active scheduler's list of active objects.EPriorityHigh
A priority higher than EPriorityUserInput.EPriorityIdle
A low priority, useful for active objects representing background processing.EPriorityLow
A priority higher than EPriorityIdle but lower than EPriorityStandard.EPriorityStandard
Most active objects will have this priority.EPriorityUserInput
A priority higher than EPriorityStandard; useful for active objects handling use...Extension_(TUint,TAny *&,TAny *)
Extension function IsActive()const
Determines whether the active object has a request outstanding.IsAdded()const
Determines whether the active object has been added to the active scheduler's li...Priority()const
Gets the priority of the active object.RunError(TInt)
Handles a leave occurring in the request completion event handler CActive::RunL(...RunL()
Handles an active object's request completion event.SetActive()
Indicates that the active object has issued a request and that it is now outstan...SetPriority(TInt)
Sets the priority of the active object.TPriority
Defines standard priorities for active objects. iStatus
The request status associated with an asynchronous request.Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...CActive::RunL()
Handles an active object's request completion event.CAsyncOneShot::Call()
Queues this active object to be run once.IMPORT_C CAsyncOneShot(TInt aPriority);
Constructor taking a priority value.
Specifically, the constructor:
1. sets this active object's priority value
2. opens a handle to the current thread to ensure that the thread cannot be closed until this CAsyncOneShot object is destroyed
3. adds this active object to the current active scheduler.
|
|
IMPORT_C virtual ~CAsyncOneShot();
Frees resources prior to destruction.
Specifically, it closes the handle to the current thread.
CActive::~CActive()
Frees resources prior to destruction.IMPORT_C virtual void DoCancel();
Implements cancellation of an outstanding request.
The class provides an empty implementation.
This is called by the destructor.
IMPORT_C virtual void Call();
Queues this active object to be run once.
|
inline RThread& Thread();
Gets a handle to the current thread.
|