From 52d0fe67f8998b215a47ebc697600cae49a7b17a Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 22 Mar 2015 18:20:38 +0100 Subject: o Better class names for options. --- sensor/include/trygvis/sensor/io.h | 58 ++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 31 deletions(-) (limited to 'sensor/include') diff --git a/sensor/include/trygvis/sensor/io.h b/sensor/include/trygvis/sensor/io.h index 2cace70..bbeb80e 100644 --- a/sensor/include/trygvis/sensor/io.h +++ b/sensor/include/trygvis/sensor/io.h @@ -12,9 +12,30 @@ namespace io { using namespace std; using namespace boost::asio; -class output_fields; +class sample_output_stream_option { +public: + virtual ~sample_output_stream_option() { + }; +}; + +class output_fields_option : public sample_output_stream_option { +public: + ~output_fields_option() { + } + + vector fields; +}; + +class timestamp_field_option : public sample_output_stream_option { +public: + timestamp_field_option(string name) : name(name) { + } + + ~timestamp_field_option() { + } -class timestamp_field; + string name; +}; class SampleOutputStream { public: @@ -86,7 +107,7 @@ private: class RrdSampleOutputStream : public SampleOutputStream { public: - RrdSampleOutputStream(shared_ptr stream, KeyDictionary &dict, const SampleKey *timestamp_key, o output_fields); + RrdSampleOutputStream(shared_ptr stream, KeyDictionary &dict, const SampleKey *timestamp_key, o output_fields); void write(SampleRecord const &sample) override; @@ -154,31 +175,6 @@ public: virtual void process(mutable_buffers_1 buffer); }; -class sample_output_stream_option { -public: - virtual ~sample_output_stream_option() { - }; -}; - -class output_fields : public sample_output_stream_option { -public: - ~output_fields() { - } - - vector fields; -}; - -class timestamp_field : public sample_output_stream_option { -public: - timestamp_field(string name) : name(name) { - } - - ~timestamp_field() { - } - - string name; -}; - unique_ptr open_sample_stream_parser( shared_ptr output, KeyDictionary &dict, @@ -188,14 +184,15 @@ unique_ptr open_sample_output_stream( shared_ptr output, KeyDictionary &dict, sample_format_type type, -vector options); + vector options); static inline unique_ptr open_sample_output_stream( shared_ptr output, KeyDictionary &dict, sample_format_type type) { -return open_sample_output_stream(output, dict, type); + vector options; + return open_sample_output_stream(output, dict, type, options); } static inline @@ -203,7 +200,6 @@ unique_ptr thread_safe_sample_output_stream(unique return make_unique(move(underlying)); }; - } } } -- cgit v1.2.3