aboutsummaryrefslogtreecommitdiffstats
path: root/src/PuncturingEncoder.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/PuncturingEncoder.h')
-rw-r--r--src/PuncturingEncoder.h37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/PuncturingEncoder.h b/src/PuncturingEncoder.h
index 17dc21f..19be53e 100644
--- a/src/PuncturingEncoder.h
+++ b/src/PuncturingEncoder.h
@@ -1,6 +1,11 @@
/*
Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Her Majesty
the Queen in Right of Canada (Communications Research Center Canada)
+
+ Copyright (C) 2016
+ Matthias P. Braendli, matthias.braendli@mpb.li
+
+ http://opendigitalradio.org
*/
/*
This file is part of ODR-DabMod.
@@ -19,8 +24,7 @@
along with ODR-DabMod. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef PUNCTURING_ENCODER_H
-#define PUNCTURING_ENCODER_H
+#pragma once
#ifdef HAVE_CONFIG_H
# include <config.h>
@@ -28,36 +32,31 @@
#include "PuncturingRule.h"
-#include "ModCodec.h"
+#include "ModPlugin.h"
#include <vector>
#include <sys/types.h>
-
+#include <boost/optional.hpp>
class PuncturingEncoder : public ModCodec
{
-private:
- size_t d_in_block_size;
- size_t d_out_block_size;
- std::vector<PuncturingRule*> d_rules;
- PuncturingRule* d_tail_rule;
-
-protected:
- void adjust_item_size();
-
public:
PuncturingEncoder();
- virtual ~PuncturingEncoder();
- PuncturingEncoder(const PuncturingEncoder&);
- PuncturingEncoder& operator=(const PuncturingEncoder&);
-
+
void append_rule(const PuncturingRule& rule);
void append_tail_rule(const PuncturingRule& rule);
int process(Buffer* const dataIn, Buffer* dataOut);
const char* name() { return "PuncturingEncoder"; }
size_t getInputSize() { return d_in_block_size; }
size_t getOutputSize() { return d_out_block_size; }
-};
+private:
+ size_t d_in_block_size;
+ size_t d_out_block_size;
+ std::vector<PuncturingRule> d_rules;
+ boost::optional<PuncturingRule> d_tail_rule;
+
+ void adjust_item_size();
+
+};
-#endif // PUNCTURING_ENCODER_H