| 44 | } |
| 45 | |
| 46 | std::unique_ptr<RleDecoder> createRleDecoder(std::unique_ptr<SeekableInputStream> input, |
| 47 | bool isSigned, RleVersion version, MemoryPool& pool, |
| 48 | ReaderMetrics* metrics) { |
| 49 | switch (static_cast<int64_t>(version)) { |
| 50 | case RleVersion_1: |
| 51 | return std::make_unique<RleDecoderV1>(std::move(input), isSigned, metrics); |
| 52 | case RleVersion_2: |
| 53 | return std::make_unique<RleDecoderV2>(std::move(input), isSigned, pool, metrics); |
| 54 | default: |
| 55 | throw NotImplementedYet("Not implemented yet"); |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | template <typename T> |
| 60 | void RleEncoder::add(const T* data, uint64_t numValues, const char* notNull) { |