Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / orbsvcs / tests / EC_Throughput / ECT_Supplier.h
blobdf062485bc0d7227d26de5c48af212450e398123
1 /* -*- C++ -*- */
2 //
3 // ============================================================================
4 //
5 // = DESCRIPTION
6 // This is a helper class for the throughput tests of the Event
7 // Channel.
8 //
9 // ============================================================================
11 #ifndef ECT_SUPPLIER_H
12 #define ECT_SUPPLIER_H
14 #include "ECT_Driver.h"
16 #if !defined (ACE_LACKS_PRAGMA_ONCE)
17 # pragma once
18 #endif /* ACE_LACKS_PRAGMA_ONCE */
20 #include "orbsvcs/Channel_Clients_T.h"
21 #include "orbsvcs/RtecEventChannelAdminC.h"
22 #include "orbsvcs/RtecSchedulerC.h"
23 #include "ace/Task.h"
25 class Test_Supplier : public ACE_Task<ACE_SYNCH>
28 // = TITLE
29 // Simplifies the supplier task startup.
31 // = DESCRIPTION
33 public:
34 Test_Supplier (ECT_Driver *driver);
36 int svc (void);
37 // Run the test, just forwards to the driver
39 void connect (RtecScheduler::Scheduler_ptr scheduler,
40 const char* name,
41 int burst_count,
42 int burst_size,
43 int event_size,
44 int burst_pause,
45 int type_start,
46 int type_count,
47 RtecEventChannelAdmin::EventChannel_ptr ec);
48 // This method connects the supplier to the EC.
50 void disconnect (void);
51 // Disconnect from the EC.
53 virtual void disconnect_push_supplier (void);
54 // The methods in the skeleton.
56 RtecEventComm::EventSourceID supplier_id (void) const;
57 // The supplier ID.
59 RtecEventChannelAdmin::ProxyPushConsumer_ptr consumer_proxy (void);
60 // We talk to the EC (as a supplier) using this proxy, no duplicates
61 // are done here...
63 void dump_results (const ACE_TCHAR* name,
64 ACE_Basic_Stats::scale_factor_type global_scale_factor);
65 // Dump the results...
67 void accumulate (ACE_Throughput_Stats& stats) const;
68 // Add our statistics to <stats>
70 private:
71 ECT_Driver *driver_;
72 // Class we forward to.
74 void *cookie_;
75 // The test provide us a cookie so we can give back our identity.
77 RtecEventComm::EventSourceID supplier_id_;
78 // We generate an id based on the name....
80 RtecEventChannelAdmin::ProxyPushConsumer_var consumer_proxy_;
81 // We talk to the EC (as a supplier) using this proxy.
83 ACE_PushSupplier_Adapter<Test_Supplier> supplier_;
84 // We also connect to the EC as a consumer so we can receive the
85 // timeout events.
87 ACE_Throughput_Stats throughput_;
88 // Measure the elapsed time spent while sending the events.
90 int burst_count_;
91 int burst_size_;
92 int event_size_;
93 int burst_pause_;
94 int type_start_;
95 int type_count_;
96 // The test data.
99 #endif /* ECT_SUPPLIER_H */