Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Huffman_Decoder_Engine Class Reference

Huffman decoder. More...

#include <Huffman.H>

Collaboration diagram for Aleph::Huffman_Decoder_Engine:
[legend]

Public Member Functions

 Huffman_Decoder_Engine (BinNode< std::string > *p, const std::string &end)
 Decoder constructor.
 
BinNode< std::string > *& get_root ()
 Returns the root of the Huffman decoding tree.
 
void decode (BitArray &bit_stream, std::ostream &output)
 Decode a bit stream.
 

Private Attributes

BinNode< std::string > * root
 
std::string end_symbol
 

Detailed Description

Huffman decoder.

See also
Huffman_Encoder_Engine

Definition at line 669 of file Huffman.H.

Constructor & Destructor Documentation

◆ Huffman_Decoder_Engine()

Aleph::Huffman_Decoder_Engine::Huffman_Decoder_Engine ( BinNode< std::string > *  p,
const std::string &  end 
)
inline

Decoder constructor.

Builds a decoder given a previously constructed Huffman tree.

Parameters
[in]pRoot of the Huffman decoding tree.
[in]endEnd-of-stream symbol.

Definition at line 682 of file Huffman.H.

Member Function Documentation

◆ decode()

void Aleph::Huffman_Decoder_Engine::decode ( BitArray bit_stream,
std::ostream &  output 
)
inline

Decode a bit stream.

decode(bit_stream, output) decodes bit_stream using the Huffman prefix tree and writes the decoded output into output.

Parameters
[in]bit_streamEncoded bit stream.
[out]outputOutput stream where the decoded text is written.

Definition at line 705 of file Huffman.H.

References ah_domain_error_if, end_symbol, Aleph::BinNode< Key >::get_key(), Aleph::is_leaf(), Aleph::LLINK(), Aleph::maps(), output, Aleph::RLINK(), root, and Aleph::HTList::size().

◆ get_root()

BinNode< std::string > *& Aleph::Huffman_Decoder_Engine::get_root ( )
inline

Returns the root of the Huffman decoding tree.

Definition at line 689 of file Huffman.H.

References ah_domain_error_if, and root.

Member Data Documentation

◆ end_symbol

std::string Aleph::Huffman_Decoder_Engine::end_symbol
private

Definition at line 672 of file Huffman.H.

Referenced by decode().

◆ root

BinNode<std::string>* Aleph::Huffman_Decoder_Engine::root
private

Definition at line 671 of file Huffman.H.

Referenced by decode(), and get_root().


The documentation for this class was generated from the following file: