class encoder

Scope: kodo_fulcrum

In header: #include <encoder.hpp>

Brief description

The fulcrum encoder supports the concatenated code structure with an “outer” and “inner” code.

Member types (public)

class factory

Member functions (public)

uint32_t block_size () const
uint32_t bytes_used () const
const uint8_t * const_symbol (uint32_t index) const
uint32_t expansion () const
bool has_set_seed () const
bool has_systematic_mode () const
bool has_trace_support () const
bool in_systematic_phase () const
void initialize (factory & the_factory)
uint32_t inner_symbols () const
bool is_every_symbol_initialized () const
bool is_symbol_initialized (uint32_t index) const
bool is_systematic_on () const
bool is_trace_enabled () const
uint32_t payload_size () const
uint32_t rank () const
void set_bytes_used (uint32_t bytes_used)
void set_const_symbol (uint32_t index, const storage::const_storage & symbol)
void set_const_symbols (const storage::const_storage & symbol_storage)
void set_seed (uint32_t seed_value)
void set_systematic_off ()
void set_systematic_on ()
void set_trace_callback (const kodo_core::trace_callback_function & callback)
void set_trace_off ()
void set_trace_stdout ()
void set_zone_prefix (const std::string & zone_prefix)
uint32_t symbol_size () const
uint32_t symbols () const
uint32_t symbols_initialized () const
uint32_t write_payload (uint8_t * payload)

Description

For a detailed description of the fulcrum codec see the following paper on arxiv: by Lucani et. al.

Member Function Description

uint32_t block_size ()

Returns:
the block size i.e. the total size in bytes that this coder operates on. Users may use the bytes_used() function provided in the symbol storage layers to see how many of those bytes are then used.

uint32_t bytes_used ()

Returns:
the number of bytes used

const uint8_t * const_symbol (uint32_t index)

Parameter index:
the index number of the symbol
Returns:
Returns a const pointer to the symbol data. The size of the symbol data is provided by the symbol_size() function.

uint32_t expansion ()

Returns:
The expansion factor used. The expansion factor denotes the number of additional symbols created by the outer code.

bool has_set_seed ()

Returns whether the coder implements set_seed() .

Returns:
True if the function is available otherwise false

bool has_systematic_mode ()

Returns whether the encoder has a systematic mode.

Returns:
True if the systematic mode is available otherwise false

bool has_trace_support ()

Returns whether the coder has support for tracing.

Returns:
True if tracing is available otherwise false

bool in_systematic_phase ()

Returns:
true if the encoder is in the systematic phase, i.e. there is a systematic packet to send

void initialize (factory & the_factory)

Initializes the coder and ensures the object is in a clean state. A coder may be initialized many times.

Parameter the_factory:
The factory used to build the codec layer. Provides access to cached data and factory functions.

uint32_t inner_symbols ()

Returns:
the number of symbols in the inner code

bool is_every_symbol_initialized ()

Returns:
True if all symbols in the storage layer are initialized. Initialized means that a symbol’s memory is available and has been explicitly set by the user through a layer::set_const_symbol() , layer::set_const_symbols() , layer::set_mutable_symbol() or layer::set_mutable_symbols() call. Any symbol which is initialized is also available.

bool is_symbol_initialized (uint32_t index)

Parameter index:
The index of the symbol to check
Returns:
True if the specific symbol is initialized. Initialized means that a symbol’s memory is available and it has been explicitly set by layer::set_const_symbol() , layer::set_const_symbols() , layer::set_mutable_symbol() or layer::set_mutable_symbols() . Any symbol which is initialized is also available.

bool is_systematic_on ()

Returns:
, true if the encoder is in systematic mode

bool is_trace_enabled ()

Returns whether a tracing is enabled for the coder.

Returns:
True if tracing is enabled otherwise false

uint32_t payload_size ()

Returns:
the required payload buffer size in bytes

uint32_t rank ()

The rank of an encoder states how many symbols are available for encoding. The rank of a decoder indicates how many symbols have been partially or fully decoded. This number is also equivalent to the number of pivot elements we have in the decoding matrix.

Returns:
the rank of the encoder/decoder

void set_bytes_used (uint32_t bytes_used)

Sets the number of bytes used

Parameter bytes_used:
number of bytes used of the total coders block size

void set_const_symbol (uint32_t index, const storage::const_storage & symbol)

