semf
errorcorrectioncode.h
Go to the documentation of this file.
1
10#ifndef SEMF_APP_PROCESSING_ERRORCORRECTIONCODE_H_
11#define SEMF_APP_PROCESSING_ERRORCORRECTIONCODE_H_
12
15#include <cstdint>
16
17namespace semf
18{
19namespace app
20{
25{
26public:
27 virtual ~ErrorCorrectionCode() = default;
28
37 virtual size_t encode(const uint8_t data[], size_t dataBitSize, uint8_t buffer[], size_t bufferSize) const = 0;
46 virtual size_t decode(const uint8_t data[], size_t dataSize, uint8_t buffer[], size_t bufferSize) const = 0;
52 virtual size_t blockBitSize(size_t messageBitSize) const = 0;
53
56};
57} /* namespace app */
58} /* namespace semf */
59#endif /* SEMF_APP_PROCESSING_ERRORCORRECTIONCODE_H_ */
Signal for lightweight signal/slot implementation. One signal can be connected to multiple slots and ...
Definition: signal.h:41
Interface for error correction code implementations.
virtual size_t blockBitSize(size_t messageBitSize) const =0
Calculates the size of the bits which are needed to store a certain amount of bits with ecc.
virtual size_t encode(const uint8_t data[], size_t dataBitSize, uint8_t buffer[], size_t bufferSize) const =0
Add ecc bits to the data and write them to the buffer.
virtual size_t decode(const uint8_t data[], size_t dataSize, uint8_t buffer[], size_t bufferSize) const =0
Remove ecc bits from the data, corrects bit errors and write them to the buffer.
virtual ~ErrorCorrectionCode()=default