Octane v1.01.20 - The Open Compression Toolkit for C++ http://octane.sourceforge.net/
Homepage | Main | Modules | Class Hierarchy | Compound List | File List | Compound Members | Related Pages

HuffNode Class Reference

#include <huffmannodes.hpp>

Inheritance diagram for HuffNode:

HuffNode_Leaf HuffNode_Middle List of all members.

Detailed Description

The base HuffNode class is used to represent both leaf and internal HuffNodes.

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 > &current_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 HuffNodeget_child0 ()
 get pointer to left child

virtual HuffNodeget_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


The documentation for this class was generated from the following files:  
Generated on 20 May 2004 by doxygen 1.3.3