diff options
Diffstat (limited to 'src/dabOutput/dabOutput.h')
-rw-r--r-- | src/dabOutput/dabOutput.h | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/src/dabOutput/dabOutput.h b/src/dabOutput/dabOutput.h index 18f3848..c8ce9f2 100644 --- a/src/dabOutput/dabOutput.h +++ b/src/dabOutput/dabOutput.h @@ -55,6 +55,8 @@ // Configuration for EDI output struct edi_configuration_t { + unsigned chunk_len; // RSk, data length of each chunk + unsigned fec; // number of fragments that can be recovered bool enabled; unsigned int source_port; bool dump; @@ -78,6 +80,8 @@ class DabOutput virtual int Close() = 0; virtual ~DabOutput() {} + + virtual std::string get_info() = 0; }; // ----- used in File and Fifo outputs @@ -111,7 +115,12 @@ class DabOutputFile : public DabOutput int Write(void* buffer, int size); int Close(); + std::string get_info() { + return "file://" + filename_; + } + protected: + std::string filename_; int file_; EtiFileType type_; unsigned long nbFrames_; @@ -126,6 +135,11 @@ class DabOutputFifo : public DabOutputFile ~DabOutputFifo() {} int Write(void* buffer, int size); + + std::string get_info() { + return "fifo://" + filename_; + } + }; // -------------- RAW socket ----------- @@ -162,7 +176,12 @@ class DabOutputRaw : public DabOutput int Open(const char* name); int Write(void* buffer, int size); int Close(); + + std::string get_info() { + return "raw://" + filename_; + } private: + std::string filename_; #ifdef _WIN32 HANDLE socket_; #else @@ -197,7 +216,11 @@ class DabOutputUdp : public DabOutput int Write(void* buffer, int size); int Close() { return 0; } + std::string get_info() { + return "udp://" + uri_; + } private: + std::string uri_; UdpSocket* socket_; UdpPacket* packet_; }; @@ -230,9 +253,14 @@ class DabOutputTcp : public DabOutput int Write(void* buffer, int size); int Close(); + std::string get_info() { + return "tcp://" + uri_; + } + TcpServer* server; TcpSocket* client; private: + std::string uri_; pthread_t thread_; }; @@ -252,7 +280,12 @@ class DabOutputSimul : public DabOutput int Open(const char* name); int Write(void* buffer, int size); int Close() { return 0; } + + std::string get_info() { + return "simul://" + name_; + } private: + std::string name_; #ifdef _WIN32 DWORD startTime_; #else @@ -304,6 +337,7 @@ class DabOutputZMQ : public DabOutput { public: DabOutputZMQ() : + endpoint_(""), zmq_proto_(""), zmq_context_(1), zmq_pub_sock_(zmq_context_, ZMQ_PUB), zmq_message_ix(0) @@ -312,6 +346,7 @@ class DabOutputZMQ : public DabOutput } DabOutputZMQ(std::string zmq_proto) : + endpoint_(""), zmq_proto_(zmq_proto), zmq_context_(1), zmq_pub_sock_(zmq_context_, ZMQ_PUB), zmq_message_ix(0) @@ -323,7 +358,11 @@ class DabOutputZMQ : public DabOutput zmq_pub_sock_.close(); } - int Open(const char* name); + std::string get_info() { + return "zmq: " + zmq_proto_ + "://" + endpoint_; + } + + int Open(const char* endpoint); int Write(void* buffer, int size); int Close(); private: @@ -334,6 +373,7 @@ class DabOutputZMQ : public DabOutput /* Forbid copy constructor */ } + std::string endpoint_; std::string zmq_proto_; zmq::context_t zmq_context_; // handle for the zmq context zmq::socket_t zmq_pub_sock_; // handle for the zmq publisher socket |