From 8afaac21b14b5892151a4796d69734f07aff0219 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 16 Feb 1999 06:29:05 +0000 Subject: *** empty log message *** --- ace/Proactor.h | 437 +++++++++++++++++++-------------------------------------- 1 file changed, 145 insertions(+), 292 deletions(-) (limited to 'ace/Proactor.h') diff --git a/ace/Proactor.h b/ace/Proactor.h index 2766a512b48..9ac19b94644 100644 --- a/ace/Proactor.h +++ b/ace/Proactor.h @@ -16,85 +16,26 @@ // // ============================================================================ -#ifndef ACE_PROACTOR_H +#if !defined (ACE_PROACTOR_H) #define ACE_PROACTOR_H #include "ace/OS.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once +#pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/Asynch_IO.h" -#include "ace/Thread_Manager.h" -#include "ace/Event_Handler.h" - -#include "ace/Timer_Queue.h" -#include "ace/Timer_List.h" -#include "ace/Timer_Heap.h" -#include "ace/Timer_Wheel.h" -#include "ace/Free_List.h" -#include "ace/Pipe.h" - -#if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) || \ - (defined (ACE_HAS_AIO_CALLS)) +#if ((defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) || (defined (ACE_HAS_AIO_CALLS))) // This only works on Win32 platforms and on Unix platforms supporting -// aio calls. - -// Forward declarations. -class ACE_Asynch_Result; -class ACE_Asynch_Operation; -class ACE_Proactor_Timer_Handler; -class ACE_Proactor; -#if defined (ACE_HAS_AIO_CALLS) -class ACE_AIO_Accept_Handler; -#endif /* ACE_HAS_AIO_CALLS */ - -class ACE_Export ACE_Proactor_Handle_Timeout_Upcall -{ - // = TITLE - // Functor for . - // - // = DESCRIPTION - // This class implements the functor required by the Timer - // Queue to call on ACE_Handlers. -public: - friend class ACE_Proactor; - // Proactor has special privileges, access needed to: proactor (). - - typedef ACE_Timer_Queue_T - TIMER_QUEUE; +// POSIX aio calls. - ACE_Proactor_Handle_Timeout_Upcall (void); - // Constructor. - - int timeout (TIMER_QUEUE &timer_queue, - ACE_Handler *handler, - const void *arg, - const ACE_Time_Value &cur_time); - // This method is called when the timer expires. - - int cancellation (TIMER_QUEUE &timer_queue, - ACE_Handler *handler); - // This method is called when the timer is canceled. - - int deletion (TIMER_QUEUE &timer_queue, - ACE_Handler *handler, - const void *arg); - // This method is called when the timer queue is destroyed and the - // timer is still contained in it. - -protected: - int proactor (ACE_Proactor &proactor); - // Set the proactor. This will fail, if one is already set! +#include "ace/Asynch_IO.h" +#include "ace/Asynch_IO_Impl.h" - ACE_Proactor *proactor_; - // Handle to the proactor. This is needed for the completion port. -}; +// Forward declarations. +class ACE_Proactor_Impl; -class ACE_Export ACE_Proactor : public ACE_Event_Handler +class ACE_Export ACE_Proactor { // = TITLE // A manager for asynchronous event demultiplexing. @@ -104,84 +45,10 @@ class ACE_Export ACE_Proactor : public ACE_Event_Handler // http://www.cs.wustl.edu/~schmidt/proactor.ps.gz for more // details. public: - friend class ACE_Proactor_Timer_Handler; - // Timer Handler has special privileges because Access needed to: - // thr_mgr_ - - friend class ACE_Proactor_Handle_Timeout_Upcall; - // Access needed to: Asynch_Timer, and completion_port_. - - friend class ACE_Asynch_Operation; - // For POSIX4-compliant-Unix systems, the - // call is used by - // to store some information with the - // Proactor after an call is issued, so that the Proactor can - // retrive this information to do and . - -#if defined (ACE_HAS_AIO_CALLS) - friend class ACE_Asynch_Accept_Handler; - // For POSIX4 implementation, this class takes care of doing the - // Asynch_Accept. - - friend class ACE_AIO_Accept_Handler; - // We need also this class with the Proactor to take care of - // Asynch_Accept when we use AIO_CONTROL_BLOCKS. -#endif /* ACE_HAS_AIO_CALLS */ - - // = Here are the typedefs that the uses. - - // @@ Can these typedefs be capitalized? - typedef ACE_Timer_Queue_T - Timer_Queue; - typedef ACE_Timer_Queue_Iterator_T - Timer_Queue_Iterator; - typedef ACE_Timer_List_T - Timer_List; - typedef ACE_Timer_List_Iterator_T - Timer_List_Iterator; - typedef ACE_Timer_Heap_T - Timer_Heap; - typedef ACE_Timer_Heap_Iterator_T - Timer_Heap_Iterator; - typedef ACE_Timer_Wheel_T - Timer_Wheel; - typedef ACE_Timer_Wheel_Iterator_T - Timer_Wheel_Iterator; - - enum POSIX_COMPLETION_STRATEGY - { - // Use the real time signals and do on the - // signals. - RT_SIGNALS, - // Store the control blocks with the and do - // on them, - AIO_CONTROL_BLOCKS - }; - // For Posix4-Compliat-Unix systems how the completion of the - // asynchronous calls should be got from the OS. - - ACE_Proactor (size_t number_of_threads = 0, - Timer_Queue *tq = 0, - int used_with_reactor_event_loop = 0, - POSIX_COMPLETION_STRATEGY completion_strategy = AIO_CONTROL_BLOCKS); + ACE_Proactor (ACE_Proactor_Impl *implementation = 0, + int delete_implementation = 0); // A do nothing constructor. - + virtual ~ACE_Proactor (void); // Virtual destruction. @@ -218,14 +85,14 @@ public: // Close the IO completion port. virtual int register_handle (ACE_HANDLE handle, - const void *completion_key); + const void *completion_key); // This method adds the to the I/O completion port. This // function is a no-op function for Unix systems. // = Timer management. virtual long schedule_timer (ACE_Handler &handler, - const void *act, - const ACE_Time_Value &time); + const void *act, + const ACE_Time_Value &time); // Schedule a that will expire after