Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: webrtc/tools/event_log_visualizer/plot_base.h

Issue 2750583002: Pass label and plot style to the TimeSeries' constructor. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/tools/event_log_visualizer/analyzer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/tools/event_log_visualizer/plot_base.h
diff --git a/webrtc/tools/event_log_visualizer/plot_base.h b/webrtc/tools/event_log_visualizer/plot_base.h
index e2bec2df78cb75b842cab7863727a1f46ebf2bd4..d6f4616545fe121ab1efb307303f862b2b140a58 100644
--- a/webrtc/tools/event_log_visualizer/plot_base.h
+++ b/webrtc/tools/event_log_visualizer/plot_base.h
@@ -28,6 +28,10 @@ struct TimeSeriesPoint {
struct TimeSeries {
TimeSeries() = default;
+ TimeSeries(const char* label, PlotStyle style)
+ : label(label), style(style), points() {}
+ TimeSeries(const std::string& label, PlotStyle style)
+ : label(label), style(style), points() {}
TimeSeries(TimeSeries&& other)
: label(std::move(other.label)),
style(other.style),
@@ -97,6 +101,18 @@ class Plot {
// Sets the title of the plot.
void SetTitle(std::string title);
+ // Add a new TimeSeries to the plot.
+ TimeSeries* AddTimeSeries(const char* label, PlotStyle style) {
michaelt 2017/03/13 15:36:42 Shouldn't we code this in the cc file ?
terelius 2017/03/14 17:13:59 Yes. Done.
+ series_list_.emplace_back(label, style);
+ return &series_list_.back();
+ }
+
+ // Add a new TimeSeries to the plot.
+ TimeSeries* AddTimeSeries(const std::string& label, PlotStyle style) {
+ series_list_.emplace_back(label, style);
+ return &series_list_.back();
+ }
+
std::vector<TimeSeries> series_list_;
protected:
« no previous file with comments | « webrtc/tools/event_log_visualizer/analyzer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698