From 2ae808d4cd368b36443324cbfe45cd889faafc58 Mon Sep 17 00:00:00 2001 From: Matheus Catarino Date: Mon, 9 Dec 2024 09:05:01 -0300 Subject: [PATCH] updated (https://github.com/tigerbeetle/tigerbeetle/pull/2534) --- README.md | 9 +++++++++ include/tb_client.hpp | 7 ++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ea83c89..ee847c5 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,15 @@ ### How to Build and Run +**CMake Presets** + +```bash +$> cmake --preset dev +# OR +$> cmake --preset release +$> cmake --build build -t run_with_tb +``` + **Another C++ toolchain** ```bash diff --git a/include/tb_client.hpp b/include/tb_client.hpp index 4dd657a..29c12aa 100644 --- a/include/tb_client.hpp +++ b/include/tb_client.hpp @@ -90,7 +90,8 @@ inline void default_on_completion([[maybe_unused]] uintptr_t context, class Client { public: - explicit Client(const std::string &address, uint32_t cluster_id = 0, + explicit Client(const std::string &address, + std::array cluster_id = {}, uintptr_t on_completion_ctx = 0, void (*on_completion_fn)(uintptr_t, tb_client_t, tb_packet_t *, uint64_t, @@ -98,8 +99,8 @@ class Client { uint32_t) = &default_on_completion) : client(nullptr) { status = - tb_client_init(&client, cluster_id, address.c_str(), address.length(), - on_completion_ctx, on_completion_fn); + tb_client_init(&client, cluster_id.data(), address.c_str(), + address.length(), on_completion_ctx, on_completion_fn); } Client(const Client &) = delete;