diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-12-25 21:34:03 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-12-25 21:34:03 +0100 |
commit | 2bba7d602744ccd6dab26940661f0fdfbf231af8 (patch) | |
tree | 590a5808497da3b621e29239cd56db6c89c2d6a9 /src/ModPlugin.cpp | |
parent | b5fd4a6ab6ac92af2141233f802e71c861cd89f4 (diff) | |
download | dabmod-2bba7d602744ccd6dab26940661f0fdfbf231af8.tar.gz dabmod-2bba7d602744ccd6dab26940661f0fdfbf231af8.tar.bz2 dabmod-2bba7d602744ccd6dab26940661f0fdfbf231af8.zip |
Refactor flowgraph and puncturing rules
Diffstat (limited to 'src/ModPlugin.cpp')
-rw-r--r-- | src/ModPlugin.cpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/ModPlugin.cpp b/src/ModPlugin.cpp index 1f94770..775b284 100644 --- a/src/ModPlugin.cpp +++ b/src/ModPlugin.cpp @@ -1,6 +1,11 @@ /* Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 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. @@ -20,4 +25,49 @@ */ #include "ModPlugin.h" +#include "PcDebug.h" +#include <stdexcept> +#include <string> + +#define MODASSERT(cond) \ + if (not (cond)) { \ + throw std::runtime_error("Assertion failure: " #cond " for " + \ + std::string(name())); \ + } + +int ModInput::process( + std::vector<Buffer*> dataIn, + std::vector<Buffer*> dataOut) +{ + MODASSERT(dataIn.empty()); + MODASSERT(dataOut.size() == 1); + return process(dataOut[0]); +} + +int ModCodec::process( + std::vector<Buffer*> dataIn, + std::vector<Buffer*> dataOut) +{ + MODASSERT(dataIn.size() == 1); + MODASSERT(dataOut.size() == 1); + return process(dataIn[0], dataOut[0]); +} + +int ModMux::process( + std::vector<Buffer*> dataIn, + std::vector<Buffer*> dataOut) +{ + MODASSERT(not dataIn.empty()); + MODASSERT(dataOut.size() == 1); + return process(dataIn, dataOut[0]); +} + +int ModOutput::process( + std::vector<Buffer*> dataIn, + std::vector<Buffer*> dataOut) +{ + MODASSERT(dataIn.size() == 1); + MODASSERT(dataOut.empty()); + return process(dataIn[0]); +} |