aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-04-10 16:42:27 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-04-10 16:42:27 +0200
commit9b8e06e041127d02666c7dcc8942ddd9d508767a (patch)
treed8e5fda0e065f1602c502ef92f0a558565e86bd2
parent5ab51f3672c8d1d2a0d6124179cdbc17823553c6 (diff)
downloaddabmod-9b8e06e041127d02666c7dcc8942ddd9d508767a.tar.gz
dabmod-9b8e06e041127d02666c7dcc8942ddd9d508767a.tar.bz2
dabmod-9b8e06e041127d02666c7dcc8942ddd9d508767a.zip
Don't use boost in PuncturingEncoder
-rw-r--r--src/PuncturingEncoder.cpp25
-rw-r--r--src/PuncturingEncoder.h15
2 files changed, 21 insertions, 19 deletions
diff --git a/src/PuncturingEncoder.cpp b/src/PuncturingEncoder.cpp
index de4319b..347266a 100644
--- a/src/PuncturingEncoder.cpp
+++ b/src/PuncturingEncoder.cpp
@@ -2,7 +2,7 @@
Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Her Majesty
the Queen in Right of Canada (Communications Research Center Canada)
- Copyright (C) 2016
+ Copyright (C) 2018
Matthias P. Braendli, matthias.braendli@mpb.li
http://opendigitalradio.org
@@ -24,22 +24,20 @@
along with ODR-DabMod. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "PuncturingEncoder.h"
-#include "PcDebug.h"
-
#include <string>
-#include <stdio.h>
#include <stdexcept>
-#include <stdint.h>
-#include <assert.h>
+#include <cstdio>
+#include <cstdint>
+#include <cassert>
+#include "PuncturingEncoder.h"
+#include "PcDebug.h"
PuncturingEncoder::PuncturingEncoder() :
ModCodec(),
d_num_cu(0),
d_in_block_size(0),
- d_out_block_size(0),
- d_tail_rule()
+ d_out_block_size(0)
{
PDEBUG("PuncturingEncoder() @ %p\n", this);
}
@@ -49,8 +47,7 @@ PuncturingEncoder::PuncturingEncoder(
ModCodec(),
d_num_cu(num_cu),
d_in_block_size(0),
- d_out_block_size(0),
- d_tail_rule()
+ d_out_block_size(0)
{
PDEBUG("PuncturingEncoder(%zu) @ %p\n", num_cu, this);
}
@@ -93,8 +90,10 @@ void PuncturingEncoder::append_rule(const PuncturingRule& rule)
void PuncturingEncoder::append_tail_rule(const PuncturingRule& rule)
{
- PDEBUG("append_tail_rule(rule(%zu, 0x%x))\n", rule.length(), rule.pattern());
- d_tail_rule = rule;
+ PDEBUG("append_tail_rule(rule(%zu, 0x%x))\n",
+ rule.length(), rule.pattern());
+
+ d_tail_rule.reset(new PuncturingRule(rule));
adjust_item_size();
}
diff --git a/src/PuncturingEncoder.h b/src/PuncturingEncoder.h
index b6f9f0e..15695e7 100644
--- a/src/PuncturingEncoder.h
+++ b/src/PuncturingEncoder.h
@@ -2,7 +2,7 @@
Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Her Majesty
the Queen in Right of Canada (Communications Research Center Canada)
- Copyright (C) 2016
+ Copyright (C) 2018
Matthias P. Braendli, matthias.braendli@mpb.li
http://opendigitalradio.org
@@ -30,14 +30,14 @@
# include <config.h>
#endif
+#include <vector>
+#include <memory>
+#include <string>
+#include <cstddef>
#include "PuncturingRule.h"
#include "ModPlugin.h"
-#include <vector>
-#include <string>
-#include <sys/types.h>
-#include <boost/optional.hpp>
class PuncturingEncoder : public ModCodec
{
@@ -68,7 +68,10 @@ private:
size_t d_in_block_size;
size_t d_out_block_size;
std::vector<PuncturingRule> d_rules;
- boost::optional<PuncturingRule> d_tail_rule;
+
+ // We use a unique_ptr because we don't want to depend
+ // on boost::optional here
+ std::unique_ptr<PuncturingRule> d_tail_rule;
void adjust_item_size();
};