summaryrefslogtreecommitdiffstats
path: root/grapher/GraphData.hxx
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-12-02 16:41:11 -0500
committerDave Brolley <brolley@redhat.com>2009-12-02 16:41:11 -0500
commit6bb613f9be856632dec47cab4b27a7fe92c2fe64 (patch)
tree76e778645ea20df5fd89981994ee249fc760d4f5 /grapher/GraphData.hxx
parent5d4ea4cc1d1f7531fb0ff4d0498957e0333a61eb (diff)
parent4a0ae64c47b159d4dd0ea471f1f8044503843a7f (diff)
downloadsystemtap-steved-6bb613f9be856632dec47cab4b27a7fe92c2fe64.tar.gz
systemtap-steved-6bb613f9be856632dec47cab4b27a7fe92c2fe64.tar.xz
systemtap-steved-6bb613f9be856632dec47cab4b27a7fe92c2fe64.zip
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Diffstat (limited to 'grapher/GraphData.hxx')
-rw-r--r--grapher/GraphData.hxx25
1 files changed, 17 insertions, 8 deletions
diff --git a/grapher/GraphData.hxx b/grapher/GraphData.hxx
index 0e26fb4d..04f415f3 100644
--- a/grapher/GraphData.hxx
+++ b/grapher/GraphData.hxx
@@ -1,6 +1,9 @@
#ifndef SYSTEMTAP_GRAPHDATA_HXX
#define SYSTEMTAP_GRAPHDATA_HXX 1
+#include <stdint.h>
+
+#include <sstream>
#include <string>
#include <utility>
#include <vector>
@@ -8,26 +11,26 @@
#include <boost/circular_buffer.hpp>
+#include "GraphStyle.hxx"
+
namespace systemtap
{
struct GraphDataBase
{
virtual ~GraphDataBase() {}
- enum Style
- { BAR,
- DOT,
- EVENT
- };
- typedef boost::circular_buffer<double> TimeList;
+
+ 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;
}
+ virtual std::string elementAsString(size_t element) = 0;
// size of grid square at "normal" viewing
+ std::string name;
double scale;
double color[3];
- Style style;
+ GraphStyle* style;
std::string title;
std::string xAxisText;
std::string yAxisText;
@@ -44,6 +47,12 @@ namespace systemtap
: GraphDataBase(cap), data(cap)
{
}
+ std::string elementAsString(size_t element)
+ {
+ std::ostringstream stream;
+ stream << data[element];
+ return stream.str();
+ }
DataList data;
};
struct CSVData