diff options
Diffstat (limited to 'TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/RedGreen_Test.h')
-rw-r--r-- | TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/RedGreen_Test.h | 152 |
1 files changed, 78 insertions, 74 deletions
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/RedGreen_Test.h b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/RedGreen_Test.h index 2eeae43842c..720939e4b2c 100644 --- a/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/RedGreen_Test.h +++ b/TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/RedGreen_Test.h @@ -1,18 +1,18 @@ /* -*- C++ -*- */ -// $Id$ -// ========================================================================== -// -// = FILENAME -// RedGreen_Test.h -// -// = DESCRIPTION -// Performance test to show improvement in Notify performance by picking the -// correcting configuration. -// -// = AUTHOR -// Pradeep Gore <pradeep@cs.wustl.edu> -// -// ========================================================================== +//============================================================================= +/** + * @file RedGreen_Test.h + * + * $Id$ + * + * Performance test to show improvement in Notify performance by picking the + * correcting configuration. + * + * + * @author Pradeep Gore <pradeep@cs.wustl.edu> + */ +//============================================================================= + #ifndef NOTIFY_RedGreen_Test_CLIENT_H #define NOTIFY_RedGreen_Test_CLIENT_H @@ -34,37 +34,41 @@ class RedGreen_Test_StructuredPushConsumer; class RedGreen_Test_StructuredPushSupplier; +/** + * @class Worker + * + * @brief Run a server thread + * + * Use the ACE_Task_Base class to run server threads + */ class Worker : public ACE_Task_Base { - // = TITLE - // Run a server thread - // - // = DESCRIPTION - // Use the ACE_Task_Base class to run server threads - // public: + /// Constructor. Worker (void); - // Constructor. void orb (CORBA::ORB_ptr orb); + /// The thread entry point. virtual int svc (void); - // The thread entry point. // Shutdown ORB void done (void); private: + /// The orb CORBA::ORB_var orb_; - // The orb }; +/** + * @class RedGreen_Test + * + * @brief RedGreen_Test + * + * Shows how consumers RedGreen_Test for events. + */ class RedGreen_Test { - // = TITLE - // RedGreen_Test - // = DESCRIPTION - // Shows how consumers RedGreen_Test for events. public: // = Initialization @@ -75,82 +79,82 @@ class RedGreen_Test void dump_results (void); + /// Initialize the Client. void init (int argc, ACE_TCHAR *argv []); - // Initialize 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. + /// Destroy from the EC void destroy_ec (void); - // Destroy from the EC int burst_size_; Worker worker_; int nthreads_; 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. RedGreen_Test_StructuredPushConsumer* normal_consumer_; RedGreen_Test_StructuredPushConsumer* slow_consumer_; @@ -171,49 +175,49 @@ class RedGreen_Test_StructuredPushConsumer public: // = Initialization and Termination code + /// Constructor. RedGreen_Test_StructuredPushConsumer (RedGreen_Test* RedGreen_Test); - // 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. + /// Accumulate the throughput statistics into <throughput> void accumulate_into (ACE_Throughput_Stats &throughput) const; - // Accumulate the throughput statistics into <throughput> + /// Accumulate the throughput statistics into <throughput> void dump_stats (const ACE_TCHAR* msg, ACE_UINT32 gsf); - // Accumulate the throughput statistics into <throughput> 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> RedGreen_Test* RedGreen_Test_; - // callback <done> + /// Protect internal state TAO_SYNCH_MUTEX lock_; - // Protect internal state int push_count_; + /// Used for reporting stats ACE_Throughput_Stats throughput_; - // Used for reporting stats // = Methods + /// Destructor virtual ~RedGreen_Test_StructuredPushConsumer (void); - // Destructor // = NotifyPublish method virtual void offer_change ( @@ -255,39 +259,39 @@ class RedGreen_Test_StructuredPushSupplier // public: // = Initialization and Termination code + /// Constructor. RedGreen_Test_StructuredPushSupplier (void); - // Constructor. + /// Connect the Supplier to the EventChannel. + /// Creates a new proxy supplier and connects to it. void connect (CosNotifyChannelAdmin::SupplierAdmin_ptr supplier_admin); - // Connect the Supplier to the EventChannel. - // Creates a new proxy supplier and connects to it. + /// Disconnect from the supplier. void disconnect (void); - // Disconnect from the supplier. + /// Send one event. virtual void send_event (CosNotification::StructuredEvent& event); - // Send one event. + /// Accumulate the throughput statistics into <throughput> void accumulate_into (ACE_Throughput_Stats &throughput) const; - // Accumulate the throughput statistics into <throughput> + /// Accumulate the throughput statistics into <throughput> void dump_stats (const ACE_TCHAR* msg, ACE_UINT32 gsf); - // Accumulate the throughput statistics into <throughput> 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. + /// Measure the elapsed time spent while sending the events. ACE_Throughput_Stats throughput_; - // Measure the elapsed time spent while sending the events. // = Protected Methods + /// Destructor virtual ~RedGreen_Test_StructuredPushSupplier (); - // Destructor // = NotifyRedGreen_Test virtual void subscription_change ( |