gem5 v24.0.0.0
|
Node for the Huffman tree. More...
Public Member Functions | |
Node (uint64_t value, uint64_t frequency) | |
Initialize node as a leaf node. | |
Node (Node *left, Node *right) | |
Initialize node as an internal node. | |
uint64_t | getFrequency () const |
Getter for the frequency counter. | |
bool | isLeaf () const |
Determine if the node is a leaf node by checking if it does not have sub-trees. | |
uint64_t | getValue () const |
Get the leaf's value. | |
const Node * | getLeftSubTree () const |
const Node * | getRightSubTree () const |
Private Attributes | |
const uint64_t | _frequency |
Frequency of the value represented by this node. | |
const uint64_t | _value |
Value represented by this node, if this is a leaf node. | |
std::unique_ptr< Node > | _left |
The left tree. | |
std::unique_ptr< Node > | _right |
The right tree. | |
Definition at line 76 of file huffman.hh.
|
inline |
Initialize node as a leaf node.
Definition at line 93 of file huffman.hh.
Initialize node as an internal node.
Definition at line 99 of file huffman.hh.
|
inline |
Getter for the frequency counter.
Definition at line 106 of file huffman.hh.
References _frequency.
Referenced by gem5::compression::encoder::Huffman::NodeComparator::operator()().
|
inline |
Definition at line 132 of file huffman.hh.
References _left.
Referenced by gem5::compression::encoder::Huffman::generateCodes().
|
inline |
Definition at line 133 of file huffman.hh.
References _right.
Referenced by gem5::compression::encoder::Huffman::generateCodes().
|
inline |
Get the leaf's value.
Definition at line 126 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 115 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 80 of file huffman.hh.
Referenced by getFrequency().
|
private |
The left tree.
Definition at line 86 of file huffman.hh.
Referenced by getLeftSubTree(), and isLeaf().
|
private |
The right tree.
Definition at line 89 of file huffman.hh.
Referenced by getRightSubTree(), and isLeaf().
|
private |
Value represented by this node, if this is a leaf node.
Definition at line 83 of file huffman.hh.
Referenced by getValue().