aboutsummaryrefslogtreecommitdiff
path: root/sensor/include/trygvis
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-03-22 18:20:38 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2015-03-22 18:20:38 +0100
commit52d0fe67f8998b215a47ebc697600cae49a7b17a (patch)
tree18da6306fde41ae9707f658ef2ddd14ced5de882 /sensor/include/trygvis
parentec15f36073b77375a06457c423d9a56245aa9dfc (diff)
downloadble-toys-52d0fe67f8998b215a47ebc697600cae49a7b17a.tar.gz
ble-toys-52d0fe67f8998b215a47ebc697600cae49a7b17a.tar.bz2
ble-toys-52d0fe67f8998b215a47ebc697600cae49a7b17a.tar.xz
ble-toys-52d0fe67f8998b215a47ebc697600cae49a7b17a.zip
o Better class names for options.
Diffstat (limited to 'sensor/include/trygvis')
-rw-r--r--sensor/include/trygvis/sensor/io.h58
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));
};
-
}
}
}