diff options
author | dhinton <dhinton@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-11-09 20:44:19 +0000 |
---|---|---|
committer | dhinton <dhinton@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-11-09 20:44:19 +0000 |
commit | cfac95fcac5f725b75b5cf8edc48e20b2fae35c9 (patch) | |
tree | 53fb73b05a2e5709529d22fd62b895c957a3a295 /docs | |
parent | bd4585e3fa206d46fb83d4c6738135b43d9804d8 (diff) | |
download | ATCD-cfac95fcac5f725b75b5cf8edc48e20b2fae35c9.tar.gz |
ChangeLogTag:Sun Nov 9 20:53:07 UTC 2003 Don Hinton <dhinton@dresystems.com>
Diffstat (limited to 'docs')
48 files changed, 115 insertions, 52 deletions
diff --git a/docs/tutorials/002/server.cpp b/docs/tutorials/002/server.cpp index cfef3aa1a59..fcb35cf7842 100644 --- a/docs/tutorials/002/server.cpp +++ b/docs/tutorials/002/server.cpp @@ -5,6 +5,7 @@ #include "ace/Acceptor.h" #include "ace/SOCK_Acceptor.h" #include "ace/Reactor.h" +#include "ace/Signal.h" #include "handler.h" /* We'll still use the global reactor pointer. There's a snappy way diff --git a/docs/tutorials/003/client.cpp b/docs/tutorials/003/client.cpp index fdfa51e1752..d9a8ef6942d 100644 --- a/docs/tutorials/003/client.cpp +++ b/docs/tutorials/003/client.cpp @@ -4,6 +4,8 @@ ACE_SOCK_Connector. */ #include "ace/Log_Msg.h" #include "ace/SOCK_Connector.h" +#include "ace/OS_NS_string.h" +#include "ace/OS_NS_stdio.h" /* Unlike the previous two tutorials, we're going to allow the user to provide command line options this time. Still, we need defaults in diff --git a/docs/tutorials/004/client.cpp b/docs/tutorials/004/client.cpp index 54bcbc04fa0..b42425f2502 100644 --- a/docs/tutorials/004/client.cpp +++ b/docs/tutorials/004/client.cpp @@ -5,6 +5,7 @@ #include "ace/Log_Msg.h" #include "ace/SOCK_Connector.h" #include "ace/SString.h" +#include "ace/OS_NS_stdio.h" /* In this tutorial, we extend SOCK_Stream by adding a few wrappers around the send_n() method. */ diff --git a/docs/tutorials/005/server.cpp b/docs/tutorials/005/server.cpp index dee968339d7..70fdbc48a77 100644 --- a/docs/tutorials/005/server.cpp +++ b/docs/tutorials/005/server.cpp @@ -6,6 +6,7 @@ source file. We let it worry about the "real work". */ #include "client_acceptor.h" +#include "ace/Signal.h" /* As before, we create a simple signal handler that will set our finished flag. There are, of course, more elegant ways to handle diff --git a/docs/tutorials/006/server.cpp b/docs/tutorials/006/server.cpp index 6d0d7010228..0abe222707c 100644 --- a/docs/tutorials/006/server.cpp +++ b/docs/tutorials/006/server.cpp @@ -6,6 +6,7 @@ source file. We let it worry about the "real work". */ #include "client_acceptor.h" +#include "ace/Signal.h" /* As before, we create a simple signal handler that will set our finished flag. There are, of course, more elegant ways to handle diff --git a/docs/tutorials/007/server.cpp b/docs/tutorials/007/server.cpp index 4e61be6f23a..0336ab41da7 100644 --- a/docs/tutorials/007/server.cpp +++ b/docs/tutorials/007/server.cpp @@ -6,6 +6,7 @@ source file. We let it worry about the "real work". */ #include "client_acceptor.h" +#include "ace/Signal.h" /* As before, we create a simple signal handler that will set our finished flag. There are, of course, more elegant ways to handle diff --git a/docs/tutorials/007/thread_pool.h b/docs/tutorials/007/thread_pool.h index b83742511ac..bd0d32a9f29 100644 --- a/docs/tutorials/007/thread_pool.h +++ b/docs/tutorials/007/thread_pool.h @@ -8,6 +8,7 @@ such a thing. */ #include "ace/Task.h" #include "ace/Atomic_Op.h" +#include "ace/Mutex.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/docs/tutorials/008/broadcast_client.cpp b/docs/tutorials/008/broadcast_client.cpp index 3176de032a2..2e191f912f4 100644 --- a/docs/tutorials/008/broadcast_client.cpp +++ b/docs/tutorials/008/broadcast_client.cpp @@ -3,6 +3,7 @@ #include "ace/Log_Msg.h" #include "ace/SOCK_Dgram_Bcast.h" #include "ace/INET_Addr.h" +#include "ace/OS_NS_string.h" static const u_short PORT = ACE_DEFAULT_SERVER_PORT; diff --git a/docs/tutorials/008/directed_client.cpp b/docs/tutorials/008/directed_client.cpp index d7c02f69dd3..4f0d94e19ba 100644 --- a/docs/tutorials/008/directed_client.cpp +++ b/docs/tutorials/008/directed_client.cpp @@ -3,6 +3,7 @@ #include "ace/Log_Msg.h" #include "ace/SOCK_Dgram.h" #include "ace/INET_Addr.h" +#include "ace/OS_NS_string.h" /* Once again, we use the default server port. In a "real" system, the server's port (or ports) would be published in some way so that diff --git a/docs/tutorials/008/server.cpp b/docs/tutorials/008/server.cpp index 7cacb040822..70902fadda6 100644 --- a/docs/tutorials/008/server.cpp +++ b/docs/tutorials/008/server.cpp @@ -5,6 +5,7 @@ #include "ace/Log_Msg.h" #include "ace/SOCK_Dgram.h" #include "ace/INET_Addr.h" +#include "ace/OS_NS_string.h" /* Use the typical TCP/IP port address for receiving datagrams. */ static const u_short PORT = ACE_DEFAULT_SERVER_PORT; diff --git a/docs/tutorials/009/broadcast_client.cpp b/docs/tutorials/009/broadcast_client.cpp index 7eb282f6f73..9594f9eb777 100644 --- a/docs/tutorials/009/broadcast_client.cpp +++ b/docs/tutorials/009/broadcast_client.cpp @@ -3,6 +3,8 @@ #include "ace/Log_Msg.h" #include "ace/SOCK_Dgram_Bcast.h" #include "ace/INET_Addr.h" +#include "ace/OS_NS_string.h" +#include "ace/Time_Value.h" static const u_short PORT = ACE_DEFAULT_SERVER_PORT; diff --git a/docs/tutorials/009/directed_client.cpp b/docs/tutorials/009/directed_client.cpp index 7ec65ee23ff..ebb2b35312d 100644 --- a/docs/tutorials/009/directed_client.cpp +++ b/docs/tutorials/009/directed_client.cpp @@ -3,6 +3,8 @@ #include "ace/Log_Msg.h" #include "ace/SOCK_Dgram.h" #include "ace/INET_Addr.h" +#include "ace/OS_NS_string.h" +#include "ace/Time_Value.h" static const u_short PORT = ACE_DEFAULT_SERVER_PORT; diff --git a/docs/tutorials/009/server.cpp b/docs/tutorials/009/server.cpp index ee6dc1be311..76bce118399 100644 --- a/docs/tutorials/009/server.cpp +++ b/docs/tutorials/009/server.cpp @@ -8,6 +8,7 @@ #include "ace/Log_Msg.h" #include "ace/SOCK_Dgram.h" #include "ace/INET_Addr.h" +#include "ace/OS_NS_string.h" static const u_short PORT = ACE_DEFAULT_SERVER_PORT; diff --git a/docs/tutorials/010/message_queue.cpp b/docs/tutorials/010/message_queue.cpp index f16f2606da7..315079bfe66 100644 --- a/docs/tutorials/010/message_queue.cpp +++ b/docs/tutorials/010/message_queue.cpp @@ -5,6 +5,7 @@ don't have memory leaks. */ #include "task.h" #include "block.h" +#include "ace/OS_NS_unistd.h" int run_test (int iterations, diff --git a/docs/tutorials/010/task.cpp b/docs/tutorials/010/task.cpp index 238b1882727..cccb33fa337 100644 --- a/docs/tutorials/010/task.cpp +++ b/docs/tutorials/010/task.cpp @@ -2,6 +2,7 @@ #include "task.h" #include "block.h" +#include "ace/OS_NS_unistd.h" /* Set our housekeeping pointer to NULL and tell the user we exist. */ Task::Task (size_t n_threads) diff --git a/docs/tutorials/010/task.h b/docs/tutorials/010/task.h index 4e0b974a60d..9c7e8dfb235 100644 --- a/docs/tutorials/010/task.h +++ b/docs/tutorials/010/task.h @@ -4,6 +4,7 @@ #define TASK_H #include "ace/Task.h" +#include "ace/Barrier.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/docs/tutorials/011/message_queue.cpp b/docs/tutorials/011/message_queue.cpp index 168a9793f9f..6e644e6ed8f 100644 --- a/docs/tutorials/011/message_queue.cpp +++ b/docs/tutorials/011/message_queue.cpp @@ -5,6 +5,8 @@ #include "task.h" #include "block.h" #include "data.h" +#include "ace/OS_NS_unistd.h" +#include "ace/OS_NS_string.h" static int @@ -38,7 +40,7 @@ run_test (int iterations, /* As before, put a text message into the block. */ ACE_OS::sprintf (message->wr_ptr (), "This is message %d.", i); - message->wr_ptr (strlen (message->rd_ptr ())); + message->wr_ptr (ACE_OS::strlen (message->rd_ptr ())); message->wr_ptr (1); // Move beyond the NULL diff --git a/docs/tutorials/011/task.cpp b/docs/tutorials/011/task.cpp index 76d77caf860..d777d0e32d8 100644 --- a/docs/tutorials/011/task.cpp +++ b/docs/tutorials/011/task.cpp @@ -3,6 +3,7 @@ #include "task.h" #include "block.h" #include "data.h" +#include "ace/OS_NS_unistd.h" Task::Task (size_t n_threads) : barrier_ (n_threads), diff --git a/docs/tutorials/011/task.h b/docs/tutorials/011/task.h index 2350b0be230..cfd920140d5 100644 --- a/docs/tutorials/011/task.h +++ b/docs/tutorials/011/task.h @@ -4,6 +4,7 @@ #define TASK_H #include "ace/Task.h" +#include "ace/Barrier.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/docs/tutorials/012/message_queue.cpp b/docs/tutorials/012/message_queue.cpp index 8410d92ad5f..93138e961df 100644 --- a/docs/tutorials/012/message_queue.cpp +++ b/docs/tutorials/012/message_queue.cpp @@ -4,6 +4,8 @@ #include "block.h" #include "work.h" #include "task.h" +#include "ace/OS_NS_string.h" +#include "ace/OS_NS_unistd.h" /* I want to be sure that our Task object gets destructed correctly, so @@ -47,7 +49,7 @@ int run_test (int iterations, int threads) As before, put a text message into the block. */ ACE_OS::sprintf (message->wr_ptr (), "This is message %d.", i); - message->wr_ptr (strlen (message->rd_ptr ())+1); + message->wr_ptr (ACE_OS::strlen (message->rd_ptr ())+1); /* Add the work to our thread pool diff --git a/docs/tutorials/012/task.cpp b/docs/tutorials/012/task.cpp index 5f7d040237e..4c778c89ad5 100644 --- a/docs/tutorials/012/task.cpp +++ b/docs/tutorials/012/task.cpp @@ -4,6 +4,8 @@ #include "task.h" #include "block.h" #include "work.h" +#include "ace/OS_NS_string.h" +#include "ace/OS_NS_unistd.h" /* Boring default constructor. Be sure our barrier_ is initialized in @@ -109,7 +111,7 @@ int Task::svc (void) */ const char *cp = message_block->rd_ptr (); // Don't forget to skip the NULL we inserted - message_block->rd_ptr (strlen (cp) + 1); + message_block->rd_ptr (ACE_OS::strlen (cp) + 1); /* Get the Unit_Of_Work pointer out of our specialized diff --git a/docs/tutorials/012/task.h b/docs/tutorials/012/task.h index afeed1bbf1d..2f4959afeae 100644 --- a/docs/tutorials/012/task.h +++ b/docs/tutorials/012/task.h @@ -5,6 +5,7 @@ #define TASK_H #include "ace/Task.h" +#include "ace/Barrier.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/docs/tutorials/013/block.h b/docs/tutorials/013/block.h index 91261c3ecd0..9e58b18f6f1 100644 --- a/docs/tutorials/013/block.h +++ b/docs/tutorials/013/block.h @@ -10,9 +10,10 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/Synch.h" #include "mld.h" #include "work.h" +#include "ace/Lock_Adapter_T.h" +#include "ace/Mutex.h" /* In this Tutorial, we derive from ACE_Data_Block for our special data. With diff --git a/docs/tutorials/013/mld.h b/docs/tutorials/013/mld.h index 2f43562bb4b..3fd3995000d 100644 --- a/docs/tutorials/013/mld.h +++ b/docs/tutorials/013/mld.h @@ -4,7 +4,7 @@ #ifndef MLD_H #define MLD_H -#include "ace/Synch.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -12,6 +12,7 @@ #include "ace/Singleton.h" #include "ace/Atomic_Op.h" +#include "ace/Mutex.h" /* This is a cheap memory leak detector. Each class I want to watch over diff --git a/docs/tutorials/013/task.cpp b/docs/tutorials/013/task.cpp index 37af6f8072f..12f9c6bae1e 100644 --- a/docs/tutorials/013/task.cpp +++ b/docs/tutorials/013/task.cpp @@ -4,6 +4,7 @@ #include "task.h" #include "block.h" #include "work.h" +#include "ace/Barrier.h" /* Construct the Task with zero or more subtasks. If subtasks are requested, diff --git a/docs/tutorials/013/task.h b/docs/tutorials/013/task.h index c111333b022..88f3a749cc3 100644 --- a/docs/tutorials/013/task.h +++ b/docs/tutorials/013/task.h @@ -12,6 +12,8 @@ #include "mld.h" +class ACE_Barrier; + /* This is much like the Task we've used in the past for implementing a thread pool. This time, however, I've made the Task an element in a singly-linked diff --git a/docs/tutorials/013/work.h b/docs/tutorials/013/work.h index bdd0835e098..c7670fe709b 100644 --- a/docs/tutorials/013/work.h +++ b/docs/tutorials/013/work.h @@ -10,7 +10,6 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/Synch.h" #include "mld.h" /* diff --git a/docs/tutorials/015/Makefile.client b/docs/tutorials/015/Makefile.client index 440b813cfb3..96fc638d82a 100644 --- a/docs/tutorials/015/Makefile.client +++ b/docs/tutorials/015/Makefile.client @@ -11,7 +11,6 @@ FILES += Protocol_Stream FILES += Protocol_Task FILES += Xmit FILES += Recv -FILES += CompressionSocket FILES += Compressor FILES += CompressorBase FILES += ZlibCompressor @@ -24,6 +23,8 @@ SRC += $(addsuffix .cpp,$(FILES)) HDR = *.h +LDLIBS = -lz + MAKEFILE = Makefile.client DEPEND = .depend.client diff --git a/docs/tutorials/015/Makefile.server b/docs/tutorials/015/Makefile.server index bc44c1d3867..bfcfbf61c42 100644 --- a/docs/tutorials/015/Makefile.server +++ b/docs/tutorials/015/Makefile.server @@ -11,7 +11,6 @@ FILES += Protocol_Stream FILES += Protocol_Task FILES += Xmit FILES += Recv -FILES += CompressionSocket FILES += Compressor FILES += CompressorBase FILES += ZlibCompressor @@ -25,6 +24,8 @@ SRC += $(addsuffix .cpp,$(FILES)) HDR = *.h +LDLIBS = -lz + MAKEFILE = Makefile.server DEPEND = .depend.server diff --git a/docs/tutorials/015/Protocol_Stream.cpp b/docs/tutorials/015/Protocol_Stream.cpp index 6b7fd05c3cc..b5ca9dc9438 100644 --- a/docs/tutorials/015/Protocol_Stream.cpp +++ b/docs/tutorials/015/Protocol_Stream.cpp @@ -9,6 +9,7 @@ #include "Compressor.h" #include "ace/Stream_Modules.h" +#include "ace/OS_NS_string.h" /* You can choose at compile time to include/exclude the protocol pieces. @@ -117,7 +118,7 @@ Protocol_Stream::open (bool isOriginator) neg.algorithmCount = 1; neg.algorithm[0] = acode; - memcpy(message->wr_ptr(), &neg, sizeof(neg)); + ACE_OS::memcpy(message->wr_ptr(), &neg, sizeof(neg)); message->wr_ptr(sizeof(neg)); if (put(message, 0) < 0) @@ -132,7 +133,7 @@ Protocol_Stream::open (bool isOriginator) } CompressionNegotiationReply negResponse; - memcpy(&negResponse, response->rd_ptr(), sizeof(negResponse)); + ACE_OS::memcpy(&negResponse, response->rd_ptr(), sizeof(negResponse)); response->release(); if (negResponse.errorCode != NEGOTIATE_OK) @@ -151,7 +152,7 @@ Protocol_Stream::open (bool isOriginator) } CompressionNegotiation neg; - memcpy(&neg, message->rd_ptr(), sizeof(neg)); + ACE_OS::memcpy(&neg, message->rd_ptr(), sizeof(neg)); message->release(); // Reply to handshake message. @@ -184,7 +185,7 @@ Protocol_Stream::open (bool isOriginator) } ACE_Message_Block* reply = new ACE_Message_Block( 1024 ); - memcpy(reply->wr_ptr(), &negResponse, sizeof(negResponse)); + ACE_OS::memcpy(reply->wr_ptr(), &negResponse, sizeof(negResponse)); reply->wr_ptr(sizeof(neg)); if (put(reply, 0) < 0) diff --git a/docs/tutorials/015/Xmit.cpp b/docs/tutorials/015/Xmit.cpp index 4f2ed4f274f..be8fca28cf6 100644 --- a/docs/tutorials/015/Xmit.cpp +++ b/docs/tutorials/015/Xmit.cpp @@ -3,6 +3,7 @@ #include "Xmit.h" #include "ace/SOCK_Stream.h" +#include "ace/OS_NS_string.h" /* Construct the object with the peer connection and choose not to activate ourselves into a dedicated thread. You might get some @@ -63,7 +64,7 @@ int Xmit::send(ACE_Message_Block *message, ACE_Time_Value *timeout) // Be sure we send the end-of-string NULL so that Recv will // know when to stop assembling the length. - rval = this->peer().send_n( msize, strlen(msize)+1, 0, timeout ); + rval = this->peer().send_n( msize, ACE_OS::strlen(msize)+1, 0, timeout ); if( rval == -1 ) { diff --git a/docs/tutorials/015/ZlibCompressor.cpp b/docs/tutorials/015/ZlibCompressor.cpp index b258f68fc5a..7eb17d59e48 100644 --- a/docs/tutorials/015/ZlibCompressor.cpp +++ b/docs/tutorials/015/ZlibCompressor.cpp @@ -6,6 +6,7 @@ #include "ZlibCompressor.h" #include "ace/SOCK_Stream.h" +#include "ace/OS_NS_string.h" #include <zlib.h> @@ -34,7 +35,7 @@ int ZlibCompressor::send(ACE_Message_Block *message, // Other libraries/algorithms may have their own quirks. int err; - int mlen = strlen(message->rd_ptr())+1; + int mlen = ACE_OS::strlen(message->rd_ptr())+1; zstream_.next_in = (Bytef*)message->rd_ptr(); zstream_.avail_in = (uInt) mlen; zstream_.avail_out = (uInt) 5 * message->size(); diff --git a/docs/tutorials/015/client.cpp b/docs/tutorials/015/client.cpp index af4433d4a23..1c193bedcb1 100644 --- a/docs/tutorials/015/client.cpp +++ b/docs/tutorials/015/client.cpp @@ -5,6 +5,7 @@ communicating with the server */ #include "Client_i.h" +#include "ace/OS_NS_string.h" int main(int argc, char *argv[]) { @@ -36,7 +37,7 @@ int main(int argc, char *argv[]) "we want there to be an opportunity for some compression to occur. " "That's why it has a whofflly style and goes on and on and on.", i); - message->wr_ptr (strlen (message->rd_ptr ())+1); + message->wr_ptr (ACE_OS::strlen (message->rd_ptr ())+1); // client will take ownership of the message block so that // we don't have to remember to release(). We *do* have diff --git a/docs/tutorials/016/Condition_i.h b/docs/tutorials/016/Condition_i.h index 83f32489d20..a265d9ac670 100644 --- a/docs/tutorials/016/Condition_i.h +++ b/docs/tutorials/016/Condition_i.h @@ -3,7 +3,9 @@ #ifndef CONDITION_H #define CONDITION_H -#include "ace/Synch.h" +#include "ace/Thread_Mutex.h" +#include "ace/Condition_Thread_Mutex.h" +#include "ace/Guard_T.h" /** A wrapper for ACE_Condition<>. When you're using an ACE_Condition<> you have to have three things: - Some variable diff --git a/docs/tutorials/016/condition.cpp b/docs/tutorials/016/condition.cpp index 39690ca689b..7af7326f5bf 100644 --- a/docs/tutorials/016/condition.cpp +++ b/docs/tutorials/016/condition.cpp @@ -3,6 +3,7 @@ #include "Condition_i.h" #include "ace/Task.h" +#include "ace/OS_NS_unistd.h" /* In order to test our Condition we'll derive from ACE_Task<> so that we can have several threads accessing the condition variable diff --git a/docs/tutorials/017/Barrier_i.cpp b/docs/tutorials/017/Barrier_i.cpp index 0784205360a..01f25bdf275 100644 --- a/docs/tutorials/017/Barrier_i.cpp +++ b/docs/tutorials/017/Barrier_i.cpp @@ -2,6 +2,7 @@ // $Id$ #include "Barrier_i.h" +#include "ace/Barrier.h" /* Initialize the threads_ count to zero and the barrier_ pointer to a safe value. At the same time, we remember the thread that created diff --git a/docs/tutorials/017/Barrier_i.h b/docs/tutorials/017/Barrier_i.h index cb9c3d4ce0e..00e50fcaa44 100644 --- a/docs/tutorials/017/Barrier_i.h +++ b/docs/tutorials/017/Barrier_i.h @@ -3,8 +3,10 @@ #ifndef BARRIER_H #define BARRIER_H -#include "ace/Synch.h" #include "ace/Atomic_Op.h" +#include "ace/Mutex.h" + +class ACE_Barrier; /* Barrier is a simple wrapper for the ACE_Barrier synchronization class. The ACE_Barrier is already pretty easy to use but I thought diff --git a/docs/tutorials/018/Test_T.h b/docs/tutorials/018/Test_T.h index 82c84c5be9a..09133eda5f1 100644 --- a/docs/tutorials/018/Test_T.h +++ b/docs/tutorials/018/Test_T.h @@ -5,6 +5,8 @@ #include "ace/Task.h" #include "ace/Atomic_Op.h" +#include "ace/Barrier.h" +#include "ace/Mutex.h" /* We'll create a simple ACE_Task derivative for testing a couple of different locking mechanisms. We've hidden the open() method to diff --git a/docs/tutorials/019/client.cpp b/docs/tutorials/019/client.cpp index 55b99b52667..976ffb56aca 100644 --- a/docs/tutorials/019/client.cpp +++ b/docs/tutorials/019/client.cpp @@ -4,6 +4,7 @@ #include "shmem.h" #include "ace/Log_Msg.h" +#include "ace/os_include/os_ctype.h" #if defined(ACE_LACKS_SYSV_SHMEM) int diff --git a/docs/tutorials/019/server.cpp b/docs/tutorials/019/server.cpp index ec65de3bfb5..9311db6193b 100644 --- a/docs/tutorials/019/server.cpp +++ b/docs/tutorials/019/server.cpp @@ -8,6 +8,7 @@ #include "shmem.h" #include "ace/Log_Msg.h" +#include "ace/OS_NS_unistd.h" #if defined (ACE_LACKS_SYSV_SHMEM) int diff --git a/docs/tutorials/019/server2.cpp b/docs/tutorials/019/server2.cpp index dca34b15acd..82bbca08e35 100644 --- a/docs/tutorials/019/server2.cpp +++ b/docs/tutorials/019/server2.cpp @@ -3,6 +3,7 @@ #include "shmem.h" #include "ace/Log_Msg.h" +#include "ace/OS_NS_unistd.h" #if defined (ACE_LACKS_SYSV_SHMEM) int diff --git a/docs/tutorials/019/shmem.cpp b/docs/tutorials/019/shmem.cpp index 2f05aa01160..a23608f871d 100644 --- a/docs/tutorials/019/shmem.cpp +++ b/docs/tutorials/019/shmem.cpp @@ -3,6 +3,8 @@ #include "shmem.h" #include "ace/Log_Msg.h" +#include "ace/OS_NS_stdio.h" +#include "ace/OS_NS_unistd.h" #if ! defined (ACE_LACKS_SYSV_SHMEM) diff --git a/docs/tutorials/020/client.cpp b/docs/tutorials/020/client.cpp index 2ffb34a7404..102855f96b1 100644 --- a/docs/tutorials/020/client.cpp +++ b/docs/tutorials/020/client.cpp @@ -4,6 +4,7 @@ #include "mmap.h" #include "ace/Log_Msg.h" +#include "ace/os_include/os_ctype.h" int main (int, char *[]) { diff --git a/docs/tutorials/020/mmap.cpp b/docs/tutorials/020/mmap.cpp index b99811aa0d4..7bf24a3c42d 100644 --- a/docs/tutorials/020/mmap.cpp +++ b/docs/tutorials/020/mmap.cpp @@ -4,6 +4,8 @@ #include "mmap.h" #include "ace/Log_Msg.h" +#include "ace/OS_NS_stdio.h" +#include "ace/OS_NS_unistd.h" SharedData::SharedData(int _initialize) : available_(0) diff --git a/docs/tutorials/020/server.cpp b/docs/tutorials/020/server.cpp index 549189ae2b1..3dd14916416 100644 --- a/docs/tutorials/020/server.cpp +++ b/docs/tutorials/020/server.cpp @@ -4,6 +4,7 @@ #include "mmap.h" #include "ace/Log_Msg.h" +#include "ace/OS_NS_unistd.h" int main (int, char *[]) diff --git a/docs/tutorials/020/server2.cpp b/docs/tutorials/020/server2.cpp index abbe2f5b68b..5e17ac0d879 100644 --- a/docs/tutorials/020/server2.cpp +++ b/docs/tutorials/020/server2.cpp @@ -4,6 +4,7 @@ #include "mmap.h" #include "ace/Log_Msg.h" +#include "ace/OS_NS_unistd.h" int main (int, char *[]) diff --git a/docs/tutorials/022/Makefile b/docs/tutorials/022/Makefile index c164a653cac..bbfb7604601 100644 --- a/docs/tutorials/022/Makefile +++ b/docs/tutorials/022/Makefile @@ -10,45 +10,50 @@ # itself that will satisfy our application needs. This one was taken from # one of the examples. - # Define the name of the binary we want to create. There has to be - # a CPP file $(BIN).cpp but it doesn't necessarily have to have your - # main() in it. Most of the time, though, it will. +# Define the name of the binary we want to create. There has to be +# a CPP file $(BIN).cpp but it doesn't necessarily have to have your +# main() in it. Most of the time, though, it will. MAKEFILE = Makefile BIN = server LIBNAME = libAcceptor_Server LIB = $(LIBNAME).a SHLIB = $(LIBNAME).$(SOEXT) - # Few applications will have a single source file. We use the FILES - # macro to build up a list of additional files to compile. Notice - # that we leave off the extension just as with BIN + +# Few applications will have a single source file. We use the FILES +# macro to build up a list of additional files to compile. Notice +# that we leave off the extension just as with BIN FILES = FILES += Acceptor_Service client_handler - # Here we use some GNU make extensions to build the SRC macro. Basically, - # we're just adding .cpp to the value of BIN and for each entry of the - # FILES macro. +# Here we use some GNU make extensions to build the SRC macro. Basically, +# we're just adding .cpp to the value of BIN and for each entry of the +# FILES macro. PSRC = $(addsuffix .cpp,$(BIN)) LSRC = $(addsuffix .cpp,$(FILES)) +# Since we use the client_handler from tutorial 005, make sure we +# can find it. +CPPFLAGS += -I../005 + LDLIBS = LIBS += $(ACELIB) - # The BUILD macro is used by the ACE makefiles. Basically, it tells - # the system what to build. I don't really know what VBIN is other - # than it is constructed from the value of BIN. Just go with it... +# The BUILD macro is used by the ACE makefiles. Basically, it tells +# the system what to build. I don't really know what VBIN is other +# than it is constructed from the value of BIN. Just go with it... BUILD = $(VLIB) $(VSHLIB) $(SHLIBA) $(VBIN) #---------------------------------------------------------------------------- # Include macros and targets #---------------------------------------------------------------------------- - # This is where the real power lies! These included makefile components - # are similar to the C++ templates in ACE. That is, they do a tremendous - # amount of work for you and all you have to do is include them. - # As a matter of fact, in our project, I created a single file named - # "app.mk" that includes all of these. Our project makefiles then just - # need to include app.mk to get everything they need. +# This is where the real power lies! These included makefile components +# are similar to the C++ templates in ACE. That is, they do a tremendous +# amount of work for you and all you have to do is include them. +# As a matter of fact, in our project, I created a single file named +# "app.mk" that includes all of these. Our project makefiles then just +# need to include app.mk to get everything they need. include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU include $(ACE_ROOT)/include/makeinclude/macros.GNU @@ -62,10 +67,10 @@ include $(ACE_ROOT)/include/makeinclude/rules.local.GNU # Local targets #---------------------------------------------------------------------------- - # Sometimes I like to reformat my code to make it more readable. This is - # more useful for the comments than anything else. Unfortunately, the - # "indent" program doesn't quite grok C++ so I have to post-process it's - # output just a bit. +# Sometimes I like to reformat my code to make it more readable. This is +# more useful for the comments than anything else. Unfortunately, the +# "indent" program doesn't quite grok C++ so I have to post-process it's +# output just a bit. Indent : # for i in $(SRC) $(HDR) ; do \ indent -npsl -l80 -fca -fc1 -cli0 -cdb < $$i | \ @@ -80,17 +85,17 @@ Indent : # mv $$i~ $$i ;\ done - # One of the targets in the ACE makefiles is "depend". It will invoke - # your compiler in a way that will generate a list of dependencies for - # you. This is a great thing! Unfortunately, it puts all of that mess - # directly into the Makefile. I prefer my Makefile to stay clean and - # uncluttered. The perl script referenced here pulls the dependency - # stuff back out of the Makefile and into a file ".depend" which we then - # include just like the makefile components above. - # - # NOTE: The 'depend' target expects to have GCC available. - # You can do the same thing with other compilers but the ACE - # makefiles and utilities are only wired up to work with GCC. +# One of the targets in the ACE makefiles is "depend". It will invoke +# your compiler in a way that will generate a list of dependencies for +# you. This is a great thing! Unfortunately, it puts all of that mess +# directly into the Makefile. I prefer my Makefile to stay clean and +# uncluttered. The perl script referenced here pulls the dependency +# stuff back out of the Makefile and into a file ".depend" which we then +# include just like the makefile components above. +# +# NOTE: The 'depend' target expects to have GCC available. +# You can do the same thing with other compilers but the ACE +# makefiles and utilities are only wired up to work with GCC. Depend : depend perl ../fix.Makefile @@ -101,5 +106,5 @@ CLEAN : realclean # Dependencies #---------------------------------------------------------------------------- - # Don't put anything below here. Between the "depend" target and fix.Makefile - # it's guaranteed to be lost! +# Don't put anything below here. Between the "depend" target and fix.Makefile +# it's guaranteed to be lost! diff --git a/docs/tutorials/022/server.cpp b/docs/tutorials/022/server.cpp index 5c3bce4601e..b9915be4122 100644 --- a/docs/tutorials/022/server.cpp +++ b/docs/tutorials/022/server.cpp @@ -15,6 +15,8 @@ server, we need to declare our Acceptor_Service */ #include "Acceptor_Service.h" +#include "ace/Signal.h" + extern "C" void handler (int) { ACE_Service_Config::reconfig_occurred (1); |