00001 /* -*- C++ -*- */ 00002 //============================================================================= 00003 /** 00004 * @file Notification_Strategy.h 00005 * 00006 * $Id: Notification_Strategy.h,v 1.1.1.1 2003/02/21 18:36:32 chad Exp $ 00007 * 00008 * @author Doug Schmidt 00009 */ 00010 //============================================================================= 00011 #ifndef ACE_NOTIFICATION_STRATEGY_H 00012 #define ACE_NOTIFICATION_STRATEGY_H 00013 #include "ace/pre.h" 00014 00015 #include "ace/Event_Handler.h" 00016 00017 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00018 # pragma once 00019 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00020 00021 // Forward decls. 00022 class ACE_Reactor; 00023 00024 /** 00025 * @class ACE_Notification_Strategy 00026 * 00027 * @brief Abstract class used for notifying an interested party 00028 * 00029 * A vehicle for extending the behavior of ACE_Message_Queue wrt 00030 * notification *without subclassing*. Thus, it's an example of 00031 * the Bridge/Strategy patterns. 00032 */ 00033 class ACE_Export ACE_Notification_Strategy 00034 { 00035 public: 00036 /// Constructor. 00037 ACE_Notification_Strategy (ACE_Event_Handler *eh, 00038 ACE_Reactor_Mask mask); 00039 00040 /// Destructor. 00041 virtual ~ACE_Notification_Strategy (void); 00042 00043 virtual int notify (void) = 0; 00044 virtual int notify (ACE_Event_Handler *, 00045 ACE_Reactor_Mask mask) = 0; 00046 00047 /// Get the event handler. 00048 ACE_Event_Handler *event_handler (void); 00049 00050 /// Set the event handler. 00051 void event_handler (ACE_Event_Handler *eh); 00052 00053 /// Get the reactor mask. 00054 ACE_Reactor_Mask mask (void) const; 00055 00056 /// Set the reactor mask. 00057 void mask (ACE_Reactor_Mask m); 00058 00059 protected: 00060 /// The event handler. 00061 ACE_Event_Handler *eh_; 00062 00063 /// The reactor mask. 00064 ACE_Reactor_Mask mask_; 00065 }; 00066 00067 00068 #if defined (__ACE_INLINE__) 00069 #include "ace/Notification_Strategy.inl" 00070 #endif /* __ACE_INLINE __ */ 00071 00072 #include "ace/post.h" 00073 #endif /*ACE_NOTIFICATION_STRATEGY_H */
1.2.14 written by Dimitri van Heesch,
© 1997-2002