diff options
author | Steve Huston <shuston@riverace.com> | 2002-09-24 20:33:15 +0000 |
---|---|---|
committer | Steve Huston <shuston@riverace.com> | 2002-09-24 20:33:15 +0000 |
commit | ac05676e71aa0fe9ca22266594258482bb7d8d5f (patch) | |
tree | 9b047fb22d742725229578b5acfa45e1a1982c22 /examples/C++NPv2 | |
parent | 6cd7fe6c88c34c87dd42759d1d6c91140c23494b (diff) | |
download | ATCD-ac05676e71aa0fe9ca22266594258482bb7d8d5f.tar.gz |
ChangeLogTag:Tue Sep 24 16:07:21 2002 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'examples/C++NPv2')
-rw-r--r-- | examples/C++NPv2/Select_Reactor_Logging_Server.cpp | 19 | ||||
-rw-r--r-- | examples/C++NPv2/Server_Shutdown.cpp | 23 | ||||
-rw-r--r-- | examples/C++NPv2/TP_Reactor_Logging_Server.cpp | 19 |
3 files changed, 50 insertions, 11 deletions
diff --git a/examples/C++NPv2/Select_Reactor_Logging_Server.cpp b/examples/C++NPv2/Select_Reactor_Logging_Server.cpp index 4f1dfcee48d..778e5fd3262 100644 --- a/examples/C++NPv2/Select_Reactor_Logging_Server.cpp +++ b/examples/C++NPv2/Select_Reactor_Logging_Server.cpp @@ -9,11 +9,11 @@ #include "ace/Select_Reactor.h" #include "ace/Thread_Manager.h" -#include <string> - #if defined (ACE_WIN32) && (!defined (ACE_HAS_STANDARD_CPP_LIBRARY) || \ (ACE_HAS_STANDARD_CPP_LIBRARY == 0)) -# error "Must add to config.h: #define ACE_HAS_STANDARD_CPP_LIBRARY 1" +# include <stdio.h> +#else +# include <string> #endif #include "Reactor_Logging_Server.h" @@ -58,6 +58,17 @@ static ACE_THR_FUNC_RETURN controller (void *arg) { Quit_Handler *quit_handler = 0; ACE_NEW_RETURN (quit_handler, Quit_Handler (reactor), 0); +#if defined (ACE_WIN32) && (!defined (ACE_HAS_STANDARD_CPP_LIBRARY) || \ + (ACE_HAS_STANDARD_CPP_LIBRARY == 0)) + for (;;) { + char user_input[80]; + gets (user_input); + if (ACE_OS_String::strcmp (user_input, "quit") == 0) { + reactor->notify (quit_handler); + break; + } + } +#else for (;;) { std::string user_input; std::getline (cin, user_input, '\n'); @@ -66,6 +77,8 @@ static ACE_THR_FUNC_RETURN controller (void *arg) { break; } } +#endif + return 0; } diff --git a/examples/C++NPv2/Server_Shutdown.cpp b/examples/C++NPv2/Server_Shutdown.cpp index 9e371d81f01..7aa53224ec0 100644 --- a/examples/C++NPv2/Server_Shutdown.cpp +++ b/examples/C++NPv2/Server_Shutdown.cpp @@ -11,15 +11,15 @@ #include "ace/Thread_Manager.h" #include "ace/streams.h" -#include <string> - -#include "SLDEX_export.h" - #if defined (ACE_WIN32) && (!defined (ACE_HAS_STANDARD_CPP_LIBRARY) || \ (ACE_HAS_STANDARD_CPP_LIBRARY == 0)) -# error "Must add to config.h: #define ACE_HAS_STANDARD_CPP_LIBRARY 1" +# include <stdio.h> +#else +# include <string> #endif +#include "SLDEX_export.h" + class Quit_Handler : public ACE_Event_Handler { friend class ace_dewarn_gplusplus; @@ -47,6 +47,17 @@ static ACE_THR_FUNC_RETURN controller (void *arg) { Quit_Handler *quit_handler = 0; ACE_NEW_RETURN (quit_handler, Quit_Handler (reactor), 0); +#if defined (ACE_WIN32) && (!defined (ACE_HAS_STANDARD_CPP_LIBRARY) || \ + (ACE_HAS_STANDARD_CPP_LIBRARY == 0)) + for (;;) { + char user_input[80]; + gets (user_input); + if (ACE_OS_String::strcmp (user_input, "quit") == 0) { + reactor->notify (quit_handler); + break; + } + } +#else for (;;) { std::string user_input; std::getline (cin, user_input, '\n'); @@ -55,6 +66,8 @@ static ACE_THR_FUNC_RETURN controller (void *arg) { break; } } +#endif + return 0; } diff --git a/examples/C++NPv2/TP_Reactor_Logging_Server.cpp b/examples/C++NPv2/TP_Reactor_Logging_Server.cpp index 5d4a3b37aba..16d575d055f 100644 --- a/examples/C++NPv2/TP_Reactor_Logging_Server.cpp +++ b/examples/C++NPv2/TP_Reactor_Logging_Server.cpp @@ -10,11 +10,11 @@ #include "ace/TP_Reactor.h" #include "ace/Thread_Manager.h" -#include <string> - #if defined (ACE_WIN32) && (!defined (ACE_HAS_STANDARD_CPP_LIBRARY) || \ (ACE_HAS_STANDARD_CPP_LIBRARY == 0)) -# error "Must add to config.h: #define ACE_HAS_STANDARD_CPP_LIBRARY 1" +# include <stdio.h> +#else +# include <string> #endif #include "Reactor_Logging_Server.h" @@ -59,6 +59,17 @@ static ACE_THR_FUNC_RETURN controller (void *arg) { Quit_Handler *quit_handler = 0; ACE_NEW_RETURN (quit_handler, Quit_Handler (reactor), 0); +#if defined (ACE_WIN32) && (!defined (ACE_HAS_STANDARD_CPP_LIBRARY) || \ + (ACE_HAS_STANDARD_CPP_LIBRARY == 0)) + for (;;) { + char user_input[80]; + gets (user_input); + if (ACE_OS_String::strcmp (user_input, "quit") == 0) { + reactor->notify (quit_handler); + break; + } + } +#else for (;;) { std::string user_input; std::getline (cin, user_input, '\n'); @@ -67,6 +78,8 @@ static ACE_THR_FUNC_RETURN controller (void *arg) { break; } } +#endif + return 0; } |