summaryrefslogtreecommitdiff
path: root/docs/tutorials/019/page05.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/tutorials/019/page05.html')
-rw-r--r--docs/tutorials/019/page05.html112
1 files changed, 0 insertions, 112 deletions
diff --git a/docs/tutorials/019/page05.html b/docs/tutorials/019/page05.html
deleted file mode 100644
index b04217a9551..00000000000
--- a/docs/tutorials/019/page05.html
+++ /dev/null
@@ -1,112 +0,0 @@
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="Author" CONTENT="James CE Johnson">
- <TITLE>ACE Tutorial 019</TITLE>
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#000FFF" VLINK="#FF0F0F">
-
-<CENTER><B><FONT SIZE=+2>ACE Tutorial 019</FONT></B></CENTER>
-
-<CENTER><B><FONT SIZE=+2>Sharing your Memories</FONT></B></CENTER>
-
-<P>
-<HR WIDTH="100%">
- Here's the mysterious shmem.h. I wanted to show it after the
- placement-new client and server so that the SharedData object
- would have some relevance.
- <HR>
-<HR width=50%><P><center>shmem.h</center><HR width=50%>
-<PRE>
-
-<font color=blue>#ifndef</font> <font color=purple>SHMEM_H</font>
-<font color=blue>#define</font> <font color=purple>SHMEM_H</font>
-
-<font color=red>// This is where you'll find the ACE_Shared_Memory_SV object</font>
-<font color=blue>#include</font> "<font color=green>ace/Shared_Memory_SV.h</font>"
-
-<font color=red>// SHMSZ is just enough for the alphabet and a null terminator</font>
-<font color=blue>#define</font> <font color=purple>SHMSZ</font> 27
-
-<font color=red>// Play with this, pick a value you like that isn't used by something else.</font>
-<font color=blue>#define</font> <font color=purple>SHM_KEY</font> 4200
-
-<font color=red>/*
- This is what we stuff into shared memory via placement new in the
- second client/server pair. Notice that it is a very basic object
- with no virtual methods and only concrete data.
- */</font>
-class SharedData
-{
-public:
- <font color=red>// Construct the object and optionally initialize buf_.</font>
- SharedData(int _initialize = 1);
-
- <font color=red>// Put some data into buf_</font>
- void set(void);
- <font color=red>// Show the data in buf_</font>
- void show(void);
- <font color=red>// What is the value of available_</font>
- int available(void);
- <font color=red>// Set the value of available_</font>
- void available(int _available);
-
-protected:
- <font color=red>// Big enough for a simple message</font>
- char buf_[128];
- <font color=red>// A cheap mutex</font>
- int available_;
-};
-
-<font color=blue>#endif</font> <font color=red>// SHMEM_H</font>
-</PRE>
-<HR width=50%><P><center>shmem.cpp</center><HR width=50%>
-<PRE>
-
-<font color=blue>#include</font> "<font color=green>shmem.h</font>"
-
-<font color=red>/*
- Set the available_ flag to zero & optionally initialize the buf_
- area.
-*/</font>
-<font color=#008888>SharedData::SharedData</font>(int _initialize)
- : available_(0)
-{
- if( _initialize )
- {
- <font color=#008888>ACE_OS::sprintf</font>(buf_,"<font color=green>UNSET\n</font>");
- }
-}
-
-<font color=red>/*
- Write the process ID into the buffer. This will prove to us that
- the data really is shared between the client and server.
-*/</font>
-void <font color=#008888>SharedData::set</font>(void)
-{
- <font color=#008888>ACE_OS::sprintf</font>(buf_,"<font color=green>My PID is (%d)\n</font>",ACE_OS::getpid());
-}
-
-<font color=red>/*
- Display the buffer to the user
-*/</font>
-void <font color=#008888>SharedData::show</font>(void)
-{
- ACE_DEBUG ((LM_INFO, "<font color=green>(%P|%t) Shared Data text is (%s)\n</font>",
- buf_ ));
-}
-
-<font color=red>// Show flag</font>
-int <font color=#008888>SharedData::available</font>(void)
-{
- return available_;
-}
-
-<font color=red>// Set flag</font>
-void <font color=#008888>SharedData::available</font>(int _available)
-{
- available_ = _available;
-}
-</PRE>
-<P><HR WIDTH="100%">
-<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page06.html">Continue This Tutorial</A>]</CENTER>