jubilant-funicular
Public Member Functions | Protected Attributes | Private Attributes | List of all members
nta::HuffmanNode Class Reference

A node in a Huffman tree. More...

#include <Compressor.h>

Inheritance diagram for nta::HuffmanNode:
Inheritance graph
[legend]
Collaboration diagram for nta::HuffmanNode:
Collaboration graph
[legend]

Public Member Functions

 HuffmanNode ()
 basic constructor
 
 HuffmanNode (HuffmanNode *l, HuffmanNode *r)
 sets l and r as children of this and sets m_freq to the sum of their frequencies
 
virtual ~HuffmanNode ()
 recursively destroys node
 
auto getEncodings (crstring enc="") const -> std::map< GLubyte, std::string >
 returns map of all the bytes and how they are encoded
 
HuffmanNodegetLeft () const
 returns children
 
HuffmanNodegetRight () const
 
bool hasChildren () const
 returns whether or not the node has children
 
int getFrequency () const
 returns the frequency of the node
 

Protected Attributes

int m_freq
 the frequency of the nodes associated bytes
 

Private Attributes

HuffmanNodem_lChild
 the children of the node
 
HuffmanNodem_rChild
 

Detailed Description

A node in a Huffman tree.

Definition at line 13 of file Compressor.h.


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