Warning: This is an old version. The latest stable version is Version 11.0.1.
Scope: kodo_slide
Implementation of a complete RLNC sliding window encoder.
encoder () | |
encoder (encoder && other) | |
encoder (const encoder & other) | |
encoder & | operator= (encoder && other) |
encoder & | operator= (const encoder & other) |
~encoder () | |
void | reset () |
void | configure (finite_field field, uint32_t symbol_size) |
finite_field | field () const |
uint64_t | symbol_size () const |
uint64_t | stream_symbols () const |
uint64_t | stream_lower_bound () const |
uint64_t | stream_upper_bound () const |
uint64_t | push_front_symbol (const uint8_t * symbol) |
uint64_t | pop_back_symbol () |
uint64_t | window_symbols () const |
uint64_t | window_lower_bound () const |
uint64_t | window_upper_bound () const |
void | set_window (uint64_t lower_bound, uint64_t symbols) |
uint64_t | coefficient_vector_size () const |
void | set_seed (uint64_t seed_value) |
void | generate (uint8_t * coefficients) |
void | write_source_symbol (uint8_t * symbol, uint64_t index) |
void | write_symbol (uint8_t * symbol, const uint8_t * coefficients) |
void | set_log_stdout () |
void | set_zone_prefix (const std::string & zone_prefix) |
Default constructor.
R-value copy constructor.
Copy constructor (disabled). This type is only movable.
R-value move assign operator.
Copy assign operator (disabled). This type is only movable.
Destructor.
Resets the coder and ensures that the object is in a clean state. A coder may be reset many times.
Configures the encoder with the given parameters. This must be called before anything else. If needed configure can be called again. This is useful for reusing an existing coder. Note that the a reconfiguration always implies a reset, so the coder will be in a clean state after the operation
- Parameter
field
:- the chosen finite field
- Parameter
symbol_size
:- the size of a symbol in bytes
- Returns:
- The finite field used.
- Returns:
- The size of a symbol in the stream in bytes.
- Returns:
The total number of symbols available in memory at the encoder. The number of symbols in the coding window MUST be less than or equal to this number. The total range of valid symbol indices is:
for (uint64_t i = 0; i < stream_symbols(); ++i) { std::cout << i + stream_lower_bound() << "\n"; }
- Returns:
- The index of the oldest symbol known by the encoder. This symbol may not be inside the window but can be included in the window if needed.
- Returns:
- The upper bound of the stream. The range of valid symbol indices goes from [ encoder::stream_lower_bound() , encoder::stream_upper_bound() ). Note the stream is a half-open interval. Going from encoder::stream_lower_bound() to encoder::stream_upper_bound() - 1.
Adds a new symbol to the front of the encoder. Increments the number of symbols in the stream and increases the encoder::stream_upper_bound() . This does not move the encoder’s window. So if you want to include this new symbol in the encoding you should update the window also:
encoder.set_window(encoder.stream_lower_bound(), encoder.stream_symbols());
- Parameter
symbol
:- Pointer to the symbol. Note, the caller must ensure that the memory of the symbol remains valid as long as the symbol is included in the stream. The caller is responsible for freeing the memory if needed. Once the symbol is popped from the stream.
- Returns:
- The stream index of the symbol being added.
Remove the “oldest” symbol from the stream. Increments the encoder::stream_lower_bound() . This does not update the encoder’s window. So you need to make sure the symbol is not longer included in any encodings e.g.:
encoder.set_window(encoder.stream_lower_bound(), encoder.stream_symbols());
- Returns:
- The index of the symbol being removed
- Returns:
- The number of symbols currently in the coding window. The window must be within the bounds of the stream.
- Returns:
- The index of the “oldest” symbol in the coding window.
- Returns:
- The upper bound of the window. The range of valid symbol indices goes from [ encoder::window_lower_bound() , encoder::window_upper_bound() ). Note the window is a half-open interval. Going from encoder::window_lower_bound() to encoder::window_upper_bound() - 1.
The window represents the symbols which will be included in the next encoding. The window cannot exceed the bounds of the stream. Example: If window_lower_bound=4 and window_symbol=3 the following symbol indices will be included 4,5,6
- Parameter
lower_bound
:- Sets the index of the oldest symbol in the window.
- Parameter
symbols
:- Sets number of symbols within the window.
- Returns:
- The size of the coefficient vector in the current window in bytes. The number of coefficients is equal to the number of symbols in the window. The size in bits of each coefficients depends on the finite field chosen. A custom coding scheme can be implemented by generating the coding vector manually. Alternatively the built-in generator can be used. See encoder::set_seed (…) and encoder::generate (…).
Seed the internal random generator function. If using the same seed on the encoder and decoder the exact same set of coefficients will be generated.
- Parameter
seed_value
:- A value for the seed.
Generate coding coefficients for the symbols in the coding window according to the specified seed (see encoder::set_seed (…)).
- Parameter
coefficients
:- Buffer where the coding coefficients should be stored. This buffer must be encoder::coefficient_vector_size() large in bytes.
Write a source symbol to the symbol buffer.
- Parameter
symbol
:- The buffer where the source symbol will be stored. The symbol buffer must be encoder::symbol_size() large.
- Parameter
index
:- The symbol index which should be written.
Write an encoded symbol according to the coding coefficients.
- Parameter
symbol
:- The buffer where the encoded symbol will be stored. The symbol buffer must be encoder::symbol_size() large.
- Parameter
coefficients
:- The coding coefficients. These must have the memory layout required (see README.rst). A compatible format can be created using encoder::generate (…)
Enables logging in a stack. The output will be written to standard out.
Sets a zone prefix for the logging output. The zone prefix will be appended to all the output. This makes it possible to have two stacks that both log to standard out, but still differentiate the output.
- Parameter
zone_prefix
:- The zone prefix to append to all logging zones