Creates instances of the class HuffmanEncodingTree. More...
#include <DS_HuffmanEncodingTreeFactory.h>
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. | |
| HuffmanEncodingTree * | GenerateTree (void) |
| Generate a HuffmanEncodingTree. | |
Creates instances of the class HuffmanEncodingTree.
This class takes a frequency table and given that frequence table, will generate an instance of HuffmanEncodingTree
Definition at line 18 of file DS_HuffmanEncodingTreeFactory.h.
| HuffmanEncodingTreeFactory::HuffmanEncodingTreeFactory | ( | ) |
Default constructor.
| void HuffmanEncodingTreeFactory::AddToFrequencyTable | ( | unsigned char * | array, | |
| int | size | |||
| ) |
Pass an array of bytes to this to add those elements to the frequency table.
| [in] | array | the data to insert into the frequency table |
| [in] | 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 int* HuffmanEncodingTreeFactory::GetFrequencyTable | ( | void | ) |
Returns the frequency table as a pointer.
| void HuffmanEncodingTreeFactory::GetFrequencyTable | ( | unsigned int | _frequency[256] | ) |
Copies the frequency table to the array passed. Retrieve the frequency table.
| [in] | _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
1.7.1