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 | |
14 | namespace duckdb { |
15 | class ClientContext; |
16 | |
17 | class BufferedDeserializer : public Deserializer { |
18 | public: |
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 | |
25 | public: |
26 | void ReadData(data_ptr_t buffer, uint64_t read_size) override; |
27 | }; |
28 | |
29 | class BufferedContextDeserializer : public BufferedDeserializer { |
30 | public: |
31 | BufferedContextDeserializer(ClientContext &context_p, data_ptr_t ptr, idx_t data_size) |
32 | : BufferedDeserializer(ptr, data_size), context(context_p) { |
33 | } |
34 | |
35 | public: |
36 | ClientContext &context; |
37 | |
38 | ClientContext &GetContext() override; |
39 | }; |
40 | |
41 | } // namespace duckdb |
42 |