diff options
Diffstat (limited to 'orbsvcs/examples/Notify/Subscribe/Subscribe.h')
-rw-r--r-- | orbsvcs/examples/Notify/Subscribe/Subscribe.h | 117 |
1 files changed, 60 insertions, 57 deletions
diff --git a/orbsvcs/examples/Notify/Subscribe/Subscribe.h b/orbsvcs/examples/Notify/Subscribe/Subscribe.h index 2b07367a90e..d7d53791135 100644 --- a/orbsvcs/examples/Notify/Subscribe/Subscribe.h +++ b/orbsvcs/examples/Notify/Subscribe/Subscribe.h @@ -1,17 +1,17 @@ /* -*- C++ -*- */ -// $Id$ -// ========================================================================== -// -// = FILENAME -// Subscribe.h -// -// = DESCRIPTION -// Class to demo structured event subscription. -// -// = AUTHOR -// Pradeep Gore <pradeep@cs.wustl.edu> -// -// ========================================================================== +//============================================================================= +/** + * @file Subscribe.h + * + * $Id$ + * + * Class to demo structured event subscription. + * + * + * @author Pradeep Gore <pradeep@cs.wustl.edu> + */ +//============================================================================= + #ifndef NOTIFY_SUBSCRIBE_CLIENT_H #define NOTIFY_SUBSCRIBE_CLIENT_H @@ -23,85 +23,88 @@ class Subscribe_StructuredPushConsumer; class Subscribe_StructuredPushSupplier; +/** + * @class Subscribe + * + * @brief Subscribe + * + * Shows how consumers subscribe for events. + */ class Subscribe { - // = TITLE - // Subscribe - // = DESCRIPTION - // Shows how consumers subscribe for events. public: // = Initialization and Termination Subscribe (void); ~Subscribe (); + /// Init the Client. void init (int argc, ACE_TCHAR *argv []); - // Init the Client. + /// Run the demo. void run (void); - // Run the demo. + /// Called when all events we are waiting for have occured. void done (void); - // Called when all events we are waiting for have occured. protected: + /// Initializes the ORB. void init_ORB (int argc, ACE_TCHAR *argv []); - // Initializes the ORB. + /// Try to get hold of a running naming service. void resolve_naming_service (void); - // Try to get hold of a running naming service. + /// Try to resolve the Notify factory from the Naming service. void resolve_Notify_factory (void); - // Try to resolve the Notify factory from the Naming service. + /// Create an EC. void create_EC (void); - // Create an EC. + /// Create the Supplier Admin. void create_supplieradmin(void); - // Create the Supplier Admin. + /// Create the Consumer Admin. void create_consumeradmin (void); - // Create the Consumer Admin. + /// Create and initialize the consumers. void create_consumers (void); - // Create and initialize the consumers. + /// create and initialize the suppliers. void create_suppliers (void); - // create and initialize the suppliers. + /// send the events. void send_events (void); - // send the events. // = Data Members + /// Reference to the root poa. PortableServer::POA_var root_poa_; - // Reference to the root poa. + /// The ORB that we use. CORBA::ORB_var orb_; - // The ORB that we use. + /// Handle to the name service. CosNaming::NamingContext_var naming_context_; - // Handle to the name service. + /// Channel factory. CosNotifyChannelAdmin::EventChannelFactory_var notify_factory_; - // Channel factory. + /// The one channel that we create using the factory. CosNotifyChannelAdmin::EventChannel_var ec_; - // The one channel that we create using the factory. + /// The group operator between admin-proxy's. CosNotifyChannelAdmin::InterFilterGroupOperator ifgop_; - // The group operator between admin-proxy's. + /// Initial qos specified to the factory when creating the EC. CosNotification::QoSProperties initial_qos_; - // Initial qos specified to the factory when creating the EC. + /// Initial admin props specified to the factory when creating the EC. CosNotification::AdminProperties initial_admin_; - // Initial admin props specified to the factory when creating the EC. + /// The consumer admin used by consumers. CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin_; - // The consumer admin used by consumers. + /// The supplier admin used by suppliers. CosNotifyChannelAdmin::SupplierAdmin_var supplier_admin_; - // The supplier admin used by suppliers. Subscribe_StructuredPushConsumer* consumer_1_; Subscribe_StructuredPushConsumer* consumer_2_; @@ -109,8 +112,8 @@ class Subscribe Subscribe_StructuredPushSupplier* supplier_1_; Subscribe_StructuredPushSupplier* supplier_2_; + /// Set this flag to exit the run loop. CORBA::Boolean done_; - // Set this flag to exit the run loop. }; /*****************************************************************/ @@ -126,35 +129,35 @@ class Subscribe_StructuredPushConsumer public: // = Initialization and Termination code + /// Constructor. Subscribe_StructuredPushConsumer (Subscribe* subscribe); - // Constructor. + /// Connect the Consumer to the EventChannel. + /// Creates a new proxy supplier and connects to it. void connect (CosNotifyChannelAdmin::ConsumerAdmin_ptr consumer_admin); - // Connect the Consumer to the EventChannel. - // Creates a new proxy supplier and connects to it. + /// Disconnect from the supplier. virtual void disconnect (void); - // Disconnect from the supplier. + /// Accessor for the Proxy that we're connected to. CosNotifyChannelAdmin::StructuredProxyPushSupplier_ptr get_proxy_supplier (void); - // Accessor for the Proxy that we're connected to. // public data member for evaluating the results of subscription. CosNotification::EventTypeSeq expected_subscription_; protected: // = Data members + /// The proxy that we are connected to. CosNotifyChannelAdmin::StructuredProxyPushSupplier_var proxy_supplier_; - // The proxy that we are connected to. + /// The proxy_supplier id. CosNotifyChannelAdmin::ProxyID proxy_supplier_id_; - // The proxy_supplier id. + /// callback <done> Subscribe* subscribe_; - // callback <done> // = Methods + /// Destructor virtual ~Subscribe_StructuredPushConsumer (void); - // Destructor // = NotifyPublish method virtual void offer_change ( @@ -184,30 +187,30 @@ class Subscribe_StructuredPushSupplier // public: // = Initialization and Termination code + /// Constructor. Subscribe_StructuredPushSupplier (void); - // Constructor. + /// Connect the Supplier to the EventChannel. + /// Creates a new proxy consumer and connects to it. void connect (CosNotifyChannelAdmin::SupplierAdmin_ptr supplier_admin); - // Connect the Supplier to the EventChannel. - // Creates a new proxy consumer and connects to it. + /// Disconnect from the supplier. void disconnect (void); - // Disconnect from the supplier. + /// Send one event. virtual void send_event (const CosNotification::StructuredEvent& event); - // Send one event. protected: // = Data members + /// The proxy that we are connected to. CosNotifyChannelAdmin::StructuredProxyPushConsumer_var proxy_consumer_; - // The proxy that we are connected to. + /// This supplier's id. CosNotifyChannelAdmin::ProxyID proxy_consumer_id_; - // This supplier's id. // = Protected Methods + /// Destructor virtual ~Subscribe_StructuredPushSupplier (); - // Destructor // = NotifySubscribe virtual void subscription_change ( |