diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-03-21 14:30:09 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-06-19 10:43:35 +0200 |
commit | 76e7f0f79c908bf7d0a447ea643dbcdde8f064d2 (patch) | |
tree | 214230901ec43d923e1696c54005a123278df086 /src/utils.cpp | |
parent | 0ac177534620caa13864f9bfcd804004e3e538fd (diff) | |
download | dabmux-76e7f0f79c908bf7d0a447ea643dbcdde8f064d2.tar.gz dabmux-76e7f0f79c908bf7d0a447ea643dbcdde8f064d2.tar.bz2 dabmux-76e7f0f79c908bf7d0a447ea643dbcdde8f064d2.zip |
Start big refactoring
Multiplexer in separate object
Replace pointers by shared_ptr
Switch to C++11
Diffstat (limited to 'src/utils.cpp')
-rw-r--r-- | src/utils.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/utils.cpp b/src/utils.cpp index e360d93..50591ae 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -3,7 +3,7 @@ 2011, 2012 Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Copyright (C) 2013, 2014 Matthias P. Braendli + Copyright (C) 2013, 2014, 2015 Matthias P. Braendli http://mpb.li */ /* @@ -24,6 +24,7 @@ */ #include <cstring> #include <iostream> +#include <boost/shared_ptr.hpp> #include "DabMux.h" #include "utils.h" @@ -73,7 +74,7 @@ void header_message() fprintf(stderr, "(Communications Research Centre Canada) All rights reserved.\n\n"); fprintf(stderr, - "Copyright (C) 2013, 2014 Matthias P. Braendli\n"); + "Copyright (C) 2013, 2014, 2015 Matthias P. Braendli\n"); fprintf(stderr, "http://opendigitalradio.org\n\n"); @@ -352,21 +353,14 @@ void printUsage(char *name, FILE* out) } #endif -void printOutputs(vector<dabOutput*>& outputs) +void printOutputs(vector<boost::shared_ptr<DabOutput> >& outputs) { - vector<dabOutput*>::const_iterator output; int index = 0; - for (output = outputs.begin(); output != outputs.end(); ++output) { + for (auto output : outputs) { etiLog.log(info, "Output %i", index); - etiLog.level(info) << " protocol: " << - (*output)->outputProto; - - etiLog.level(info) << " name: " << - (*output)->outputName.c_str(); - // Daboutputfile mangles with outputName, inserting \0 to - // cut the string in several parts. That doesn't work - // with stl strings. Thats why the .c_str() + etiLog.level(info) << " URI: " << + output->get_info(); ++index; } @@ -528,7 +522,7 @@ void printSubchannels(vector<dabSubchannel*>& subchannels) } } -void printEnsemble(dabEnsemble* ensemble) +void printEnsemble(const boost::shared_ptr<dabEnsemble> ensemble) { etiLog.log(info, "Ensemble"); etiLog.log(info, " id: 0x%lx (%lu)", ensemble->id, ensemble->id); |