JayBeams  0.1
Another project to have fun coding.
levels_name.hpp
Go to the documentation of this file.
1 #ifndef jb_mktdata_detail_levels_name_hpp
2 #define jb_mktdata_detail_levels_name_hpp
3 
5 
6 namespace jb {
7 namespace mktdata {
8 namespace detail {
9 
10 /**
11  * Define the message name for a inside feed with N levels.
12  *
13  * JayBeams assigns a name (implemented as a 16-bit identifier) to
14  * each message. Messages that represent the top N levels of a market
15  * are named differently depending on how many levels they have. This
16  * class defines the names for each supported level.
17  *
18  * @tparam N the number of levels.
19  */
20 template <std::size_t N>
21 struct levels_name {};
22 
23 /// Specialize for N == 1.
24 template <>
25 struct levels_name<1> {
26  static constexpr char name = u'1';
27 };
28 
29 /// Specialize for N == 4.
30 template <>
31 struct levels_name<4> {
32  static constexpr char name = u'4';
33 };
34 
35 /// Specialize for N == 8.
36 template <>
37 struct levels_name<8> {
38  static constexpr char name = u'8';
39 };
40 
41 } // namespace detail
42 } // namespace mktdata
43 } // namespace jb
44 
45 #endif // jb_mktdata_detail_levels_name_hpp
Define the message name for a inside feed with N levels.
Definition: levels_name.hpp:21
The top-level namespace for the JayBeams library.
Definition: as_hhmmss.hpp:7