aboutsummaryrefslogtreecommitdiffstats
path: root/src/odr-padenc.h
diff options
context:
space:
mode:
authorStefan Pöschel <github@basicmaster.de>2017-08-23 18:52:58 +0200
committerStefan Pöschel <github@basicmaster.de>2017-08-23 18:52:58 +0200
commit50e051adebc847a338694b53f1d9ea41c8290529 (patch)
treeb9c4fcec9aa1d3fd24dd56a7abacedf63b264c3b /src/odr-padenc.h
parent4f15498395b178b6134549da91ce72d1c53eaea7 (diff)
downloadODR-PadEnc-50e051adebc847a338694b53f1d9ea41c8290529.tar.gz
ODR-PadEnc-50e051adebc847a338694b53f1d9ea41c8290529.tar.bz2
ODR-PadEnc-50e051adebc847a338694b53f1d9ea41c8290529.zip
Move current PAD encoder algorithm into subclass
This allows to replace the current PAD encoding algorithm by alternative methods in the future.
Diffstat (limited to 'src/odr-padenc.h')
-rw-r--r--src/odr-padenc.h22
1 files changed, 18 insertions, 4 deletions
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) {}
+};