18 std::shared_ptr<BitOStream>
m_out;
28 template<
typename literals_t>
31 std::shared_ptr<BitOStream> out,
32 literals_t&& literals)
43 template<
typename literals_t>
60 template<
typename value_t>
74 template<
typename value_t>
79 inline const std::shared_ptr<BitOStream>&
stream() {
91 std::shared_ptr<BitIStream>
m_in;
126 template<
typename value_t>
128 return value_t(r.
min()) +
139 template<
typename value_t>
141 return value_t(m_in->read_bit());
144 inline const std::shared_ptr<BitIStream>&
stream() {
156 #define DECODER_CTOR(env, in) \ 157 inline Decoder(Env&& env, Input& in) \ 158 : Decoder(std::move(env), \ 159 std::make_shared<BitIStream>(in)) {} \ 160 inline Decoder(Env&& env, std::shared_ptr<BitIStream> in) \ 161 : tdc::Decoder(std::move(env), in) Represents a generic range of positive integers.
Encoder(Env &&env, std::shared_ptr< BitOStream > out, literals_t &&literals)
Constructor.
Contains the text compression and encoding framework.
constexpr uint_fast8_t bits_for(size_t n)
Computes the number of bits required to store the given integer value.
Represents a compiler-level fixed range.
Wrapper for input streams that provides bitwise reading functionality.
std::shared_ptr< BitIStream > m_in
The underlying bit input stream.
Encoder(Env &&env, Output &out, literals_t &&literals)
Convenience constructor.
Decoder(Env &&env, Input &in)
Convenience constructor.
size_t max() const
Yields the range's maximum value.
Env & env()
Provides access to the environment that the algorithm works in.
Wrapper for output streams that provides bitwise writing functionality.
size_t min() const
Yields the range's minimum value.
An abstraction layer for algorithm output.
const std::shared_ptr< BitIStream > & stream()
bool eof() const
Tests whether the end of the bit input stream has been reached.
std::shared_ptr< BitOStream > m_out
The underlying bit output stream.
value_t decode(const Range &r)
Decodes an arbitrary-range integer value.
Decoder(Env &&env, std::shared_ptr< BitIStream > in)
Constructor.
value_t decode(const BitRange &r)
Decodes a bit.
void encode(value_t v, const BitRange &r)
Encodes a bit.
Local environment for a compression/encoding/decompression call.
void encode(value_t v, const Range &r)
Encodes an arbitrary-range integer value.
Interface for algorithms.
const std::shared_ptr< BitOStream > & stream()