// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include #include #include namespace search::fakedata { template class BitEncode64 : public bitcompression::EncodeContext64 { search::ComprFileWriteContext _cbuf; public: BitEncode64(); ~BitEncode64() override; using EC = bitcompression::EncodeContext64; void writeComprBuffer() { _cbuf.writeComprBuffer(true); } void writeComprBufferIfNeeded() { if (this->_valI >= this->_valE) _cbuf.writeComprBuffer(false); } std::pair grabComprBuffer(vespalib::alloc::Alloc & comprAlloc) { return _cbuf.grabComprBuffer(comprAlloc); } }; extern template class BitEncode64; extern template class BitEncode64; }