summaryrefslogtreecommitdiffstats
path: root/grapher/GraphData.hxx
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-08-04 12:35:41 -0400
committerDave Brolley <brolley@redhat.com>2009-08-04 12:35:41 -0400
commitbc9077d171b8250a93a1b5a481e34913e5585dd5 (patch)
tree1fa945c76a66e297e783354ccd7a860aa65d304b /grapher/GraphData.hxx
parent3174c3ca37371d738b86d630dc4d8b15104e57d0 (diff)
parent8b095b454b34e88c04592be6c651153f802eced6 (diff)
downloadsystemtap-steved-bc9077d171b8250a93a1b5a481e34913e5585dd5.tar.gz
systemtap-steved-bc9077d171b8250a93a1b5a481e34913e5585dd5.tar.xz
systemtap-steved-bc9077d171b8250a93a1b5a481e34913e5585dd5.zip
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Conflicts: cache.cxx
Diffstat (limited to 'grapher/GraphData.hxx')
-rw-r--r--grapher/GraphData.hxx49
1 files changed, 27 insertions, 22 deletions
diff --git a/grapher/GraphData.hxx b/grapher/GraphData.hxx
index 0f3b0b31..e4c08cfd 100644
--- a/grapher/GraphData.hxx
+++ b/grapher/GraphData.hxx
@@ -1,44 +1,49 @@
#ifndef SYSTEMTAP_GRAPHDATA_HXX
#define SYSTEMTAP_GRAPHDATA_HXX 1
+#include <string>
#include <utility>
#include <vector>
+#include <tr1/memory>
namespace systemtap
{
- struct GraphData
+ struct GraphDataBase
{
- public:
+ virtual ~GraphDataBase() {}
enum Style
{ BAR,
- DOT
+ DOT,
+ EVENT
};
- GraphData() : scale(1.0), style(BAR)
+ GraphDataBase() : 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;
+ typedef std::vector<double> TimeList;
// 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;
- }
- };
+ std::string title;
+ std::string xAxisText;
+ std::string yAxisText;
+ TimeList times;
+ };
+
+ template<typename T>
+ class GraphData : public GraphDataBase
+ {
+ public:
+ typedef T data_type;
+ typedef std::vector<data_type> DataList;
+ DataList data;
+ };
+ struct CSVData
+ {
+ typedef std::pair<std::string, std::tr1::shared_ptr<GraphDataBase> >
+ Element;
+ std::vector<Element> elements;
};
}
#endif