diff options
author | Tim Moore <timoore@redhat.com> | 2009-12-01 19:05:09 +0100 |
---|---|---|
committer | Tim Moore <timoore@redhat.com> | 2009-12-02 19:39:37 +0100 |
commit | 6197b0dc80c4f87000d26213293fe2cb72fbe081 (patch) | |
tree | 23e7b4716f9d618e0891d67cee127c614177b370 /grapher/GraphData.hxx | |
parent | 06e217d9990635be43a59233d75c504385d1e243 (diff) | |
download | systemtap-steved-6197b0dc80c4f87000d26213293fe2cb72fbe081.tar.gz systemtap-steved-6197b0dc80c4f87000d26213293fe2cb72fbe081.tar.xz systemtap-steved-6197b0dc80c4f87000d26213293fe2cb72fbe081.zip |
Refactor drawing of different styles of graph into classes
* grapher/GraphStyle.cxx: New file
* grapher/GraphStyle.hxx: New file
* grapher/Graph(draw): Move much drawing code to GraphStyle::draw
Diffstat (limited to 'grapher/GraphData.hxx')
-rw-r--r-- | grapher/GraphData.hxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/grapher/GraphData.hxx b/grapher/GraphData.hxx index e06ffdb8..9a267fc5 100644 --- a/grapher/GraphData.hxx +++ b/grapher/GraphData.hxx @@ -11,19 +11,17 @@ #include <boost/circular_buffer.hpp> +#include "GraphStyle.hxx" + namespace systemtap { struct GraphDataBase { virtual ~GraphDataBase() {} - enum Style - { BAR, - DOT, - EVENT - }; + typedef boost::circular_buffer<int64_t> TimeList; GraphDataBase(TimeList::capacity_type cap = 50000) - : scale(1.0), style(BAR), times(cap) + : scale(1.0), style(&GraphStyleBar::instance), times(cap) { color[0] = 0.0; color[1] = 1.0; color[2] = 0.0; } @@ -31,7 +29,7 @@ namespace systemtap // size of grid square at "normal" viewing double scale; double color[3]; - Style style; + GraphStyle* style; std::string title; std::string xAxisText; std::string yAxisText; |