summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-08-06 11:39:03 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-08-06 11:39:03 +0200
commit56047e1f068b2ea4386cabd73bc0f29f55068250 (patch)
tree519dc3cca366faae17d147491a1119e983fe1288
parenteaa257925ddef888402e1b601dda45646ad6a373 (diff)
downloaddabmod-56047e1f068b2ea4386cabd73bc0f29f55068250.tar.gz
dabmod-56047e1f068b2ea4386cabd73bc0f29f55068250.tar.bz2
dabmod-56047e1f068b2ea4386cabd73bc0f29f55068250.zip
Remove raw flowgraph pointer from DabModulator
-rw-r--r--src/DabModulator.cpp14
-rw-r--r--src/DabModulator.h6
2 files changed, 4 insertions, 16 deletions
diff --git a/src/DabModulator.cpp b/src/DabModulator.cpp
index 4e0bc33..bebbedd 100644
--- a/src/DabModulator.cpp
+++ b/src/DabModulator.cpp
@@ -74,7 +74,7 @@ DabModulator::DabModulator(
myNormalise(normalise),
myGainmodeVariance(gainmodeVariance),
myEtiSource(etiSource),
- myFlowgraph(NULL),
+ myFlowgraph(),
myFilterTapsFilename(filterTapsFilename),
myPolyCoefFilename(polyCoefFilename),
myTiiConfig(tiiConfig)
@@ -90,14 +90,6 @@ DabModulator::DabModulator(
}
-DabModulator::~DabModulator()
-{
- PDEBUG("DabModulator::~DabModulator() @ %p\n", this);
-
- delete myFlowgraph;
-}
-
-
void DabModulator::setMode(unsigned mode)
{
switch (mode) {
@@ -145,7 +137,7 @@ int DabModulator::process(Buffer* dataOut)
PDEBUG("DabModulator::process(dataOut: %p)\n", dataOut);
- if (myFlowgraph == NULL) {
+ if (not myFlowgraph) {
unsigned mode = myEtiSource.getMode();
if (myDabMode != 0) {
mode = myDabMode;
@@ -154,7 +146,7 @@ int DabModulator::process(Buffer* dataOut)
}
setMode(mode);
- myFlowgraph = new Flowgraph();
+ myFlowgraph = make_shared<Flowgraph>();
////////////////////////////////////////////////////////////////
// CIF data initialisation
////////////////////////////////////////////////////////////////
diff --git a/src/DabModulator.h b/src/DabModulator.h
index 0c691dd..e8048ac 100644
--- a/src/DabModulator.h
+++ b/src/DabModulator.h
@@ -57,9 +57,6 @@ public:
float gainmodeVariance,
const std::string& filterTapsFilename,
const std::string& polyCoefFilename);
- DabModulator(const DabModulator& other) = delete;
- DabModulator& operator=(const DabModulator& other) = delete;
- virtual ~DabModulator();
int process(Buffer* dataOut);
const char* name() { return "DabModulator"; }
@@ -78,8 +75,7 @@ protected:
float myNormalise;
float myGainmodeVariance;
EtiSource& myEtiSource;
- Flowgraph* myFlowgraph;
- OutputMemory* myOutput;
+ std::shared_ptr<Flowgraph> myFlowgraph;
std::string myFilterTapsFilename;
std::string myPolyCoefFilename;
tii_config_t& myTiiConfig;