2 * @file Client_Options.cpp
4 * @author Carlos O'Ryan <coryan@uci.edu>
7 #include "Client_Options.h"
9 #include "ace/Log_Msg.h"
11 Client_Options::Client_Options (int &argc
, ACE_TCHAR
*argv
[])
12 : ior (ACE_TEXT("file://test.ior"))
15 , high_priority_period (0)
16 , high_priority_workload (0)
17 , low_priority_period (0)
18 , low_priority_workload (0)
19 , low_priority_consumers (0)
22 , global_low_priority_rate (0)
23 , unique_low_priority_event (0)
24 , funky_supplier_publication (0)
25 , high_priority_is_last (0)
27 ACE_Arg_Shifter
arg_shifter (argc
, argv
);
29 while (arg_shifter
.is_anything_left ())
31 const ACE_TCHAR
*arg
= arg_shifter
.get_current ();
33 if (ACE_OS::strcmp (arg
, ACE_TEXT("-k")) == 0)
35 arg_shifter
.consume_arg ();
37 if (arg_shifter
.is_parameter_next ())
39 this->ior
= arg_shifter
.get_current ();
40 arg_shifter
.consume_arg ();
44 else if (option (arg_shifter
, ACE_TEXT("-i"), iterations
)) {}
45 else if (option (arg_shifter
, ACE_TEXT("-n"), nthreads
)) {}
46 else if (option (arg_shifter
, ACE_TEXT("-h"), high_priority_period
)) {}
47 else if (option (arg_shifter
, ACE_TEXT("-l"), low_priority_period
)) {}
48 else if (option (arg_shifter
, ACE_TEXT("-w"), low_priority_workload
)) {}
49 else if (option (arg_shifter
, ACE_TEXT("-v"), high_priority_workload
)) {}
50 else if (option (arg_shifter
, ACE_TEXT("-c"), low_priority_consumers
)) {}
52 else if (boolean_option (arg_shifter
, ACE_TEXT("-d"), dump_history
)) {}
53 else if (boolean_option (arg_shifter
, ACE_TEXT("-r"), use_rt_corba
)) {}
54 else if (boolean_option (arg_shifter
, ACE_TEXT("-g"), global_low_priority_rate
)) {}
55 else if (boolean_option (arg_shifter
, ACE_TEXT("-u"), unique_low_priority_event
)) {}
56 else if (boolean_option (arg_shifter
, ACE_TEXT("-f"), funky_supplier_publication
)) {}
57 else if (boolean_option (arg_shifter
, ACE_TEXT("-x"), high_priority_is_last
)) {}
61 arg_shifter
.ignore_arg ();
67 Client_Options::option (ACE_Arg_Shifter
&arg_shifter
,
68 const ACE_TCHAR
*option_name
,
71 if (ACE_OS::strcmp (arg_shifter
.get_current (), option_name
) != 0)
73 arg_shifter
.consume_arg ();
74 if (arg_shifter
.is_parameter_next ())
76 option_value
= ACE_OS::atoi (arg_shifter
.get_current ());
77 arg_shifter
.consume_arg ();
82 "Missing value for option '%s'\n", option_name
));
88 Client_Options::boolean_option (ACE_Arg_Shifter
&arg_shifter
,
89 const ACE_TCHAR
*option_name
,
92 if (ACE_OS::strcmp (arg_shifter
.get_current (), option_name
) != 0)
94 arg_shifter
.consume_arg ();