blob: 55c791d6c292eae8d657bf0d753bbb8b8b66b545 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>OsclTimerObject class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.2.18 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="modules.html">Modules</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Data Structures</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Data Fields</a> &nbsp; <a class="qindex" href="globals.html">Globals</a> &nbsp; </center>
<hr><h1>OsclTimerObject Class Reference<br>
<small>
[<a class="el" href="group__osclproc.html">OSCL Proc</a>]</small>
</h1><code>#include &lt;<a class="el" href="oscl__scheduler__ao_8h-source.html">oscl_scheduler_ao.h</a>&gt;</code>
<p>
<p>Inheritance diagram for OsclTimerObject:
<p><center><img src="classOsclTimerObject.png" usemap="#OsclTimerObject_map" border="0" alt=""></center>
<map name="OsclTimerObject_map">
<area href="classHeapBase.html" alt="HeapBase" shape="rect" coords="181,56,352,80">
<area href="classPVActiveBase.html" alt="PVActiveBase" shape="rect" coords="362,56,533,80">
<area href="class__OsclHeapBase.html" alt="_OsclHeapBase" shape="rect" coords="181,0,352,24">
<area href="classCallbackTimer.html" alt="CallbackTimer< Alloc >" shape="rect" coords="0,168,171,192">
<area href="classOsclDNSMethod.html" alt="OsclDNSMethod" shape="rect" coords="181,168,352,192">
<area href="classOsclSocketMethod.html" alt="OsclSocketMethod" shape="rect" coords="362,168,533,192">
<area href="classOsclSocketServI.html" alt="OsclSocketServI" shape="rect" coords="543,168,714,192">
<area href="classOsclGetHostByNameMethod.html" alt="OsclGetHostByNameMethod" shape="rect" coords="181,224,352,248">
<area href="classOsclAcceptMethod.html" alt="OsclAcceptMethod" shape="rect" coords="543,224,714,248">
<area href="classOsclBindMethod.html" alt="OsclBindMethod" shape="rect" coords="543,280,714,304">
<area href="classOsclConnectMethod.html" alt="OsclConnectMethod" shape="rect" coords="543,336,714,360">
<area href="classOsclListenMethod.html" alt="OsclListenMethod" shape="rect" coords="543,392,714,416">
<area href="classOsclRecvFromMethod.html" alt="OsclRecvFromMethod" shape="rect" coords="543,448,714,472">
<area href="classOsclRecvMethod.html" alt="OsclRecvMethod" shape="rect" coords="543,504,714,528">
<area href="classOsclSendMethod.html" alt="OsclSendMethod" shape="rect" coords="543,560,714,584">
<area href="classOsclSendToMethod.html" alt="OsclSendToMethod" shape="rect" coords="543,616,714,640">
<area href="classOsclShutdownMethod.html" alt="OsclShutdownMethod" shape="rect" coords="543,672,714,696">
</map>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Methods</h2></td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF&nbsp;</td><td valign=bottom><a class="el" href="classOsclTimerObject.html#a0">OsclTimerObject</a> (int32 aPriority, const char name[])</td></tr>
<tr><td nowrap align=right valign=top>virtual OSCL_IMPORT_REF&nbsp;</td><td valign=bottom><a class="el" href="classOsclTimerObject.html#a1">~OsclTimerObject</a> ()</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF void&nbsp;</td><td valign=bottom><a class="el" href="classOsclTimerObject.html#a2">AddToScheduler</a> ()</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF void&nbsp;</td><td valign=bottom><a class="el" href="classOsclTimerObject.html#a3">RemoveFromScheduler</a> ()</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF void&nbsp;</td><td valign=bottom><a class="el" href="classOsclTimerObject.html#a4">After</a> (int32 aDelayMicrosec)</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF void&nbsp;</td><td valign=bottom><a class="el" href="classOsclTimerObject.html#a5">RunIfNotReady</a> (uint32 aDelayMicrosec=0)</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF void&nbsp;</td><td valign=bottom><a class="el" href="classOsclTimerObject.html#a6">SetBusy</a> ()</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF bool&nbsp;</td><td valign=bottom><a class="el" href="classOsclTimerObject.html#a7">IsBusy</a> () const</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF void&nbsp;</td><td valign=bottom><a class="el" href="classOsclTimerObject.html#a8">Cancel</a> ()</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF int32&nbsp;</td><td valign=bottom><a class="el" href="classOsclTimerObject.html#a9">Priority</a> () const</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF int32&nbsp;</td><td valign=bottom><a class="el" href="classOsclTimerObject.html#a10">Status</a> () const</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF void&nbsp;</td><td valign=bottom><a class="el" href="classOsclTimerObject.html#a11">SetStatus</a> (int32)</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF <a class="el" href="classOsclAOStatus.html">OsclAOStatus</a> &amp;&nbsp;</td><td valign=bottom><a class="el" href="classOsclTimerObject.html#a12">StatusRef</a> ()</td></tr>
<tr><td colspan=2><br><h2>Protected Methods</h2></td></tr>
<tr><td nowrap align=right valign=top>virtual OSCL_IMPORT_REF void&nbsp;</td><td valign=bottom><a class="el" href="classOsclTimerObject.html#b0">DoCancel</a> ()</td></tr>
<tr><td nowrap align=right valign=top>virtual OSCL_IMPORT_REF int32&nbsp;</td><td valign=bottom><a class="el" href="classOsclTimerObject.html#b1">RunError</a> (int32 aError)</td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
User base class for execution objects. OsclTimerObject defines an exec object with a timer.
<p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a name="a0" doxytag="OsclTimerObject::OsclTimerObject"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF OsclTimerObject::OsclTimerObject </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">int32&nbsp;</td>
<td class="mdname" nowrap>&nbsp; <em>aPriority</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>const char&nbsp;</td>
<td class="mdname" nowrap>&nbsp; <em>name</em>[]</td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Constructor. <dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>aPriority</em>&nbsp;</td><td>
(input param): scheduling priority </td></tr>
<tr><td valign=top><em>name</em>&nbsp;</td><td>
(input param): optional name for this AO. </td></tr>
</table>
</dl> </td>
</tr>
</table>
<a name="a1" doxytag="OsclTimerObject::~OsclTimerObject"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> virtual OSCL_IMPORT_REF OsclTimerObject::~OsclTimerObject </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Destructor. </td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a name="a2" doxytag="OsclTimerObject::AddToScheduler"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF void OsclTimerObject::AddToScheduler </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Add this AO to the current thread's scheduler.
<p>
Reimplemented from <a class="el" href="classPVActiveBase.html#a6">PVActiveBase</a>. </td>
</tr>
</table>
<a name="a4" doxytag="OsclTimerObject::After"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF void OsclTimerObject::After </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">int32&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; <em>aDelayMicrosec</em> </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
'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. <dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>anInterval:</em>&nbsp;</td><td>
timeout interval in microseconds. </td></tr>
</table>
</dl> </td>
</tr>
</table>
<a name="a8" doxytag="OsclTimerObject::Cancel"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF void OsclTimerObject::Cancel </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
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.
<p>
Reimplemented from <a class="el" href="classPVActiveBase.html#a11">PVActiveBase</a>. </td>
</tr>
</table>
<a name="b0" doxytag="OsclTimerObject::DoCancel"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> virtual OSCL_IMPORT_REF void OsclTimerObject::DoCancel </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap><code> [protected, virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
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 <a class="el" href="classOsclTimerObject.html#b0">OsclTimerObject::DoCancel</a> in its own DoCancel routine.
<p>
Implements <a class="el" href="classPVActiveBase.html#a5">PVActiveBase</a>. </td>
</tr>
</table>
<a name="a7" doxytag="OsclTimerObject::IsBusy"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF bool OsclTimerObject::IsBusy </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Return true if this AO is active, false otherwise. </td>
</tr>
</table>
<a name="a9" doxytag="OsclTimerObject::Priority"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF int32 OsclTimerObject::Priority </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Return scheduling priority of this exec object. </td>
</tr>
</table>
<a name="a3" doxytag="OsclTimerObject::RemoveFromScheduler"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF void OsclTimerObject::RemoveFromScheduler </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
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.
<p>
Reimplemented from <a class="el" href="classPVActiveBase.html#a7">PVActiveBase</a>. </td>
</tr>
</table>
<a name="b1" doxytag="OsclTimerObject::RunError"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> virtual OSCL_IMPORT_REF int32 OsclTimerObject::RunError </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">int32&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; <em>aError</em> </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap><code> [protected, virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
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. <dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>aError:</em>&nbsp;</td><td>
the leave code generated by the Run. </td></tr>
</table>
</dl>
<p>
Implements <a class="el" href="classPVActiveBase.html#a3">PVActiveBase</a>. </td>
</tr>
</table>
<a name="a5" doxytag="OsclTimerObject::RunIfNotReady"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF void OsclTimerObject::RunIfNotReady </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">uint32&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; <em>aDelayMicrosec</em> = 0 </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Complete the request after a time interval. RunIfNotReady is identical to <a class="el" href="classOsclTimerObject.html#a4">After()</a> except that it first checks the request status, and if it is already readied, it does nothing.<dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>aDelayMicrosec</em>&nbsp;</td><td>
(input param): delay in microseconds. </td></tr>
</table>
</dl> </td>
</tr>
</table>
<a name="a6" doxytag="OsclTimerObject::SetBusy"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF void OsclTimerObject::SetBusy </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
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. </td>
</tr>
</table>
<a name="a11" doxytag="OsclTimerObject::SetStatus"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF void OsclTimerObject::SetStatus </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">int32&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
</td>
</tr>
</table>
<a name="a10" doxytag="OsclTimerObject::Status"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF int32 OsclTimerObject::Status </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Request status access </td>
</tr>
</table>
<a name="a12" doxytag="OsclTimerObject::StatusRef"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF <a class="el" href="classOsclAOStatus.html">OsclAOStatus</a>&amp; OsclTimerObject::StatusRef </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
</td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="oscl__scheduler__ao_8h-source.html">oscl_scheduler_ao.h</a></ul>
<hr size="1"><img src="pvlogo_small.jpg"><address style="align: right;"><small>OSCL API</small>
<address style="align: left;"><small>Posting Version: OPENCORE_20090310 </small>
</small></address>
</body>
</html>