1 #ifndef ISIMUD_EXCHANGES_COMMON_ISIN_HPP
2 #define ISIMUD_EXCHANGES_COMMON_ISIN_HPP
22 #include "iso_3166_country_codes.hpp"
24 #include "core/int128_compatibility.hpp"
25 #include "core/memops.hpp"
26 #include "core/ttypes.hpp"
28 #include <boost/mpl/assert.hpp>
39 BOOST_MPL_ASSERT_RELATION(
sizeof(Country_Code_t), ==, 2);
40 using NSIN_t=
std::array<
char, 9>;
42 BOOST_MPL_ASSERT_RELATION(
sizeof(CUSIP_t), ==, 9);
53 BOOST_MPL_ASSERT_RELATION(
sizeof(SEDOL_t), ==, 9);
57 struct [[gnu::packed]] details_t {
58 Country_Code_t country;
59 union [[gnu::packed]] {
66 BOOST_MPL_ASSERT_RELATION(
sizeof(details_t), ==, 12);
69 using block_t=
std::array<
char,
sizeof(details_t)>;
70 BOOST_MPL_ASSERT_RELATION(
sizeof(block_t), ==, 12);
72 constexpr ISIN_t()
noexcept(
true);
73 explicit constexpr ISIN_t(block_t
const &b)
noexcept(
true);
74 template<
std::size_t Sz>
82 constexpr block_t
const &
data()
const noexcept(
true) {
88 constexpr std::size_t
hash()
const noexcept(
true);
90 friend std::ostream &operator<<(
std::ostream &os,
ISIN_t const &i)
noexcept(
false);
98 constexpr converter_t()
noexcept(
true)
101 BOOST_MPL_ASSERT_RELATION(
sizeof(converter_t), ==, 12);
104 BOOST_MPL_ASSERT_RELATION(
sizeof(ISIN_t), ==, 12);