1 | //===----------------------------------------------------------------------===// |
---|---|
2 | // DuckDB |
3 | // |
4 | // duckdb/execution/execution_context.hpp |
5 | // |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #pragma once |
10 | |
11 | #include "duckdb/common/common.hpp" |
12 | #include "duckdb/common/optional_ptr.hpp" |
13 | |
14 | namespace duckdb { |
15 | class ClientContext; |
16 | class ThreadContext; |
17 | class Pipeline; |
18 | |
19 | class ExecutionContext { |
20 | public: |
21 | ExecutionContext(ClientContext &client_p, ThreadContext &thread_p, optional_ptr<Pipeline> pipeline_p) |
22 | : client(client_p), thread(thread_p), pipeline(pipeline_p) { |
23 | } |
24 | |
25 | //! The client-global context; caution needs to be taken when used in parallel situations |
26 | ClientContext &client; |
27 | //! The thread-local context for this execution |
28 | ThreadContext &thread; |
29 | //! Reference to the pipeline for this execution, can be used for example by operators determine caching strategy |
30 | optional_ptr<Pipeline> pipeline; |
31 | }; |
32 | |
33 | } // namespace duckdb |
34 |