Skip to content

Commit edae42e

Browse files
authored
VER: Release 0.19.1
2 parents 4b51f62 + b665f4d commit edae42e

File tree

11 files changed

+108
-21
lines changed

11 files changed

+108
-21
lines changed

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## 0.19.1 - 2024-06-25
4+
5+
### Enhancements
6+
- Added `Upgrade()` method to `Metadata` to update the metadata fields according to a
7+
`VersionUpgradePolicy`
8+
- Added new publisher values for `XNAS.BASIC` and `XNAS.NLS`
9+
10+
### Bug fixes
11+
- Fixed issue where `Metadata` wasn't upgraded when passing
12+
`VersionUpgradePolicy::Upgrade`
13+
314
## 0.19.0 - 2024-06-04
415

516
### Enhancements
@@ -23,7 +34,7 @@
2334
### Bug fixes
2435
- Fixed overloading of live `Subscribe` methods
2536
- Fixed live subscribing with default-constructed `UnixNanos`
26-
- Fixed descriptions for `FINN` and `FINY` publishers.
37+
- Fixed descriptions for `FINN` and `FINY` publishers
2738

2839
## 0.18.1 - 2024-05-22
2940

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.14)
44
# Project details
55
#
66

7-
project("databento" VERSION 0.19.0 LANGUAGES CXX)
7+
project("databento" VERSION 0.19.1 LANGUAGES CXX)
88
string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPERCASE)
99

1010
#

include/databento/dbn.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ struct Metadata {
6868
std::vector<std::string> not_found;
6969
// Symbol mappings containing a native symbol and its mapping intervals.
7070
std::vector<SymbolMapping> mappings;
71+
72+
// Upgrades the metadata according to `upgrade_policy` if necessary.
73+
void Upgrade(VersionUpgradePolicy upgrade_policy);
7174
};
7275

