3 //=============================================================================
5 * @file Notification_Strategy.h
9 //=============================================================================
10 #ifndef ACE_NOTIFICATION_STRATEGY_H
11 #define ACE_NOTIFICATION_STRATEGY_H
12 #include /**/ "ace/pre.h"
14 #include "ace/Event_Handler.h"
16 #if !defined (ACE_LACKS_PRAGMA_ONCE)
18 #endif /* ACE_LACKS_PRAGMA_ONCE */
20 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
26 * @class ACE_Notification_Strategy
28 * @brief Abstract class used for notifying an interested party
30 * A vehicle for extending the behavior of ACE_Message_Queue wrt
31 * notification *without subclassing*. Thus, it's an example of
32 * the Bridge/Strategy patterns.
34 class ACE_Export ACE_Notification_Strategy
38 ACE_Notification_Strategy (ACE_Event_Handler
*eh
, ACE_Reactor_Mask mask
);
41 virtual ~ACE_Notification_Strategy () = default;
43 virtual int notify () = 0;
44 virtual int notify (ACE_Event_Handler
*, ACE_Reactor_Mask mask
) = 0;
46 /// Get the event handler.
47 ACE_Event_Handler
*event_handler ();
49 /// Set the event handler.
50 void event_handler (ACE_Event_Handler
*eh
);
52 /// Get the reactor mask.
53 ACE_Reactor_Mask
mask () const;
55 /// Set the reactor mask.
56 void mask (ACE_Reactor_Mask m
);
59 /// The event handler.
60 ACE_Event_Handler
*eh_
;
63 ACE_Reactor_Mask mask_
;
66 ACE_END_VERSIONED_NAMESPACE_DECL
68 #if defined (__ACE_INLINE__)
69 #include "ace/Notification_Strategy.inl"
70 #endif /* __ACE_INLINE __ */
72 #include /**/ "ace/post.h"
73 #endif /*ACE_NOTIFICATION_STRATEGY_H */