| 347 | |
| 348 | template <TypeKind kind> |
| 349 | VectorPtr readConstant( |
| 350 | const TypePtr& type, |
| 351 | vector_size_t size, |
| 352 | bolt::memory::MemoryPool* pool, |
| 353 | std::istream& in) { |
| 354 | using T = typename TypeTraits<kind>::NativeType; |
| 355 | |
| 356 | T value = read<T>(in); |
| 357 | |
| 358 | if constexpr (std::is_same_v<T, StringView>) { |
| 359 | if (!value.isInline()) { |
| 360 | auto stringSize = read<int32_t>(in); |
| 361 | BufferPtr stringBuffer = AlignedBuffer::allocate<char>(stringSize, pool); |
| 362 | in.read(stringBuffer->template asMutable<char>(), stringSize); |
| 363 | |
| 364 | return std::make_shared<ConstantVector<T>>( |
| 365 | pool, |
| 366 | size, |
| 367 | false, |
| 368 | type, |
| 369 | StringView(stringBuffer->as<char>(), stringSize)); |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | return std::make_shared<ConstantVector<T>>( |
| 374 | pool, size, false, type, std::move(value)); |
| 375 | } |
| 376 | |
| 377 | VectorPtr readConstantVector( |
| 378 | const TypePtr& type, |
nothing calls this directly
no test coverage detected