Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / orbsvcs / performance-tests / RTEvent / lib / Loopback_Supplier.h
blob7144ce82d4831bdc491620a08a66aecf1494f3ce
1 /**
2 * @file Loopback_Supplier.h
4 * @author Carlos O'Ryan <coryan@uci.edu>
5 */
7 #ifndef TAO_RTEC_LOOPBACK_SUPPLIER_H
8 #define TAO_RTEC_LOOPBACK_SUPPLIER_H
10 #include "rtec_perf_export.h"
11 #include "orbsvcs/RtecEventCommS.h"
12 #include "orbsvcs/RtecEventChannelAdminC.h"
14 #if !defined (ACE_LACKS_PRAGMA_ONCE)
15 # pragma once
16 #endif /* ACE_LACKS_PRAGMA_ONCE */
18 /**
19 * @class Loopback_Supplier
21 * @brief Implement a simple supplier to keep track of the latency
23 class TAO_RTEC_Perf_Export Loopback_Supplier
24 : public virtual POA_RtecEventComm::PushSupplier
26 public:
27 /// Constructor
28 /**
29 * The experiment ID is used to configure the supplier ID on the
30 * publication.
32 Loopback_Supplier (CORBA::Long experiment_id,
33 CORBA::Long response_type,
34 PortableServer::POA_ptr poa);
36 /// Connect to the event channel
37 void connect (RtecEventChannelAdmin::EventChannel_ptr ec);
39 /// Disconnect from the event channel
40 void disconnect (void);
42 void push (const RtecEventComm::EventSet &events);
44 //@{
45 /** @name The RtecEventComm::PushSupplier methods
47 virtual void disconnect_push_supplier (void);
48 virtual PortableServer::POA_ptr _default_POA (void);
49 //@}
51 private:
52 /// The experiment id
53 /// Synchronize access to the internal data
54 TAO_SYNCH_MUTEX mutex_;
56 /// The experiment id
57 CORBA::Long experiment_id_;
59 /// The response event type
60 CORBA::Long response_type_;
62 /// The proxy this object is connected to
63 RtecEventChannelAdmin::ProxyPushConsumer_var proxy_consumer_;
65 /// The default poa
66 PortableServer::POA_var default_POA_;
68 /// Count the number of events processed
69 CORBA::ULong counter_;
72 #endif /* TAO_RTEC_LOOPBACK_SUPPLIER_H */