summaryrefslogtreecommitdiffstats
path: root/src/FrameMultiplexer.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-12-26 23:10:57 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-12-26 23:10:57 +0100
commit67c82c97dfcfc68d4bd71f5773d21c34c8733c83 (patch)
treefe3b9b22293bb5c19eef4b44d30c8cde9b32057b /src/FrameMultiplexer.cpp
parent91d3331d467c05d673f965b9f6eb8d33715df2b7 (diff)
downloaddabmod-67c82c97dfcfc68d4bd71f5773d21c34c8733c83.tar.gz
dabmod-67c82c97dfcfc68d4bd71f5773d21c34c8733c83.tar.bz2
dabmod-67c82c97dfcfc68d4bd71f5773d21c34c8733c83.zip
Use ref instead of pointer for subchannel sources
Diffstat (limited to 'src/FrameMultiplexer.cpp')
-rw-r--r--src/FrameMultiplexer.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/FrameMultiplexer.cpp b/src/FrameMultiplexer.cpp
index 0bea1d1..c8ee299 100644
--- a/src/FrameMultiplexer.cpp
+++ b/src/FrameMultiplexer.cpp
@@ -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.
@@ -33,7 +38,7 @@ typedef std::complex<float> complexf;
FrameMultiplexer::FrameMultiplexer(
size_t framesize,
- const std::vector<std::shared_ptr<SubchannelSource> >* subchannels) :
+ const std::vector<std::shared_ptr<SubchannelSource> >& subchannels) :
ModMux(),
d_frameSize(framesize),
mySubchannels(subchannels)
@@ -77,12 +82,11 @@ int FrameMultiplexer::process(std::vector<Buffer*> dataIn, Buffer* dataOut)
memcpy(out, (*in)->getData(), (*in)->getLength());
++in;
// Write subchannel
- if (mySubchannels->size() != dataIn.size() - 1) {
+ if (mySubchannels.size() != dataIn.size() - 1) {
throw std::out_of_range(
"FrameMultiplexer detected subchannel size change!");
}
- std::vector<std::shared_ptr<SubchannelSource> >::const_iterator subchannel =
- mySubchannels->begin();
+ auto subchannel = mySubchannels.begin();
while (in != dataIn.end()) {
if ((*subchannel)->framesizeCu() * 8 != (*in)->getLength()) {
throw std::out_of_range(