aboutsummaryrefslogtreecommitdiff
path: root/apps/sample-timestamp.cpp
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-03-17 22:56:47 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2015-03-17 22:56:47 +0100
commit7edc4328bfd5eee557108ebdb4243ca06914c41e (patch)
treefd01761ed57c6f5d31409c7777b4c0c127a1e482 /apps/sample-timestamp.cpp
parent5d6e4c971857b5e05d7c277e7eafcb9d64dbc6a7 (diff)
downloadble-toys-7edc4328bfd5eee557108ebdb4243ca06914c41e.tar.gz
ble-toys-7edc4328bfd5eee557108ebdb4243ca06914c41e.tar.bz2
ble-toys-7edc4328bfd5eee557108ebdb4243ca06914c41e.tar.xz
ble-toys-7edc4328bfd5eee557108ebdb4243ca06914c41e.zip
o cout and unique_ptr became complicated.
o Updating lots of code to the latest api.
Diffstat (limited to 'apps/sample-timestamp.cpp')
-rw-r--r--apps/sample-timestamp.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/sample-timestamp.cpp b/apps/sample-timestamp.cpp
index dd9ab3c..4855506 100644
--- a/apps/sample-timestamp.cpp
+++ b/apps/sample-timestamp.cpp
@@ -81,7 +81,7 @@ public:
now_key = dict.indexOf(now_name);
auto sample_buffer = make_shared<VectorSampleOutputStream>();
- unique_ptr<SampleStreamParser> parser = open_sample_input_stream(dict, sample_buffer);
+ auto parser = open_sample_input_stream(sample_buffer, dict);
while (!input.fail()) {
char buffer[buffer_size];
input.read(buffer, buffer_size);
@@ -129,9 +129,10 @@ public:
return EXIT_FAILURE;
}
- auto output_stream = open_sample_output_stream(unique_ptr<ostream>(&cout), dict, parser->type());
- auto p = make_shared<TimestampFixingSampleOutputStream>(move(output_stream), dict, "timestamp", now_name, start_time);
- parser = open_sample_input_stream(dict, p, parser->type());
+ unique_ptr<SampleOutputStream> unique_output_stream = open_sample_output_stream(shared_ptr<ostream>(&cout, noop_deleter), dict, parser->type());
+ shared_ptr<SampleOutputStream> output_stream{std::move(unique_output_stream)};
+ auto p = make_shared<TimestampFixingSampleOutputStream>(output_stream, dict, timestamp_name, now_name, start_time);
+ parser = open_sample_input_stream(p, dict, parser->type());
int recordCount = 0;
@@ -147,7 +148,7 @@ public:
}
return EXIT_SUCCESS;
- }
+ };
};
}