Event log visualizer TimeSeries is now created on the stack and then moved into the vector of series.
BUG=none
Review-Url: https://codereview.webrtc.org/2824973003
Cr-Commit-Position: refs/heads/master@{#17763}
diff --git a/webrtc/tools/event_log_visualizer/plot_base.h b/webrtc/tools/event_log_visualizer/plot_base.h
index b2ab299..afa20be 100644
--- a/webrtc/tools/event_log_visualizer/plot_base.h
+++ b/webrtc/tools/event_log_visualizer/plot_base.h
@@ -34,10 +34,9 @@
struct TimeSeries {
TimeSeries() = default;
- TimeSeries(const char* label, PlotStyle style)
- : label(label), style(style), points() {}
+ TimeSeries(const char* label, PlotStyle style) : label(label), style(style) {}
TimeSeries(const std::string& label, PlotStyle style)
- : label(label), style(style), points() {}
+ : label(label), style(style) {}
TimeSeries(TimeSeries&& other)
: label(std::move(other.label)),
style(other.style),
@@ -108,10 +107,7 @@
void SetTitle(std::string title);
// Add a new TimeSeries to the plot.
- TimeSeries* AddTimeSeries(const char* label, PlotStyle style);
- TimeSeries* AddTimeSeries(const std::string& label, PlotStyle style);
-
- std::vector<TimeSeries> series_list_;
+ void AppendTimeSeries(TimeSeries&& time_series);
protected:
float xaxis_min_;
@@ -121,6 +117,7 @@
float yaxis_max_;
std::string yaxis_label_;
std::string title_;
+ std::vector<TimeSeries> series_list_;
};
class PlotCollection {