summaryrefslogtreecommitdiff
path: root/docs/tutorials/Chap_5/ex03.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/tutorials/Chap_5/ex03.html')
-rw-r--r--docs/tutorials/Chap_5/ex03.html86
1 files changed, 0 insertions, 86 deletions
diff --git a/docs/tutorials/Chap_5/ex03.html b/docs/tutorials/Chap_5/ex03.html
deleted file mode 100644
index 07dabd17a97..00000000000
--- a/docs/tutorials/Chap_5/ex03.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="Author" CONTENT="Ambreen Ilyas">
- <META NAME="GENERATOR" CONTENT="Mozilla/4.05 [en] (X11; I; SunOS 5.5.1 sun4u) [Netscape]">
- <TITLE>Example 3</TITLE>
-</HEAD>
-<BODY>
-<FONT COLOR="#CC0000">/////////////////////////////////////////////////////////////////////////////////////////////////////////////////</FONT>
-<BR><FONT COLOR="#CC0000">//// This example is from the ACE Programmers
-Guide.</FONT>
-<BR><FONT COLOR="#CC0000">////&nbsp; Chapter:&nbsp; "The Reactor" (Event
-Management)</FONT>
-<BR><FONT COLOR="#CC0000">//// For details please see the guide at</FONT>
-<BR><FONT COLOR="#CC0000">//// http://www.cs.wustl.edu/~schmidt/ACE.html</FONT>
-<BR><FONT COLOR="#CC0000">////&nbsp; AUTHOR: Umar Syyid (usyyid@hns.com)</FONT>
-<BR><FONT COLOR="#CC0000">//// and Ambreen Ilyas (ambreen@bitsmart.com)</FONT>
-<BR><FONT COLOR="#CC0000">/////////////////////////////////////////////////////////////////////////////////////////////////////////////</FONT>
-
-<P><FONT COLOR="#FF0000">//Example 3</FONT>
-<BR><FONT COLOR="#000099">#include</FONT> "<FONT COLOR="#006600">ace/Timer_Queue.h"</FONT>
-<BR><FONT COLOR="#000099">#include</FONT> "<FONT COLOR="#006600">ace/Reactor.h"</FONT>
-<BR><FONT COLOR="#000099">#define</FONT> <FONT COLOR="#663366">NUMBER_TIMERS
-10</FONT>
-
-<P>static int done = 0;
-<BR>static int count = 0;
-
-<P>class Time_Handler : public ACE_Event_Handler
-<BR>{
-<BR>public:
-<BR>&nbsp;<FONT COLOR="#FF0000">//Method which is called back by the Reactor
-when timeout occurs.</FONT>
-<BR>&nbsp;virtual int handle_timeout (const ACE_Time_Value &amp;tv,
-<BR>&nbsp;const void *arg){
-<BR>&nbsp; long current_count = long (arg);
-<BR>&nbsp; ACE_ASSERT (current_count == count);
-<BR>&nbsp; ACE_DEBUG ((LM_DEBUG, "%d: Timer #%d timed out at %d!\n",
-<BR>&nbsp;&nbsp;&nbsp;&nbsp; count, current_count, tv.sec()));
-<BR>&nbsp;
-
-<P><FONT COLOR="#FF0000">//Increment count</FONT>
-<BR>&nbsp; count ++;
-
-<P><FONT COLOR="#FF0000">//Make sure assertion doesnt fail for missing
-5th timer.</FONT>
-<BR>&nbsp; if (count ==5)
-<BR>&nbsp;&nbsp; count++;
-<BR>&nbsp;
-<BR><FONT COLOR="#FF0000">&nbsp; //If all timers done then set done flag</FONT>
-<BR>&nbsp; if (current_count == NUMBER_TIMERS - 1)
-<BR>&nbsp;&nbsp; done = 1;
-<BR><FONT COLOR="#FF0000">&nbsp; //Keep yourself registered with the Reactor.</FONT>
-<BR>&nbsp; return 0;
-<BR>&nbsp; }
-<BR>};
-
-<P>int
-<BR>main (int, char *[])
-<BR>{
-<BR>&nbsp;ACE_Reactor reactor;
-<BR>&nbsp;Time_Handler *th=new Time_Handler;
-<BR>&nbsp;int timer_id[NUMBER_TIMERS];
-<BR>&nbsp;int i;
-
-<P>&nbsp;for (i = 0; i &lt; NUMBER_TIMERS; i++)
-<BR>&nbsp; timer_id[i] = reactor.schedule_timer (th,
-<BR>&nbsp;&nbsp; (const void *) i, <FONT COLOR="#FF0000">// argument sent
-to handle_timeout()</FONT>
-<BR>&nbsp;&nbsp; ACE_Time_Value (2 * i + 1));<FONT COLOR="#FF0000"> //set
-timer to go off with delay</FONT>
-
-<P><FONT COLOR="#CC0000">&nbsp;//Cancel the fifth timer before it goes
-off</FONT>
-<BR>&nbsp;reactor.cancel_timer(timer_id[5]);<FONT COLOR="#FF0000">//Timer
-ID of timer to be removed</FONT>
-
-<P>&nbsp;while (!done)
-<BR>&nbsp; reactor.handle_events ();
-
-<P>&nbsp;return 0;
-<BR>}
-
-<P>&nbsp;<A HREF="ex04.html">Next Example</A>
-</BODY>
-</HTML>