From f2eafd28f50fb528842502e138c14ea2e54145b6 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Wed, 28 Oct 2009 22:13:50 +0100 Subject: * grapher/GraphData.hxx (GraphDataBase, GraphData): Use boost::circular_buffer for time and data storage. --- grapher/GraphData.hxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'grapher/GraphData.hxx') diff --git a/grapher/GraphData.hxx b/grapher/GraphData.hxx index e4c08cfd..0e26fb4d 100644 --- a/grapher/GraphData.hxx +++ b/grapher/GraphData.hxx @@ -6,6 +6,8 @@ #include #include +#include + namespace systemtap { struct GraphDataBase @@ -16,11 +18,12 @@ namespace systemtap DOT, EVENT }; - GraphDataBase() : scale(1.0), style(BAR) + typedef boost::circular_buffer TimeList; + GraphDataBase(TimeList::capacity_type cap = 50000) + : scale(1.0), style(BAR), times(cap) { color[0] = 0.0; color[1] = 1.0; color[2] = 0.0; } - typedef std::vector TimeList; // size of grid square at "normal" viewing double scale; double color[3]; @@ -36,7 +39,11 @@ namespace systemtap { public: typedef T data_type; - typedef std::vector DataList; + typedef boost::circular_buffer DataList; + GraphData(typename DataList::capacity_type cap = 50000) + : GraphDataBase(cap), data(cap) + { + } DataList data; }; struct CSVData -- cgit