diff options
Diffstat (limited to 'examples/Misc/test_dump.cpp')
-rw-r--r-- | examples/Misc/test_dump.cpp | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/examples/Misc/test_dump.cpp b/examples/Misc/test_dump.cpp deleted file mode 100644 index a15eac9360c..00000000000 --- a/examples/Misc/test_dump.cpp +++ /dev/null @@ -1,78 +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/Dump.h" - -ACE_RCSID(Misc, test_dump, "$Id$") - -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); - } - - // ... -}; - -int -main (int, char *[]) -{ - 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 */ - |