00001 // -*- C++ -*- 00002 00003 /** 00004 * @file ProxyConsumer.h 00005 * 00006 * $Id: ProxyConsumer.h 81422 2008-04-24 12:33:29Z johnnyw $ 00007 * 00008 * @author Pradeep Gore <pradeep@oomworks.com> 00009 */ 00010 00011 #ifndef TAO_Notify_PROXYCONSUMER_H 00012 #define TAO_Notify_PROXYCONSUMER_H 00013 00014 #include /**/ "ace/pre.h" 00015 00016 #include "orbsvcs/Notify/notify_serv_export.h" 00017 #include "orbsvcs/Notify/Event.h" 00018 #include "orbsvcs/Notify/Proxy.h" 00019 #include "orbsvcs/Notify/SupplierAdmin.h" 00020 00021 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00022 # pragma once 00023 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00024 00025 #include "orbsvcs/CosEventChannelAdminC.h" 00026 00027 #include "ace/Auto_Ptr.h" 00028 00029 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00030 00031 class TAO_Notify_Supplier; 00032 00033 /** 00034 * @class TAO_Notify_ProxyConsumer 00035 * 00036 * @brief Base class for all types of ProxyConsumer implementations. 00037 * 00038 */ 00039 class TAO_Notify_Serv_Export TAO_Notify_ProxyConsumer 00040 : public virtual TAO_Notify_Proxy 00041 { 00042 public: 00043 typedef TAO_Notify_Refcountable_Guard_T<TAO_Notify_ProxyConsumer> Ptr; 00044 /// Constructor 00045 TAO_Notify_ProxyConsumer (void); 00046 00047 /// Destructor 00048 virtual ~TAO_Notify_ProxyConsumer (void); 00049 00050 /// init: overrides Topology_Object method 00051 virtual void init (TAO_Notify::Topology_Parent * topology_parent); 00052 00053 /// Connect 00054 void connect (TAO_Notify_Supplier* supplier); 00055 00056 /// Disconnect 00057 void disconnect (void); 00058 00059 /// Shutdown (TAO_Notify_Container_T method) 00060 virtual int shutdown (void); 00061 00062 /// Destroy this object. 00063 virtual void destroy (void); 00064 00065 /// Return true if connected 00066 bool is_connected (void) const; 00067 00068 /// The SA parent. 00069 TAO_Notify_SupplierAdmin& supplier_admin (void); 00070 00071 protected: 00072 /// Access the Supplier 00073 TAO_Notify_Supplier* supplier (void); 00074 00075 /// Accept an event from the Supplier 00076 void push_i (TAO_Notify_Event * event); 00077 00078 private: 00079 /// Is this part of a reliable channel 00080 bool supports_reliable_events () const; 00081 00082 ///= Data Members. 00083 /// The SA parent. 00084 TAO_Notify_SupplierAdmin::Ptr supplier_admin_; 00085 00086 /// The Supplier that we're connect to. 00087 ACE_Auto_Ptr<TAO_Notify_Supplier> supplier_; 00088 00089 /// Access our Peer. 00090 virtual TAO_Notify_Peer* peer (void); 00091 }; 00092 00093 TAO_END_VERSIONED_NAMESPACE_DECL 00094 00095 #if defined (__ACE_INLINE__) 00096 #include "orbsvcs/Notify/ProxyConsumer.inl" 00097 #endif /* __ACE_INLINE__ */ 00098 00099 #include /**/ "ace/post.h" 00100 #endif /* TAO_Notify_PROXYCONSUMER_H */