Warning: This is a development version. The latest stable version is Version 6.0.0.

class decoder

Scope: otacast

In header: #include <otacast/decoder.hpp>

Brief description

The OTAcast decoder.

Member functions (public)

  decoder ()
  decoder (const decoder & other)
decoder & operator= (const decoder & other)
  decoder (decoder && other)
decoder & operator= (decoder && other)
  ~decoder ()
void configure (codec_width width, std::size_t block_bytes, std::size_t symbol_bytes)
void reset ()
std::size_t symbol_bytes () const
std::size_t width () const
std::size_t block_bytes () const
std::size_t symbols () const
void set_symbols_storage (uint8_t * symbol_storage)
uint8_t * symbols_storage () const
void decode (uint8_t * symbol, uint64_t seed, std::size_t offset)
std::size_t rank () const
bool is_complete () const
double progress () const

Member Function Descriptions

decoder ()
Default constructor.

decoder (const decoder & other)
Copy constructor (disabled). This type is only movable.

decoder & operator= (const decoder & other)
Copy assign operator (disabled). This type is only movable.

decoder (decoder && other)
R-value copy constructor.

decoder & operator= (decoder && other)
R-value move assign operator.

~decoder ()
Destructor.

void configure (codec_width width, std::size_t block_bytes, std::size_t symbol_bytes)

Configure the decoder with the given parameters. This is useful for reusing an existing coder. Note that the reconfiguration always implies a reset, so the coder will be in a clean state after this operation

Parameter width:
The width of the encoding i.e. now many symbols are combined for each encoded symbol
Parameter block_bytes:
The size of the block in bytes
Parameter symbol_bytes:
The size of a symbol in bytes

void reset ()
Reset the state of the decoder.

auto symbol_bytes () const -> std::size_t
Return the size in bytes per symbol supported by this decoder.

auto width () const -> std::size_t
Return the width of the encoding i.e. now many symbols are combined for each encoded symbol

auto block_bytes () const -> std::size_t
Return the total number of bytes that with this decoder spans.

auto symbols () const -> std::size_t
Return the number of symbols supported by this decoder.

void set_symbols_storage (uint8_t * symbol_storage)

Initialize all the symbols in the block

Parameter symbol_storage:
The buffer containing all the data for the the block

auto symbols_storage () const -> uint8_t *
Returns:
The memory for the block.

void decode (uint8_t * symbol, uint64_t seed, std::size_t offset)

Feed a coded symbol to the decoder.

Parameter symbol:
The data of the symbol assumed to be symbol_bytes() bytes in size.
Parameter seed:
The seed for generating the coding coefficients.
Parameter offset:
The offset of the coding coefficients

auto rank () const -> std::size_t
Return the current rank of this decoder.

auto is_complete () const -> bool
Returns:
True if the decoder is complete

auto progress () const -> double
Returns:
A value between 0 and 100, representing the decoding progress.