File tree Expand file tree Collapse file tree 6 files changed +13
-5
lines changed
Expand file tree Collapse file tree 6 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 77 messages
88- Converting a ` v1::SystemMsg ` to a ` v2::SystemMsg ` now sets to ` code ` to the heartbeat
99 value
10+ - Introduced ` kAssetCstrLen ` constant containing the size of ` asset ` field in ` InstrumentDefMsg `
1011
1112### Breaking changes
1213- Changed type of ` code ` field in ` SystemMsg ` to ` SystemCode `
1314- Changed type of ` code ` field in ` ErrorMsg ` to ` ErrorCode `
15+ - Increased the size of ` asset ` field in ` v3::InstrumentDefMsg ` from 7 to 11. The ` v3::InstrumentDefMsg ` message size remains 520 bytes.
1416
1517### Bug fixes
1618- Changed ` TriState ` to a regular enum to handle unexpected values
Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ static constexpr auto kUndefTimestamp =
2424static constexpr auto kDbnVersion = 2 ;
2525// The length of fixed-length symbol strings.
2626static constexpr auto kSymbolCstrLen = 71 ;
27+ // The length of fixed-length asset string.
28+ static constexpr auto kAssetCstrLen = 7 ;
2729// The multiplier for converting the `length` field in `RecordHeader` to bytes.
2830static constexpr std::size_t kRecordHeaderLengthMultiplier = 4 ;
2931
Original file line number Diff line number Diff line change @@ -434,7 +434,7 @@ struct InstrumentDefMsg {
434434 std::array<char , kSymbolCstrLen > raw_symbol;
435435 std::array<char , 21 > group;
436436 std::array<char , 5 > exchange;
437- std::array<char , 7 > asset;
437+ std::array<char , kAssetCstrLen > asset;
438438 std::array<char , 7 > cfi;
439439 std::array<char , 7 > security_type;
440440 std::array<char , 31 > unit_of_measure;
Original file line number Diff line number Diff line change 11#pragma once
22
3- #include " databento/datetime.hpp" // UnixNanos
3+ #include " databento/constants.hpp" // kSymbolCstrLen
4+ #include " databento/datetime.hpp" // UnixNanos
45#include " databento/enums.hpp"
56#include " databento/record.hpp"
67#include " databento/v2.hpp"
@@ -13,6 +14,7 @@ struct InstrumentDefMsg;
1314
1415namespace v1 {
1516static constexpr std::size_t kSymbolCstrLen = 22 ;
17+ static constexpr std::size_t kAssetCstrLen = databento::kAssetCstrLen ;
1618
1719using MboMsg = databento::MboMsg;
1820using TradeMsg = databento::TradeMsg;
@@ -92,7 +94,7 @@ struct InstrumentDefMsg {
9294 std::array<char , kSymbolCstrLen > raw_symbol;
9395 std::array<char , 21 > group;
9496 std::array<char , 5 > exchange;
95- std::array<char , 7 > asset;
97+ std::array<char , kAssetCstrLen > asset;
9698 std::array<char , 7 > cfi;
9799 std::array<char , 7 > security_type;
98100 std::array<char , 31 > unit_of_measure;
Original file line number Diff line number Diff line change 55
66namespace databento ::v2 {
77static constexpr std::size_t kSymbolCstrLen = databento::kSymbolCstrLen ;
8+ static constexpr std::size_t kAssetCstrLen = databento::kAssetCstrLen ;
89
910using MboMsg = databento::MboMsg;
1011using TradeMsg = databento::TradeMsg;
Original file line number Diff line number Diff line change 1010
1111namespace databento ::v3 {
1212static constexpr std::size_t kSymbolCstrLen = databento::kSymbolCstrLen ;
13+ static constexpr std::size_t kAssetCstrLen = 11 ;
1314
1415using MboMsg = databento::MboMsg;
1516using TradeMsg = databento::TradeMsg;
@@ -100,7 +101,7 @@ struct InstrumentDefMsg {
100101 std::array<char , kSymbolCstrLen > raw_symbol;
101102 std::array<char , 21 > group;
102103 std::array<char , 5 > exchange;
103- std::array<char , 7 > asset;
104+ std::array<char , kAssetCstrLen > asset;
104105 std::array<char , 7 > cfi;
105106 std::array<char , 7 > security_type;
106107 std::array<char , 31 > unit_of_measure;
@@ -124,7 +125,7 @@ struct InstrumentDefMsg {
124125 InstrumentClass leg_instrument_class;
125126 Side leg_side;
126127 // padding for alignment
127- std::array<char , 21 > reserved;
128+ std::array<char , 17 > reserved;
128129};
129130static_assert (sizeof (InstrumentDefMsg) == 520 ,
130131 " InstrumentDefMsg size must match Rust" );
You can’t perform that action at this time.
0 commit comments