diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2003-07-03 18:51:27 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2003-07-03 18:51:27 +0000 |
commit | 214fa18adef8d5327c4d968983c1476e891b95f7 (patch) | |
tree | 3218dce2f86bac17d3ca3aff515694eef989aa92 /TAO/orbsvcs/tests/Event/lib/Consumer.h | |
parent | 0f1fcb02951a4fc3e72e75a0c9f01ca887bcec84 (diff) | |
download | ATCD-214fa18adef8d5327c4d968983c1476e891b95f7.tar.gz |
ChangeLogTag: Thu Jul 03 18:51:12 UTC 2003 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'TAO/orbsvcs/tests/Event/lib/Consumer.h')
-rw-r--r-- | TAO/orbsvcs/tests/Event/lib/Consumer.h | 98 |
1 files changed, 48 insertions, 50 deletions
diff --git a/TAO/orbsvcs/tests/Event/lib/Consumer.h b/TAO/orbsvcs/tests/Event/lib/Consumer.h index 9bb507daf0f..995103cc29f 100644 --- a/TAO/orbsvcs/tests/Event/lib/Consumer.h +++ b/TAO/orbsvcs/tests/Event/lib/Consumer.h @@ -1,18 +1,14 @@ /* -*- C++ -*- */ -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// ORBSVCS Real-time Event Channel testsuite -// -// = FILENAME -// Consumer -// -// = AUTHOR -// Carlos O'Ryan (coryan@cs.wustl.edu) -// -// ============================================================================ +//============================================================================= +/** + * @file Consumer + * + * $Id$ + * + * @author Carlos O'Ryan (coryan@cs.wustl.edu) + */ +//============================================================================= + #ifndef EC_CONSUMER_H #define EC_CONSUMER_H @@ -26,97 +22,99 @@ #include "orbsvcs/RtecEventCommS.h" #include "orbsvcs/RtecEventChannelAdminC.h" +/** + * @class EC_Consumer + * + * @brief Simple consumer object to implement EC tests. + * + * This class is a consumer of events. + * The class is just a helper to simplify common tasks in EC + * tests, such as subscribing for a range of events, disconnecting + * from the EC, informing the driver of shutdown messages, etc. + * There are several ways to connect and disconnect this class, + * and it is up to the driver program to use the right one. + */ class EC_Test_Export EC_Consumer : public POA_RtecEventComm::PushConsumer { - // = TITLE - // Simple consumer object to implement EC tests. - // - // = DESCRIPTION - // This class is a consumer of events. - // The class is just a helper to simplify common tasks in EC - // tests, such as subscribing for a range of events, disconnecting - // from the EC, informing the driver of shutdown messages, etc. - // - // There are several ways to connect and disconnect this class, - // and it is up to the driver program to use the right one. - // public: + /// Constructor EC_Consumer (EC_Driver* driver, void* cookie); - // Constructor + /// The driver program can build the QoS attributes and obtain the + /// ConsumerAdmin, we do the rest. virtual void connect ( RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin, const RtecEventChannelAdmin::ConsumerQOS& qos, int shutdown_event_type ACE_ENV_ARG_DECL); - // The driver program can build the QoS attributes and obtain the - // ConsumerAdmin, we do the rest. + /** + * The driver program can build the QoS attributes and we use + * whatevet supplier_proxy we already have (useful for reconnection + * tests). + */ virtual void connect ( const RtecEventChannelAdmin::ConsumerQOS& qos, int shutdown_event_type ACE_ENV_ARG_DECL); - // The driver program can build the QoS attributes and we use - // whatevet supplier_proxy we already have (useful for reconnection - // tests). + /// returns 0 if it is not connected virtual int connected (void) const; - // returns 0 if it is not connected + /// The application can invoke this method to disconnect from the EC + /// and deactivate this class. void disconnect (ACE_ENV_SINGLE_ARG_DECL); - // The application can invoke this method to disconnect from the EC - // and deactivate this class. + /// The application is shutting down, deactivate the consumer. void shutdown (ACE_ENV_SINGLE_ARG_DECL); - // The application is shutting down, deactivate the consumer. + /// Accumulate our statistics to the totals. void accumulate (ACE_Throughput_Stats& throughput) const; - // Accumulate our statistics to the totals. + /// Printout the statistics virtual void dump_results (const char* name, ACE_UINT32 global_scale_factor); - // Printout the statistics // = The RtecEventComm::PushConsumer methods + /// The skeleton methods. virtual void push (const RtecEventComm::EventSet& events ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); virtual void disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)); - // The skeleton methods. private: + /// The main driver for the test. EC_Driver* driver_; - // The main driver for the test. + /// A magic cookie passed by the driver that we pass back in our + /// callbacks. void* cookie_; - // A magic cookie passed by the driver that we pass back in our - // callbacks. + /// We talk to the EC using this proxy. RtecEventChannelAdmin::ProxyPushSupplier_var supplier_proxy_; - // We talk to the EC using this proxy. + /// Protect internal state TAO_SYNCH_MUTEX lock_; - // Protect internal state + /// The timestamp for the first message received ACE_hrtime_t throughput_start_; - // The timestamp for the first message received + /// Used for reporting stats ACE_Throughput_Stats throughput_; - // Used for reporting stats + /// The number of push() calls int push_count_; - // The number of push() calls + /// The type used to indicate shutdown int shutdown_event_type_; - // The type used to indicate shutdown + /// Is the consumer active in the POA? int is_active_; - // Is the consumer active in the POA? + /// Cache the object reference to speed up connect/disconnect calls. RtecEventComm::PushConsumer_var myself_; - // Cache the object reference to speed up connect/disconnect calls. }; #endif /* ECT_CONSUMER_H */ |