base_n::basic_codec¶
Defined in header <mgs/base_n/basic_codec.hpp>
.
template <base_n::encoding_traits EncoderTraits,
base_n::encoding_traits DecoderTraits = EncoderTraits>
class basic_codec;
The class template basic_codec provides a generic implementation of BaseN codecs, that models the codecs::codec concept.
The definitions of the encoding/decoding operations are supplied via the template parameters, which must model base_n::encoding_traits.
Template parameters¶
Name |
Description |
---|---|
EncoderTraits |
Encoding traits used to encode input, must model base_n::encoding_traits |
DecoderTraits |
Encoding traits used to decode input, defaulted to EncoderTraits |
Member functions¶
Name |
Description |
---|---|
encoded_size [static] |
Computes the encoded size given a decoded size |
max_decoded_size [static] |
Computes the maximum decoded size given an encoded size |
Inherited from codecs::basic_codec¶
Member functions¶
Name |
Description |
---|---|
encode [static] |
Encodes input |
decode [static] |
Decodes input |
make_encoder [static] |
Creates an encoder |
make_decoder [static] |
Creates a decoder |