Octane v1.01.20 - The Open Compression Toolkit for C++ | http://octane.sourceforge.net/ |
#include <huffmannodes.hpp>
Inheritance diagram for HuffNode:
leaf HuffNodes have 0s in the child pointers, and their value member corresponds to the character they encode. internal HuffNodes don't have anything meaningful in their value member, but their child pointers point to other HuffNodes.
The huffman node class is used by the HuffmanCoder.
Definition at line 110 of file huffmannodes.hpp.
Public Member Functions | |
HuffNode () | |
constructor | |
virtual | ~HuffNode () |
destructor | |
bool | operator> (const HuffNode *&a) const |
The comparison operator used to order the priority queue. | |
virtual void | traverse_buildbitcodes (std::bitset< DEF_HUFFMANPQ_MAXFUNCBITS > ¤t_bitset, int bitsetlength) |
recursive traversal of huffman tree for building bitcodes | |
virtual void | recursive_freechildren () |
freeing memory occupied by this node and any children | |
THuffmanNodeWeight | get_weight () const |
get weight of node | |
void | increment_weight (int increment) |
increment node weight | |
void | set_weight (THuffmanNodeWeight val) |
set node weight | |
virtual unsigned int | get_memoryused () const |
get memory used by the node and its children | |
virtual HuffNode * | get_child0 () |
get pointer to left child | |
virtual HuffNode * | get_child1 () |
get pointer to right child | |
virtual bool | isleaf () |
is this a leaf node (this is an RTTI type function) | |
Protected Attributes | |
THuffmanNodeWeight | weight |
the weight of a node is just the frequency count of the node if it is a leaf, or the *sum* of frequencies for all children if it is not |