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

Code Example: Hello World

This simple example can be used for checking whether your build system has been successfully setup to use the otacast library.

 1#include <iostream>
 2
 3#include <otacast/encoder.hpp>
 4#include <otacast/version.hpp>
 5
 6int main()
 7{
 8    // Print the version of the library used
 9    std::cout << "version:      " << otacast::version() << "\n";
10
11    // Create the encoder object with a specific finite field
12    otacast::encoder encoder;
13
14    auto width = otacast::codec_width::_32;
15    std::size_t block_bytes = 1024 * 1000; // 1 MB
16    std::size_t symbol_bytes = 1500;
17
18    encoder.configure(width, block_bytes, symbol_bytes);
19
20    std::cout << "block_bytes:  " << encoder.block_bytes() << "\n";
21    std::cout << "symbol_bytes: " << encoder.symbol_bytes() << "\n";
22    std::cout << "width:        " << encoder.width() << "\n";
23    std::cout << "symbols       " << encoder.symbols() << "\n";
24    return 0;
25}