Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / orbsvcs / performance-tests / RTEvent / lib / Loopback_Pair.h
blob670ac2a2441071235861ce05bb3d63d5da68bc64
1 /**
2 * @file Loopback_Pair.h
4 * @author Carlos O'Ryan <coryan@uci.edu>
5 */
7 #ifndef TAO_PERF_RTEC_LOOPBACK_PAIR_H
8 #define TAO_PERF_RTEC_LOOPBACK_PAIR_H
10 #include "Servant_var.h"
12 #if !defined (ACE_LACKS_PRAGMA_ONCE)
13 # pragma once
14 #endif /* ACE_LACKS_PRAGMA_ONCE */
16 #include "Loopback_Supplier.h"
17 #include "Loopback_Consumer.h"
19 /**
20 * @class Loopback_Pair
22 * @brief Simplify the initialization of a Loopback connection through
23 * the event channel.
25 class TAO_RTEC_Perf_Export Loopback_Pair
27 public:
28 /// Constructor
29 /**
30 * We need a default constructor because this class is often used in
31 * arrays.
33 Loopback_Pair (void);
35 /**
36 * @param experiment_id For tests that run multiple experiments
37 * this number is changed on each iteration, guaranteeing
38 * better isolation.
39 * @param base_event_type The event type generated by the supplier.
40 * The Loopback_Consumer consumes the same event, the
41 * Loopback_Supplier generates (base_event_type + 1), and the
42 * consumer subscribes for that type too.
43 * @param iterations The number of iterations expected on the test.
44 * @param workload_in_usecs The consumer workload, in microseconds.
45 * @param gsf The high resolution timer global scale factor.
48 void init (CORBA::Long experiment_id,
49 CORBA::Long base_event_type,
50 PortableServer::POA_ptr supplier_poa,
51 PortableServer::POA_ptr consumer_poa);
53 /// Connect to the event channel
54 void connect (RtecEventChannelAdmin::EventChannel_ptr ec);
56 /// Disconnect from the event channel
57 void disconnect (void);
59 //@{
60 /** @name Accessors
62 Loopback_Supplier *loopback_supplier (void) const;
64 Loopback_Consumer *loopback_consumer (void) const;
65 //@}
67 private:
68 Servant_var<Loopback_Supplier> loopback_supplier_;
69 Servant_var<Loopback_Consumer> loopback_consumer_;
72 #if defined(__ACE_INLINE__)
73 #include "Loopback_Pair.inl"
74 #endif /* __ACE_INLINE__ */
76 #endif /* TAO_PERF_RTEC_LOOPBACK_PAIR_H */