diff options
author | Tim Moore <timoore@redhat.com> | 2009-10-28 22:13:50 +0100 |
---|---|---|
committer | Tim Moore <timoore@redhat.com> | 2009-10-28 22:13:50 +0100 |
commit | f2eafd28f50fb528842502e138c14ea2e54145b6 (patch) | |
tree | a384ad97864a7bd68697a48925464f0ba92a483f /grapher | |
parent | 1fc4d13df3342b10003c27bc0bc8bd196ecd5622 (diff) | |
download | systemtap-steved-f2eafd28f50fb528842502e138c14ea2e54145b6.tar.gz systemtap-steved-f2eafd28f50fb528842502e138c14ea2e54145b6.tar.xz systemtap-steved-f2eafd28f50fb528842502e138c14ea2e54145b6.zip |
* grapher/GraphData.hxx (GraphDataBase, GraphData): Use
boost::circular_buffer for time and data storage.
Diffstat (limited to 'grapher')
-rw-r--r-- | grapher/GraphData.hxx | 13 |
1 files changed, 10 insertions, 3 deletions
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 <vector> #include <tr1/memory> +#include <boost/circular_buffer.hpp> + namespace systemtap { struct GraphDataBase @@ -16,11 +18,12 @@ namespace systemtap DOT, EVENT }; - GraphDataBase() : scale(1.0), style(BAR) + typedef boost::circular_buffer<double> 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<double> 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<data_type> DataList; + typedef boost::circular_buffer<data_type> DataList; + GraphData(typename DataList::capacity_type cap = 50000) + : GraphDataBase(cap), data(cap) + { + } DataList data; }; struct CSVData |