Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Msg_WFMO_Reactor.h

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Msg_WFMO_Reactor.h
00006  *
00007  *  $Id: Msg_WFMO_Reactor.h,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *  @author Beskrovny Evgeny <evgeny_beskrovny@icomverse.com>
00010  *  @author Irfan Pyarali <irfan@cs.wustl.edu>
00011  */
00012 //=============================================================================
00013 
00014 
00015 #ifndef ACE_MSG_WFMO_REACTOR_H
00016 #define ACE_MSG_WFMO_REACTOR_H
00017 #include "ace/pre.h"
00018 
00019 #include "ace/config-all.h"
00020 
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 # pragma once
00023 #endif /* ACE_LACKS_PRAGMA_ONCE */
00024 
00025 #if defined (ACE_WIN32) && !defined (ACE_LACKS_MSG_WFMO)
00026 
00027 #include "ace/WFMO_Reactor.h"
00028 
00029 /**
00030  * @class ACE_Msg_WFMO_Reactor
00031  *
00032  * @brief An OO event demultiplexor and event handler dispatcher for
00033  * Win32 <MsgWaitForMultipleObjects>.
00034  *
00035  * The ACE_Msg_WFMO_Reactor is an OO event demultiplexor and
00036  * event handler Reactor. It differs from <ACE_WFMO_Reactor> by
00037  * its ability to react on Windows messages.  It is needed when
00038  * the task should serve also as a COM/DCOM server.
00039  */
00040 class ACE_Export ACE_Msg_WFMO_Reactor : public ACE_WFMO_Reactor
00041 {
00042 public:
00043   // = Initialization and termination methods.
00044   /// Initialize <ACE_Msg_WFMO_Reactor> with the default size.
00045   ACE_Msg_WFMO_Reactor (ACE_Sig_Handler * = 0,
00046                         ACE_Timer_Queue * = 0);
00047 
00048   /**
00049    * Initialize <ACE_Msg_WFMO_Reactor> with size <size>.  Two slots will be
00050    * added to the <size> parameter which will store handles used for
00051    * internal management purposes.
00052    */
00053   ACE_Msg_WFMO_Reactor (size_t size,
00054                         int unused = 0,
00055                         ACE_Sig_Handler * = 0,
00056                         ACE_Timer_Queue * = 0);
00057 
00058   /// Close down the ACE_Msg_WFMO_Reactor and release all of its resources.
00059   virtual ~ACE_Msg_WFMO_Reactor (void);
00060 
00061   /**
00062    * This event loop driver blocks for up to <max_wait_time> before
00063    * returning.  It will return earlier if timer events, I/O events,
00064    * window events, or signal events occur.  Note that <max_wait_time>
00065    * can be 0, in which case this method blocks indefinitely until
00066    * events occur.
00067    *
00068    * <max_wait_time> is decremented to reflect how much time this call
00069    * took.  For instance, if a time value of 3 seconds is passed to
00070    * handle_events and an event occurs after 2 seconds,
00071    * <max_wait_time> will equal 1 second.  This can be used if an
00072    * application wishes to handle events for some fixed amount of
00073    * time.
00074    *
00075    * <MsgWaitForMultipleObjects> is used as the demultiplexing call
00076    *
00077    * Returns the total number of <ACE_Event_Handler>s that were
00078    * dispatched, 0 if the <max_wait_time> elapsed without dispatching
00079    * any handlers, or -1 if an error occurs.
00080    *
00081    * The only difference between <alertable_handle_events> and
00082    * <handle_events> is that in the alertable case, MWMO_ALERTABLE is
00083    * passed to <MsgWaitForMultipleObjects> for the <bAlertable>
00084    * option.
00085    */
00086   virtual int handle_events (ACE_Time_Value *max_wait_time = 0);
00087   virtual int alertable_handle_events (ACE_Time_Value *max_wait_time = 0);
00088 
00089   /**
00090    * This method is just like the one above, except the
00091    * <max_wait_time> value is a reference and can therefore never be
00092    * NULL.
00093    */
00094   virtual int handle_events (ACE_Time_Value &max_wait_time);
00095   virtual int alertable_handle_events (ACE_Time_Value &max_wait_time);
00096 
00097 protected:
00098   /// Wait for timer and I/O events to occur.
00099   virtual DWORD wait_for_multiple_events (int timeout,
00100                                           int alertable);
00101 
00102   /// Check for activity on remaining handles.
00103   virtual DWORD poll_remaining_handles (DWORD index);
00104 
00105   /// Dispatches window messages.
00106   virtual int dispatch_window_messages (void);
00107 };
00108 
00109 #endif /* ACE_WIN32 && !ACE_LACKS_MSG_WFMO */
00110 
00111 #if defined (__ACE_INLINE__)
00112 #include "ace/Msg_WFMO_Reactor.i"
00113 #endif /* __ACE_INLINE__ */
00114 
00115 #include "ace/post.h"
00116 #endif /* ACE_MSG_WFMO_REACTOR_H */

Generated on Mon Jun 16 11:20:27 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002