RakNet::HuffmanEncodingTreeFactory Class Reference

Creates instances of the class HuffmanEncodingTree. More...

#include <DS_HuffmanEncodingTreeFactory.h>

List of all members.

Public Member Functions

 HuffmanEncodingTreeFactory ()
 Default constructor.
void Reset (void)
 Reset the frequency table.
void AddToFrequencyTable (unsigned char *array, int size)
 Pass an array of bytes to this to add those elements to the frequency table.
void GetFrequencyTable (unsigned int _frequency[256])
 Copies the frequency table to the array passed. Retrieve the frequency table.
unsigned int * GetFrequencyTable (void)
 Returns the frequency table as a pointer.
HuffmanEncodingTreeGenerateTree (void)
 Generate a HuffmanEncodingTree.


Detailed Description

Creates instances of the class HuffmanEncodingTree.

This class takes a frequency table and given that frequence table, will generate an instance of HuffmanEncodingTree


Member Function Documentation

void RakNet::HuffmanEncodingTreeFactory::AddToFrequencyTable ( unsigned char *  array,
int  size 
)

Pass an array of bytes to this to add those elements to the frequency table.

Parameters:
[in] array the data to insert into the frequency table
[in] size the size of the data to insert

HuffmanEncodingTree* RakNet::HuffmanEncodingTreeFactory::GenerateTree ( void   ) 

Generate a HuffmanEncodingTree.

You can also use GetFrequencyTable and GenerateFromFrequencyTable in the tree itself

Returns:
The generated instance of HuffmanEncodingTree

unsigned int* RakNet::HuffmanEncodingTreeFactory::GetFrequencyTable ( void   ) 

Returns the frequency table as a pointer.

Returns:
the address of the frenquency table

void RakNet::HuffmanEncodingTreeFactory::GetFrequencyTable ( unsigned int  _frequency[256]  ) 

Copies the frequency table to the array passed. Retrieve the frequency table.

Parameters:
[in] _frequency The frequency table used currently

void RakNet::HuffmanEncodingTreeFactory::Reset ( void   ) 

Reset the frequency table.

You don't need to call this unless you want to reuse the class for a new tree


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

Generated on Wed Feb 1 13:33:47 2012 for RakNet by  doxygen 1.5.7.1