Skip to content

Commit

Permalink
Use ReaderInterface instead of zstd decompressor in StreamReaderDataC…
Browse files Browse the repository at this point in the history
…ontext.
  • Loading branch information
junhaoliao committed Oct 15, 2024
1 parent 2d59807 commit 3b90f9d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/clp_ffi_js/ir/StreamReaderDataContext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
#include <utility>

#include <clp/Array.hpp>
#include <clp/streaming_compression/zstd/Decompressor.hpp>
#include <clp/ReaderInterface.hpp>

namespace clp_ffi_js::ir {
/**
* The data context for a `StreamReader`. It encapsulates a chain of the following resources:
* A CLP deserializer class that reads from a `clp::streaming_compression::zstd::Decompressor`,
* which in turn reads from a `clp::Array`.
* A CLP deserializer class that reads from a `clp::ReaderInterface`, which in turn reads from a
* `clp::Array`.
* @tparam deserializer_t Type of deserializer.
*/
template <typename deserializer_t>
Expand All @@ -20,11 +20,11 @@ class StreamReaderDataContext {
// Constructors
StreamReaderDataContext(
clp::Array<char>&& data_buffer,
std::unique_ptr<clp::streaming_compression::zstd::Decompressor>&& zstd_decompressor,
std::unique_ptr<clp::ReaderInterface>&& reader,
deserializer_t deserializer
)
: m_data_buffer{std::move(data_buffer)},
m_zstd_decompressor{std::move(zstd_decompressor)},
m_reader{std::move(reader)},
m_deserializer{std::move(deserializer)} {}

// Disable copy constructor and assignment operator
Expand All @@ -46,7 +46,7 @@ class StreamReaderDataContext {

private:
clp::Array<char> m_data_buffer;
std::unique_ptr<clp::streaming_compression::zstd::Decompressor> m_zstd_decompressor;
std::unique_ptr<clp::ReaderInterface> m_reader;
deserializer_t m_deserializer;
};
} // namespace clp_ffi_js::ir
Expand Down

0 comments on commit 3b90f9d

Please sign in to comment.