JayBeams
0.1
Another project to have fun coding.
|
Define a class used to represent prices in the ITCH-5.0 feed. More...
#include <price_field.hpp>
Public Types | |
typedef wire_type_t | wire_type |
The wire type. More... | |
typedef std::ratio< 1, denom > | tick |
The minimum quotation tick for this price. More... | |
Public Member Functions | |
price_field () | |
Default constructor. More... | |
price_field (wire_type rhs) | |
Constructor from a price. More... | |
price_field & | operator= (wire_type rhs) |
Assignment from. More... | |
price_field & | operator+= (price_field const &rhs) |
Addition assignment operator. More... | |
Accessors | |
double | as_double () const |
wire_type | as_integer () const |
bool | operator== (price_field const &rhs) const |
Base comparison operators. More... | |
bool | operator< (price_field const &rhs) const |
Static Public Member Functions | |
static price_field | dollar_price () |
Static Public Attributes | |
static constexpr std::intmax_t | denom = denom_v |
The denominator. More... | |
static constexpr int | denom_digits = static_digits(denom) |
The number of digits in the denominator. More... | |
Private Attributes | |
wire_type | value_ |
The value as an integer. More... | |
Define a class used to represent prices in the ITCH-5.0 feed.
The ITCH-5.0 protocol represent prices as fixed-point values. The number of decimal digits is specified in the field definition. For example, a Price(4) field represents prices with 4 decimal digits, i.e., of the 99999.9999 form. On the wire the number is actually stored as an integer. For example, the price 150.0100 would be stored on the wire as 1500100.
wire_type | an integer type, typically std::uint32_t for 4-byte wide fields, or std::uint64_t for 8-byte wide fields. |
denom | the denominator for this field, for example Price(4) would use denom==10000, while Price(8) would use 100000000. |
Definition at line 34 of file price_field.hpp.
typedef std::ratio<1, denom> jb::itch5::price_field< wire_type_t, denom_v >::tick |
The minimum quotation tick for this price.
Definition at line 48 of file price_field.hpp.
typedef wire_type_t jb::itch5::price_field< wire_type_t, denom_v >::wire_type |
The wire type.
Definition at line 39 of file price_field.hpp.
|
inline |
Default constructor.
Definition at line 51 of file price_field.hpp.
Referenced by jb::itch5::price_field< std::uint32_t, 10000 >::dollar_price(), and jb::itch5::max_price_field_value().
|
inlineexplicit |
Constructor from a price.
Definition at line 56 of file price_field.hpp.
|
inline |
Definition at line 76 of file price_field.hpp.
|
inline |
Definition at line 80 of file price_field.hpp.
|
inlinestatic |
Definition at line 99 of file price_field.hpp.
|
inline |
Addition assignment operator.
Definition at line 67 of file price_field.hpp.
|
inline |
Definition at line 93 of file price_field.hpp.
|
inline |
Assignment from.
Definition at line 61 of file price_field.hpp.
|
inline |
Base comparison operators.
Definition at line 89 of file price_field.hpp.
|
static |
The denominator.
Definition at line 42 of file price_field.hpp.
Referenced by jb::itch5::price_field< std::uint32_t, 10000 >::dollar_price(), and jb::itch5::max_price_field_value().
|
static |
The number of digits in the denominator.
Definition at line 45 of file price_field.hpp.
|
private |
The value as an integer.
Definition at line 105 of file price_field.hpp.
Referenced by jb::itch5::price_field< std::uint32_t, 10000 >::as_double(), jb::itch5::price_field< std::uint32_t, 10000 >::as_integer(), jb::itch5::price_field< std::uint32_t, 10000 >::operator+=(), jb::itch5::price_field< std::uint32_t, 10000 >::operator<(), jb::itch5::price_field< std::uint32_t, 10000 >::operator=(), and jb::itch5::price_field< std::uint32_t, 10000 >::operator==().