summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/performance-tests/EC_Latency/Consumer.h
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-08-24 21:46:48 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-08-24 21:46:48 +0000
commit77bf06c1f137d416da22d3a9b0277f72d3c05e1b (patch)
tree2557de589a023a8d33b086cced6a79729f68f3a6 /TAO/orbsvcs/performance-tests/EC_Latency/Consumer.h
parenta5ca76d4d27526f2905fff8b9bb0f0f297dd68ed (diff)
downloadATCD-77bf06c1f137d416da22d3a9b0277f72d3c05e1b.tar.gz
ChangeLogTag:Fri Aug 24 14:35:59 2001 Carlos O'Ryan <coryan@uci.edu>
Diffstat (limited to 'TAO/orbsvcs/performance-tests/EC_Latency/Consumer.h')
-rw-r--r--TAO/orbsvcs/performance-tests/EC_Latency/Consumer.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/TAO/orbsvcs/performance-tests/EC_Latency/Consumer.h b/TAO/orbsvcs/performance-tests/EC_Latency/Consumer.h
new file mode 100644
index 00000000000..b089e771fcb
--- /dev/null
+++ b/TAO/orbsvcs/performance-tests/EC_Latency/Consumer.h
@@ -0,0 +1,65 @@
+/**
+ * @file Consumer.h
+ *
+ * $Id$
+ *
+ */
+
+#ifndef ECL_CONSUMER_H
+#define ECL_CONSUMER_H
+
+#include "orbsvcs/RtecEventCommS.h"
+#include "orbsvcs/RtecEventChannelAdminC.h"
+#include "ace/Sample_History.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class ECL_Consumer
+ *
+ * @brief Implement a simple consumer to keep track of the latency
+ *
+ */
+class ECL_Consumer
+ : public virtual POA_RtecEventComm::PushConsumer
+ , public virtual PortableServer::RefCountServantBase
+
+{
+public:
+ /// Constructor
+ ECL_Consumer (int iterations);
+
+ /// Connect to the event channel
+ void connect (RtecEventChannelAdmin::EventChannel_ptr ec,
+ CORBA::Environment &ACE_TRY_ENV);
+
+ /// Disconnect from the event channel
+ void disconnect (CORBA::Environment &ACE_TRY_ENV);
+
+ /// Access the history of samples
+ ACE_Sample_History &sample_history (void);
+
+ //@{
+ /** @name The RtecEventComm::PushConsumer methods
+ */
+ virtual void push (const RtecEventComm::EventSet& events,
+ CORBA::Environment &_env)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ virtual void disconnect_push_consumer (CORBA::Environment &)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+private:
+ /// Synchronize access to the internal data
+ TAO_SYNCH_MUTEX mutex_;
+
+ /// The proxy this object is connected to
+ RtecEventChannelAdmin::ProxyPushSupplier_var proxy_supplier_;
+
+ /// The history of latency samples
+ ACE_Sample_History sample_history_;
+};
+
+#endif /* ECL_CONSUMER_H */