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

represents a leaf in a Huffman tree More...

#include <Compressor.h>

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

Public Member Functions

 HuffmanLeaf ()
 basic constructor
 
 HuffmanLeaf (GLubyte data, int freq)
 constructs a leaf with given data and freq
 
 ~HuffmanLeaf ()
 destroys leaf
 
GLubyte getData () const
 returns m_data
 
- Public Member Functions inherited from nta::HuffmanNode
 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
 

Private Attributes

GLubyte m_data
 the byte associated with the leaf
 

Additional Inherited Members

- Protected Attributes inherited from nta::HuffmanNode
int m_freq
 the frequency of the nodes associated bytes
 

Detailed Description

represents a leaf in a Huffman tree

Definition at line 38 of file Compressor.h.


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