gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::compression::encoder::Base Class Referenceabstract

Base class for encoders. More...

#include <base.hh>

Inheritance diagram for gem5::compression::encoder::Base:
gem5::compression::encoder::Huffman

Public Member Functions

 Base ()
 
virtual ~Base ()=default
 
virtual Code encode (const uint64_t val) const =0
 The function responsible for the generation of the alternative value.
 
virtual uint64_t decode (const uint64_t code) const =0
 Decode a value.
 

Detailed Description

Base class for encoders.

The goal of encoders is to provide an alternative representation to values, ideally shorter than the value. The alternative representation is called a code.

Definition at line 57 of file base.hh.

Constructor & Destructor Documentation

◆ Base()

gem5::compression::encoder::Base::Base ( )
inline

Definition at line 60 of file base.hh.

◆ ~Base()

virtual gem5::compression::encoder::Base::~Base ( )
virtualdefault

Member Function Documentation

◆ decode()

virtual uint64_t gem5::compression::encoder::Base::decode ( const uint64_t code) const
pure virtual

Decode a value.

See also
encode()
Parameters
codeThe encoded value.
Returns
The original value.

Implemented in gem5::compression::encoder::Huffman.

◆ encode()

virtual Code gem5::compression::encoder::Base::encode ( const uint64_t val) const
pure virtual

The function responsible for the generation of the alternative value.

If the size of the returning Code is greater than the maximum undelying type's size (e.g., 64 bits) the encoding results should be discarded.

Parameters
Thevalue to be encoded.
Returns
The encoded value.

Implemented in gem5::compression::encoder::Huffman.


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

Generated on Tue Jun 18 2024 16:24:19 for gem5 by doxygen 1.11.0