Main Page Modules Class Hierarchy Data Structures File List Data Fields Globals Related Pages

# OsclTimerObject Class Reference
[OSCL Proc]

`#include <oscl_scheduler_ao.h>`

Inheritance diagram for OsclTimerObject:

## Public Methods
OSCL_IMPORT_REF | OsclTimerObject (int32 aPriority, const char name[])
virtual OSCL_IMPORT_REF | ~OsclTimerObject ()
OSCL_IMPORT_REF void | AddToScheduler ()
OSCL_IMPORT_REF void | RemoveFromScheduler ()
OSCL_IMPORT_REF void | After (int32 aDelayMicrosec)
OSCL_IMPORT_REF void | RunIfNotReady (uint32 aDelayMicrosec=0)
OSCL_IMPORT_REF void | SetBusy ()
OSCL_IMPORT_REF bool | IsBusy () const
OSCL_IMPORT_REF void | Cancel ()
OSCL_IMPORT_REF int32 | Priority () const
OSCL_IMPORT_REF int32 | Status () const
OSCL_IMPORT_REF void | SetStatus (int32)
OSCL_IMPORT_REF OsclAOStatus & | StatusRef ()
## Protected Methods
virtual OSCL_IMPORT_REF void | DoCancel ()
virtual OSCL_IMPORT_REF int32 | RunError (int32 aError)

## Detailed Description

User base class for execution objects. OsclTimerObject defines an exec object with a timer.

## Constructor & Destructor Documentation

OSCL_IMPORT_REF OsclTimerObject::OsclTimerObject | ( | int32 | aPriority,
|  | const char | name[]
| ) |

  | Constructor. Parameters:
  aPriority | (input param): scheduling priority
  name | (input param): optional name for this AO.

virtual OSCL_IMPORT_REF OsclTimerObject::~OsclTimerObject | ( |  | ) | `[virtual]`

| Destructor.

## Member Function Documentation

OSCL_IMPORT_REF void OsclTimerObject::AddToScheduler | ( |  | ) |

| Add this AO to the current thread's scheduler. Reimplemented from PVActiveBase.

OSCL_IMPORT_REF void OsclTimerObject::After | ( | int32 | aDelayMicrosec | ) |

  | 'After' sets the request ready, with request status OSCL_REQUEST_STATUS_PENDING, and starts a timer. When the timer expires, the request will complete with status OSCL_REQUEST_ERR_NONE. Must be called from the same thread in which the active object is scheduled. Will leave if the request is already readied, the object is not added to any scheduler, or the calling thread does not match the scheduling thread. Parameters:
  anInterval: | timeout interval in microseconds.

OSCL_IMPORT_REF void OsclTimerObject::Cancel | ( |  | ) |

| Cancel any active request. If the request is pending, this will call the DoCancel routine, wait for the request to cancel, then set the request idle. The AO will not run. If the request is not active, it does nothing. Request must be canceled from the same thread in which it is scheduled. Reimplemented from PVActiveBase.

virtual OSCL_IMPORT_REF void OsclTimerObject::DoCancel | ( |  | ) | `[protected, virtual]`

| Cancel request handler. This gets called by scheduler when the request is cancelled. The default routine will cancel the timer. If any additional action is needed, the derived class may override this. If the derived class does override this, it should explicitly call OsclTimerObject::DoCancel in its own DoCancel routine. Implements PVActiveBase.

OSCL_IMPORT_REF bool OsclTimerObject::IsBusy | ( |  | ) |

| Return true if this AO is active, false otherwise.

OSCL_IMPORT_REF int32 OsclTimerObject::Priority | ( |  | ) |

| Return scheduling priority of this exec object.

OSCL_IMPORT_REF void OsclTimerObject::RemoveFromScheduler | ( |  | ) |

| Remove this AO from its scheduler. Will leave if the calling thread context does not match the scheduling thread. Cancels any pending request before removing. Reimplemented from PVActiveBase.

virtual OSCL_IMPORT_REF int32 OsclTimerObject::RunError | ( | int32 | aError | ) | `[protected, virtual]`

  | Run Leave handler. This gets called by scheduler when the Run routine leaves. The default implementation simply returns the leave code. If the derived class wants to handle errors from Run, it may override this. The ExecError should return OsclErrNone if it handles the error, otherwise it should return the input error code. Parameters:
  aError: | the leave code generated by the Run.
Implements PVActiveBase.

OSCL_IMPORT_REF void OsclTimerObject::RunIfNotReady | ( | uint32 | aDelayMicrosec = 0 | ) |

  | Complete the request after a time interval. RunIfNotReady is identical to After() except that it first checks the request status, and if it is already readied, it does nothing. Parameters:
  aDelayMicrosec | (input param): delay in microseconds.

OSCL_IMPORT_REF void OsclTimerObject::SetBusy | ( |  | ) |

| Set request ready for this AO. Will leave if the request is already readied, or the exec object is not added to any scheduler, or the calling thread context does not match the scheduler thread.

OSCL_IMPORT_REF void OsclTimerObject::SetStatus | ( | int32 |  | ) |

OSCL_IMPORT_REF int32 OsclTimerObject::Status | ( |  | ) |

| Request status access

OSCL_IMPORT_REF OsclAOStatus& OsclTimerObject::StatusRef | ( |  | ) |

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

- oscl_scheduler_ao.h