Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / orbsvcs / performance-tests / RTEvent / lib / Client_Pair.h
blob5f494600416d8340df0cfd103b7b306b3d17cf7b
1 /**
2 * @file Client_Pair.h
4 * @author Carlos O'Ryan <coryan@uci.edu>
5 */
7 #ifndef TAO_PERF_RTEC_CLIENT_PAIR_H
8 #define TAO_PERF_RTEC_CLIENT_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 "Consumer.h"
17 #include "Supplier.h"
19 /**
20 * @class Client_Pair
22 * @brief Simplify the initialization of a Supplier/Consumer pair
23 * connected to the event channel.
25 class TAO_RTEC_Perf_Export Client_Pair
27 public:
28 /// Constructor
29 /**
30 * We need a default constructor because this class is often used in
31 * arrays.
33 Client_Pair (void);
35 /// Initialize the consumer/supplier pair
36 /**
37 * @param experiment_id For tests that run multiple experiments
38 * this number is changed on each iteration, guaranteeing
39 * better isolation.
40 * @param base_event_type The event type generated by the supplier.
41 * The Loopback_Consumer consumes the same event, the
42 * Loopback_Supplier generates (base_event_type + 1), and the
43 * consumer subscribes for that type too.
44 * @param iterations The number of iterations expected on the test.
45 * @param workload_in_usecs The consumer workload, in microseconds.
46 * @param gsf The high resolution timer global scale factor.
49 void init (CORBA::Long experiment_id,
50 CORBA::Long base_event_type,
51 CORBA::ULong iterations,
52 CORBA::Long workload_in_usecs,
53 ACE_High_Res_Timer::global_scale_factor_type gsf,
54 PortableServer::POA_ptr supplier_poa,
55 PortableServer::POA_ptr consumer_poa);
57 /// Initialize the consumer/supplier pair
58 /**
59 * This variant works as the previous one, but it allows for
60 * multiple events in the supplier-side.
62 * @param source_event_range The number of events declared by the
63 * source.
65 void init (CORBA::Long experiment_id,
66 CORBA::Long base_event_type,
67 CORBA::Long source_event_range,
68 CORBA::ULong iterations,
69 CORBA::Long workload_in_usecs,
70 ACE_High_Res_Timer::global_scale_factor_type gsf,
71 PortableServer::POA_ptr supplier_poa,
72 PortableServer::POA_ptr consumer_poa);
74 /// Connect to the event channel
75 void connect (RtecEventChannelAdmin::EventChannel_ptr ec);
77 /// Disconnect from the event channel
78 void disconnect (void);
80 //@{
81 /** @name Accessors
83 Supplier *supplier (void) const;
85 Consumer *consumer (void) const;
86 //@}
88 private:
89 Servant_var<Supplier> supplier_;
90 Servant_var<Consumer> consumer_;
93 #if defined(__ACE_INLINE__)
94 #include "Client_Pair.inl"
95 #endif /* __ACE_INLINE__ */
97 #endif /* TAO_PERF_RTEC_CLIENT_PAIR_H */