aboutsummaryrefslogtreecommitdiffstats
path: root/src/OutputFile.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-01-07 08:49:29 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-01-07 08:49:29 +0100
commit1d833b718845b97a5b1d90f33b547b1772bc0708 (patch)
treebd34f1a8d25e150858e3bba5cbc7c0915d23f948 /src/OutputFile.h
parent1dadf3b7856940911724d02613085d57535da474 (diff)
downloaddabmod-1d833b718845b97a5b1d90f33b547b1772bc0708.tar.gz
dabmod-1d833b718845b97a5b1d90f33b547b1772bc0708.tar.bz2
dabmod-1d833b718845b97a5b1d90f33b547b1772bc0708.zip
Add new flowgraph path for metadata
Diffstat (limited to 'src/OutputFile.h')
-rw-r--r--src/OutputFile.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/OutputFile.h b/src/OutputFile.h
index 7121ef3..2b92369 100644
--- a/src/OutputFile.h
+++ b/src/OutputFile.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) 2016
+ Copyright (C) 2018
Matthias P. Braendli, matthias.braendli@mpb.li
http://opendigitalradio.org
@@ -36,19 +36,29 @@
#include <string>
#include <stdio.h>
#include <sys/types.h>
+#include <memory>
+struct FILEDeleter {
+ void operator()(FILE* fd) {
+ if (fd) {
+ fclose(fd);
+ }
+ }
+};
-class OutputFile : public ModOutput
+class OutputFile : public ModOutput, public ModMetadata
{
public:
OutputFile(std::string filename);
- virtual ~OutputFile();
- virtual int process(Buffer* dataIn);
- const char* name() { return "OutputFile"; }
+ virtual int process(Buffer* dataIn) override;
+ const char* name() override { return "OutputFile"; }
+
+ virtual meta_vec_t process_metadata(
+ const meta_vec_t& metadataIn) override;
protected:
std::string myFilename;
- FILE* myFile;
+ std::unique_ptr<FILE, FILEDeleter> myFile;
};