summaryrefslogtreecommitdiffstats
path: root/src/EtiReader.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-08-01 17:41:55 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-08-01 17:41:55 +0200
commit07f5c0fbfb43b099fa09b273a1074093c7579903 (patch)
tree48a2b759b46aaa483ab238d679cc172a97bdff82 /src/EtiReader.cpp
parentdd22ff8c7ab0ec2fae413431b7d546d2bf9367ea (diff)
downloaddabmod-07f5c0fbfb43b099fa09b273a1074093c7579903.tar.gz
dabmod-07f5c0fbfb43b099fa09b273a1074093c7579903.tar.bz2
dabmod-07f5c0fbfb43b099fa09b273a1074093c7579903.zip
Replace some loops with iterators to foreach loops
Diffstat (limited to 'src/EtiReader.cpp')
-rw-r--r--src/EtiReader.cpp17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/EtiReader.cpp b/src/EtiReader.cpp
index 500101b..76f8dbb 100644
--- a/src/EtiReader.cpp
+++ b/src/EtiReader.cpp
@@ -57,7 +57,6 @@ EtiReader::EtiReader(
unsigned tist_delay_stages,
RemoteControllers* rcs) :
state(EtiReaderStateSync),
- myFicSource(NULL),
myTimestampDecoder(tist_offset_s, tist_delay_stages)
{
PDEBUG("EtiReader::EtiReader()\n");
@@ -68,17 +67,7 @@ EtiReader::EtiReader(
eti_fc_valid = false;
}
-EtiReader::~EtiReader()
-{
- PDEBUG("EtiReader::~EtiReader()\n");
-
-// if (myFicSource != NULL) {
-// delete myFicSource;
-// }
-}
-
-
-FicSource* EtiReader::getFic()
+std::shared_ptr<FicSource>& EtiReader::getFic()
{
return myFicSource;
}
@@ -169,8 +158,8 @@ int EtiReader::process(const Buffer* dataIn)
if (!eti_fc.FICF) {
throw std::runtime_error("FIC must be present to modulate!");
}
- if (myFicSource == NULL) {
- myFicSource = new FicSource(eti_fc);
+ if (not myFicSource) {
+ myFicSource = make_shared<FicSource>(eti_fc);
}
break;
case EtiReaderStateNst: