diff options
author | pradeep <pradeep@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-10-27 06:12:33 +0000 |
---|---|---|
committer | pradeep <pradeep@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-10-27 06:12:33 +0000 |
commit | 7af180ba1d431a2fea655cad8abc27a288bcbd8b (patch) | |
tree | a41933d575c62d7a0065ee6cf2cf860b6cfd9c4e /TAO/orbsvcs/orbsvcs/Notify/Consumer.h | |
parent | 05f64e8abd88e0c1063a861fd3f21a32a2e3cd7d (diff) | |
download | ATCD-7af180ba1d431a2fea655cad8abc27a288bcbd8b.tar.gz |
ChangeLogTag:Sun Oct 27 01:04:09 2002 Pradeep Gore <pradeep@oomworks.com>
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Notify/Consumer.h')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Notify/Consumer.h | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Consumer.h b/TAO/orbsvcs/orbsvcs/Notify/Consumer.h new file mode 100644 index 00000000000..c70f93b7a3d --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/Notify/Consumer.h @@ -0,0 +1,109 @@ +/* -*- C++ -*- */ +/** + * @file Consumer.h + * + * $Id$ + * + * @author Pradeep Gore <pradeep@oomworks.com> + * + * + */ + +#ifndef TAO_NS_CONSUMER_H +#define TAO_NS_CONSUMER_H +#include "ace/pre.h" + +#include "notify_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "orbsvcs/CosNotifyCommC.h" +#include "orbsvcs/CosNotificationC.h" +#include "Peer.h" +#include "Event.h" +#include "Types.h" + +class TAO_NS_ProxySupplier; +class TAO_NS_Proxy; + +/** + * @class TAO_NS_Consumer + * + * @brief Astract Base class for wrapping consumer objects that connect to the EventChannel + * + */ +class TAO_Notify_Export TAO_NS_Consumer : public TAO_NS_Peer +{ +public: + /// Constuctor + TAO_NS_Consumer (TAO_NS_ProxySupplier* proxy); + + /// Destructor + virtual ~TAO_NS_Consumer (); + + /// Access Specific Proxy. + TAO_NS_ProxySupplier* proxy_supplier (void); + + /// Access Base Proxy. + virtual TAO_NS_Proxy* proxy (void); + + /// Push <event> to this consumer. + void push (const TAO_NS_Event_var& event ACE_ENV_ARG_DECL); + + /// Push <event> to this consumer. + virtual void push (const CORBA::Any& event ACE_ENV_ARG_DECL) = 0; + + /// Push <event> to this consumer. + virtual void push (const CosNotification::StructuredEvent& event ACE_ENV_ARG_DECL) = 0; + + /// Set Observer. + void event_dispatch_observer (TAO_NS_Event_Dispatch_Observer* event_dispatch_observer); + + /// Dispatch the pending events + void dispatch_pending (ACE_ENV_SINGLE_ARG_DECL); + + /// Is the connection suspended? + CORBA::Boolean is_suspended (void); + + /// Suspend Connection + void suspend (ACE_ENV_SINGLE_ARG_DECL); + + /// Resume Connection + void resume (ACE_ENV_SINGLE_ARG_DECL); + +protected: + /// Get the shared Proxy Lock + TAO_SYNCH_MUTEX* proxy_lock (void); + + /// Push Implementation. + virtual void push_i (const TAO_NS_Event_var& event ACE_ENV_ARG_DECL) = 0; + + // Dispatch updates implementation. + virtual void dispatch_updates_i (const TAO_NS_EventTypeSeq & added, + const TAO_NS_EventTypeSeq & removed + ACE_ENV_ARG_DECL); + + /// The Proxy that we associate with. + TAO_NS_ProxySupplier* proxy_; + + /// Observer + TAO_NS_Event_Dispatch_Observer* event_dispatch_observer_; + + /// Events pending to be delivered. + TAO_NS_Event_Collection* event_collection_; + + /// Suspended Flag. + CORBA::Boolean is_suspended_; + + /// Interface that accepts offer_changes + CosNotifyComm::NotifyPublish_var publish_; +}; + +#if defined (__ACE_INLINE__) +#include "Consumer.inl" +#endif /* __ACE_INLINE__ */ + +#include "ace/post.h" +#endif /* TAO_NS_CONSUMER_H */ |