gem5  v21.2.0.0
Public Member Functions | List of all members
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. More...
 
virtual uint64_t decode (const uint64_t code) const =0
 Decode a value. More...
 

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 59 of file base.hh.

Constructor & Destructor Documentation

◆ Base()

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

Definition at line 62 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 Dec 21 2021 11:35:28 for gem5 by doxygen 1.8.17