diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-03-20 14:42:22 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-03-20 14:42:22 +0100 |
commit | 4422ab97c43e13735d274219a2957aae7ec60d76 (patch) | |
tree | f85e6899bb832f93060921cb06f45cd7eefa2ada /src/InputReader.h | |
parent | 645b9e87fc5dab2cf87bfef1d5b2ba2ce2f85089 (diff) | |
download | dabmod-4422ab97c43e13735d274219a2957aae7ec60d76.tar.gz dabmod-4422ab97c43e13735d274219a2957aae7ec60d76.tar.bz2 dabmod-4422ab97c43e13735d274219a2957aae7ec60d76.zip |
Stop using fprintf in input information
Diffstat (limited to 'src/InputReader.h')
-rw-r--r-- | src/InputReader.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/InputReader.h b/src/InputReader.h index 4ffa2b8..85bf38b 100644 --- a/src/InputReader.h +++ b/src/InputReader.h @@ -33,15 +33,16 @@ #include <cstdio> #include <vector> +#include <string> #include <atomic> #include <memory> +#include <unistd.h> #if defined(HAVE_ZEROMQ) # include "zmq.hpp" # include "ThreadsafeQueue.h" #endif #include "Log.h" #include "Socket.h" -#include <unistd.h> #define INVALID_SOCKET -1 class InputReader @@ -52,8 +53,8 @@ class InputReader // returns number of bytes written to buffer, 0 on eof, -1 on error virtual int GetNextFrame(void* buffer) = 0; - // Print some information - virtual void PrintInfo() const = 0; + // Get some information + virtual std::string GetPrintableInfo() const = 0; }; class InputFileReader : public InputReader @@ -68,8 +69,8 @@ class InputFileReader : public InputReader int Open(std::string filename, bool loop); // Print information about the file opened - void PrintInfo() const; - int GetNextFrame(void* buffer); + virtual std::string GetPrintableInfo() const override; + virtual int GetNextFrame(void* buffer) override; private: int IdentifyType(); @@ -136,10 +137,9 @@ class InputTcpReader : public InputReader // Put next frame into buffer. This function will never write more than // 6144 bytes into buffer. // returns number of bytes written to buffer, 0 on eof, -1 on error - virtual int GetNextFrame(void* buffer); + virtual int GetNextFrame(void* buffer) override; - // Print some information - virtual void PrintInfo() const; + virtual std::string GetPrintableInfo() const override; private: TCPClient m_tcpclient; @@ -166,8 +166,8 @@ class InputZeroMQReader : public InputReader ~InputZeroMQReader(); int Open(const std::string& uri, size_t max_queued_frames); - int GetNextFrame(void* buffer); - void PrintInfo() const; + virtual int GetNextFrame(void* buffer) override; + virtual std::string GetPrintableInfo() const override; private: std::atomic<bool> m_running = ATOMIC_VAR_INIT(false); |