diff options
author | Tim Moore <timoore@redhat.com> | 2009-04-15 18:43:23 +0200 |
---|---|---|
committer | Tim Moore <timoore@redhat.com> | 2009-04-15 19:00:00 +0200 |
commit | 2d45e339f3287cf0b4805ea91b3aa9f17b6d4752 (patch) | |
tree | abd4c3faf3c774702b85a0ff6fb50da184fd5023 /GraphData.hxx | |
parent | 7a51212ca1895b85f400fafe0e5198525996af1d (diff) | |
download | systemtap-steved-2d45e339f3287cf0b4805ea91b3aa9f17b6d4752.tar.gz systemtap-steved-2d45e339f3287cf0b4805ea91b3aa9f17b6d4752.tar.xz systemtap-steved-2d45e339f3287cf0b4805ea91b3aa9f17b6d4752.zip |
graphing widget and test harness
Diffstat (limited to 'GraphData.hxx')
-rw-r--r-- | GraphData.hxx | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/GraphData.hxx b/GraphData.hxx new file mode 100644 index 00000000..0f3b0b31 --- /dev/null +++ b/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 |