diff options
Diffstat (limited to 'sensor/include')
-rw-r--r-- | sensor/include/trygvis/sensor/io.h | 58 |
1 files changed, 27 insertions, 31 deletions
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<string> 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<ostream> stream, KeyDictionary &dict, const SampleKey *timestamp_key, o<output_fields *> output_fields); + RrdSampleOutputStream(shared_ptr<ostream> stream, KeyDictionary &dict, const SampleKey *timestamp_key, o<output_fields_option *> 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<string> fields; -}; - -class timestamp_field : public sample_output_stream_option { -public: - timestamp_field(string name) : name(name) { - } - - ~timestamp_field() { - } - - string name; -}; - unique_ptr<SampleStreamParser> open_sample_stream_parser( shared_ptr<SampleOutputStream> output, KeyDictionary &dict, @@ -188,14 +184,15 @@ unique_ptr<SampleOutputStream> open_sample_output_stream( shared_ptr<ostream> output, KeyDictionary &dict, sample_format_type type, -vector<sample_output_stream_option *> options); + vector<sample_output_stream_option *> options); static inline unique_ptr<SampleOutputStream> open_sample_output_stream( shared_ptr<ostream> output, KeyDictionary &dict, sample_format_type type) { -return open_sample_output_stream(output, dict, type); + vector<sample_output_stream_option *> options; + return open_sample_output_stream(output, dict, type, options); } static inline @@ -203,7 +200,6 @@ unique_ptr<ThreadSafeSampleOutputStream> thread_safe_sample_output_stream(unique return make_unique<ThreadSafeSampleOutputStream>(move(underlying)); }; - } } } |