1#include "duckdb/common/types/vector.hpp"
2#include "duckdb/common/types/vector_buffer.hpp"
3#include "duckdb/common/types/chunk_collection.hpp"
4
5#include "duckdb/common/assert.hpp"
6
7using namespace duckdb;
8using namespace std;
9
10VectorBuffer::VectorBuffer(idx_t data_size) : type(VectorBufferType::STANDARD_BUFFER) {
11 if (data_size > 0) {
12 data = unique_ptr<data_t[]>(new data_t[data_size]);
13 }
14}
15
16buffer_ptr<VectorBuffer> VectorBuffer::CreateStandardVector(TypeId type) {
17 return make_buffer<VectorBuffer>(STANDARD_VECTOR_SIZE * GetTypeIdSize(type));
18}
19
20buffer_ptr<VectorBuffer> VectorBuffer::CreateConstantVector(TypeId type) {
21 return make_buffer<VectorBuffer>(GetTypeIdSize(type));
22}
23
24VectorStringBuffer::VectorStringBuffer() : VectorBuffer(VectorBufferType::STRING_BUFFER) {
25}
26
27VectorStructBuffer::VectorStructBuffer() : VectorBuffer(VectorBufferType::STRUCT_BUFFER) {
28}
29
30VectorStructBuffer::~VectorStructBuffer() {
31}
32
33VectorListBuffer::VectorListBuffer() : VectorBuffer(VectorBufferType::LIST_BUFFER) {
34}
35
36void VectorListBuffer::SetChild(unique_ptr<ChunkCollection> new_child) {
37 child = move(new_child);
38}
39
40VectorListBuffer::~VectorListBuffer() {
41}
42