Skip to content

Commit

Permalink
cpp: add optional flush method to IWritable
Browse files Browse the repository at this point in the history
  • Loading branch information
james-rms committed Nov 7, 2024
1 parent 570e29c commit 2093db0
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cpp/bench/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class McapBenchmarksConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
requires = "benchmark/1.7.0", "mcap/1.4.1"
requires = "benchmark/1.7.0", "mcap/1.5.0"

def build(self):
cmake = CMake(self)
Expand Down
2 changes: 1 addition & 1 deletion cpp/build-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

conan config init

conan editable add ./mcap mcap/1.4.1
conan editable add ./mcap mcap/1.5.0
conan install docs --install-folder docs/build/Release \
-s compiler.cppstd=17 -s build_type=Release --build missing

Expand Down
2 changes: 1 addition & 1 deletion cpp/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

conan config init

conan editable add ./mcap mcap/1.4.1
conan editable add ./mcap mcap/1.5.0
conan install test --install-folder test/build/Debug \
-s compiler.cppstd=17 -s build_type=Debug --build missing

Expand Down
2 changes: 1 addition & 1 deletion cpp/docs/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class McapDocsConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
requires = "mcap/1.4.1"
requires = "mcap/1.5.0"

def build(self):
cmake = CMake(self)
Expand Down
2 changes: 1 addition & 1 deletion cpp/examples/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class McapExamplesConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
requires = [
"mcap/1.4.1",
"mcap/1.5.0",
"protobuf/3.21.1",
"nlohmann_json/3.10.5",
"catch2/2.13.8",
Expand Down
2 changes: 1 addition & 1 deletion cpp/mcap/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class McapConan(ConanFile):
name = "mcap"
version = "1.4.1"
version = "1.5.0"
url = "https://github.com/foxglove/mcap"
homepage = "https://github.com/foxglove/mcap"
description = "A C++ implementation of the MCAP file format"
Expand Down
2 changes: 1 addition & 1 deletion cpp/mcap/include/mcap/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace mcap {

#define MCAP_LIBRARY_VERSION "1.4.1"
#define MCAP_LIBRARY_VERSION "1.5.0"

using SchemaId = uint16_t;
using ChannelId = uint16_t;
Expand Down
6 changes: 4 additions & 2 deletions cpp/mcap/include/mcap/writer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,11 @@ class MCAP_PUBLIC IWritable {
void resetCrc();

/**
* @brief flushes any buffered data to the output. Defaults to a no-op.
* @brief flushes any buffered data to the output. This is called by McapWriter after every
* completed chunk. Callers may also retain a reference to the writer and call flush() at their
* own cadence. Defaults to a no-op.
*/
virtual void flush() = 0;
virtual void flush() {};

protected:
virtual void handleWrite(const std::byte* data, uint64_t size) = 0;
Expand Down
2 changes: 1 addition & 1 deletion cpp/test/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class McapTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
requires = "catch2/2.13.8", "mcap/1.4.1", "nlohmann_json/3.10.5"
requires = "catch2/2.13.8", "mcap/1.5.0", "nlohmann_json/3.10.5"

def build(self):
cmake = CMake(self)
Expand Down

0 comments on commit 2093db0

Please sign in to comment.