From 0467adc104ef0a53e5e7e7ee9ed25a3254d0804a Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 4 Jul 2016 15:39:00 +0200 Subject: Properly copy DabOutputFile, make get_info() const --- src/dabOutput/dabOutput.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/dabOutput') diff --git a/src/dabOutput/dabOutput.h b/src/dabOutput/dabOutput.h index 5f02f76..d68cd9c 100644 --- a/src/dabOutput/dabOutput.h +++ b/src/dabOutput/dabOutput.h @@ -99,7 +99,7 @@ class DabOutput virtual ~DabOutput() {} - virtual std::string get_info() = 0; + virtual std::string get_info() const = 0; }; // ----- used in File and Fifo outputs @@ -122,18 +122,20 @@ class DabOutputFile : public DabOutput DabOutputFile(const DabOutputFile& other) { + filename_ = other.filename_; file_ = other.file_; nbFrames_ = other.nbFrames_; type_ = other.type_; } ~DabOutputFile() {} + const DabOutputFile& operator=(const DabOutputFile& other) = delete; int Open(const char* filename); int Write(void* buffer, int size); int Close(); - std::string get_info() { + std::string get_info() const { return "file://" + filename_; } @@ -154,7 +156,7 @@ class DabOutputFifo : public DabOutputFile int Write(void* buffer, int size); - std::string get_info() { + std::string get_info() const { return "fifo://" + filename_; } @@ -195,7 +197,7 @@ class DabOutputRaw : public DabOutput int Write(void* buffer, int size); int Close(); - std::string get_info() { + std::string get_info() const { return "raw://" + filename_; } private: @@ -234,7 +236,7 @@ class DabOutputUdp : public DabOutput int Write(void* buffer, int size); int Close() { return 0; } - std::string get_info() { + std::string get_info() const { return "udp://" + uri_; } private: @@ -271,7 +273,7 @@ class DabOutputTcp : public DabOutput int Write(void* buffer, int size); int Close(); - std::string get_info() { + std::string get_info() const { return "tcp://" + uri_; } @@ -299,7 +301,7 @@ class DabOutputSimul : public DabOutput int Write(void* buffer, int size); int Close() { return 0; } - std::string get_info() { + std::string get_info() const { return "simul://" + name_; } private: @@ -376,7 +378,7 @@ class DabOutputZMQ : public DabOutput zmq_pub_sock_.close(); } - std::string get_info() { + std::string get_info() const { return "zmq: " + zmq_proto_ + "://" + endpoint_; } -- cgit v1.2.3