gem5
v22.1.0.0
|
Node for the Huffman tree. More...
Public Member Functions | |
Node (uint64_t value, uint64_t frequency) | |
Initialize node as a leaf node. More... | |
Node (Node *left, Node *right) | |
Initialize node as an internal node. More... | |
uint64_t | getFrequency () const |
Getter for the frequency counter. More... | |
bool | isLeaf () const |
Determine if the node is a leaf node by checking if it does not have sub-trees. More... | |
uint64_t | getValue () const |
Get the leaf's value. More... | |
const Node * | getLeftSubTree () const |
const Node * | getRightSubTree () const |
Private Attributes | |
const uint64_t | _frequency |
Frequency of the value represented by this node. More... | |
const uint64_t | _value |
Value represented by this node, if this is a leaf node. More... | |
std::unique_ptr< Node > | _left |
The left tree. More... | |
std::unique_ptr< Node > | _right |
The right tree. More... | |
Definition at line 78 of file huffman.hh.
|
inline |
Initialize node as a leaf node.
Definition at line 95 of file huffman.hh.
Initialize node as an internal node.
Definition at line 101 of file huffman.hh.
|
inline |
Getter for the frequency counter.
Definition at line 108 of file huffman.hh.
References _frequency.
Referenced by gem5::compression::encoder::Huffman::NodeComparator::operator()().
|
inline |
Definition at line 134 of file huffman.hh.
References _left.
Referenced by gem5::compression::encoder::Huffman::generateCodes().
|
inline |
Definition at line 135 of file huffman.hh.
References _right.
Referenced by gem5::compression::encoder::Huffman::generateCodes().
|
inline |
Get the leaf's value.
Definition at line 128 of file huffman.hh.
References _value, and isLeaf().
Referenced by gem5::compression::encoder::Huffman::generateCodes().
|
inline |
Determine if the node is a leaf node by checking if it does not have sub-trees.
Definition at line 117 of file huffman.hh.
Referenced by gem5::compression::encoder::Huffman::generateCodes(), and getValue().
|
private |
Frequency of the value represented by this node.
Definition at line 82 of file huffman.hh.
Referenced by getFrequency().
|
private |
The left tree.
Definition at line 88 of file huffman.hh.
Referenced by getLeftSubTree(), and isLeaf().
|
private |
The right tree.
Definition at line 91 of file huffman.hh.
Referenced by getRightSubTree(), and isLeaf().
|
private |
Value represented by this node, if this is a leaf node.
Definition at line 85 of file huffman.hh.
Referenced by getValue().