Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / orbsvcs / tests / EC_Throughput / ECT_Supplier_Driver.h
blob960a697e712b00dcfeb282e7029df2c9cc0e0422
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_DRIVER_H
12 #define ECT_SUPPLIER_DRIVER_H
14 #include "ace/Task.h"
16 #if !defined (ACE_LACKS_PRAGMA_ONCE)
17 # pragma once
18 #endif /* ACE_LACKS_PRAGMA_ONCE */
20 #include "ace/High_Res_Timer.h"
21 #include "orbsvcs/Channel_Clients_T.h"
22 #include "ECT_Driver.h"
23 #include "ECT_Supplier.h"
25 class ECT_Supplier_Driver : public ECT_Driver
28 // = TITLE
30 // = DESCRIPTION
32 public:
33 ECT_Supplier_Driver (void);
34 virtual ~ECT_Supplier_Driver (void);
36 virtual void shutdown_consumer (void* consumer_cookie);
37 // Not used....
39 enum {
40 MAX_SUPPLIERS = 16
41 // Maximum number of suppliers.
44 int run (int argc, ACE_TCHAR* argv[]);
45 // Execute the test.
47 private:
48 int parse_args (int argc, ACE_TCHAR* argv[]);
49 // parse the command line args
51 void connect_suppliers (RtecScheduler::Scheduler_ptr scheduler,
52 RtecEventChannelAdmin::EventChannel_ptr local_ec);
53 void disconnect_suppliers (void);
54 // Connect the suppliers.
56 void activate_suppliers (void);
57 // Activate the suppliers, i.e. they start generating events.
59 void dump_results (void);
60 // Dump the results for each supplier.
62 private:
63 Test_Supplier* suppliers_[ECT_Supplier_Driver::MAX_SUPPLIERS];
64 // The suppliers array.
66 int n_suppliers_;
67 // The number of suppliers.
69 int burst_count_;
70 // How many bursts we will send from each supplier.
72 int burst_size_;
73 // The number of events
75 int event_size_;
76 // The size of the payload on each event.
78 int burst_pause_;
79 // The time between each event burst, in microseconds.
81 int type_start_;
82 int type_count_;
83 // We send two types of events, with different contents.
85 const ACE_TCHAR* pid_file_name_;
86 // The name of a file where the process stores its pid
89 #endif /* ECT_SUPPLIER_DRIVER_H */