diff options
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Notify/Event_Manager.h')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Notify/Event_Manager.h | 95 |
1 files changed, 70 insertions, 25 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event_Manager.h b/TAO/orbsvcs/orbsvcs/Notify/Event_Manager.h index eddef6ed5b6..5da8ed87089 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Event_Manager.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Event_Manager.h @@ -20,7 +20,8 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "Types.h" - +#include "EventTypeSeq.h" +#include "orbsvcs/ESF/ESF_Worker.h" /** * @class TAO_NS_Event_Manager @@ -43,54 +44,98 @@ public: /// Init void shutdown (void); - /// Subscribe <proxy_supplier> to the event type sequence list <seq>. - void subscribe (TAO_NS_ProxySupplier* proxy_supplier, const TAO_NS_EventTypeSeq& seq ACE_ENV_ARG_DECL); + /// Connect ProxySupplier + void connect (TAO_NS_ProxySupplier* proxy_supplier ACE_ENV_ARG_DECL); - /// Unsubscribe <proxy_supplier> to the event type sequence list <seq>. - void un_subscribe (TAO_NS_ProxySupplier* proxy_supplier, const TAO_NS_EventTypeSeq& seq ACE_ENV_ARG_DECL); + /// Disconnect ProxySupplier + void disconnect (TAO_NS_ProxySupplier* proxy_supplier ACE_ENV_ARG_DECL); - /// Subscribe <proxy_consumer> to the event type sequence list <seq>. - void publish (TAO_NS_ProxyConsumer* proxy_consumer, const TAO_NS_EventTypeSeq& seq ACE_ENV_ARG_DECL); + /// Connect ProxyConsumer + void connect (TAO_NS_ProxyConsumer* proxy_consumer ACE_ENV_ARG_DECL); - /// Subscribe <proxy_consumer> to the event type sequence list <seq>. - void un_publish (TAO_NS_ProxyConsumer* proxy_consumer, const TAO_NS_EventTypeSeq& seq ACE_ENV_ARG_DECL); + /// Disconnect ProxyConsumer + void disconnect (TAO_NS_ProxyConsumer* proxy_consumer ACE_ENV_ARG_DECL); /// Map accessors. TAO_NS_Consumer_Map* consumer_map (void); TAO_NS_Supplier_Map* supplier_map (void); - /// Event Dispatch Observer - TAO_NS_Event_Dispatch_Observer* event_dispatch_observer (void); + /// Offer change received on <proxy_consumer>. + void offer_change (TAO_NS_ProxyConsumer* proxy_consumer, const TAO_NS_EventTypeSeq& added, const TAO_NS_EventTypeSeq& removed ACE_ENV_ARG_DECL); - /// Update dispatch observer. - TAO_NS_Updates_Dispatch_Observer* updates_dispatch_observer (void); + /// Subscription change received on <proxy_supplier>. + void subscription_change (TAO_NS_ProxySupplier* proxy_supplier, const TAO_NS_EventTypeSeq& added, const TAO_NS_EventTypeSeq& removed ACE_ENV_ARG_DECL); + + /// What are the types being offered. + const TAO_NS_EventTypeSeq& offered_types (void); + + /// What are the types being subscribed. + const TAO_NS_EventTypeSeq& subscription_types (void); protected: + /// Subscribe <proxy_supplier> to the event type sequence list <seq>. + void subscribe (TAO_NS_ProxySupplier* proxy_supplier, const TAO_NS_EventTypeSeq& seq, TAO_NS_EventTypeSeq& new_seq ACE_ENV_ARG_DECL); + + /// Unsubscribe <proxy_supplier> to the event type sequence list <seq>. + void un_subscribe (TAO_NS_ProxySupplier* proxy_supplier, const TAO_NS_EventTypeSeq& seq, TAO_NS_EventTypeSeq& last_seq ACE_ENV_ARG_DECL); + + /// Subscribe <proxy_consumer> to the event type sequence list <seq>. + void publish (TAO_NS_ProxyConsumer* proxy_consumer, const TAO_NS_EventTypeSeq& seq, TAO_NS_EventTypeSeq& new_seq ACE_ENV_ARG_DECL); + + /// Subscribe <proxy_consumer> to the event type sequence list <seq>. + void un_publish (TAO_NS_ProxyConsumer* proxy_consumer, const TAO_NS_EventTypeSeq& seq, TAO_NS_EventTypeSeq& last_seq ACE_ENV_ARG_DECL); + /// Consumer Map TAO_NS_Consumer_Map* consumer_map_; /// Supplier Map TAO_NS_Supplier_Map* supplier_map_; +}; + +/********************************************************************************/ - /// Consumer Map Observer - TAO_NS_Consumer_Map_Observer* consumer_map_observer_; +/** + * @class TAO_NS_ProxyConsumer_Update_Worker + * + * @brief Inform ProxyConsumer of updates. + * + */ +class TAO_Notify_Export TAO_NS_ProxyConsumer_Update_Worker : public TAO_ESF_Worker<TAO_NS_ProxyConsumer> +{ +public: + TAO_NS_ProxyConsumer_Update_Worker (const TAO_NS_EventTypeSeq& added, const TAO_NS_EventTypeSeq& removed); - /// Supplier Map Observer - TAO_NS_Supplier_Map_Observer* supplier_map_observer_; +protected: + ///= TAO_ESF_Worker method + void work (TAO_NS_ProxyConsumer* proxy ACE_ENV_ARG_DECL); - /// Event Dispatch Observer. - TAO_NS_Event_Dispatch_Observer* event_dispatch_observer_; + const TAO_NS_EventTypeSeq& added_; + const TAO_NS_EventTypeSeq& removed_; +}; - /// Update dispatch observer. - TAO_NS_Updates_Dispatch_Observer* updates_dispatch_observer_; +/********************************************************************************/ - /// Worker task that dispatches pending events. - TAO_NS_Event_Pending_Worker* event_pending_worker_; +/** + * @class TAO_NS_ProxySupplier_Update_Worker + * + * @brief Inform ProxySupplier of updates. + * + */ +class TAO_Notify_Export TAO_NS_ProxySupplier_Update_Worker : public TAO_ESF_Worker<TAO_NS_ProxySupplier> +{ +public: + TAO_NS_ProxySupplier_Update_Worker (const TAO_NS_EventTypeSeq& added, const TAO_NS_EventTypeSeq& removed); + +protected: + ///= TAO_ESF_Worker method + void work (TAO_NS_ProxySupplier* proxy ACE_ENV_ARG_DECL); - /// Worker task that dispatches pending update messges. - TAO_NS_Updates_Pending_Worker* updates_pending_worker_; + const TAO_NS_EventTypeSeq& added_; + const TAO_NS_EventTypeSeq& removed_; }; +/********************************************************************************/ + #if defined (__ACE_INLINE__) #include "Event_Manager.inl" #endif /* __ACE_INLINE__ */ |