summaryrefslogtreecommitdiffstats
path: root/src/Flowgraph.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-12-25 21:34:03 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-12-25 21:34:03 +0100
commit2bba7d602744ccd6dab26940661f0fdfbf231af8 (patch)
tree590a5808497da3b621e29239cd56db6c89c2d6a9 /src/Flowgraph.h
parentb5fd4a6ab6ac92af2141233f802e71c861cd89f4 (diff)
downloaddabmod-2bba7d602744ccd6dab26940661f0fdfbf231af8.tar.gz
dabmod-2bba7d602744ccd6dab26940661f0fdfbf231af8.tar.bz2
dabmod-2bba7d602744ccd6dab26940661f0fdfbf231af8.zip
Refactor flowgraph and puncturing rules
Diffstat (limited to 'src/Flowgraph.h')
-rw-r--r--src/Flowgraph.h37
1 files changed, 22 insertions, 15 deletions
diff --git a/src/Flowgraph.h b/src/Flowgraph.h
index 9c6c2d8..ebb7314 100644
--- a/src/Flowgraph.h
+++ b/src/Flowgraph.h
@@ -2,7 +2,7 @@
Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Her Majesty
the Queen in Right of Canada (Communications Research Center Canada)
- Copyright (C) 2015
+ Copyright (C) 2016
Matthias P. Braendli, matthias.braendli@mpb.li
http://opendigitalradio.org
@@ -24,8 +24,7 @@
along with ODR-DabMod. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef FLOWGRAPH_H
-#define FLOWGRAPH_H
+#pragma once
#ifdef HAVE_CONFIG_H
# include <config.h>
@@ -37,28 +36,38 @@
#include <memory>
#include <sys/types.h>
#include <vector>
-
+#include <list>
+#include <cstdio>
class Node
{
public:
Node(std::shared_ptr<ModPlugin> plugin);
~Node();
- Node(const Node&);
- Node& operator=(const Node&);
+ Node(const Node&) = delete;
+ Node& operator=(const Node&) = delete;
std::shared_ptr<ModPlugin> plugin() { return myPlugin; }
- std::vector<std::shared_ptr<Buffer> > myInputBuffers;
- std::vector<std::shared_ptr<Buffer> > myOutputBuffers;
-
int process();
time_t processTime() { return myProcessTime; }
void addProcessTime(time_t processTime) {
myProcessTime += processTime;
}
+ void addOutputBuffer(Buffer::sptr& buffer);
+ void removeOutputBuffer(Buffer::sptr& buffer);
+
+ void addInputBuffer(Buffer::sptr& buffer);
+ void removeInputBuffer(Buffer::sptr& buffer);
+
protected:
+ std::list<Buffer::sptr> myInputBuffers;
+ std::list<Buffer::sptr> myOutputBuffers;
+#if DEBUG
+ std::list<FILE*> myDebugFiles;
+#endif
+
std::shared_ptr<ModPlugin> myPlugin;
time_t myProcessTime;
};
@@ -69,8 +78,8 @@ class Edge
public:
Edge(std::shared_ptr<Node>& src, std::shared_ptr<Node>& dst);
~Edge();
- Edge(const Edge&);
- Edge& operator=(const Edge&);
+ Edge(const Edge&) = delete;
+ Edge& operator=(const Edge&) = delete;
protected:
std::shared_ptr<Node> mySrcNode;
@@ -84,8 +93,8 @@ class Flowgraph
public:
Flowgraph();
virtual ~Flowgraph();
- Flowgraph(const Flowgraph&);
- Flowgraph& operator=(const Flowgraph&);
+ Flowgraph(const Flowgraph&) = delete;
+ Flowgraph& operator=(const Flowgraph&) = delete;
void connect(std::shared_ptr<ModPlugin> input,
std::shared_ptr<ModPlugin> output);
@@ -98,5 +107,3 @@ protected:
};
-#endif // FLOWGRAPH_H
-