libjmmcg  release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
fix_to_links_main.hpp
Go to the documentation of this file.
1 #ifndef ISIMUD_EXCHANGES_links_fix_to_links_hpp
2 #define ISIMUD_EXCHANGES_links_fix_to_links_hpp
3 
4 /******************************************************************************
5 ** Copyright © 2017 by J.M.McGuiness, isimud@hussar.me.uk
6 **
7 ** This library is free software; you can redistribute it and/or
8 ** modify it under the terms of the GNU Lesser General Public
9 ** License as published by the Free Software Foundation; either
10 ** version 2.1 of the License, or (at your option) any later version.
11 **
12 ** This library is distributed in the hope that it will be useful,
13 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 ** Lesser General Public License for more details.
16 **
17 ** You should have received a copy of the GNU Lesser General Public
18 ** License along with this library; if not, write to the Free Software
19 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21 
22 #include "../BATSBOE/EU/v1/batsboe.hpp"
23 #include "../BATSBOE/US/v1/batsboe.hpp"
24 #include "../MIT/BIT/bit.hpp"
25 #include "../MIT/JSE/jse.hpp"
26 #include "../MIT/LSE/lse.hpp"
27 #include "../MIT/OSLO/oslo.hpp"
28 #include "../MIT/TRQ/trq.hpp"
29 
34 
35 #include "../conversions/fix_to_batsboe_eu_conversions.hpp"
36 #include "../conversions/batsboe_eu_to_fix_conversions.hpp"
37 #include "../conversions/fix_to_mit_conversions.hpp"
38 #include "../conversions/mit_to_fix_conversions.hpp"
39 
40 #include "core/unordered_tuple.hpp"
41 
42 namespace isimud { namespace ISIMUD_VER_NAMESPACE { namespace exchanges {
43 
44 class fix_to_links : public fix_to_link {
45 public:
46  using base_t=fix_to_link;
47  struct link_base {};
48  struct link_t {
49  /// How to get the MIC out of the specified link.
50  template<class Link>
51  struct get_mic_as_hash {
52  static constexpr const exchanges::common::mic_codes::ISO_10383_MIC_Codes value=Link::exchange_msg_details_t::MIC_code;
53  };
54  using FIX_version=exchanges::FIX::v5_0sp2::MsgTypes;
55  /// The super-funky container for exchange links that performs no dynamic allocation & has optimal, constant-time lookup!
57  exchanges::common::mic_codes::ISO_10383_MIC_Codes, ///< The keys to find the link required for sending the message from the XDEST tag in the incoming FIX message.
58  exchanges::common::link_base, ///< We need a common base for the links, but not that testing reveals that gcc & clang can de-virtualise the call (also because we return the derived type).
59  exchanges::common::mic_codes::hash, ///< The ISO specification of MICs ensures they are a perfect hash! Yay!
60  get_mic_as_hash, ///< How to get the MIC out of the link.
68  >;
69  };
70 
71  static int main(int argc, char const * const *argv) noexcept(true);
72 };
73 
74 } } }
75 
77 
78 #endif