diff options
author | jxh <jxh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-01-07 23:46:09 +0000 |
---|---|---|
committer | jxh <jxh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-01-07 23:46:09 +0000 |
commit | 7009debdb00618b75a4cae14f4b6ba377930717f (patch) | |
tree | 489c7485fe6bb427254a741ba31690749d9e2f59 /examples | |
parent | 17206b5893240e4de8e287c677e31e3a906de6db (diff) | |
download | ATCD-7009debdb00618b75a4cae14f4b6ba377930717f.tar.gz |
Added virtual destructors to classes that needed them.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/Timer_Queue/Driver.cpp | 5 | ||||
-rw-r--r-- | examples/Timer_Queue/Driver.h | 27 | ||||
-rw-r--r-- | examples/Timer_Queue/Reactor_Timer_Queue_Test.cpp | 4 | ||||
-rw-r--r-- | examples/Timer_Queue/Reactor_Timer_Queue_Test.h | 17 | ||||
-rw-r--r-- | examples/Timer_Queue/Thread_Timer_Queue_Test.cpp | 4 | ||||
-rw-r--r-- | examples/Timer_Queue/Thread_Timer_Queue_Test.h | 19 |
6 files changed, 48 insertions, 28 deletions
diff --git a/examples/Timer_Queue/Driver.cpp b/examples/Timer_Queue/Driver.cpp index ee6e166dfb5..8c4c8d591b1 100644 --- a/examples/Timer_Queue/Driver.cpp +++ b/examples/Timer_Queue/Driver.cpp @@ -43,6 +43,11 @@ Command<RECEIVER, ACTION>::execute (void *arg) // gets the next request from the user input. +template <class TQ, class RECEIVER, class ACTION> +Timer_Queue_Test_Driver<TQ, RECEIVER, ACTION>::~Timer_Queue_Test_Driver (void) +{ +} + template <class TQ, class RECEIVER, class ACTION> int Timer_Queue_Test_Driver<TQ, RECEIVER, ACTION>::get_next_request (void) { diff --git a/examples/Timer_Queue/Driver.h b/examples/Timer_Queue/Driver.h index 3abaf97377c..2369cc54a8c 100644 --- a/examples/Timer_Queue/Driver.h +++ b/examples/Timer_Queue/Driver.h @@ -6,17 +6,17 @@ // // = LIBRARY // examples -// +// // = FILENAME // Driver.h // // = DESCRIPTION -// This code builds an abstraction to factor out common code for +// This code builds an abstraction to factor out common code for // the different implementations of the Timer_Queue. // // = AUTHORS // Sergio Flores-Gaitan <sergio@cs.wustl.edu> -// +// // ============================================================================ #if !defined (_DRIVER_H_) @@ -27,7 +27,7 @@ #include "ace/Timer_Queue_Adapters.h" template <class RECEIVER, class ACTION> -class Command +class Command // = TITLE // Defines an abstract class that allows us to invoke commands // without knowing anything about the implementation. This class @@ -42,7 +42,7 @@ class Command { public: Command (RECEIVER &recvr, ACTION action); - // Sets the <receiver_> of the Command to recvr, and the + // Sets the <receiver_> of the Command to recvr, and the // <action_> of the Command to <action>. virtual int execute (void *arg); @@ -58,9 +58,9 @@ private: template <class TQ, class RECEIVER, class ACTION> class Timer_Queue_Test_Driver - // = TITLE - // Defines a class that provides a simmple implementation for - // a test driver for timer queues. + // = TITLE + // Defines a class that provides a simmple implementation for + // a test driver for timer queues. // // = DESCRIPTION // This is the place where the common code to test the different @@ -71,6 +71,9 @@ class Timer_Queue_Test_Driver // to that implementation. { public: + virtual ~Timer_Queue_Test_Driver (void); + // Default destructor + virtual int parse_commands (const char *buf); // Breaks up the input string buffer into pieces and executes // the appropriate method to handle that operation. @@ -79,7 +82,7 @@ public: // This is the main entry point to the test driver. The user // of the class should normally invoke this method. // Returns 0 when successful, or 0 otherwise. - + virtual int get_next_request (void); // This internal method gets the next request from the user. // Returns -1 when user wants to exit. Returns 0 otherwise. @@ -90,13 +93,13 @@ public: // Otherwise, a -1 is returned and errno is set to indicate the error. // = Template Methods. - + virtual int display_menu (void)=0; // Prints the user interface for the driver to STDOUT. - + virtual int init (void)=0; // Initializes values and operations for the driver. - + protected: TQ timer_queue_; // timer queue diff --git a/examples/Timer_Queue/Reactor_Timer_Queue_Test.cpp b/examples/Timer_Queue/Reactor_Timer_Queue_Test.cpp index b94a79a6d3e..e00a2c8a295 100644 --- a/examples/Timer_Queue/Reactor_Timer_Queue_Test.cpp +++ b/examples/Timer_Queue/Reactor_Timer_Queue_Test.cpp @@ -138,6 +138,10 @@ Reactor_Timer_Queue_Test_Driver::Reactor_Timer_Queue_Test_Driver (void) { } +Reactor_Timer_Queue_Test_Driver::~Reactor_Timer_Queue_Test_Driver (void) +{ +} + int Reactor_Timer_Queue_Test_Driver::display_menu (void) { diff --git a/examples/Timer_Queue/Reactor_Timer_Queue_Test.h b/examples/Timer_Queue/Reactor_Timer_Queue_Test.h index abee5e95843..fd29fb3ac6a 100644 --- a/examples/Timer_Queue/Reactor_Timer_Queue_Test.h +++ b/examples/Timer_Queue/Reactor_Timer_Queue_Test.h @@ -6,7 +6,7 @@ // // = LIBRARY // examples -// +// // = FILENAME // Reactor_Timer_Queue_Test.h // @@ -17,7 +17,7 @@ // = AUTHORS // Nanbor Wang <nw1@cs.wustl.edu> and // Sergio Flores-Gaitan <sergio@cs.wustl.edu> -// +// // ============================================================================ #if !defined (_REACTOR_TIMER_QUEUE_TEST_H_) @@ -77,7 +77,7 @@ private: ACE_Timer_Queue *tq_; // Keep a pointer to the timer queue we are using so we can traverse // the queue. - + int done_; // Flag used to close down program. @@ -89,7 +89,7 @@ private: class Reactor_Timer_Queue_Test_Driver : public Timer_Queue_Test_Driver <ACE_Timer_Heap, Input_Handler, Input_Handler::ACTION> // = TITLE // Implements a test driver for a reactive timer queue using - // <ACE_Reactor>. + // <ACE_Reactor>. // // = DESCRIPTION // This class implements the logic to test the reactor @@ -102,7 +102,10 @@ public: // input handler can call hook methods from the driver. Such // methods are the common factored out code from other // implementations of timer queues. - + + virtual ~Reactor_Timer_Queue_Test_Driver (void); + // Default destructor + virtual int display_menu (void); // Prints the menu of options. @@ -113,7 +116,7 @@ public: virtual int run_test (void); // Main entry point to the test driver implementation. - + private: Input_Handler thandler_; // This is the stdin handler. @@ -131,7 +134,7 @@ public: void set_timer_id (long tid); // Sets the timer id for this handler <tid_> to <tid> - + private: long tid_; // timer ID. diff --git a/examples/Timer_Queue/Thread_Timer_Queue_Test.cpp b/examples/Timer_Queue/Thread_Timer_Queue_Test.cpp index 806cace456c..e62107b7e78 100644 --- a/examples/Timer_Queue/Thread_Timer_Queue_Test.cpp +++ b/examples/Timer_Queue/Thread_Timer_Queue_Test.cpp @@ -192,6 +192,10 @@ Thread_Timer_Queue_Test_Driver::Thread_Timer_Queue_Test_Driver (void) { } +Thread_Timer_Queue_Test_Driver::~Thread_Timer_Queue_Test_Driver (void) +{ +} + int Thread_Timer_Queue_Test_Driver::run_test (void) { diff --git a/examples/Timer_Queue/Thread_Timer_Queue_Test.h b/examples/Timer_Queue/Thread_Timer_Queue_Test.h index 58d63f823c6..e6c8c3663f8 100644 --- a/examples/Timer_Queue/Thread_Timer_Queue_Test.h +++ b/examples/Timer_Queue/Thread_Timer_Queue_Test.h @@ -6,18 +6,18 @@ // // = LIBRARY // examples -// +// // = FILENAME // Thread_Timer_Queue_Test.h // // = DESCRIPTION -// This code exercises the <ACE_Thread_Timer_Queue_Adapter> using +// This code exercises the <ACE_Thread_Timer_Queue_Adapter> using // an <ACE_Timer_Heap_T> // // = AUTHORS -// Carlos O'Ryan <coryan@cs.wustl.edu> and +// Carlos O'Ryan <coryan@cs.wustl.edu> and // Sergio Flores-Gaitan <sergio@cs.wustl.edu> -// +// // ============================================================================ #if !defined (_THREAD_TIMER_QUEUE_TEST_H_) @@ -30,7 +30,7 @@ // These typedefs ensure that we use the minimal amount of locking // necessary. -typedef ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex> +typedef ACE_Event_Handler_Handle_Timeout_Upcall<ACE_Null_Mutex> Upcall; typedef ACE_Timer_Heap_T<ACE_Event_Handler *, Upcall, @@ -38,7 +38,7 @@ typedef ACE_Timer_Heap_T<ACE_Event_Handler *, Timer_Heap; typedef ACE_Timer_Heap_Iterator_T<ACE_Event_Handler *, Upcall, - ACE_Null_Mutex> + ACE_Null_Mutex> Timer_Heap_Iterator; typedef ACE_Thread_Timer_Queue_Adapter<Timer_Heap> Thread_Timer_Queue; @@ -89,12 +89,12 @@ private: // How many micro seconds are in a second. Timer_Queue_Test_Driver<Thread_Timer_Queue, Input_Task, Input_Task::ACTION> &driver_; - // The thread timer queue test driver + // The thread timer queue test driver }; class Thread_Timer_Queue_Test_Driver : public Timer_Queue_Test_Driver <Thread_Timer_Queue, Input_Task, Input_Task::ACTION> // = TITLE - // Implements an example application that exercises <Thread_Timer_Queue> + // Implements an example application that exercises <Thread_Timer_Queue> // timer queue. // // = DESCRIPTION @@ -105,6 +105,7 @@ class Thread_Timer_Queue_Test_Driver : public Timer_Queue_Test_Driver <Thread_Ti { public: Thread_Timer_Queue_Test_Driver (void); + ~Thread_Timer_Queue_Test_Driver (void); virtual int display_menu (void); virtual int init (void); @@ -115,7 +116,7 @@ private: // Subclassed from ACE_Task. }; -class Handler : public ACE_Event_Handler +class Handler : public ACE_Event_Handler // = TITLE // Event handler for the timer queue timeout events. // |