2 //=============================================================================
6 * @author Carlos O'Ryan (coryan@cs.wustl.edu)
8 //=============================================================================
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 * @brief Test the EC connection feature
26 * The EC can be configured to allow re-connection of suppliers
27 * and consumers, this test verifies that:
28 * + The EC does *not* allow connections if the feature is
29 * disabled (the default)
30 * + The EC does allow connections if the feature is enabled
32 * - There are no memory leaks
33 * - Compares the time required for a connection vs a complete
34 * connect/disconnect cycle, specially as the number of
35 * suppliers and consumers increases.
37 class EC_Connect
: public EC_Driver
43 // = The EC_Driver methods
44 virtual int parse_args (int& argc
, ACE_TCHAR
* argv
[]);
45 virtual void print_usage (void);
46 virtual void print_args (void) const;
48 /// Don't run the suppliers, just test connect and disconnect calls.
49 void execute_test (void);
51 virtual void dump_results (void);
53 virtual void connect_consumer (
54 RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin
,
56 virtual void connect_supplier (
57 RtecEventChannelAdmin::SupplierAdmin_ptr supplier_admin
,
59 virtual void disconnect_consumers (void);
60 virtual void disconnect_suppliers (void);
62 virtual EC_Consumer
* allocate_consumer (int i
);
63 virtual EC_Supplier
* allocate_supplier (int i
);
65 virtual void connect_clients (void);
66 virtual void disconnect_clients (void);
69 ACE_hrtime_t start_time_
;
70 ACE_Throughput_Stats consumer_connect_
;
71 ACE_Throughput_Stats supplier_connect_
;
72 ACE_Throughput_Stats consumer_disconnect_
;
73 ACE_Throughput_Stats supplier_disconnect_
;
75 /// What is connected first?
79 // ****************************************************************
81 class ECC_Consumer
: public EC_Consumer
84 ECC_Consumer (EC_Driver
*driver
, void* cookie
);
86 virtual void connect (
87 RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin
,
88 const RtecEventChannelAdmin::ConsumerQOS
& qos
,
89 int shutdown_event_type
);
90 virtual void connect (
91 const RtecEventChannelAdmin::ConsumerQOS
& qos
,
92 int shutdown_event_type
);
93 virtual void dump_results (const ACE_TCHAR
* name
,
94 ACE_High_Res_Timer::global_scale_factor_type global_scale_factor
);
97 ACE_Throughput_Stats connect_time_
;
100 // ****************************************************************
102 class ECC_Supplier
: public EC_Supplier
105 ECC_Supplier (EC_Driver
*driver
, void* cookie
);
107 virtual void connect (
108 RtecEventChannelAdmin::SupplierAdmin_ptr supplier_admin
,
109 const RtecEventChannelAdmin::SupplierQOS
& qos
,
110 int shutdown_event_type
);
111 virtual void connect (
112 const RtecEventChannelAdmin::SupplierQOS
& qos
,
113 int shutdown_event_type
);
114 virtual void dump_results (const ACE_TCHAR
* name
,
115 ACE_High_Res_Timer::global_scale_factor_type global_scale_factor
);
118 ACE_Throughput_Stats connect_time_
;
121 #endif /* EC_CONNECT_H */