summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-05-24 02:41:42 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-05-24 02:41:42 +0000
commit08e792a36b19ed67d980546e264aa1f5f0108428 (patch)
treef006f4a111c82b490c235e7e81117991beb7b0c2
parent12cf09d5f4bda020d2726f629f841a7116b98852 (diff)
downloadATCD-08e792a36b19ed67d980546e264aa1f5f0108428.tar.gz
renamed ACE_IOStream and ACE_Streambuf classes, and added ACE_LACKS_ACE_IOSTREAM support
-rw-r--r--examples/IOStream/client/iostream_client.cpp12
-rw-r--r--examples/IOStream/server/iostream_server.cpp19
-rw-r--r--tests/IOStream_Test.cpp18
3 files changed, 36 insertions, 13 deletions
diff --git a/examples/IOStream/client/iostream_client.cpp b/examples/IOStream/client/iostream_client.cpp
index 1d909d17853..f544aa391b3 100644
--- a/examples/IOStream/client/iostream_client.cpp
+++ b/examples/IOStream/client/iostream_client.cpp
@@ -3,10 +3,11 @@
int main (int argc, char *argv[])
{
+#if !defined (ACE_LACKS_ACE_IOSTREAM)
char *server_host = argc > 1 ? argv[1] : ACE_DEFAULT_SERVER_HOST;
u_short server_port = argc > 2 ? ACE_OS::atoi (argv[2]) : ACE_DEFAULT_SERVER_PORT;
- ACE_IOStream<ACE_SOCK_Stream> server;
+ ACE_IOStream_T<ACE_SOCK_Stream> server;
ACE_SOCK_Connector connector;
ACE_INET_Addr addr (server_port, server_host);
@@ -39,11 +40,16 @@ int main (int argc, char *argv[])
if (server.close () == -1)
ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "close"), -1);
+#else
+ ACE_ERROR ((LM_ERROR, "ACE_IOSTREAM not supported on this platform\n"));
+#endif /* !ACE_LACKS_ACE_IOSTREAM */
return 0;
}
+#if !defined (ACE_LACKS_ACE_IOSTREAM)
#if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION)
-template class ACE_IOStream <ACE_SOCK_Stream>;
-template class ACE_Streambuf <ACE_SOCK_Stream>;
+template class ACE_IOStream_T <ACE_SOCK_Stream>;
+template class ACE_Streambuf_T <ACE_SOCK_Stream>;
#endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */
+#endif /* !ACE_LACKS_ACE_IOSTREAM */
diff --git a/examples/IOStream/server/iostream_server.cpp b/examples/IOStream/server/iostream_server.cpp
index 149d5a61eb7..3bd7c6482f3 100644
--- a/examples/IOStream/server/iostream_server.cpp
+++ b/examples/IOStream/server/iostream_server.cpp
@@ -1,5 +1,5 @@
-// This is a simple example of using the ACE_IOStream and
-// ACE_streambuf templates to create an object based on ACE_*_Stream
+// This is a simple example of using the ACE_IOStream_T and
+// ACE_Streambuf_T templates to create an object based on ACE_*_Stream
// classes which mimic a C++ iostream.
#include "ace/Acceptor.h"
@@ -7,11 +7,13 @@
#include "ace/Service_Config.h"
#include "ace/IOStream.h"
+#if !defined (ACE_LACKS_ACE_IOSTREAM)
+
// Declare a new type which will case an ACE_SOCK_Stream to behave
// like an iostream. The new type (ACE_SOCK_IOStream) can be used
// anywhere an ACE_SOCK_Stream is used.
-typedef ACE_IOStream<ACE_SOCK_Stream> ACE_SOCK_IOStream ;
+typedef ACE_IOStream_T<ACE_SOCK_Stream> ACE_SOCK_IOStream ;
// Create a service handler object based on our new
// iostream/SOCK_Stream hybrid.
@@ -101,10 +103,12 @@ public:
// create handler objects for us.
typedef ACE_Acceptor<Handler, ACE_SOCK_ACCEPTOR> Logging_Acceptor;
+#endif /* !ACE_LACKS_ACE_IOSTREAM */
int
main (int argc, char *argv [])
{
+#if !defined (ACE_LACKS_ACE_IOSTREAM)
ACE_Service_Config daemon;
// Create an adapter to end the event loop.
@@ -134,13 +138,18 @@ main (int argc, char *argv [])
ACE_DEBUG ((LM_DEBUG, " (%P|%t) shutting down server daemon\n"));
+#else
+ ACE_ERROR ((LM_ERROR, "ACE_IOSTREAM not supported on this platform\n"));
+#endif /* !ACE_LACKS_ACE_IOSTREAM */
return 0;
}
+#if !defined (ACE_LACKS_ACE_IOSTREAM)
#if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION)
template class ACE_Acceptor <Handler, ACE_SOCK_ACCEPTOR>;
-template class ACE_IOStream <ACE_SOCK_Stream>;
-template class ACE_Streambuf <ACE_SOCK_Stream>;
+template class ACE_IOStream_T <ACE_SOCK_Stream>;
+template class ACE_Streambuf_T <ACE_SOCK_Stream>;
template class ACE_Svc_Handler <ACE_SOCK_IOStream, ACE_INET_Addr, ACE_NULL_SYNCH>;
#endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */
+#endif /* !ACE_LACKS_ACE_IOSTREAM */
diff --git a/tests/IOStream_Test.cpp b/tests/IOStream_Test.cpp
index be0cfc1c683..32f9a0a3019 100644
--- a/tests/IOStream_Test.cpp
+++ b/tests/IOStream_Test.cpp
@@ -21,11 +21,12 @@
#include "ace/Acceptor.h"
#include "ace/SOCK_Connector.h"
#include "ace/SOCK_Acceptor.h"
-#include "ace/INET_Addr.h"
#include "ace/IOStream.h"
#include "test_config.h"
-typedef ACE_IOStream<ACE_SOCK_Stream> ACE_SOCK_IOStream;
+#if !defined (ACE_LACKS_ACE_IOSTREAM)
+
+typedef ACE_IOStream_T<ACE_SOCK_Stream> ACE_SOCK_IOStream;
/* The biggest drawback to an iostream is that it generally
eats up whitespace when performing a get (>>) operation.
@@ -374,19 +375,26 @@ spawn (void)
#endif /* ACE_HAS_THREADS */
return 0;
}
+#endif /* !ACE_LACKS_ACE_IOSTREAM */
int
main (int, char *[])
{
ACE_START_TEST ("IOStream_Test");
+#if !defined (ACE_LACKS_ACE_IOSTREAM)
spawn ();
-
+#else
+ ACE_ERROR ((LM_ERROR, "ACE_IOSTREAM not supported on this platform\n"));
+#endif /* !ACE_LACKS_ACE_IOSTREAM */
ACE_END_TEST;
return 0;
}
+
+#if !defined (ACE_LACKS_ACE_IOSTREAM)
#if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION)
-template class ACE_IOStream<ACE_SOCK_Stream>;
-template class ACE_Streambuf<ACE_SOCK_Stream>;
+template class ACE_IOStream_T<ACE_SOCK_Stream>;
+template class ACE_Streambuf_T<ACE_SOCK_Stream>;
#endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */
+#endif /* !ACE_LACKS_ACE_IOSTREAM */