From 50e051adebc847a338694b53f1d9ea41c8290529 Mon Sep 17 00:00:00 2001 From: Stefan Pöschel Date: Wed, 23 Aug 2017 18:52:58 +0200 Subject: Move current PAD encoder algorithm into subclass This allows to replace the current PAD encoding algorithm by alternative methods in the future. --- src/odr-padenc.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src/odr-padenc.h') diff --git a/src/odr-padenc.h b/src/odr-padenc.h index ce77c27..e29542b 100644 --- a/src/odr-padenc.h +++ b/src/odr-padenc.h @@ -69,16 +69,30 @@ struct PadEncoderOptions { // --- PadEncoder ----------------------------------------------------------------- class PadEncoder { -private: - static const int DLS_REPETITION_WHILE_SLS; - +protected: PadEncoderOptions options; + int output_fd; std::mutex status_mutex; bool do_exit; + + PadEncoder(PadEncoderOptions options) : options(options), output_fd(-1), do_exit(false) {} + + virtual int Encode() = 0; public: - PadEncoder(PadEncoderOptions options) : options(options), do_exit(false) {} + virtual ~PadEncoder() {} int Main(); void DoExit(); }; + + +// --- BurstPadEncoder ----------------------------------------------------------------- +class BurstPadEncoder : public PadEncoder { +private: + static const int DLS_REPETITION_WHILE_SLS; + + int Encode(); +public: + BurstPadEncoder(PadEncoderOptions options) : PadEncoder(options) {} +}; -- cgit v1.2.3