Notification_Strategy.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file   Notification_Strategy.h
00006  *
00007  *  $Id: Notification_Strategy.h 80826 2008-03-04 14:51:23Z wotte $
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, ACE_Reactor_Mask mask);
00041 
00042   /// Destructor.
00043   virtual ~ACE_Notification_Strategy (void);
00044 
00045   virtual int notify (void) = 0;
00046   virtual int notify (ACE_Event_Handler *, ACE_Reactor_Mask mask) = 0;
00047 
00048   /// Get the event handler.
00049   ACE_Event_Handler *event_handler (void);
00050 
00051   /// Set the event handler.
00052   void event_handler (ACE_Event_Handler *eh);
00053 
00054   /// Get the reactor mask.
00055   ACE_Reactor_Mask mask (void) const;
00056 
00057   /// Set the reactor mask.
00058   void mask (ACE_Reactor_Mask m);
00059 
00060 protected:
00061   /// The event handler.
00062   ACE_Event_Handler *eh_;
00063 
00064   /// The reactor mask.
00065   ACE_Reactor_Mask mask_;
00066 };
00067 
00068 ACE_END_VERSIONED_NAMESPACE_DECL
00069 
00070 #if defined (__ACE_INLINE__)
00071 #include "ace/Notification_Strategy.inl"
00072 #endif /* __ACE_INLINE __ */
00073 
00074 #include /**/ "ace/post.h"
00075 #endif /*ACE_NOTIFICATION_STRATEGY_H */

Generated on Tue Feb 2 17:18:41 2010 for ACE by  doxygen 1.4.7