7 namespace fly::coders {
9 using symbol_type = std::uint8_t;
10 using frequency_type = std::uint64_t;
12 using code_type = std::uint16_t;
13 using length_type = std::uint8_t;
16 struct HuffmanNodeComparator;
18 using HuffmanNodeQueue =
19 std::priority_queue<HuffmanNode *, std::vector<HuffmanNode *>, HuffmanNodeComparator>;
50 void become_symbol(symbol_type symbol, frequency_type frequency);
62 frequency_type m_frequency;
104 HuffmanCode(symbol_type symbol, code_type code, length_type length) noexcept;
132 symbol_type m_symbol;
134 length_type m_length;
friend bool operator<(const HuffmanCode &left, const HuffmanCode &right)
Definition: types.cpp:80
HuffmanCode & operator=(HuffmanCode &&code) noexcept
Definition: types.cpp:70
HuffmanCode() noexcept
Definition: types.cpp:49
void become_symbol(symbol_type symbol, frequency_type frequency)
Definition: types.cpp:25
HuffmanNode & operator=(HuffmanNode &&node) noexcept
Definition: types.cpp:11
HuffmanNode() noexcept
Definition: types.cpp:6
void become_intermediate(HuffmanNode *left, HuffmanNode *right)
Definition: types.cpp:34