summaryrefslogtreecommitdiffstats
path: root/grapher/GraphData.hxx
diff options
context:
space:
mode:
authorTim Moore <timoore@redhat.com>2009-04-20 10:06:50 +0200
committerTim Moore <timoore@redhat.com>2009-04-20 10:06:50 +0200
commitc6cc0049534b543878844c728dbdd3a06cbf7969 (patch)
tree75df1566da2f5f780249e1e8c3a25b41fc85610b /grapher/GraphData.hxx
parentb185f07818262bad07e2904a696f2dfcd22fc1fe (diff)
parent1087b83f9b60e85d3d41cebd797f2eb4cc495bc6 (diff)
downloadsystemtap-steved-c6cc0049534b543878844c728dbdd3a06cbf7969.tar.gz
systemtap-steved-c6cc0049534b543878844c728dbdd3a06cbf7969.tar.xz
systemtap-steved-c6cc0049534b543878844c728dbdd3a06cbf7969.zip
Merge branch 'timoore/grapher'
Diffstat (limited to 'grapher/GraphData.hxx')
-rw-r--r--grapher/GraphData.hxx44
1 files changed, 44 insertions, 0 deletions
diff --git a/grapher/GraphData.hxx b/grapher/GraphData.hxx
new file mode 100644
index 00000000..0f3b0b31
--- /dev/null
+++ b/grapher/GraphData.hxx
@@ -0,0 +1,44 @@
+#ifndef SYSTEMTAP_GRAPHDATA_HXX
+#define SYSTEMTAP_GRAPHDATA_HXX 1
+
+#include <utility>
+#include <vector>
+
+namespace systemtap
+{
+ struct GraphData
+ {
+ public:
+ enum Style
+ { BAR,
+ DOT
+ };
+ GraphData() : scale(1.0), style(BAR)
+ {
+ color[0] = 0.0; color[1] = 1.0; color[2] = 0.0;
+ }
+ typedef std::pair<double, double> Datum;
+ typedef std::vector<Datum> List;
+ // size of grid square at "normal" viewing
+ double scale;
+ double color[3];
+ Style style;
+ List data;
+ struct Compare
+ {
+ bool operator() (const Datum& lhs, const Datum& rhs) const
+ {
+ return lhs.first < rhs.first;
+ }
+ bool operator() (double lhs, const Datum& rhs) const
+ {
+ return lhs < rhs.first;
+ }
+ bool operator() (const Datum& lhs, double rhs) const
+ {
+ return lhs.first < rhs;
+ }
+ };
+ };
+}
+#endif