From 83d2624cdfc1dd45ab1da02881448c5584ff6050 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sat, 29 Oct 2016 00:05:12 +0200 Subject: Modernize ReedSolomon, use vector instead of raw buffer --- src/ReedSolomon.h | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'src/ReedSolomon.h') diff --git a/src/ReedSolomon.h b/src/ReedSolomon.h index d96a522..abcef62 100644 --- a/src/ReedSolomon.h +++ b/src/ReedSolomon.h @@ -1,6 +1,11 @@ /* Copyright (C) 2005, 2006, 2007, 2008, 2009 Her Majesty the Queen in Right of Canada (Communications Research Center Canada) + + Copyright (C) 2016 + Matthias P. Braendli, matthias.braendli@mpb.li + + http://www.opendigitalradio.org */ /* This file is part of ODR-DabMux. @@ -19,34 +24,33 @@ along with ODR-DabMux. If not, see . */ -#ifndef _REEDSOLOMON -#define _REEDSOLOMON +#pragma once #ifdef HAVE_CONFIG_H # include #endif +#include class ReedSolomon { public: - ReedSolomon(int N, int K, bool reverse = false, + ReedSolomon(int N, int K, + bool reverse = false, int gfpoly = 0x11d, int firstRoot = 0, int primElem = 1); - ReedSolomon(const ReedSolomon& clone); - virtual ~ReedSolomon(); + ReedSolomon(const ReedSolomon& other) = delete; + ReedSolomon operator=(const ReedSolomon& other) = delete; + ~ReedSolomon(); void setReverse(bool state); - int encode(void* data, void* fec, unsigned long size); - int encode(void* data, unsigned long size); - -protected: - int myN; - int myK; + int encode(void* data, void* fec, size_t size); + int encode(void* data, size_t size); private: + int m_N; + int m_K; + void* rsData; bool reverse; }; - -#endif // _REEDSOLOMON -- cgit v1.2.3