4 * @author Carlos O'Ryan <coryan@uci.edu>
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)
14 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 * @brief Simplify the initialization of a Supplier/Consumer pair
23 * connected to the event channel.
25 class TAO_RTEC_Perf_Export Client_Pair
30 * We need a default constructor because this class is often used in
35 /// Initialize the consumer/supplier pair
37 * @param experiment_id For tests that run multiple experiments
38 * this number is changed on each iteration, guaranteeing
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
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
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);
83 Supplier
*supplier (void) const;
85 Consumer
*consumer (void) const;
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 */