Sets the data storage for a const symbol.

Parameter index:
the index of the symbol in the coding block
Parameter symbol:
the actual data of that symbol

void set_const_symbols (const storage::const_storage & symbol_storage)

Sets the storage for the source symbols. This will specify all symbols also in the case of partial data. If this is not desired then the symbols should be specified individually. This also means that it is the responsibility of the user to communicate how many of the bytes transmitted are application data.

Parameter symbol_storage:
A storage::const_storage container initialized with the buffer to be use as encoding buffer.

void set_seed (uint32_t seed_value)

Set the seed of the coefficient generator used. Note that not all generators provide the set_seed() function. E.g. a layer using a Vandermonde matrix as source for the symbol coefficients will not implement the set_seed() function.

Parameter seed_value:
The seed value for the generator.

void set_systematic_off ()

Turns off systematic mode

void set_systematic_on ()

Sets the encoder in systematic mode

void set_trace_callback (const kodo_core::trace_callback_function & callback)

Enables tracing in a stack. trace_callback for more information about the callback signature.

Parameter callback:
The function callback where the tracing information will be delivered. As a user you specify the callback if you want to have control over the tracing output.

void set_trace_off ()

Disables tracing in a stack.

void set_trace_stdout ()

Enables tracing in a stack. The output will be written to standard out.

void set_zone_prefix (const std::string & zone_prefix)

Sets a zone prefix for the tracing output. The zone prefix will be appended to all the output. This makes it possible to have two stacks that both trace to standard out, but still differentiate the output.

Parameter zone_prefix:
The zone prefix to append to all tracing zones

uint32_t symbol_size ()

Returns:
the symbol size of a symbol in bytes

uint32_t symbols ()

Returns:
the number of symbols in this block coder

uint32_t symbols_initialized ()

Returns:
The number of symbols that are initialized. Initialized means that a symbols memory is available and has been explicitly set by the user through a layer::set_const_symbol() , layer::set_const_symbols() , layer::set_mutable_symbol() or layer::set_mutable_symbols() call. Any symbol which is initialized is also available.

uint32_t write_payload (uint8_t * payload)

Writes the payload representing a single encoded symbol into the provided buffer. The exact content and structure of the payload depends on the codec used. The provided buffer should have a size of at least layer::payload_size() bytes. This is guaranteed to be enough for the specific configuration used for the codec, e.g. the number of symbols and the size of a symbol. However, since many codecs use variable-size encoding, i.e. using less bytes to represent the headers of a systematic symbol, we will return the actual number of bytes used. So that the application can avoid transmitting/storing more data than actually needed.

Parameter payload:
The buffer where the payload should be written.
Returns:
the total bytes used from the payload buffer

class factory

Scope: kodo_fulcrum::encoder

In header: #include <encoder.hpp>

Brief description

Factory class that is needed to instantiate an encoder.

Member types (public)

using pointer

Member functions (public)

  factory (fifi::api::field field, uint32_t symbols, uint32_t symbol_size)
pointer build ()
uint32_t expansion () const
void set_expansion (uint32_t expansion)
void set_symbol_size (uint32_t symbol_size)
void set_symbols (uint32_t symbols)
uint32_t symbol_size () const
uint32_t symbols () const

Member Function Description

factory (fifi::api::field field, uint32_t symbols, uint32_t symbol_size)

Factory base constructor.

Parameter field:
the chosen finite field
Parameter symbols:
the number of symbols in the coding block
Parameter symbol_size:
the size of a symbol in bytes

pointer build ()

Builds the actual coder.

Returns:
pointer to an instantiation of an encoder or decoder

uint32_t expansion ()

Returns:
The expansion factor used. The expansion factor denotes the number of additional symbols created by the outer code.

void set_expansion (uint32_t expansion)

Sets the number of expansion symbols

Parameter expansion:
The number of expansion symbols to use

void set_symbol_size (uint32_t symbol_size)

Sets the symbol size

Parameter symbol_size:
the symbol size

void set_symbols (uint32_t symbols)

Sets the number of symbols

Parameter symbols:
the number of symbols

uint32_t symbol_size ()

Returns:
the symbol size in bytes

uint32_t symbols ()

Returns:
the number of symbols in a block

Type Description

using pointer = std::shared_ptr
Type of the pointer returned by the factory objects.