diff options
Diffstat (limited to 'examples/Misc')
-rw-r--r-- | examples/Misc/.cvsignore | 16 | ||||
-rw-r--r-- | examples/Misc/Makefile.am | 118 | ||||
-rw-r--r-- | examples/Misc/Misc.mpc | 66 | ||||
-rw-r--r-- | examples/Misc/test_XtReactor1.cpp | 173 | ||||
-rw-r--r-- | examples/Misc/test_XtReactor2.cpp | 101 | ||||
-rw-r--r-- | examples/Misc/test_dump.cpp | 43 | ||||
-rw-r--r-- | examples/Misc/test_dump.h | 50 | ||||
-rw-r--r-- | examples/Misc/test_get_opt.cpp | 54 | ||||
-rw-r--r-- | examples/Misc/test_profile_timer.cpp | 38 | ||||
-rw-r--r-- | examples/Misc/test_read_buffer.cpp | 34 | ||||
-rw-r--r-- | examples/Misc/test_set.cpp | 64 | ||||
-rw-r--r-- | examples/Misc/test_sstring.cpp | 26 | ||||
-rw-r--r-- | examples/Misc/test_trace.cpp | 117 |
13 files changed, 0 insertions, 900 deletions
diff --git a/examples/Misc/.cvsignore b/examples/Misc/.cvsignore deleted file mode 100644 index a31a7786288..00000000000 --- a/examples/Misc/.cvsignore +++ /dev/null @@ -1,16 +0,0 @@ -test_XtReactor1 -test_XtReactor2 -test_dump -test_dump -test_get_opt -test_get_opt -test_profile_timer -test_profile_timer -test_read_buffer -test_read_buffer -test_set -test_set -test_sstring -test_sstring -test_trace -test_trace diff --git a/examples/Misc/Makefile.am b/examples/Misc/Makefile.am deleted file mode 100644 index 6b4d5a5b1db..00000000000 --- a/examples/Misc/Makefile.am +++ /dev/null @@ -1,118 +0,0 @@ -## Process this file with automake to create Makefile.in -## -## $Id$ -## -## This file was generated by MPC. Any changes made directly to -## this file will be lost the next time it is generated. -## -## MPC Command: -## ./bin/mwc.pl -include /home/jtc/ACE/ACE-config3/MPC/config -include /home/jtc/ACE/ACE-config3/MPC/templates -type automake ACE.mwc - -ACE_BUILDDIR = $(top_builddir) -ACE_ROOT = $(top_srcdir) - -## Makefile.Misc_Test_Dump.am -noinst_PROGRAMS = test_dump - -test_dump_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) - -test_dump_SOURCES = \ - test_dump.cpp \ - test_dump.h - -test_dump_LDADD = \ - $(top_builddir)/ace/libACE.la - -## Makefile.Misc_Test_Get_Opt.am -noinst_PROGRAMS += test_get_opt - -test_get_opt_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) - -test_get_opt_SOURCES = \ - test_get_opt.cpp \ - test_dump.h - -test_get_opt_LDADD = \ - $(top_builddir)/ace/libACE.la - -## Makefile.Misc_Test_Profile_Timer.am -noinst_PROGRAMS += test_profile_timer - -test_profile_timer_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) - -test_profile_timer_SOURCES = \ - test_profile_timer.cpp \ - test_dump.h - -test_profile_timer_LDADD = \ - $(top_builddir)/ace/libACE.la - -## Makefile.Misc_Test_Read_Buffer.am -noinst_PROGRAMS += test_read_buffer - -test_read_buffer_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) - -test_read_buffer_SOURCES = \ - test_read_buffer.cpp \ - test_dump.h - -test_read_buffer_LDADD = \ - $(top_builddir)/ace/libACE.la - -## Makefile.Misc_Test_Set.am -noinst_PROGRAMS += test_set - -test_set_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) - -test_set_SOURCES = \ - test_set.cpp \ - test_dump.h - -test_set_LDADD = \ - $(top_builddir)/ace/libACE.la - -## Makefile.Misc_Test_Sstring.am -noinst_PROGRAMS += test_sstring - -test_sstring_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) - -test_sstring_SOURCES = \ - test_sstring.cpp \ - test_dump.h - -test_sstring_LDADD = \ - $(top_builddir)/ace/libACE.la - -## Makefile.Misc_Test_Trace.am -noinst_PROGRAMS += test_trace - -test_trace_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) - -test_trace_SOURCES = \ - test_trace.cpp \ - test_dump.h - -test_trace_LDADD = \ - $(top_builddir)/ace/libACE.la - -## Clean up template repositories, etc. -clean-local: - -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.* - -rm -f gcctemp.c gcctemp so_locations *.ics - -rm -rf cxx_repository ptrepository ti_files - -rm -rf templateregistry ir.out - -rm -rf ptrepository SunWS_cache Templates.DB diff --git a/examples/Misc/Misc.mpc b/examples/Misc/Misc.mpc deleted file mode 100644 index b0ed858efbd..00000000000 --- a/examples/Misc/Misc.mpc +++ /dev/null @@ -1,66 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*test_dump) : aceexe { - exename = test_dump - Source_Files { - test_dump.cpp - } -} - -project(*test_get_opt) : aceexe { - exename = test_get_opt - Source_Files { - test_get_opt.cpp - } -} - -project(*test_profile_timer) : aceexe { - avoids += ace_for_tao - exename = test_profile_timer - Source_Files { - test_profile_timer.cpp - } -} - -project(*test_read_buffer) : aceexe { - exename = test_read_buffer - Source_Files { - test_read_buffer.cpp - } -} - -project(*test_set) : aceexe { - exename = test_set - Source_Files { - test_set.cpp - } -} - -project(*test_sstring) : aceexe { - exename = test_sstring - Source_Files { - test_sstring.cpp - } -} - -project(*test_trace) : aceexe { - exename = test_trace - Source_Files { - test_trace.cpp - } -} - -project(*test_XtReactor1) : aceexe, ace_xtreactor, ace_motif { - exename = test_XtReactor1 - Source_Files { - test_XtReactor1.cpp - } -} - -project(*test_XtReactor2) : aceexe, ace_xtreactor, ace_motif { - exename = test_XtReactor2 - Source_Files { - test_XtReactor2.cpp - } -} diff --git a/examples/Misc/test_XtReactor1.cpp b/examples/Misc/test_XtReactor1.cpp deleted file mode 100644 index f4bef54aeae..00000000000 --- a/examples/Misc/test_XtReactor1.cpp +++ /dev/null @@ -1,173 +0,0 @@ -// $Id$ - -// The following is another test that exercises the Eric C. Newton's -// <ecn@clark.net> XtReactor implementation. - -#include "ace/OS_main.h" -#include "ace/XtReactor.h" -#include "ace/Reactor.h" -#include "ace/Message_Block.h" -#include "ace/Log_Msg.h" -#include "ace/OS_NS_unistd.h" -#include "ace/OS_NS_fcntl.h" - -ACE_RCSID (Misc, - test_XtReactor1, - "$Id$") - -//#define String XtString -#include <Xm/PushB.h> - -class Stdout : public ACE_Event_Handler -{ -public: - Stdout (ACE_Reactor * r) - : reactor_ (r), - msg_ (1000000) // Make a very big message block. - { - int 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 -ACE_TMAIN (int argc, ACE_TCHAR**argv) -{ - // The worlds most useless user interface - Widget top_level = XtVaAppInitialize (NULL, - "buttontest", - NULL, - 0, - &argc, - argv, - NULL, - NULL); - char change[] = "change"; // XmCreatePushButton() wants a non-const - // string. - Widget button = XmCreatePushButton (top_level, - change, - 0, - 0); - XtManageChild (button); - XtAddCallback (button, - XmNactivateCallback, - ActivateCB, - NULL); - - // A reactor beastie. - ACE_XtReactor xreactor (XtWidgetToApplicationContext (top_level)); - ACE_Reactor reactor (&xreactor); - - // Print a message when data is recv'd on stdin... - ACE_Event_Handler *stdin_; - ACE_NEW_RETURN (stdin_, - Stdin (new Stdout (&reactor)), - -1); - reactor.register_handler (stdin_, - ACE_Event_Handler::READ_MASK); - - // Print a message every 10 seconds. - if (reactor.schedule_timer (stdin_, 0, - ACE_Time_Value (10), - ACE_Time_Value (10)) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "schedule_timer"), - -1); - - // Show the top_level widget. - XtRealizeWidget (top_level); - - // Demonstrate Reactor/Xt event loop unification. - XtAppMainLoop (XtWidgetToApplicationContext (top_level)); - - return 0; -} diff --git a/examples/Misc/test_XtReactor2.cpp b/examples/Misc/test_XtReactor2.cpp deleted file mode 100644 index 2e2f4be0ba2..00000000000 --- a/examples/Misc/test_XtReactor2.cpp +++ /dev/null @@ -1,101 +0,0 @@ -// $Id$ - -// The following test exercises the Eric C. Newton's <ecn@clark.net> -// XtReactor implementation. - -#include "ace/OS_main.h" -#include "ace/XtReactor.h" -#include "ace/Reactor.h" -#include "ace/Message_Block.h" -#include "ace/Log_Msg.h" -#include "ace/OS_NS_unistd.h" - -ACE_RCSID (Misc, - test_XtReactor2, - "$Id$") - - -#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) - { - char c; - if (ACE_OS::read (ACE_STDIN, &c, 1)==1) - ACE_DEBUG ((LM_DEBUG, - "Got input '%d'\n", - (int) 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; - } -}; - -static void -ActivateCB (Widget, XtPointer, XtPointer) -{ - ACE_DEBUG ((LM_DEBUG, - "Button pushed!\n")); -} - -int -ACE_TMAIN (int argc, ACE_TCHAR**argv) -{ - // The worlds most useless user interface - Widget top_level = XtVaAppInitialize (NULL, - "buttontest", - NULL, - 0, - &argc, - argv, - NULL, - NULL); - char change[] = "change"; // XmCreatePushButton() wants a non-const - // string. - Widget button = XmCreatePushButton (top_level, - change, - 0, - 0); - XtManageChild (button); - XtAddCallback (button, - XmNactivateCallback, - ActivateCB, - NULL); - - // A reactor beastie. - ACE_XtReactor xreactor (XtWidgetToApplicationContext (top_level)); - ACE_Reactor reactor (&xreactor); - - // Print a message when data is recv'd on stdin... - ACE_Event_Handler * stdin_; - ACE_NEW_RETURN (stdin_, - Stdin, - -1); - reactor.register_handler (stdin_, - ACE_Event_Handler::READ_MASK); - - // Print a message every 10 seconds - if (reactor.schedule_timer (stdin_, 0, - ACE_Time_Value (10), - ACE_Time_Value (10)) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "schedule_timer"), -1); - - // Show the top_level widget - XtRealizeWidget (top_level); - - // Demonstrate Reactor/Xt event loop unification: - XtAppMainLoop (XtWidgetToApplicationContext (top_level)); -} diff --git a/examples/Misc/test_dump.cpp b/examples/Misc/test_dump.cpp deleted file mode 100644 index 1d908ba7505..00000000000 --- a/examples/Misc/test_dump.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// $Id$ - -// The following code illustrates how the ACE_Dumpable mechanisms are -// integrated into ACE components like the SOCK_Acceptor and -// SOCK_Stream. - -#include "ace/OS_main.h" -#include "ace/Dump.h" -#include "test_dump.h" - -#include "ace/Reactor.h" - -ACE_RCSID(Misc, test_dump, "$Id$") - -int -ACE_TMAIN (int, ACE_TCHAR *[]) -{ - SOCK outer_sock; - // Note that the SOCK superclass is *not* printed. - SOCK_Stream outer_stream; - SOCK_Acceptor outer_acceptor; - ACE_ODB::instance ()->dump_objects (); - { - SOCK inner_sock; - // Note that the SOCK superclass is *not* printed. - SOCK_Stream inner_stream; - SOCK_Acceptor inner_acceptor; - ACE_ODB::instance ()->dump_objects (); - } - ACE_ODB::instance ()->dump_objects (); - return 0; -} - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Dumpable_Adapter<SOCK_Stream>; -template class ACE_Dumpable_Adapter<SOCK>; -template class ACE_Dumpable_Adapter<SOCK_Acceptor>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Dumpable_Adapter<SOCK_Stream> -#pragma instantiate ACE_Dumpable_Adapter<SOCK> -#pragma instantiate ACE_Dumpable_Adapter<SOCK_Acceptor> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - diff --git a/examples/Misc/test_dump.h b/examples/Misc/test_dump.h deleted file mode 100644 index 9c7e0bb7de8..00000000000 --- a/examples/Misc/test_dump.h +++ /dev/null @@ -1,50 +0,0 @@ -// $Id$ - -// Define the classes used with templates in test_dump.cpp - -#ifndef __TEST_DUMP_H -#define __TEST_DUMP_H - -#include "ace/Dump.h" -#include "ace/OS_NS_stdio.h" - -class SOCK -{ -public: - SOCK (void) { ACE_REGISTER_OBJECT (SOCK); } - ~SOCK (void) { ACE_REMOVE_OBJECT; } - - void dump (void) const { - ACE_OS::fprintf (stderr, "hello from SOCK = %lu\n", (u_long) this); - } - - // ... -}; - -class SOCK_Acceptor : public SOCK -{ -public: - SOCK_Acceptor (void) { ACE_REGISTER_OBJECT (SOCK_Acceptor); } - ~SOCK_Acceptor (void) { ACE_REMOVE_OBJECT; } - - void dump (void) const { - ACE_OS::fprintf (stderr, "hello from SOCK_Acceptor = %lu\n", (u_long) this); - } - - // ... -}; - -class SOCK_Stream : public SOCK -{ -public: - SOCK_Stream (void) { ACE_REGISTER_OBJECT (SOCK_Stream); } - ~SOCK_Stream (void) { ACE_REMOVE_OBJECT; } - - void dump (void) const { - ACE_OS::fprintf (stderr, "hello from SOCK_Stream = %lu\n", (u_long) this); - } - - // ... -}; - -#endif /* __TEST_DUMP_H */ diff --git a/examples/Misc/test_get_opt.cpp b/examples/Misc/test_get_opt.cpp deleted file mode 100644 index 3fd0a16ac80..00000000000 --- a/examples/Misc/test_get_opt.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// $Id$ - -// Test the ACE_Get_Opt class. - -#include "ace/OS_main.h" -#include "ace/Get_Opt.h" -#include "ace/Log_Msg.h" - -ACE_RCSID(Misc, test_get_opt, "$Id$") - -int -ACE_TMAIN (int argc, ACE_TCHAR *argv[]) -{ - ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("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.opt_arg ())); - 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.opt_arg ())); - 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.opt_arg ())); - 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.opt_arg ())); - break; - default: - ACE_DEBUG ((LM_DEBUG, "got %c, which is unrecognized!\n", c)); - break; - } - - for (int i = get_opt.opt_ind (); 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 adb6f599f83..00000000000 --- a/examples/Misc/test_profile_timer.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// $Id$ - -#include "ace/OS_main.h" -#include "ace/Profile_Timer.h" -#include "ace/Log_Msg.h" -#include "ace/OS_NS_stdlib.h" -#include "ace/OS_NS_unistd.h" - -ACE_RCSID(Misc, test_profile_timer, "$Id$") - -static const int DEFAULT_ITERATIONS = 100000000; - -int -ACE_TMAIN (int argc, ACE_TCHAR *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 1c24aec98b7..00000000000 --- a/examples/Misc/test_read_buffer.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// $Id$ - -#include "ace/OS_main.h" -#include "ace/OS_NS_fcntl.h" -#include "ace/OS_NS_unistd.h" -#include "ace/Malloc_Base.h" -#include "ace/Service_Config.h" -#include "ace/Read_Buffer.h" -#include "ace/OS_NS_stdlib.h" - - -ACE_RCSID (Misc, - test_read_buffer, - "$Id$") - -int -ACE_TMAIN (int argc, ACE_TCHAR *argv[]) -{ - ACE_HANDLE handle = argc > 1 ? ACE_OS::open (argv[1], O_RDONLY) : ACE_STDIN; - int term = argc > 2 ? ACE_OS::atoi (argv[2]) : EOF; - int search = argc > 3 ? ACE_OS::atoi (argv[3]) : '\n'; - int replace = argc > 4 ? ACE_OS::atoi (argv[4]) : '\0'; - - ACE_Read_Buffer rb (handle); - - char *buf; - - while ((buf = rb.read (term, search, replace)) != 0) - { - ACE_OS::write (ACE_STDOUT, buf, rb.size ()); - ACE_Allocator::instance ()->free (buf); - } - return 0; -} diff --git a/examples/Misc/test_set.cpp b/examples/Misc/test_set.cpp deleted file mode 100644 index b5c81d64bc8..00000000000 --- a/examples/Misc/test_set.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// $Id$ - -#include "ace/OS_main.h" -#include "ace/Containers.h" -#include "ace/Log_Msg.h" - -int -ACE_TMAIN (int, ACE_TCHAR *[]) -{ - ACE_Unbounded_Set<int> s1; - - ACE_ASSERT (s1.size () == 0); - s1.insert_tail (10); - s1.insert_tail (20); - ACE_ASSERT (s1.size () == 2); - - ACE_Unbounded_Set<int> s2 (s1); - ACE_ASSERT (s2.size () == 2); - - ACE_Unbounded_Set<int> s3; - ACE_ASSERT (s3.size () == 0); - - s3 = s2; - ACE_ASSERT (s3.size () == s2.size ()); - - ACE_Unbounded_Set<int> s4 (s3); - ACE_ASSERT (s4.size () == 2); - - int *ip = 0; - - ACE_DEBUG ((LM_DEBUG, "dumping s1\n")); - for (ACE_Unbounded_Set_Iterator<int> iter1 (s1); - iter1.next (ip) != 0; - iter1.advance ()) - ACE_DEBUG ((LM_DEBUG, "item = %d\n", *ip)); - - ACE_DEBUG ((LM_DEBUG, "dumping s2\n")); - for (ACE_Unbounded_Set_Iterator<int> iter2 (s2); - iter2.next (ip) != 0; - iter2.advance ()) - ACE_DEBUG ((LM_DEBUG, "item = %d\n", *ip)); - - ACE_DEBUG ((LM_DEBUG, "dumping s3\n")); - for (ACE_Unbounded_Set_Iterator<int> iter3 (s3); - iter3.next (ip) != 0; - iter3.advance ()) - ACE_DEBUG ((LM_DEBUG, "item = %d\n", *ip)); - - ACE_DEBUG ((LM_DEBUG, "dumping s4\n")); - for (ACE_Unbounded_Set_Iterator<int> iter4 (s4); - iter4.next (ip) != 0; - iter4.advance ()) - ACE_DEBUG ((LM_DEBUG, "item = %d\n", *ip)); - - return 0; -} - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Unbounded_Set<int>; -template class ACE_Unbounded_Set_Iterator<int>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Unbounded_Set<int> -#pragma instantiate ACE_Unbounded_Set_Iterator<int> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/examples/Misc/test_sstring.cpp b/examples/Misc/test_sstring.cpp deleted file mode 100644 index 67bd996e73c..00000000000 --- a/examples/Misc/test_sstring.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// $Id$ - -#include "ace/OS_main.h" -#include "ace/SString.h" -#include "ace/Log_Msg.h" - -ACE_RCSID(Misc, test_sstring, "$Id$") - -int -ACE_TMAIN (int, ACE_TCHAR *[]) -{ - ACE_CString s1 ("hello"); - ACE_CString s2 ("world"); - ACE_CString s3 ("el"); - ACE_NS_WString s4 ("hello"); - ACE_NS_WString s5 ("world"); - ACE_NS_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 338cf8eaa77..00000000000 --- a/examples/Misc/test_trace.cpp +++ /dev/null @@ -1,117 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples/Misc -// -// = FILENAME -// test_trace.cpp -// -// = DESCRIPTION -// This example illustrates how to use the ACE tracing feature and -// also illustrates how to redirect the output to a file. -// -// = AUTHOR -// Douglas C. Schmidt <schmidt@cs.wustl.edu> and -// Irfan Pyarali <irfan@cs.wustl.edu> -// -// ============================================================================ - -// Enable tracing -#define ACE_NTRACE 0 - -#include "ace/OS_main.h" -#include "ace/Signal.h" -#include "ace/Task.h" - -ACE_RCSID(Misc, test_trace, "$Id$") - -class My_Task : public ACE_Task_Base -{ -public: - My_Task (size_t depth) - : depth_ (depth) - { - } - - int recursive (size_t depth); - - virtual int svc (void) - { - return this->recursive (this->depth_); - } - -private: - size_t depth_; - // Depth of the recursion. -}; - - -int -My_Task::recursive (size_t depth) -{ - ACE_Trace trace (ACE_TEXT("int recursive (size_t depth)"), - __LINE__, - ACE_TEXT(__FILE__)); - - if (depth > 0) - return recursive (depth - 1); - else - return 0; - // Destructor of <ACE_Trace> automatically called. -} - -extern "C" -void -exithook (void) -{ - ACE_DEBUG ((LM_DEBUG, - "we're outta here!\n")); -} - -int -ACE_TMAIN (int argc, ACE_TCHAR *argv[]) -{ - const size_t MAX_DEPTH = argc == 1 ? 10 : ACE_OS::atoi (argv[1]); - - ACE_OS::atexit (exithook); - - if (argc > 2) - ACE_Trace::set_nesting_indent (ACE_OS::atoi (argv[2])); - - ACE_Trace trace (ACE_TEXT("int ACE_TMAIN (int argc, ACE_TCHAR *argv[])"), - __LINE__, - ACE_TEXT(__FILE__)); - - // The following won't work on MVS OpenEdition... - ACE_Sig_Action sig1 ((ACE_SignalHandler) ACE_Trace::start_tracing, - SIGUSR1); - ACE_UNUSED_ARG (sig1); - ACE_Sig_Action sig2 ((ACE_SignalHandler) ACE_Trace::stop_tracing, - SIGUSR2); - ACE_UNUSED_ARG (sig2); - - My_Task task (MAX_DEPTH); - -#if defined(ACE_MT_SAFE) && (ACE_MT_SAFE != 0) - int n_threads = argc > 3 ? ACE_OS::atoi (argv[3]) : 4; - - if (task.activate (THR_BOUND | THR_DETACHED, n_threads) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "activate"), - -1); - - // Wait for all the threads to exit. - ACE_Thread_Manager::instance ()->wait (); -#else - const int MAX_ITERATIONS = argc > 3 ? ACE_OS::atoi (argv[3]) : 10; - - for (int i = 0; i < MAX_ITERATIONS; i++) - task.svc (); -#endif /* ACE_MT_SAFE */ - - // Destructor automatically called. - return 0; -} |