Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / orbsvcs / performance-tests / RTEvent / lib / Client_Pair.cpp
blob64b9ad83e9ae9e76b262c672a21ab5a967a05897
1 /**
2 * @file Client_Pair.cpp
4 * @author Carlos O'Ryan <coryan@uci.edu>
5 */
7 #include "Client_Pair.h"
8 #include "Auto_Disconnect.h"
10 #if !defined(__ACE_INLINE__)
11 #include "Client_Pair.inl"
12 #endif /* __ACE_INLINE__ */
14 void
15 Client_Pair::init (CORBA::Long experiment_id,
16 CORBA::Long base_event_type,
17 CORBA::ULong iterations,
18 CORBA::Long workload_in_usecs,
19 ACE_High_Res_Timer::global_scale_factor_type gsf,
20 PortableServer::POA_ptr supplier_poa,
21 PortableServer::POA_ptr consumer_poa)
23 const CORBA::Long source_event_range = 1;
24 this->init (experiment_id,
25 base_event_type,
26 source_event_range,
27 iterations,
28 workload_in_usecs,
29 gsf,
30 supplier_poa,
31 consumer_poa);
34 void
35 Client_Pair::init (CORBA::Long experiment_id,
36 CORBA::Long base_event_type,
37 CORBA::Long source_event_range,
38 CORBA::ULong iterations,
39 CORBA::Long workload_in_usecs,
40 ACE_High_Res_Timer::global_scale_factor_type gsf,
41 PortableServer::POA_ptr supplier_poa,
42 PortableServer::POA_ptr consumer_poa)
44 this->supplier_ = new Supplier (experiment_id,
45 base_event_type, source_event_range,
46 supplier_poa);
47 this->consumer_ = new Consumer (experiment_id,
48 base_event_type + 1,
49 iterations,
50 workload_in_usecs,
51 gsf,
52 consumer_poa);
55 void
56 Client_Pair::connect (RtecEventChannelAdmin::EventChannel_ptr ec)
58 this->supplier_->connect (ec);
59 Auto_Disconnect<Supplier> supplier_disconnect (this->supplier_);
61 this->consumer_->connect (ec);
62 Auto_Disconnect<Consumer> consumer_disconnect (this->consumer_);
64 consumer_disconnect.release ();
65 supplier_disconnect.release ();
68 void
69 Client_Pair::disconnect ()
71 Auto_Disconnect<Supplier> supplier_disconnect (this->supplier_);
72 Auto_Disconnect<Consumer> consumer_disconnect (this->consumer_);