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