class encoder

Scope: otacast

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

Brief description

The otacast encoder.

Member functions (public)

  encoder ()
  encoder (const encoder & other)
encoder & operator= (const encoder & other)
  encoder (encoder && other)
encoder & operator= (encoder && other)
  ~encoder ()
void configure (finite_field field, uint64_t block_bytes, uint64_t symbol_bytes, uint64_t width)
void reset ()
uint64_t symbol_bytes () const
uint64_t width () const
uint64_t block_bytes () const
uint64_t symbols () const
finite_field finite_field () const
void set_symbols_storage (const uint8_t * symbol_storage)
const uint8_t * symbols_storage () const
uint64_t encode (uint8_t * symbol, uint64_t seed)

Member Function Description

encoder ()
Default constructor.

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

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

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

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

~encoder ()
Destructor.

void configure (finite_field field, uint64_t block_bytes, uint64_t symbol_bytes, uint64_t width)

Configure the encoder 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 field:
The finite field to use
Parameter block_bytes:
The size of the block in bytes
Parameter symbol_bytes:
The size of a symbol in bytes
Parameter width:
The width of the encoding i.e. now many symbols are combined for each encoded symbol

void reset ()
Reset the state of the encoder.

auto symbol_bytes () const -> uint64_t
Return the size in bytes per symbol supported by this encoder.

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

auto block_bytes () const -> uint64_t
Return total number of bytes that is currently being encoded with this encoder.

auto symbols () const -> uint64_t
Return the number of symbols supported by this encoder.

auto finite_field () const -> finite_field
Return the finite field used.

void set_symbols_storage (const 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 -> const uint8_t *
Returns:
The memory for the block.

auto encode (uint8_t * symbol, uint64_t seed) -> uint64_t

Creates a new encoded symbol.

Parameter symbol:
This is the memory where the encoded symbol will be produced. This buffer must be large enough to store symbol_bytes() bytes.
Parameter seed:
The seed for generating the coding coefficients
Returns:
The offset of the coding coefficients
Versions
3.0.0
2.1.0
2.0.1
2.0.0
1.0.0
Development
latest