summaryrefslogtreecommitdiff
path: root/examples/Misc
diff options
context:
space:
mode:
Diffstat (limited to 'examples/Misc')
-rw-r--r--examples/Misc/Makefile279
-rw-r--r--examples/Misc/test_XtReactor1.cpp139
-rw-r--r--examples/Misc/test_XtReactor2.cpp71
-rw-r--r--examples/Misc/test_dump.cpp71
-rw-r--r--examples/Misc/test_get_opt.cpp51
-rw-r--r--examples/Misc/test_profile_timer.cpp33
-rw-r--r--examples/Misc/test_read_buffer.cpp30
-rw-r--r--examples/Misc/test_sstring.cpp22
-rw-r--r--examples/Misc/test_trace.cpp49
9 files changed, 0 insertions, 745 deletions
diff --git a/examples/Misc/Makefile b/examples/Misc/Makefile
deleted file mode 100644
index 554d92af06a..00000000000
--- a/examples/Misc/Makefile
+++ /dev/null
@@ -1,279 +0,0 @@
-#----------------------------------------------------------------------------
-# @(#)Makefile 1.1 10/18/96
-#
-# Makefile for testing the miscellaneous ACE components.
-#----------------------------------------------------------------------------
-
-#----------------------------------------------------------------------------
-# Local macros
-#----------------------------------------------------------------------------
-
-BIN = test_dump \
- test_get_opt \
- test_profile_timer \
- test_read_buffer \
- test_sstring \
- test_trace \
- test_XtReactor1 \
- test_XtReactor2
-
-LSRC = $(addsuffix .cpp,$(BIN))
-
-LDLIBS =
-
-VLDLIBS = $(LDLIBS:%=%$(VAR))
-
-BUILD = $(VBIN)
-
-#----------------------------------------------------------------------------
-# Include macros and targets
-#----------------------------------------------------------------------------
-
-include $(WRAPPER_ROOT)/include/makeinclude/wrapper_macros.GNU
-include $(WRAPPER_ROOT)/include/makeinclude/macros.GNU
-include $(WRAPPER_ROOT)/include/makeinclude/rules.common.GNU
-include $(WRAPPER_ROOT)/include/makeinclude/rules.nonested.GNU
-include $(WRAPPER_ROOT)/include/makeinclude/rules.bin.GNU
-include $(WRAPPER_ROOT)/include/makeinclude/rules.local.GNU
-
-#----------------------------------------------------------------------------
-# Local targets
-#----------------------------------------------------------------------------
-
-#----------------------------------------------------------------------------
-# Dependencies
-#----------------------------------------------------------------------------
-
-# DO NOT DELETE THIS LINE -- g++dep uses it.
-# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
-
-.obj/test_dump.o .shobj/test_dump.so: test_dump.cpp \
- $(WRAPPER_ROOT)/ace/Dump.h \
- $(WRAPPER_ROOT)/ace/Synch.h \
- $(WRAPPER_ROOT)/ace/ACE.h \
- $(WRAPPER_ROOT)/ace/OS.h \
- $(WRAPPER_ROOT)/ace/Time_Value.h \
- $(WRAPPER_ROOT)/ace/config.h \
- $(WRAPPER_ROOT)/ace/stdcpp.h \
- $(WRAPPER_ROOT)/ace/Trace.h \
- $(WRAPPER_ROOT)/ace/Log_Msg.h \
- $(WRAPPER_ROOT)/ace/Log_Record.h \
- $(WRAPPER_ROOT)/ace/Log_Priority.h \
- $(WRAPPER_ROOT)/ace/Log_Record.i \
- $(WRAPPER_ROOT)/ace/ACE.i \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.i \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.i \
- $(WRAPPER_ROOT)/ace/Synch_T.h \
- $(WRAPPER_ROOT)/ace/Event_Handler.h \
- $(WRAPPER_ROOT)/ace/Dump_T.h
-.obj/test_get_opt.o .shobj/test_get_opt.so: test_get_opt.cpp \
- $(WRAPPER_ROOT)/ace/Get_Opt.h \
- $(WRAPPER_ROOT)/ace/ACE.h \
- $(WRAPPER_ROOT)/ace/OS.h \
- $(WRAPPER_ROOT)/ace/Time_Value.h \
- $(WRAPPER_ROOT)/ace/config.h \
- $(WRAPPER_ROOT)/ace/stdcpp.h \
- $(WRAPPER_ROOT)/ace/Trace.h \
- $(WRAPPER_ROOT)/ace/Log_Msg.h \
- $(WRAPPER_ROOT)/ace/Log_Record.h \
- $(WRAPPER_ROOT)/ace/Log_Priority.h \
- $(WRAPPER_ROOT)/ace/Log_Record.i \
- $(WRAPPER_ROOT)/ace/ACE.i
-.obj/test_profile_timer.o .shobj/test_profile_timer.so: test_profile_timer.cpp \
- $(WRAPPER_ROOT)/ace/Profile_Timer.h \
- $(WRAPPER_ROOT)/ace/ACE.h \
- $(WRAPPER_ROOT)/ace/OS.h \
- $(WRAPPER_ROOT)/ace/Time_Value.h \
- $(WRAPPER_ROOT)/ace/config.h \
- $(WRAPPER_ROOT)/ace/stdcpp.h \
- $(WRAPPER_ROOT)/ace/Trace.h \
- $(WRAPPER_ROOT)/ace/Log_Msg.h \
- $(WRAPPER_ROOT)/ace/Log_Record.h \
- $(WRAPPER_ROOT)/ace/Log_Priority.h \
- $(WRAPPER_ROOT)/ace/Log_Record.i \
- $(WRAPPER_ROOT)/ace/ACE.i
-.obj/test_read_buffer.o .shobj/test_read_buffer.so: test_read_buffer.cpp \
- $(WRAPPER_ROOT)/ace/Service_Config.h \
- $(WRAPPER_ROOT)/ace/Service_Object.h \
- $(WRAPPER_ROOT)/ace/Shared_Object.h \
- $(WRAPPER_ROOT)/ace/ACE.h \
- $(WRAPPER_ROOT)/ace/OS.h \
- $(WRAPPER_ROOT)/ace/Time_Value.h \
- $(WRAPPER_ROOT)/ace/config.h \
- $(WRAPPER_ROOT)/ace/stdcpp.h \
- $(WRAPPER_ROOT)/ace/Trace.h \
- $(WRAPPER_ROOT)/ace/Log_Msg.h \
- $(WRAPPER_ROOT)/ace/Log_Record.h \
- $(WRAPPER_ROOT)/ace/Log_Priority.h \
- $(WRAPPER_ROOT)/ace/Log_Record.i \
- $(WRAPPER_ROOT)/ace/ACE.i \
- $(WRAPPER_ROOT)/ace/Event_Handler.h \
- $(WRAPPER_ROOT)/ace/Thread_Manager.h \
- $(WRAPPER_ROOT)/ace/Thread.h \
- $(WRAPPER_ROOT)/ace/Synch.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.i \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.i \
- $(WRAPPER_ROOT)/ace/Synch_T.h \
- $(WRAPPER_ROOT)/ace/Set.h \
- $(WRAPPER_ROOT)/ace/Proactor.h \
- $(WRAPPER_ROOT)/ace/Message_Block.h \
- $(WRAPPER_ROOT)/ace/Malloc.h \
- $(WRAPPER_ROOT)/ace/Malloc_T.h \
- $(WRAPPER_ROOT)/ace/Memory_Pool.h \
- $(WRAPPER_ROOT)/ace/Signal.h \
- $(WRAPPER_ROOT)/ace/Mem_Map.h \
- $(WRAPPER_ROOT)/ace/Timer_Queue.h \
- $(WRAPPER_ROOT)/ace/Timer_Queue.i \
- $(WRAPPER_ROOT)/ace/ReactorEx.h \
- $(WRAPPER_ROOT)/ace/Token.h \
- $(WRAPPER_ROOT)/ace/Reactor.h \
- $(WRAPPER_ROOT)/ace/Handle_Set.h \
- $(WRAPPER_ROOT)/ace/Pipe.h \
- $(WRAPPER_ROOT)/ace/Pipe.i \
- $(WRAPPER_ROOT)/ace/SOCK_Stream.h \
- $(WRAPPER_ROOT)/ace/SOCK_IO.h \
- $(WRAPPER_ROOT)/ace/SOCK.h \
- $(WRAPPER_ROOT)/ace/Addr.h \
- $(WRAPPER_ROOT)/ace/IPC_SAP.h \
- $(WRAPPER_ROOT)/ace/IPC_SAP.i \
- $(WRAPPER_ROOT)/ace/SOCK.i \
- $(WRAPPER_ROOT)/ace/SOCK_IO.i \
- $(WRAPPER_ROOT)/ace/INET_Addr.h \
- $(WRAPPER_ROOT)/ace/SOCK_Stream.i \
- $(WRAPPER_ROOT)/ace/Reactor.i \
- $(WRAPPER_ROOT)/ace/Svc_Conf_Tokens.h \
- $(WRAPPER_ROOT)/ace/Read_Buffer.h \
- $(WRAPPER_ROOT)/ace/Read_Buffer.i
-.obj/test_sstring.o .shobj/test_sstring.so: test_sstring.cpp \
- $(WRAPPER_ROOT)/ace/SString.h \
- $(WRAPPER_ROOT)/ace/ACE.h \
- $(WRAPPER_ROOT)/ace/OS.h \
- $(WRAPPER_ROOT)/ace/Time_Value.h \
- $(WRAPPER_ROOT)/ace/config.h \
- $(WRAPPER_ROOT)/ace/stdcpp.h \
- $(WRAPPER_ROOT)/ace/Trace.h \
- $(WRAPPER_ROOT)/ace/Log_Msg.h \
- $(WRAPPER_ROOT)/ace/Log_Record.h \
- $(WRAPPER_ROOT)/ace/Log_Priority.h \
- $(WRAPPER_ROOT)/ace/Log_Record.i \
- $(WRAPPER_ROOT)/ace/ACE.i
-.obj/test_trace.o .shobj/test_trace.so: test_trace.cpp \
- $(WRAPPER_ROOT)/ace/Thread.h \
- $(WRAPPER_ROOT)/ace/ACE.h \
- $(WRAPPER_ROOT)/ace/OS.h \
- $(WRAPPER_ROOT)/ace/Time_Value.h \
- $(WRAPPER_ROOT)/ace/config.h \
- $(WRAPPER_ROOT)/ace/stdcpp.h \
- $(WRAPPER_ROOT)/ace/Trace.h \
- $(WRAPPER_ROOT)/ace/Log_Msg.h \
- $(WRAPPER_ROOT)/ace/Log_Record.h \
- $(WRAPPER_ROOT)/ace/Log_Priority.h \
- $(WRAPPER_ROOT)/ace/Log_Record.i \
- $(WRAPPER_ROOT)/ace/ACE.i \
- $(WRAPPER_ROOT)/ace/Signal.h \
- $(WRAPPER_ROOT)/ace/Synch.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.i \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.i \
- $(WRAPPER_ROOT)/ace/Synch_T.h \
- $(WRAPPER_ROOT)/ace/Event_Handler.h \
- $(WRAPPER_ROOT)/ace/Set.h
-.obj/test_XtReactor1.o .shobj/test_XtReactor1.so: test_XtReactor1.cpp \
- $(WRAPPER_ROOT)/ace/XtReactor.h \
- $(WRAPPER_ROOT)/ace/Reactor.h \
- $(WRAPPER_ROOT)/ace/Handle_Set.h \
- $(WRAPPER_ROOT)/ace/ACE.h \
- $(WRAPPER_ROOT)/ace/OS.h \
- $(WRAPPER_ROOT)/ace/Time_Value.h \
- $(WRAPPER_ROOT)/ace/config.h \
- $(WRAPPER_ROOT)/ace/stdcpp.h \
- $(WRAPPER_ROOT)/ace/Trace.h \
- $(WRAPPER_ROOT)/ace/Log_Msg.h \
- $(WRAPPER_ROOT)/ace/Log_Record.h \
- $(WRAPPER_ROOT)/ace/Log_Priority.h \
- $(WRAPPER_ROOT)/ace/Log_Record.i \
- $(WRAPPER_ROOT)/ace/ACE.i \
- $(WRAPPER_ROOT)/ace/Timer_Queue.h \
- $(WRAPPER_ROOT)/ace/Event_Handler.h \
- $(WRAPPER_ROOT)/ace/Synch.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.i \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.i \
- $(WRAPPER_ROOT)/ace/Synch_T.h \
- $(WRAPPER_ROOT)/ace/Timer_Queue.i \
- $(WRAPPER_ROOT)/ace/Signal.h \
- $(WRAPPER_ROOT)/ace/Set.h \
- $(WRAPPER_ROOT)/ace/Thread.h \
- $(WRAPPER_ROOT)/ace/Token.h \
- $(WRAPPER_ROOT)/ace/Pipe.h \
- $(WRAPPER_ROOT)/ace/Pipe.i \
- $(WRAPPER_ROOT)/ace/SOCK_Stream.h \
- $(WRAPPER_ROOT)/ace/SOCK_IO.h \
- $(WRAPPER_ROOT)/ace/SOCK.h \
- $(WRAPPER_ROOT)/ace/Addr.h \
- $(WRAPPER_ROOT)/ace/IPC_SAP.h \
- $(WRAPPER_ROOT)/ace/IPC_SAP.i \
- $(WRAPPER_ROOT)/ace/SOCK.i \
- $(WRAPPER_ROOT)/ace/SOCK_IO.i \
- $(WRAPPER_ROOT)/ace/INET_Addr.h \
- $(WRAPPER_ROOT)/ace/SOCK_Stream.i \
- $(WRAPPER_ROOT)/ace/Reactor.i \
- $(WRAPPER_ROOT)/ace/Message_Block.h \
- $(WRAPPER_ROOT)/ace/Malloc.h \
- $(WRAPPER_ROOT)/ace/Malloc_T.h \
- $(WRAPPER_ROOT)/ace/Memory_Pool.h \
- $(WRAPPER_ROOT)/ace/Mem_Map.h
-.obj/test_XtReactor2.o .shobj/test_XtReactor2.so: test_XtReactor2.cpp \
- $(WRAPPER_ROOT)/ace/XtReactor.h \
- $(WRAPPER_ROOT)/ace/Reactor.h \
- $(WRAPPER_ROOT)/ace/Handle_Set.h \
- $(WRAPPER_ROOT)/ace/ACE.h \
- $(WRAPPER_ROOT)/ace/OS.h \
- $(WRAPPER_ROOT)/ace/Time_Value.h \
- $(WRAPPER_ROOT)/ace/config.h \
- $(WRAPPER_ROOT)/ace/stdcpp.h \
- $(WRAPPER_ROOT)/ace/Trace.h \
- $(WRAPPER_ROOT)/ace/Log_Msg.h \
- $(WRAPPER_ROOT)/ace/Log_Record.h \
- $(WRAPPER_ROOT)/ace/Log_Priority.h \
- $(WRAPPER_ROOT)/ace/Log_Record.i \
- $(WRAPPER_ROOT)/ace/ACE.i \
- $(WRAPPER_ROOT)/ace/Timer_Queue.h \
- $(WRAPPER_ROOT)/ace/Event_Handler.h \
- $(WRAPPER_ROOT)/ace/Synch.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.h \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Simple.i \
- $(WRAPPER_ROOT)/ace/SV_Semaphore_Complex.i \
- $(WRAPPER_ROOT)/ace/Synch_T.h \
- $(WRAPPER_ROOT)/ace/Timer_Queue.i \
- $(WRAPPER_ROOT)/ace/Signal.h \
- $(WRAPPER_ROOT)/ace/Set.h \
- $(WRAPPER_ROOT)/ace/Thread.h \
- $(WRAPPER_ROOT)/ace/Token.h \
- $(WRAPPER_ROOT)/ace/Pipe.h \
- $(WRAPPER_ROOT)/ace/Pipe.i \
- $(WRAPPER_ROOT)/ace/SOCK_Stream.h \
- $(WRAPPER_ROOT)/ace/SOCK_IO.h \
- $(WRAPPER_ROOT)/ace/SOCK.h \
- $(WRAPPER_ROOT)/ace/Addr.h \
- $(WRAPPER_ROOT)/ace/IPC_SAP.h \
- $(WRAPPER_ROOT)/ace/IPC_SAP.i \
- $(WRAPPER_ROOT)/ace/SOCK.i \
- $(WRAPPER_ROOT)/ace/SOCK_IO.i \
- $(WRAPPER_ROOT)/ace/INET_Addr.h \
- $(WRAPPER_ROOT)/ace/SOCK_Stream.i \
- $(WRAPPER_ROOT)/ace/Reactor.i \
- $(WRAPPER_ROOT)/ace/Message_Block.h \
- $(WRAPPER_ROOT)/ace/Malloc.h \
- $(WRAPPER_ROOT)/ace/Malloc_T.h \
- $(WRAPPER_ROOT)/ace/Memory_Pool.h \
- $(WRAPPER_ROOT)/ace/Mem_Map.h
-
-# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/examples/Misc/test_XtReactor1.cpp b/examples/Misc/test_XtReactor1.cpp
deleted file mode 100644
index 6c1647ec4f6..00000000000
--- a/examples/Misc/test_XtReactor1.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-// The following is another test that exercises the Eric C. Newton's
-// $Id$
-
-// <ecn@clark.net> XtReactor implementation.
-
-
-#include "ace/XtReactor.h"
-#include "ace/Message_Block.h"
-
-#if defined (ACE_HAS_XT)
-#define String XtString
-#include <Xm/PushB.h>
-
-class Stdout : public ACE_Event_Handler
-{
-public:
- Stdout (ACE_Reactor * r)
- : reactor_ (r), msg_ (1000000)
- {
- int flags;
- flags = ACE_OS::fcntl (ACE_STDOUT, F_GETFL);
-
- if (flags != -1
- && ACE_OS::fcntl (ACE_STDOUT, F_SETFL, flags | O_NONBLOCK) != -1)
- return;
- else
- ACE_DEBUG ((LM_DEBUG, "Unable to set stdout to non-block."));
- }
-
- ACE_HANDLE get_handle (void) const { return ACE_STDOUT; }
-
- int handle_output (ACE_HANDLE)
- {
- char *s = msg_.rd_ptr ();
-
- if (ACE_OS::write (ACE_STDOUT, s, 1)==1)
- {
- ACE_DEBUG ((LM_DEBUG, "wrote output '%d'\n", (int) *s));
- msg_.rd_ptr (1);
- }
-
- if (msg_.length () == 0)
- {
- reactor_->remove_handler (this, ACE_Event_Handler::WRITE_MASK);
- msg_.rd_ptr (msg_.base ());
- msg_.wr_ptr (msg_.base ());
- }
- return 0;
- }
-
- void put (char c)
- {
- if (msg_.length () == 0)
- reactor_->register_handler (this, ACE_Event_Handler::WRITE_MASK);
-
- if (msg_.wr_ptr () < msg_.end ())
- {
- *msg_.wr_ptr () = c;
- msg_.wr_ptr (1);
- }
- else
- ACE_DEBUG ((LM_DEBUG, "Oops... data falling off the end of the buffer!\n"));
- }
-
-private:
- ACE_Reactor *reactor_;
- ACE_Message_Block msg_;
-};
-
-class Stdin : public ACE_Event_Handler
-{
-public:
- Stdin (Stdout *out)
- : out_ (out) {}
-
- ACE_HANDLE get_handle () const { return ACE_STDIN; }
-
- int handle_input (ACE_HANDLE)
- {
- char c;
-
- if (ACE_OS::read (ACE_STDIN, &c, 1) == 1)
- out_->put (c);
-
- return 0;
- }
-
- int handle_timeout (const ACE_Time_Value &tv, const void *)
- {
- ACE_DEBUG ((LM_DEBUG, "Timeout! %f\n", (double) (tv.msec ()/1000.)));
- return 0;
- }
-
-private:
- Stdout *out_;
-};
-
-static void
-ActivateCB (Widget, XtPointer, XtPointer)
-{
- ACE_DEBUG ((LM_DEBUG, "Button pushed!\n"));
-}
-
-int
-main (int argc, char**argv)
-{
- // The worlds most useless user interface
- Widget top_level = XtVaAppInitialize (NULL, "buttontest", NULL, 0,
- &argc, argv, NULL, NULL);
- Widget button = XmCreatePushButton (top_level, "change", 0, 0);
- XtManageChild (button);
- XtAddCallback (button, XmNactivateCallback, ActivateCB, NULL);
-
- // A reactor beastie
- ACE_XtReactor reactor (XtWidgetToApplicationContext (top_level));
-
- // Print a message when data is recv'd on stdin...
- ACE_Event_Handler *stdin_ = new Stdin (new Stdout (&reactor));
- reactor.register_handler (stdin_, ACE_Event_Handler::READ_MASK);
-
- // Print a message every 10 seconds.
- reactor.schedule_timer (stdin_, 0, ACE_Time_Value (10), ACE_Time_Value (10));
-
- // Show the top_level widget.
- XtRealizeWidget (top_level);
-
- // Demonstrate Reactor/Xt event loop unification.
- XtAppMainLoop (XtWidgetToApplicationContext (top_level));
-
- return 0;
-}
-#else
-int
-main (int, char *[])
-{
- ACE_ERROR ((LM_ERROR, "XT not configured for this platform\n"));
- return 0;
-}
-#endif /* ACE_HAS_XT */
diff --git a/examples/Misc/test_XtReactor2.cpp b/examples/Misc/test_XtReactor2.cpp
deleted file mode 100644
index 31fab787b26..00000000000
--- a/examples/Misc/test_XtReactor2.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-// The following test exercises the Eric C. Newton's <ecn@clark.net>
-// $Id$
-
-// XtReactor implementation.
-
-
-#include "ace/XtReactor.h"
-#include "ace/Message_Block.h"
-
-#if defined (ACE_HAS_XT)
-#define String XtString
-#include <Xm/PushB.h>
-
-class Stdin : public ACE_Event_Handler
-{
-public:
- ACE_HANDLE get_handle (void) const { return ACE_STDIN; }
-
- int handle_input (ACE_HANDLE fd)
- {
- char c;
- if (read (0, &c, 1)==1)
- printf ("Got input '%d'\n", (int)c);
- return 0;
- }
-
- int handle_timeout (const ACE_Time_Value &tv, const void *arg)
- {
- printf ("Timeout! %f\n", (double) (tv.msec ()/1000.));
- return 0;
- }
-};
-
-void ActivateCB (Widget w, XtPointer, XtPointer)
-{
- printf ("Button pushed!\n");
-}
-
-int main (int argc, char**argv)
-{
- // The worlds most useless user interface
- Widget top_level = XtVaAppInitialize (NULL, "buttontest", NULL, 0,
- &argc, argv, NULL, NULL);
- Widget button = XmCreatePushButton (top_level, "change", 0, 0);
- XtManageChild (button);
- XtAddCallback (button, XmNactivateCallback, ActivateCB, NULL);
-
- // A reactor beastie.
- ACE_XtReactor reactor (XtWidgetToApplicationContext (top_level));
-
- // Print a message when data is recv'd on stdin...
- ACE_Event_Handler * stdin_ = new Stdin;
- reactor.register_handler (stdin_, ACE_Event_Handler::READ_MASK);
-
- // Print a message every 10 seconds
- reactor.schedule_timer (stdin_, 0, ACE_Time_Value (10), ACE_Time_Value (10));
-
- // Show the top_level widget
- XtRealizeWidget (top_level);
-
- // Demonstrate Reactor/Xt event loop unification:
- XtAppMainLoop (XtWidgetToApplicationContext (top_level));
-}
-#else
-int
-main (int, char *[])
-{
- ACE_ERROR ((LM_ERROR, "XT not configured for this platform\n"));
- return 0;
-}
-#endif /* ACE_HAS_XT */
diff --git a/examples/Misc/test_dump.cpp b/examples/Misc/test_dump.cpp
deleted file mode 100644
index 4a736efd2cd..00000000000
--- a/examples/Misc/test_dump.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-// The following code illustrates how the ACE_Dumpable mechanisms are
-// $Id$
-
-// integrated into ACE components like the SOCK_Acceptor and
-// SOCK_Stream.
-
-#include "ace/Dump.h"
-
-class SOCK
-{
-public:
- SOCK (void) { ACE_REGISTER_OBJECT (SOCK); }
- ~SOCK (void) { ACE_REMOVE_OBJECT; }
-
- void dump (void) const {
- cerr << "hello from SOCK = " << (u_long) this << endl;
- }
-
- // ...
-};
-
-class SOCK_Acceptor : public SOCK
-{
-public:
- SOCK_Acceptor (void) { ACE_REGISTER_OBJECT (SOCK_Acceptor); }
- ~SOCK_Acceptor (void) { ACE_REMOVE_OBJECT; }
-
- void dump (void) const {
- cerr << "hello from SOCK_Acceptor = " << (u_long) this << endl;
- }
-
- // ...
-};
-
-class SOCK_Stream : public SOCK
-{
-public:
- SOCK_Stream (void) { ACE_REGISTER_OBJECT (SOCK_Stream); }
- ~SOCK_Stream (void) { ACE_REMOVE_OBJECT; }
-
- void dump (void) const {
- cerr << "hello from SOCK_Stream = " << (u_long) this << endl;
- }
-
- // ...
-};
-
-int
-main (void)
-{
- SOCK sock;
- // Note that the SOCK superclass is *not* printed.
- SOCK_Stream stream;
- SOCK_Acceptor acceptor;
- ACE_ODB::instance ()->dump_objects ();
- {
- SOCK sock;
- // Note that the SOCK superclass is *not* printed.
- SOCK_Stream stream;
- SOCK_Acceptor acceptor;
- ACE_ODB::instance ()->dump_objects ();
- }
- ACE_ODB::instance ()->dump_objects ();
- return 0;
-}
-
-#if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION)
-template class ACE_Dumpable_Adapter<SOCK_Stream>;
-template class ACE_Dumpable_Adapter<SOCK>;
-template class ACE_Dumpable_Adapter<SOCK_Acceptor>;
-#endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */
diff --git a/examples/Misc/test_get_opt.cpp b/examples/Misc/test_get_opt.cpp
deleted file mode 100644
index c68928b6e57..00000000000
--- a/examples/Misc/test_get_opt.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-// $Id$
-
-// Test the ACE_Get_Opt class.
-
-#include "ace/Get_Opt.h"
-
-
-int
-main (int argc, char *argv[])
-{
- ACE_Get_Opt get_opt (argc, argv, "ab:cd:ef:gh:");
- int c;
-
- while ((c = get_opt ()) != EOF)
- switch (c)
- {
- case 'a':
- ACE_DEBUG ((LM_DEBUG, "got a\n"));
- break;
- case 'b':
- ACE_DEBUG ((LM_DEBUG, "got b with arg %s\n", get_opt.optarg));
- break;
- case 'c':
- ACE_DEBUG ((LM_DEBUG, "got c\n"));
- break;
- case 'd':
- ACE_DEBUG ((LM_DEBUG, "got d with arg %s\n", get_opt.optarg));
- break;
- case 'e':
- ACE_DEBUG ((LM_DEBUG, "got e\n"));
- break;
- case 'f':
- ACE_DEBUG ((LM_DEBUG, "got f with arg %s\n", get_opt.optarg));
- break;
- case 'g':
- ACE_DEBUG ((LM_DEBUG, "got g\n"));
- break;
- case 'h':
- ACE_DEBUG ((LM_DEBUG, "got h with arg %s\n", get_opt.optarg));
- break;
- default:
- ACE_DEBUG ((LM_DEBUG, "got %c, which is unrecognized!\n", c));
- break;
- }
-
- for (int i = get_opt.optind; i < argc; i++)
- ACE_DEBUG ((LM_DEBUG, "optind = %d, argv[optind] = %s\n",
- i, argv[i]));
-
- return 0;
-}
diff --git a/examples/Misc/test_profile_timer.cpp b/examples/Misc/test_profile_timer.cpp
deleted file mode 100644
index 366876a42a5..00000000000
--- a/examples/Misc/test_profile_timer.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-#include "ace/Profile_Timer.h"
-// $Id$
-
-
-
-static const int DEFAULT_ITERATIONS = 100000000;
-
-int
-main (int argc, char *argv[])
-{
- ACE_Profile_Timer timer;
- int iterations = argc > 1 ? ACE_OS::atoi (argv[1]) : DEFAULT_ITERATIONS;
-
- timer.start ();
-
- for (int i = 0; i < iterations; i++)
- ACE_OS::getpid ();
-
- timer.stop ();
-
- ACE_Profile_Timer::ACE_Elapsed_Time et;
-
- timer.elapsed_time (et);
-
- ACE_DEBUG ((LM_DEBUG, "iterations = %d\n", iterations));
- ACE_DEBUG ((LM_DEBUG, "real time = %f secs, user time = %f secs, system time = %f secs\n",
- et.real_time, et.user_time, et.system_time));
-
- ACE_DEBUG ((LM_DEBUG, "time per call = %f usecs\n",
- (et.real_time / double (iterations)) * 1000000));
- return 0;
-}
-
diff --git a/examples/Misc/test_read_buffer.cpp b/examples/Misc/test_read_buffer.cpp
deleted file mode 100644
index c661e4f1159..00000000000
--- a/examples/Misc/test_read_buffer.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-#include "ace/Service_Config.h"
-// $Id$
-
-#include "ace/Read_Buffer.h"
-
-int
-main (int argc, char *argv[])
-{
- int handle = argc > 1 ? ::open (argv[1], O_RDONLY) : 0;
- int term = argc > 2 ? ::atoi (argv[2]) : EOF;
- int search = argc > 3 ? ::atoi (argv[3]) : '\n';
- int replace = argc > 4 ? ::atoi (argv[4]) : '\0';
-
- ACE_Read_Buffer rb (handle);
-
- char *buf;
-
- while ((buf = rb.read (term, search, replace)) != 0)
- {
- ::write (1, buf, rb.size ());
- ACE_Service_Config::alloc ()->free (buf);
- }
- return 0;
-}
-
-#if 0
-#if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION)
-template class ACE_Stream<ACE_Null_Mutex, ACE_Null_Condition_Mutex>;
-#endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */
-#endif
diff --git a/examples/Misc/test_sstring.cpp b/examples/Misc/test_sstring.cpp
deleted file mode 100644
index 55e797c3851..00000000000
--- a/examples/Misc/test_sstring.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-// $Id$
-
-#include "ace/SString.h"
-
-int
-main (int, char *[])
-{
- ACE_CString s1 ("hello");
- ACE_CString s2 ("world");
- ACE_CString s3 ("el");
- ACE_WString s4 ("hello");
- ACE_WString s5 ("world");
- ACE_WString s6 ("el");
-
- ACE_ASSERT (s1 != s2);
- ACE_ASSERT (s1.strstr (s2) == -1);
- ACE_ASSERT (s1.strstr (s2) == -1);
- ACE_ASSERT (s1.strstr (s3));
- ACE_ASSERT (s4.strstr (s5) == -1);
- ACE_ASSERT (s5.strstr (s6));
- return 0;
-}
diff --git a/examples/Misc/test_trace.cpp b/examples/Misc/test_trace.cpp
deleted file mode 100644
index 41b407cbdca..00000000000
--- a/examples/Misc/test_trace.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-// Enable tracing
-// $Id$
-
-#define ACE_NTRACE 0
-
-#include "ace/Thread.h"
-#include "ace/Signal.h"
-
-static void
-foo (int max_depth)
-{
- ACE_Trace _ ("void foo (void)", __LINE__, __FILE__);
-
- if (max_depth > 0)
- foo (max_depth - 1);
- // Destructor automatically called.
-}
-
-int
-main (int argc, char *argv[])
-{
- const int MAX_DEPTH = argc == 1 ? 10 : atoi (argv[1]);
-
- if (argc > 2)
- ACE_Trace::set_nesting_indent (ACE_OS::atoi (argv[2]));
-
- ACE_Trace _ ("int main (int argc, char *argv[])", __LINE__, __FILE__);
-
- // The following won't work on MVS OpenEdition...
- ACE_Sig_Action sig1 ((ACE_SignalHandler) ACE_Trace::start_tracing, SIGUSR1);
- ACE_Sig_Action sig2 ((ACE_SignalHandler) ACE_Trace::stop_tracing, SIGUSR2);
-
-#if defined (ACE_MT_SAFE)
- int n_threads = argc > 3 ? ACE_OS::atoi (argv[3]) : 4;
-
- if (ACE_Thread::spawn_n (n_threads, ACE_THR_FUNC (foo),
- (void *) MAX_DEPTH,
- THR_BOUND | THR_DETACHED) != n_threads)
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "spawn_n"), -1);
- ACE_OS::thr_exit (0);
-#else
- for (;;)
- foo (MAX_DEPTH);
-#endif /* ACE_MT_SAFE */
-
- // Destructor automatically called.
- return 0;
-}
-