# HuffmanEncodingTreeFactory Class Reference

`#include <HuffmanEncodingTreeFactory.h>`

List of all members.

## Public Member Functions

| HuffmanEncodingTreeFactory ()
void | Reset (void)
void | AddToFrequencyTable (unsigned char *array, int size)
void | GetFrequencyTable (unsigned long _frequency[256])
unsigned long * | GetFrequencyTable (void)
HuffmanEncodingTree * | GenerateTree (void)

## Private Attributes

unsigned long | frequency [256]

## Detailed Description

This generates a special case of the huffman encoding tree with 8 bit keys

## Constructor & Destructor Documentation

HuffmanEncodingTreeFactory::HuffmanEncodingTreeFactory | ( |  | ) |

| Default Constructor

## Member Function Documentation

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

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

Parameters:

  | array | the data to insert into the frequency table
  | size | the size of the data to insert

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

| Generate a HuffmanEncodingTree. You can also use GetFrequencyTable and GenerateFromFrequencyTable in the tree itself

unsigned long * HuffmanEncodingTreeFactory::GetFrequencyTable | ( | void |  | ) |

Returns the frequency table as a pointer

Returns:
  the address of the frenquency table

void HuffmanEncodingTreeFactory::GetFrequencyTable | ( | unsigned long | _frequency[256] | ) |

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

Parameters:

  | _frequency | The frequency table used currently

void 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

## Member Data Documentation

unsigned long HuffmanEncodingTreeFactory::frequency[256]`[private]`

| 256 frequencies.

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

- Projects/raknet/include/raknet/HuffmanEncodingTreeFactory.h
- Projects/raknet/Source/HuffmanEncodingTreeFactory.cpp