gem5  v21.0.1.0
Public Member Functions | List of all members
Compressor::Encoder::Base Class Referenceabstract

Base class for encoders. More...

#include <base.hh>

Inheritance diagram for Compressor::Encoder::Base:
Compressor::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 50 of file base.hh.

Constructor & Destructor Documentation

◆ Base()

Compressor::Encoder::Base::Base ( )
inline

Definition at line 53 of file base.hh.

◆ ~Base()

virtual Compressor::Encoder::Base::~Base ( )
virtualdefault

Member Function Documentation

◆ decode()

virtual uint64_t Compressor::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 Compressor::Encoder::Huffman.

◆ encode()

virtual Code Compressor::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 Compressor::Encoder::Huffman.


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

Generated on Tue Jun 22 2021 15:28:50 for gem5 by doxygen 1.8.17