1//===----------------------------------------------------------------------===//
2// DuckDB
3//
4// duckdb/common/serializer/buffered_deserializer.hpp
5//
6//
7//===----------------------------------------------------------------------===//
8
9#pragma once
10
11#include "duckdb/common/serializer.hpp"
12#include "duckdb/common/serializer/buffered_serializer.hpp"
13
14namespace duckdb {
15class ClientContext;
16
17class BufferedDeserializer : public Deserializer {
18public:
19 BufferedDeserializer(data_ptr_t ptr, idx_t data_size);
20 explicit BufferedDeserializer(BufferedSerializer &serializer);
21
22 data_ptr_t ptr;
23 data_ptr_t endptr;
24
25public:
26 void ReadData(data_ptr_t buffer, uint64_t read_size) override;
27};
28
29class BufferedContextDeserializer : public BufferedDeserializer {
30public:
31 BufferedContextDeserializer(ClientContext &context_p, data_ptr_t ptr, idx_t data_size)
32 : BufferedDeserializer(ptr, data_size), context(context_p) {
33 }
34
35public:
36 ClientContext &context;
37
38 ClientContext &GetContext() override;
39};
40
41} // namespace duckdb
42