diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-09-13 00:26:05 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-09-13 00:26:05 +0000 |
commit | 7a042e4f8a987a50143415af690a878881d4b48f (patch) | |
tree | 338a92488326f0585d65743bd3d6ec0650fd6db1 /tests/MT_Reactor_Timer_Test.h | |
parent | 9b50028195a935518c2716dcdb94d5bb167a0af2 (diff) | |
download | ATCD-TAO-1_0_4.tar.gz |
This commit was manufactured by cvs2svn to create tag 'TAO-1_0_4'.TAO-1_0_4
Diffstat (limited to 'tests/MT_Reactor_Timer_Test.h')
-rw-r--r-- | tests/MT_Reactor_Timer_Test.h | 109 |
1 files changed, 0 insertions, 109 deletions
diff --git a/tests/MT_Reactor_Timer_Test.h b/tests/MT_Reactor_Timer_Test.h deleted file mode 100644 index 91d84220bb7..00000000000 --- a/tests/MT_Reactor_Timer_Test.h +++ /dev/null @@ -1,109 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// tests -// -// = FILENAME -// MT_Reactor_Timer_Test.h -// -// = DESCRIPTION -// This file contains class definitions needed for template -// instantiation in the MT_Reactor_Timer_Test.cpp file. -// -// = AUTHOR -// Steve Huston <shuston@riverace.com> -// -// ============================================================================ - -#ifndef ACE_TESTS_MT_REACTOR_TIMER_TEST_H -#define ACE_TESTS_MT_REACTOR_TIMER_TEST_H - -#include "ace/Reactor.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Task.h" -#include "ace/Pipe.h" -#include "ace/Synch.h" - -class Time_Handler : public ACE_Task<ACE_SYNCH> -{ - // = TITLE - // Test out the multi-threading features of the Reactor's timer - // mechanism. -public: - Time_Handler (void); - - void setup (void); - - int verify_results(void); - - virtual int svc (void); - // Run by a daemon thread to handle deferred processing. - - virtual int handle_timeout (const ACE_Time_Value &tv, - const void *arg); - -private: - enum - { - TIMER_SLOTS = 10 - }; - - long timer_id_[TIMER_SLOTS]; - // The timer_id_ array holds timer IDs. They also have some other values - // that are specific to this test: - // -1 the timer has not been set - // -2 the timer was set, but has been cancelled - // -3 the timer was set, and it already fired - enum { TIMER_NOTSET = -1, TIMER_CANCELLED = -2, TIMER_FIRED = -3 }; - - long prev_timer_; - -#if defined ACE_HAS_THREADS - ACE_Thread_Mutex lock_; -#endif /* ACE_HAS_THREADS */ - -}; - -class Dispatch_Count_Handler : public ACE_Event_Handler -{ - // = TITLE - // A simple test to ensure that the Reactor counts the number of - // dispatches correctly. -public: - Dispatch_Count_Handler (void); - - int handle_close (ACE_HANDLE h, - ACE_Reactor_Mask m); - // Clean up resources from the Reactor. - - virtual int handle_timeout (const ACE_Time_Value &tv, - const void *arg); - // Keep track of the number of timeouts. - - virtual int handle_input (ACE_HANDLE); - // Keep track of the number of I/O events. - - virtual int handle_exception (ACE_HANDLE); - // Keep track of the number of notifies. - - int verify_results (void); - // Verify that the expected events did happen. - -private: - ACE_Pipe pipe_; - // Provide something to trigger I/O. - - int input_seen_; - int notify_seen_; - size_t timers_fired_; - -}; - -#endif /* ACE_TESTS_MT_REACTOR_TIMER_TEST_H */ |