|
libjmmcg
release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
|
#include "stdafx.h"#include <boost/test/included/unit_test.hpp>#include <boost/mpl/list.hpp>#include "core/ave_deviation_meter.hpp"#include "core/jthread.hpp"#include "core/latency_timestamps.hpp"#include "core/max_min.hpp"#include "core/socket_client_manager.hpp"#include "core/socket_server.hpp"Go to the source code of this file.
Classes | |
| struct | isimud::ISIMUD_VER_NAMESPACE::exchanges::common::thread_traits |
| From the detected NUMA layout, assign cores to the logical threads in the FIX-to-exchange translator. More... | |
| struct | isimud::ISIMUD_VER_NAMESPACE::exchanges::common::thread_traits::thread_info |
| struct | msgs_t |
| struct | msgs_t::static_size |
| struct | msgs_t::static_size::Header_t |
| struct | msgs_t::static_size::message |
| struct | msgs_t::static_size::heartbeat |
| struct | msgs_t::variable_size |
| struct | msgs_t::variable_size::Header_t |
| struct | msgs_t::variable_size::message |
| struct | msgs_t::variable_size::heartbeat |
| struct | just_connect |
| struct | num_msgs |
| struct | sink< SktT, MsgsT > |
| struct | sink< SktT, MsgsT >::heartbeats |
| struct | simple_reflect< SktT, MsgsT > |
| struct | simple_reflect< SktT, MsgsT >::heartbeats |
Namespaces | |
| namespace | isimud |
| namespace | isimud::ISIMUD_VER_NAMESPACE |
| namespace | isimud::ISIMUD_VER_NAMESPACE::exchanges |
| namespace | isimud::ISIMUD_VER_NAMESPACE::exchanges::common |
Macros | |
| #define | BOOST_TEST_MODULE libjmmcg_tests |
Typedefs | |
| using | api_thread_traits = ppd::thread_params< ppd::platform_api > |
| using | timed_results_t = ave_deviation_meter< double > |
| using | asio_client_mgr_t = socket::asio::client_manager< ppd::api_lock_traits< ppd::platform_api, ppd::heavyweight_threading >::critical_section_type::lock_type > |
| using | glibc_client_mgr_t = socket::glibc::client_manager< ppd::api_lock_traits< ppd::platform_api, ppd::heavyweight_threading >::critical_section_type::lock_type > |
| template<template< class, class > class ProcRules> | |
| using | cxns_types = boost::mpl::list< std::pair< asio_client_mgr_t, socket::svr< ProcRules< asio_client_mgr_t::socket_t, msgs_t::static_size >, socket::server_manager::loopback< typename ProcRules< asio_client_mgr_t::socket_t, msgs_t::static_size >::heartbeats, asio_client_mgr_t::socket_t > > >, std::pair< glibc_client_mgr_t, socket::svr< ProcRules< glibc_client_mgr_t::socket_t, msgs_t::static_size >, socket::server_manager::loopback< typename ProcRules< glibc_client_mgr_t::socket_t, msgs_t::static_size >::heartbeats, glibc_client_mgr_t::socket_t > > >, std::pair< asio_client_mgr_t, socket::svr< ProcRules< asio_client_mgr_t::socket_t, msgs_t::variable_size >, socket::server_manager::loopback< typename ProcRules< asio_client_mgr_t::socket_t, msgs_t::variable_size >::heartbeats, asio_client_mgr_t::socket_t > > >, std::pair< glibc_client_mgr_t, socket::svr< ProcRules< glibc_client_mgr_t::socket_t, msgs_t::variable_size >, socket::server_manager::loopback< typename ProcRules< glibc_client_mgr_t::socket_t, msgs_t::variable_size >::heartbeats, glibc_client_mgr_t::socket_t > > > > |
| using | cxns_sink_types = cxns_types< sink > |
| using | cxns_reflect_types = cxns_types< simple_reflect > |
Enumerations | |
| enum | : bool { has_static_size =true } |
| enum | : std::size_t { header_t_size =sizeof(Header_t) } |
| enum | : std::size_t { header_t_size =sizeof(Header_t) } |
| enum | : unsigned { max_missed_heartbeats =1 } |
| enum | : bool { has_static_size =true } |
| enum | : std::size_t { header_t_size =sizeof(Header_t) } |
| enum | : std::size_t { header_t_size =sizeof(Header_t) } |
| enum | : unsigned { max_missed_heartbeats =1 } |
| enum | : bool { has_static_size =true } |
| enum | : std::size_t { header_t_size =sizeof(Header_t) } |
| enum | : std::size_t { header_t_size =sizeof(Header_t) } |
| enum | : unsigned { max_missed_heartbeats =1 } |
| enum | : bool { has_static_size =true } |
| enum | : std::size_t { header_t_size =sizeof(Header_t) } |
| enum | : std::size_t { header_t_size =sizeof(Header_t) } |
| enum | : unsigned { max_missed_heartbeats =1 } |
Functions | |
| const boost::asio::ip::address | localhost (boost::asio::ip::address_v4::loopback()) |
| constexpr | Header_t (std::size_t l) noexcept(true) |
| constexpr std::size_t | length () const noexcept(true) |
| The actual, not the foolish BATSBOE-specified, length which excludes the start_of_message field. More... | |
| constexpr bool | is_valid () const noexcept(true) |
| Verify that the referenced FIX message is valid. More... | |
| constexpr | message () noexcept(true) |
| constexpr | heartbeat () noexcept(true) |
| BOOST_AUTO_TEST_CASE_TEMPLATE (ctor, cxns_t, cxns_reflect_types) | |
| BOOST_AUTO_TEST_CASE_TEMPLATE (single_server_and_client, cxns_t, cxns_reflect_types) | |
| BOOST_AUTO_TEST_CASE_TEMPLATE (single_server_and_two_successive_clients, cxns_t, cxns_reflect_types) | |
| BOOST_AUTO_TEST_CASE_TEMPLATE (single_server_and_two_simultaneous_clients, cxns_t, cxns_reflect_types) | |
| BOOST_AUTO_TEST_CASE_TEMPLATE (single_server_and_client_one_message, cxns_t, cxns_reflect_types) | |
| BOOST_AUTO_TEST_CASE_TEMPLATE (single_server_and_client_one_message_reconnect_sequential, cxns_t, cxns_reflect_types) | |
| BOOST_AUTO_TEST_CASE_TEMPLATE (single_server_and_client_two_messages, cxns_t, cxns_reflect_types) | |
| BOOST_AUTO_TEST_CASE_TEMPLATE (two_repeated_servers_and_clients, cxns_t, cxns_reflect_types) | |
| BOOST_AUTO_TEST_CASE_TEMPLATE (reflect_msgs_at_a_time, cxns_t, cxns_reflect_types) | |
| BOOST_AUTO_TEST_CASE_TEMPLATE (sink_one_msg_repeatedly, cxns_t, cxns_sink_types) | |
| BOOST_AUTO_TEST_CASE_TEMPLATE (sink_different_msgs_parallel, cxns_t, cxns_sink_types) | |
| BOOST_AUTO_TEST_CASE_TEMPLATE (reflect_msgs_parallel, cxns_t, cxns_reflect_types) | |
| BOOST_AUTO_TEST_CASE_TEMPLATE (reflect_different_msgs_parallel, cxns_t, cxns_reflect_types) | |
Variables | |
| const unsigned short | unused_port =12347u |
| const unsigned short | timeout =5u |
| const std::size_t | length_ |
| std::uint64_t | sequence {} |
| const uint8_t | c =42 |
| std::array< char, 123 > | data {'x'} |
| #define BOOST_TEST_MODULE libjmmcg_tests |
Definition at line 21 of file socket_server.cpp.
| typedef ppd::thread_params< ppd::platform_api > api_thread_traits |
Definition at line 56 of file socket_server.cpp.
| typedef socket::asio::client_manager< ppd::api_lock_traits< ppd::platform_api, ppd::heavyweight_threading >::critical_section_type::lock_type > asio_client_mgr_t |
Definition at line 257 of file socket_server.cpp.
| typedef cxns_types< simple_reflect > cxns_reflect_types |
Definition at line 309 of file socket_server.cpp.
| typedef cxns_types< sink > cxns_sink_types |
Definition at line 308 of file socket_server.cpp.
| using cxns_types = boost::mpl::list< std::pair< asio_client_mgr_t, socket::svr< ProcRules<asio_client_mgr_t::socket_t, msgs_t::static_size>, socket::server_manager::loopback< typename ProcRules<asio_client_mgr_t::socket_t, msgs_t::static_size>::heartbeats, asio_client_mgr_t::socket_t > > >, std::pair< glibc_client_mgr_t, socket::svr< ProcRules<glibc_client_mgr_t::socket_t, msgs_t::static_size>, socket::server_manager::loopback< typename ProcRules<glibc_client_mgr_t::socket_t, msgs_t::static_size>::heartbeats, glibc_client_mgr_t::socket_t > > >, std::pair< asio_client_mgr_t, socket::svr< ProcRules<asio_client_mgr_t::socket_t, msgs_t::variable_size>, socket::server_manager::loopback< typename ProcRules<asio_client_mgr_t::socket_t, msgs_t::variable_size>::heartbeats, asio_client_mgr_t::socket_t > > >, std::pair< glibc_client_mgr_t, socket::svr< ProcRules<glibc_client_mgr_t::socket_t, msgs_t::variable_size>, socket::server_manager::loopback< typename ProcRules<glibc_client_mgr_t::socket_t, msgs_t::variable_size>::heartbeats, glibc_client_mgr_t::socket_t > > > > |
Definition at line 265 of file socket_server.cpp.
| typedef socket::glibc::client_manager< ppd::api_lock_traits< ppd::platform_api, ppd::heavyweight_threading >::critical_section_type::lock_type > glibc_client_mgr_t |
Definition at line 260 of file socket_server.cpp.
| using timed_results_t = ave_deviation_meter<double> |
Definition at line 57 of file socket_server.cpp.
| anonymous enum : unsigned |
| Enumerator | |
|---|---|
| max_missed_heartbeats | |
Definition at line 3 of file socket_server.cpp.
| anonymous enum : bool |
| Enumerator | |
|---|---|
| has_static_size | |
Definition at line 0 of file socket_server.cpp.
| anonymous enum : std::size_t |
| Enumerator | |
|---|---|
| header_t_size | |
Definition at line 0 of file socket_server.cpp.
| anonymous enum : std::size_t |
| Enumerator | |
|---|---|
| header_t_size | |
Definition at line 0 of file socket_server.cpp.
| anonymous enum : unsigned |
| Enumerator | |
|---|---|
| max_missed_heartbeats | |
Definition at line 3 of file socket_server.cpp.
| anonymous enum : bool |
| Enumerator | |
|---|---|
| has_static_size | |
Definition at line 0 of file socket_server.cpp.
| anonymous enum : std::size_t |
| Enumerator | |
|---|---|
| header_t_size | |
Definition at line 0 of file socket_server.cpp.
| anonymous enum : std::size_t |
| Enumerator | |
|---|---|
| header_t_size | |
Definition at line 0 of file socket_server.cpp.
| anonymous enum : unsigned |
| Enumerator | |
|---|---|
| max_missed_heartbeats | |
Definition at line 3 of file socket_server.cpp.
| anonymous enum : bool |
| Enumerator | |
|---|---|
| has_static_size | |
Definition at line 0 of file socket_server.cpp.
| anonymous enum : std::size_t |
| Enumerator | |
|---|---|
| header_t_size | |
Definition at line 0 of file socket_server.cpp.
| anonymous enum : std::size_t |
| Enumerator | |
|---|---|
| header_t_size | |
Definition at line 0 of file socket_server.cpp.
| anonymous enum : unsigned |
| Enumerator | |
|---|---|
| max_missed_heartbeats | |
Definition at line 3 of file socket_server.cpp.
| anonymous enum : bool |
| Enumerator | |
|---|---|
| has_static_size | |
Definition at line 0 of file socket_server.cpp.
| anonymous enum : std::size_t |
| Enumerator | |
|---|---|
| header_t_size | |
Definition at line 0 of file socket_server.cpp.
| anonymous enum : std::size_t |
| Enumerator | |
|---|---|
| header_t_size | |
Definition at line 0 of file socket_server.cpp.
| BOOST_AUTO_TEST_CASE_TEMPLATE | ( | ctor | , |
| cxns_t | , | ||
| cxns_reflect_types | |||
| ) |
Definition at line 315 of file socket_server.cpp.
References jmmcg::LIBJMMCG_VER_NAMESPACE::no_latency_timestamps::no_latency_timestamps().
| BOOST_AUTO_TEST_CASE_TEMPLATE | ( | reflect_different_msgs_parallel | , |
| cxns_t | , | ||
| cxns_reflect_types | |||
| ) |
Definition at line 893 of file socket_server.cpp.
References isimud::ISIMUD_VER_NAMESPACE::exchanges::common::thread_traits::exchange_simulator_thread, jmmcg::LIBJMMCG_VER_NAMESPACE::no_latency_timestamps::no_latency_timestamps(), timeout, and unused_port.
| BOOST_AUTO_TEST_CASE_TEMPLATE | ( | reflect_msgs_at_a_time | , |
| cxns_t | , | ||
| cxns_reflect_types | |||
| ) |
Definition at line 645 of file socket_server.cpp.
References isimud::ISIMUD_VER_NAMESPACE::exchanges::common::thread_traits::exchange_simulator_thread, jmmcg::LIBJMMCG_VER_NAMESPACE::no_latency_timestamps::no_latency_timestamps(), timeout, and unused_port.
| BOOST_AUTO_TEST_CASE_TEMPLATE | ( | reflect_msgs_parallel | , |
| cxns_t | , | ||
| cxns_reflect_types | |||
| ) |
Definition at line 834 of file socket_server.cpp.
References isimud::ISIMUD_VER_NAMESPACE::exchanges::common::thread_traits::exchange_simulator_thread, jmmcg::LIBJMMCG_VER_NAMESPACE::no_latency_timestamps::no_latency_timestamps(), timeout, and unused_port.
| BOOST_AUTO_TEST_CASE_TEMPLATE | ( | single_server_and_client | , |
| cxns_t | , | ||
| cxns_reflect_types | |||
| ) |
Definition at line 335 of file socket_server.cpp.
References isimud::ISIMUD_VER_NAMESPACE::exchanges::common::thread_traits::exchange_simulator_thread, jmmcg::LIBJMMCG_VER_NAMESPACE::no_latency_timestamps::no_latency_timestamps(), and unused_port.
| BOOST_AUTO_TEST_CASE_TEMPLATE | ( | single_server_and_client_one_message | , |
| cxns_t | , | ||
| cxns_reflect_types | |||
| ) |
Definition at line 447 of file socket_server.cpp.
References isimud::ISIMUD_VER_NAMESPACE::exchanges::common::thread_traits::exchange_simulator_thread, jmmcg::LIBJMMCG_VER_NAMESPACE::no_latency_timestamps::no_latency_timestamps(), timeout, and unused_port.
| BOOST_AUTO_TEST_CASE_TEMPLATE | ( | single_server_and_client_one_message_reconnect_sequential | , |
| cxns_t | , | ||
| cxns_reflect_types | |||
| ) |
Definition at line 484 of file socket_server.cpp.
References isimud::ISIMUD_VER_NAMESPACE::exchanges::common::thread_traits::exchange_simulator_thread, jmmcg::LIBJMMCG_VER_NAMESPACE::no_latency_timestamps::no_latency_timestamps(), timeout, and unused_port.
| BOOST_AUTO_TEST_CASE_TEMPLATE | ( | single_server_and_client_two_messages | , |
| cxns_t | , | ||
| cxns_reflect_types | |||
| ) |
Definition at line 539 of file socket_server.cpp.
References isimud::ISIMUD_VER_NAMESPACE::exchanges::common::thread_traits::exchange_simulator_thread, jmmcg::LIBJMMCG_VER_NAMESPACE::no_latency_timestamps::no_latency_timestamps(), timeout, and unused_port.
| BOOST_AUTO_TEST_CASE_TEMPLATE | ( | single_server_and_two_simultaneous_clients | , |
| cxns_t | , | ||
| cxns_reflect_types | |||
| ) |
Definition at line 409 of file socket_server.cpp.
References isimud::ISIMUD_VER_NAMESPACE::exchanges::common::thread_traits::exchange_simulator_thread, jmmcg::LIBJMMCG_VER_NAMESPACE::no_latency_timestamps::no_latency_timestamps(), and unused_port.
| BOOST_AUTO_TEST_CASE_TEMPLATE | ( | single_server_and_two_successive_clients | , |
| cxns_t | , | ||
| cxns_reflect_types | |||
| ) |
Definition at line 365 of file socket_server.cpp.
References isimud::ISIMUD_VER_NAMESPACE::exchanges::common::thread_traits::exchange_simulator_thread, jmmcg::LIBJMMCG_VER_NAMESPACE::no_latency_timestamps::no_latency_timestamps(), and unused_port.
| BOOST_AUTO_TEST_CASE_TEMPLATE | ( | sink_different_msgs_parallel | , |
| cxns_t | , | ||
| cxns_sink_types | |||
| ) |
Definition at line 767 of file socket_server.cpp.
References isimud::ISIMUD_VER_NAMESPACE::exchanges::common::thread_traits::exchange_simulator_thread, jmmcg::LIBJMMCG_VER_NAMESPACE::no_latency_timestamps::no_latency_timestamps(), timeout, and unused_port.
| BOOST_AUTO_TEST_CASE_TEMPLATE | ( | sink_one_msg_repeatedly | , |
| cxns_t | , | ||
| cxns_sink_types | |||
| ) |
Definition at line 718 of file socket_server.cpp.
References isimud::ISIMUD_VER_NAMESPACE::exchanges::common::thread_traits::exchange_simulator_thread, jmmcg::LIBJMMCG_VER_NAMESPACE::no_latency_timestamps::no_latency_timestamps(), timeout, and unused_port.
| BOOST_AUTO_TEST_CASE_TEMPLATE | ( | two_repeated_servers_and_clients | , |
| cxns_t | , | ||
| cxns_reflect_types | |||
| ) |
Definition at line 581 of file socket_server.cpp.
References isimud::ISIMUD_VER_NAMESPACE::exchanges::common::thread_traits::exchange_simulator_thread, jmmcg::LIBJMMCG_VER_NAMESPACE::no_latency_timestamps::no_latency_timestamps(), timeout, and unused_port.
|
explicitconstexprnoexcept |
Definition at line 7 of file socket_server.cpp.
|
constexprnoexcept |
Definition at line 10 of file socket_server.cpp.
|
constexprnoexcept |
Verify that the referenced FIX message is valid.
Definition at line 9 of file socket_server.cpp.
|
constexprnoexcept |
The actual, not the foolish BATSBOE-specified, length which excludes the start_of_message field.
Determine the total size of the referenced message.
Definition at line 9 of file socket_server.cpp.
| const boost::asio::ip::address localhost | ( | boost::asio::ip::address_v4::loopback() | ) |
|
constexprnoexcept |
Definition at line 7 of file socket_server.cpp.
| const std::uint64_t c =42 |
Definition at line 4 of file socket_server.cpp.
| std::array<char, 123> data {'x'} |
Definition at line 5 of file socket_server.cpp.
| const std::size_t length_ |
Definition at line 4 of file socket_server.cpp.
| std::uint64_t sequence {} |
Definition at line 5 of file socket_server.cpp.
| const unsigned short timeout =5u |
Definition at line 60 of file socket_server.cpp.
Referenced by BOOST_AUTO_TEST_CASE_TEMPLATE().
| const unsigned short unused_port =12347u |
Definition at line 59 of file socket_server.cpp.
Referenced by BOOST_AUTO_TEST_CASE_TEMPLATE().