From 0374af511d7efdb856af372f126e66e5a78841d7 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 19 Jul 2015 20:02:00 +0200 Subject: o Applying clang-format to all apps. --- apps/sample-add-timestamp.h | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'apps/sample-add-timestamp.h') diff --git a/apps/sample-add-timestamp.h b/apps/sample-add-timestamp.h index 711cf49..8439519 100644 --- a/apps/sample-add-timestamp.h +++ b/apps/sample-add-timestamp.h @@ -13,11 +13,9 @@ using namespace trygvis::sensor::io; namespace po = boost::program_options; class TimestampAddingSampleOutputStream : public SampleOutputStream { - public: TimestampAddingSampleOutputStream(shared_ptr output, KeyDictionary &dict, string timestamp_name) - : - timestamp_key(dict.indexOf(timestamp_name)) { + : timestamp_key(dict.indexOf(timestamp_name)) { if (input_time_resolution_ == time_resolution::MILLISECONDS) { factor = 1000; } else { @@ -43,7 +41,6 @@ private: }; class sample_add_timestamp : public app { - private: string timestamp_name; time_resolution resolution; @@ -56,10 +53,10 @@ public: ~sample_add_timestamp() = default; void add_options(po::options_description_easy_init &options) override { - options - ("resolution", po::value(&resolution)->default_value(time_resolution::SECONDS)) - ("timestamp-name", po::value(×tamp_name)->default_value("timestamp")) - ("output-format", po::value(&output_format)->default_value(sample_format_type::KEY_VALUE)); + options("resolution", po::value(&resolution)->default_value(time_resolution::SECONDS)); + options("timestamp-name", po::value(×tamp_name)->default_value("timestamp")); + options("output-format", + po::value(&output_format)->default_value(sample_format_type::KEY_VALUE)); } const int buffer_size = 1024; @@ -72,9 +69,10 @@ public: KeyDictionary dict; sample_output_stream_options options = {}; - unique_ptr unique_output_stream = open_sample_output_stream(shared_ptr(&cout, noop_deleter), dict, output_format, options); + auto unique_output_stream = + open_sample_output_stream(shared_ptr(&cout, noop_deleter), dict, output_format, options); shared_ptr output_stream{std::move(unique_output_stream)}; - shared_ptr p = make_shared(output_stream, dict, timestamp_name); + auto p = make_shared(output_stream, dict, timestamp_name); auto parser = open_sample_stream_parser(p, dict); int recordCount = 0; @@ -82,7 +80,7 @@ public: while (!input->eof()) { char buffer[buffer_size]; input->read(buffer, buffer_size); - size_t gcount = (size_t)input->gcount(); + size_t gcount = (size_t) input->gcount(); recordCount++; @@ -93,6 +91,5 @@ public: return EXIT_SUCCESS; }; }; - } } -- cgit v1.2.3