libjmmcg  release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
fix_to_links_main_impl.hpp
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright © 2017 by J.M.McGuiness, isimud@hussar.me.uk
3 **
4 ** This library is free software; you can redistribute it and/or
5 ** modify it under the terms of the GNU Lesser General Public
6 ** License as published by the Free Software Foundation; either
7 ** version 2.1 of the License, or (at your option) any later version.
8 **
9 ** This library is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 ** Lesser General Public License for more details.
13 **
14 ** You should have received a copy of the GNU Lesser General Public
15 ** License along with this library; if not, write to the Free Software
16 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18 
19 namespace isimud { namespace ISIMUD_VER_NAMESPACE { namespace exchanges {
20 
21 inline int
22 fix_to_links::main(int argc, char const * const *argv) noexcept(true) {
23  return base_t::main<link_t>(
24  argc,
25  argv,
34  )
35  )
36  )
37  )
38  )
39  )
40  ),
41  [](boost::program_options::variables_map const &vm) {
42  using conn_pol_t=typename link_t::exchg_link_t::conn_pol_t;
45 
46  auto const MIC_code_gen=[]() {
49  return ss.str();
50  };
52  std::ifstream ref_data_src(vm[(MIC_code+"_ref_data").c_str()].as<std::string>().c_str());
54 
55  const std::string user(vm[(MIC_code+"_username").c_str()].as<std::string>());
58  const std::string pass(vm[(MIC_code+"_password").c_str()].as<std::string>());
61  const std::string new_pass(vm[(MIC_code+"_new_password").c_str()].as<std::string>());
64  const std::string reason(vm[(MIC_code+"_logout_reason").c_str()].as<std::string>());
67  return std::make_tuple(
68  typename link_t::client_link_t::ctor_args{
69  boost::asio::ip::address_v4::from_string(vm["client_address"].as<std::string>()),
70  vm["client_port"].as<unsigned short>(),
72  },
73  conn_pol_t(
74  typename conn_pol_t::gateways_t(
75  std::make_pair(boost::asio::ip::address_v4::from_string(vm[(MIC_code+"_primary_gateway_address").c_str()].as<std::string>()), vm[(MIC_code+"_primary_gateway_port").c_str()].as<unsigned short>()),
76  std::make_pair(boost::asio::ip::address_v4::from_string(vm[(MIC_code+"_secondary_gateway_address").c_str()].as<std::string>()), vm[(MIC_code+"_secondary_gateway_port").c_str()].as<unsigned short>())
77  ),
78  typename conn_pol_t::logon_args_t{
79  user_conv,
80  pass_conv,
82  },
85  }
86  ),
88  );
89  }
90  );
91 }
92 
93 } } }