7376
inline bool operator==(const MappingInterval& lhs, const MappingInterval& rhs) {

include/databento/publishers.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,14 @@ enum class Publisher : std::uint16_t {
333333
IfeuImpactXoff = 84,
334334
// ICE Endex - Off-Market Trades
335335
NdexImpactXoff = 85,
336+
// Nasdaq NLS - Nasdaq BX
337+
XnasNlsXbos = 86,
338+
// Nasdaq NLS - Nasdaq PSX
339+
XnasNlsXpsx = 87,
340+
// Nasdaq Basic - Nasdaq BX
341+
XnasBasicXbos = 88,
342+
// Nasdaq Basic - Nasdaq PSX
343+
XnasBasicXpsx = 89,
336344
};
337345

338346
// Get a Publisher's Venue.

pkg/PKGBUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Maintainer: Databento <support@databento.com>
22
_pkgname=databento-cpp
33
pkgname=databento-cpp-git
4-
pkgver=0.19.0
4+
pkgver=0.19.1
55
pkgrel=1
66
pkgdesc="Official C++ client for Databento"
77
arch=('any')

src/dbn.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,20 @@
22

33
#include <array>
44
#include <sstream> // ostringstream
5-
#include <utility> // pair
65

6+
#include "databento/constants.hpp"
77
#include "stream_op_helper.hpp"
88

99
namespace databento {
10+
11+
void Metadata::Upgrade(VersionUpgradePolicy upgrade_policy) {
12+
if (version < kDbnVersion &&
13+
upgrade_policy == VersionUpgradePolicy::Upgrade) {
14+
version = kDbnVersion;
15+
symbol_cstr_len = kSymbolCstrLen;
16+
}
17+
}
18+
1019
std::string ToString(const Metadata& metadata) { return MakeString(metadata); }
1120
std::ostream& operator<<(std::ostream& stream, const Metadata& metadata) {
1221
auto helper = StreamOpBuilder{stream}

src/dbn_decoder.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ databento::Metadata DbnDecoder::DecodeMetadata() {
191191
buffer_idx_ = read_buffer_.size();
192192
auto metadata = DbnDecoder::DecodeMetadataFields(version_, read_buffer_);
193193
ts_out_ = metadata.ts_out;
194+
metadata.Upgrade(upgrade_policy_);
194195
return metadata;
195196
}
196197

src/live_blocking.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ databento::Metadata LiveBlocking::Start() {
130130
auto metadata =
131131
DbnDecoder::DecodeMetadataFields(version_and_size.first, meta_buffer);
132132
version_ = metadata.version;
133+
metadata.Upgrade(upgrade_policy_);
133134
return metadata;
134135
}
135136

src/publishers.cpp

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,18 @@ Venue PublisherVenue(Publisher publisher) {
748748
case Publisher::NdexImpactXoff: {
749749
return Venue::Xoff;
750750
}
751+
case Publisher::XnasNlsXbos: {
752+
return Venue::Xbos;
753+
}
754+
case Publisher::XnasNlsXpsx: {
755+
return Venue::Xpsx;
756+
}
757+
case Publisher::XnasBasicXbos: {
758+
return Venue::Xbos;
759+
}
760+
case Publisher::XnasBasicXpsx: {
761+
return Venue::Xpsx;
762+
}
751763
default: {
752764
throw InvalidArgumentError{
753765
"PublisherVenue", "publisher",
@@ -1013,6 +1025,18 @@ Dataset PublisherDataset(Publisher publisher) {
10131025
case Publisher::NdexImpactXoff: {
10141026
return Dataset::NdexImpact;
10151027
}
1028+
case Publisher::XnasNlsXbos: {
1029+
return Dataset::XnasNls;
1030+
}
1031+
case Publisher::XnasNlsXpsx: {
1032+
return Dataset::XnasNls;
1033+
}
1034+
case Publisher::XnasBasicXbos: {
1035+
return Dataset::XnasBasic;
1036+
}
1037+
case Publisher::XnasBasicXpsx: {
1038+
return Dataset::XnasBasic;
1039+
}
10161040
default: {
10171041
throw InvalidArgumentError{
10181042
"PublisherDataset", "publisher",
@@ -1279,6 +1303,18 @@ const char* ToString(Publisher publisher) {
12791303
case Publisher::NdexImpactXoff: {
12801304
return "NDEX.IMPACT.XOFF";
12811305
}
1306+
case Publisher::XnasNlsXbos: {
1307+
return "XNAS.NLS.XBOS";
1308+
}
1309+
case Publisher::XnasNlsXpsx: {
1310+
return "XNAS.NLS.XPSX";
1311+
}
1312+
case Publisher::XnasBasicXbos: {
1313+
return "XNAS.BASIC.XBOS";
1314+
}
1315+
case Publisher::XnasBasicXpsx: {
1316+
return "XNAS.BASIC.XPSX";
1317+
}
12821318
default: {
12831319
return "Unknown";
12841320
}
@@ -1547,6 +1583,18 @@ Publisher FromString(const std::string& str) {
15471583
if (str == "NDEX.IMPACT.XOFF") {
15481584
return Publisher::NdexImpactXoff;
15491585
}
1586+
if (str == "XNAS.NLS.XBOS") {
1587+
return Publisher::XnasNlsXbos;
1588+
}
1589+
if (str == "XNAS.NLS.XPSX") {
1590+
return Publisher::XnasNlsXpsx;
1591+
}
1592+
if (str == "XNAS.BASIC.XBOS") {
1593+
return Publisher::XnasBasicXbos;
1594+
}
1595+
if (str == "XNAS.BASIC.XPSX") {
1596+
return Publisher::XnasBasicXpsx;
1597+
}
15501598
throw InvalidArgumentError{"FromString<Publisher>", "str",
15511599
"unknown value '" + str + '\''};
15521600
}

test/src/dbn_decoder_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ TEST_F(DbnDecoderTests, TestDecodeDefinitionUpgrade) {
109109
const Metadata ch_metadata = channel_target_->DecodeMetadata();
110110
const Metadata f_metadata = file_target_->DecodeMetadata();
111111
EXPECT_EQ(ch_metadata, f_metadata);
112-
EXPECT_EQ(ch_metadata.version, 1);
112+
EXPECT_EQ(ch_metadata.version, 2);
113113
EXPECT_EQ(ch_metadata.dataset, dataset::kXnasItch);
114114
EXPECT_EQ(ch_metadata.schema, Schema::Definition);
115115
EXPECT_EQ(ch_metadata.start.time_since_epoch().count(), 1633305600000000000);

0 commit comments

Comments
 (0)