22 inline boost::program_options::options_description
25 using exchange_msg_details_t=
typename link_t::exchg_link_t::exchange_msg_details_t;
26 using proc_rules_t=
BATSBOE::
common::simulator_responses<exchange_msg_details_t>;
28 std::string
const MIC_code=[]() {
29 std::ostringstream ss;
30 exchanges::common::mic_codes::to_stream<exchange_msg_details_t::MIC_code>(ss);
33 std::ostringstream os;
34 std::string
const details=os.str()+
"\n"+[]() {
35 std::ostringstream ss;
36 ss<<
"ISO 10383: MIC Codes official information: ";
37 decltype(+exchanges::common::mic_codes::collection[
40 std::underlying_type<exchanges::common::mic_codes::ISO_10383_MIC_Codes>::type
42 exchange_msg_details_t::MIC_code
45 ])::type::to_stream(ss);
49 boost::program_options::options_description link_opts((MIC_code+
" link options.").c_str());
50 link_opts.add_options()
52 (MIC_code+
"_sequence_number").c_str(),
53 boost::program_options::value<
unsigned>()->required(),
54 "The initial sequence number that should be used to log on to the exchange."
57 (MIC_code+
"_session_sub_id").c_str(),
58 boost::program_options::value<
unsigned>()->required(),
59 "The session sub ID that should be used to log on to the exchange."
62 (MIC_code+
"_no_unspec_replay").c_str(),
63 boost::program_options::value<
bool>()->required(),
64 "Whether no unspecified replays should be used to log on to the exchange."
66 boost::program_options::options_description exchange(
"Exchange options (the defaults are suitable for use with the simulator)");
67 exchange.add_options()
69 (MIC_code+
"_gateway_address").c_str(),
70 boost::program_options::value<
std::string>()->required()->default_value(
boost::
asio::
ip::address_v4::loopback().to_string()),
71 "IP address (in v4 format; thus the network interface to which it is bound) of the gateway to which the translator should connect."
74 (MIC_code+
"_gateway_port").c_str(),
75 boost::program_options::value<
unsigned short>()->required(),
76 "The port of the gateway to which the translator should connect."
79 (MIC_code+
"_username").c_str(),
80 boost::program_options::value<
std::string>()->required()->default_value(proc_rules_t::username.begin()),
81 "The username with which to connect to the exchange."
84 (MIC_code+
"_password").c_str(),
85 boost::program_options::value<
std::string>()->required()->default_value(proc_rules_t::password.begin()),
86 "The password with which to connect to the exchange."
89 (MIC_code+
"_logout_reason").c_str(),
90 boost::program_options::value<
std::string>()->required()->default_value(
"TTFN"),
91 "The reason that should be used when logging out of the connected exchange."
93 boost::program_options::options_description all_opts(details);
94 all_opts.add(link_opts).add(exchange);
96 return std::move(all);