summaryrefslogtreecommitdiff
path: root/docs/tutorials/Chap_7/ex01.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/tutorials/Chap_7/ex01.html')
-rw-r--r--docs/tutorials/Chap_7/ex01.html91
1 files changed, 0 insertions, 91 deletions
diff --git a/docs/tutorials/Chap_7/ex01.html b/docs/tutorials/Chap_7/ex01.html
deleted file mode 100644
index 988c876bf39..00000000000
--- a/docs/tutorials/Chap_7/ex01.html
+++ /dev/null
@@ -1,91 +0,0 @@
-<HTML>
-<!-- $Id$ -->
-<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 1</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 Message Queue"</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="#CC0000">//Example 1</FONT>
-<BR><FONT COLOR="#000099">#include</FONT> "<FONT COLOR="#006600">ace/Message_Queue.h"</FONT>
-<BR><FONT COLOR="#000099">#include</FONT> <FONT COLOR="#006600">"ace/Get_Opt.h"</FONT>
-<BR><FONT COLOR="#000099">#define</FONT> <FONT COLOR="#663366">SIZE_BLOCK
-1</FONT>
-<BR><FONT COLOR="#000099">#define</FONT> <FONT COLOR="#663366">NO_MSGS
-10</FONT>
-
-<P>class QTest{
-<BR>public:
-<BR>QTest():no_msgs_(NO_MSGS){
-<BR>&nbsp;<FONT COLOR="#FF0000">//First create a message queue of default
-size.</FONT>
-<BR>&nbsp;if(!(this->mq_=new ACE_Message_Queue&lt;ACE_NULL_SYNCH> ()))
-<BR>&nbsp; ACE_DEBUG((LM_ERROR,"Error in message queue initialization \n"));
-<BR>&nbsp;}
-<BR>&nbsp;
-<BR>int start_test(){
-<BR>&nbsp; for(int i=0; i&lt;no_msgs_;i++){
-<BR>&nbsp;<FONT COLOR="#FF0000">//create a new message block of size 1</FONT>
-<BR>&nbsp;ACE_Message_Block *mb= new ACE_Message_Block(SIZE_BLOCK);<FONT COLOR="#FF0000"></FONT>
-
-<P><FONT COLOR="#FF0000">&nbsp;//Insert data into the message block using
-the rd_ptr</FONT>
-<BR>&nbsp;*mb->wr_ptr()=i;
-
-<P><FONT COLOR="#FF0000">&nbsp;//Be careful to advance the wr_ptr</FONT>
-<BR>&nbsp;mb->wr_ptr(1);
-
-<P>&nbsp;<FONT COLOR="#FF0000">//Enqueue the message block onto the message
-queue</FONT>
-<BR>&nbsp;if(this->mq_->enqueue_prio(mb)==-1){
-<BR>&nbsp; ACE_DEBUG((LM_ERROR,"\nCould not enqueue on to mq!!\n"));
-<BR>&nbsp; return -1;
-<BR>&nbsp; }
-<BR>&nbsp;
-<BR>&nbsp;ACE_DEBUG((LM_INFO,"EQd data: %d\n",*mb->rd_ptr()));
-<BR>&nbsp;&nbsp; } <FONT COLOR="#FF0000">//end for</FONT>
-
-<P><FONT COLOR="#FF0000">//Now dequeue all the messages</FONT>
-<BR>this->dequeue_all();
-<BR>return 0;
-<BR>&nbsp;}
-
-<P>void dequeue_all(){
-<BR>&nbsp;ACE_DEBUG((LM_INFO,"\n\nBeginning DQ \n"));
-<BR>&nbsp;ACE_DEBUG((LM_INFO,"No. of Messages on Q:%d Bytes on Q:%d \n",mq_->message_count(),
-mq_->message_bytes()));
-<BR>&nbsp;ACE_Message_Block *mb;
-
-<P>&nbsp;<FONT COLOR="#FF0000">//dequeue the head of the message queue
-until no more messages are left</FONT>
-<BR>&nbsp;for(int i=0;i&lt;no_msgs_;i++){
-<BR>&nbsp; mq_->dequeue_head(mb);
-<BR>&nbsp; ACE_DEBUG((LM_INFO,"DQd data %d\n",*mb->rd_ptr()));
-<BR>&nbsp; }
-<BR>&nbsp;}
-<BR>private:
-<BR>&nbsp;ACE_Message_Queue&lt;ACE_NULL_SYNCH> *mq_;
-<BR>&nbsp;int no_msgs_;
-<BR>};
-<BR>&nbsp;
-
-<P>int main(int argc, char* argv[]){
-<BR>&nbsp;QTest test;
-<BR>&nbsp;if(test.start_test()&lt;0)
-<BR>&nbsp; ACE_DEBUG((LM_ERROR,"Program failure \n"));
-<BR>}
-
-<P>&nbsp;<A HREF="ex02.html">Next Example</A>
-</BODY>
-</HTML>