summaryrefslogtreecommitdiffstats
path: root/src/PuncturingEncoder.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-12-25 21:34:03 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-12-25 21:34:03 +0100
commit2bba7d602744ccd6dab26940661f0fdfbf231af8 (patch)
tree590a5808497da3b621e29239cd56db6c89c2d6a9 /src/PuncturingEncoder.h
parentb5fd4a6ab6ac92af2141233f802e71c861cd89f4 (diff)
downloaddabmod-2bba7d602744ccd6dab26940661f0fdfbf231af8.tar.gz
dabmod-2bba7d602744ccd6dab26940661f0fdfbf231af8.tar.bz2
dabmod-2bba7d602744ccd6dab26940661f0fdfbf231af8.zip
Refactor flowgraph and puncturing rules
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