Skip to content

Commit 6338f47

Browse files
authored
VER: Release 0.30.0
2 parents 0e000c5 + ee6f258 commit 6338f47

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+333
-320
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## 0.30.0 - 2025-02-11
4+
5+
### Enhancements
6+
- Added `Resubscribe()` methods to `LiveBlocking` and `LiveThreaded` to make it easier
7+
to resume a live session after losing the connection to the live gateway
8+
- Added `Subscriptions()` getter methods to `LiveBlocking` and `LiveThreaded` for
9+
getting all active subscriptions
10+
- Added `CommoditySpot` `InstrumentClass` variant
11+
312
## 0.29.0 - 2025-02-04
413

514
### Enhancements

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.29.0 LANGUAGES CXX)
7+
project("databento" VERSION 0.30.0 LANGUAGES CXX)
88
string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPERCASE)
99

1010
#

cmake/SourcesAndHeaders.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ set(headers
2323
include/databento/ireadable.hpp
2424
include/databento/live.hpp
2525
include/databento/live_blocking.hpp
26+
include/databento/live_subscription.hpp
2627
include/databento/live_threaded.hpp
2728
include/databento/log.hpp
2829
include/databento/metadata.hpp

examples/historical/metadata.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ int main() {
4949

5050
const auto all_unit_prices = client.MetadataListUnitPrices(kGlbxMdp3);
5151
std::cout << "Unit prices:\n";
52-
for (const auto& mode_and_prices : all_unit_prices) {
53-
const auto* mode_str = ToString(mode_and_prices.mode);
54-
for (const auto& schema_and_price : mode_and_prices.unit_prices) {
55-
std::cout << "- (" << mode_str << ", " << schema_and_price.first
56-
<< "): " << schema_and_price.second << '\n';
52+
for (const auto& [mode, unit_prices] : all_unit_prices) {
53+
const auto* mode_str = ToString(mode);
54+
for (const auto [schema, price] : unit_prices) {
55+
std::cout << "- (" << mode_str << ", " << schema << "): " << price
56+
<< '\n';
5757
}
5858
}
5959
std::cout << '\n';

examples/live/live_smoke_test.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <sstream>
1212
#include <stdexcept>
1313
#include <string>
14-
#include <unordered_map>
1514

1615
using namespace databento;
1716

@@ -28,7 +27,6 @@ std::vector<std::string> SplitSymbols(const std::string& symbols) {
2827
}
2928

3029
std::pair<bool, UnixNanos> TryConvertToUnixNanos(const char* start) {
31-
std::stringstream ss(start);
3230
std::size_t pos;
3331
const uint64_t result = std::stoul(start, &pos, 10);
3432
if (pos != std::strlen(start)) {
@@ -187,10 +185,10 @@ int main(int argc, char* argv[]) {
187185
if (use_snapshot) {
188186
client.SubscribeWithSnapshot(symbols, schema, stype);
189187
} else if (start) {
190-
const auto converted = TryConvertToUnixNanos(start);
191-
if (converted.first) {
192-
start_from_epoch = converted.second.time_since_epoch().count() == 0;
193-
client.Subscribe(symbols, schema, stype, converted.second);
188+
const auto [success, start_nanos] = TryConvertToUnixNanos(start);
189+
if (success) {
190+
start_from_epoch = start_nanos.time_since_epoch().count() == 0;
191+
client.Subscribe(symbols, schema, stype, start_nanos);
194192
} else {
195193
client.Subscribe(symbols, schema, stype, start);
196194
}

examples/live/simple.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ static std::sig_atomic_t volatile gSignal;
1616

1717
int main() {
1818
databento::PitSymbolMap symbol_mappings;
19-
std::unique_ptr<databento::ILogReceiver> log_receiver{
20-
new databento::ConsoleLogReceiver{databento::LogLevel::Debug}};
19+
auto log_receiver = std::make_unique<databento::ConsoleLogReceiver>(
20+
databento::LogLevel::Debug);
2121

2222
auto client = databento::LiveBuilder{}
2323
.SetLogReceiver(log_receiver.get())

include/databento/detail/json_helpers.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ namespace httplib {
1515
using Params = std::multimap<std::string, std::string>;
1616
}
1717

18-
namespace databento {
19-
namespace detail {
18+
namespace databento::detail {
2019
void SetIfNotEmpty(httplib::Params* params, const std::string& key,
2120
const std::string& value);
2221
void SetIfNotEmpty(httplib::Params* params, const std::string& key,
@@ -95,5 +94,4 @@ date::year_month_day ParseAt(const std::string& endpoint,
9594
const nlohmann::json& json,
9695
const std::string& key);
9796

98-
} // namespace detail
99-
} // namespace databento
97+
} // namespace databento::detail

include/databento/detail/scoped_fd.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
#include <winsock2.h> // SOCKET
55
#endif
66

7-
namespace databento {
8-
namespace detail {
7+
namespace databento::detail {
98
#ifdef _WIN32
109
using Socket = SOCKET;
1110
#else
@@ -35,5 +34,4 @@ class ScopedFd {
3534
private:
3635
Socket fd_{kUnset};
3736
};
38-
} // namespace detail
39-
} // namespace databento
37+
} // namespace databento::detail

include/databento/detail/scoped_thread.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
#include <thread>
44
#include <utility> // forward, move
55

6-
namespace databento {
7-
namespace detail {
6+
namespace databento::detail {
87
// An RAII thread that joins if necessary on destruction, like std::jthread in
98
// C++20.
109
class ScopedThread {
@@ -37,5 +36,4 @@ class ScopedThread {
3736
private:
3837
std::thread thread_;
3938
};
40-
} // namespace detail
41-
} // namespace databento
39+
} // namespace databento::detail

include/databento/detail/shared_channel.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66

77
#include "databento/ireadable.hpp"
88

9-
namespace databento {
10-
namespace detail {
9+
namespace databento::detail {
1110
// Copyable, thread-safe, unidirectional channel.
1211
class SharedChannel : public IReadable {
1312
public:
@@ -28,5 +27,4 @@ class SharedChannel : public IReadable {
2827

2928
std::shared_ptr<Channel> channel_;
3029
};
31-
} // namespace detail
32-
} // namespace databento
30+
} // namespace databento::detail

0 commit comments

Comments
 (0)