From 3c434960a680c459d526bee483a2bc79ce767473 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Wed, 29 Apr 2009 19:52:50 +0200 Subject: Refactor StapParser into its own files * grapher/StapParser.cxx: new file * grapher/StapParser.hxx: new file * grapher/grapher.cxx: Use external StapParser class. --- grapher/StapParser.hxx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 grapher/StapParser.hxx (limited to 'grapher/StapParser.hxx') diff --git a/grapher/StapParser.hxx b/grapher/StapParser.hxx new file mode 100644 index 00000000..a94b0a9b --- /dev/null +++ b/grapher/StapParser.hxx @@ -0,0 +1,21 @@ +#include "GraphData.hxx" +#include "GraphWidget.hxx" + +#include +namespace systemtap +{ +class StapParser +{ + std::string _buffer; + typedef std::map > DataMap; + DataMap _dataSets; + Gtk::Window& _win; + GraphWidget& _widget; +public: + StapParser(Gtk::Window& win, + GraphWidget& widget) : _win(win), _widget(widget) {} + + bool ioCallback(Glib::IOCondition ioCondition); + +}; +} -- cgit From 0f262fd10d337db0ec435d840b541d629879ce9f Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Wed, 20 May 2009 13:29:54 +0200 Subject: Add CSV syntax support to the grapher * grapher/GraphData.hxx (CSVData): new class * grapher/GraphData.cxx (commaSplit): new function (ioCallback): handle CSV definition and data --- grapher/StapParser.hxx | 1 + 1 file changed, 1 insertion(+) (limited to 'grapher/StapParser.hxx') diff --git a/grapher/StapParser.hxx b/grapher/StapParser.hxx index a94b0a9b..624accc7 100644 --- a/grapher/StapParser.hxx +++ b/grapher/StapParser.hxx @@ -9,6 +9,7 @@ class StapParser std::string _buffer; typedef std::map > DataMap; DataMap _dataSets; + CSVData _csv; Gtk::Window& _win; GraphWidget& _widget; public: -- cgit From 5f4f8b1129659adb2015ce42821faccf8fe6d8d5 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Wed, 27 May 2009 10:32:51 +0200 Subject: Templatize GraphData * grapher/GraphData.hxx (GraphDataBase): new superclass for GraphData. Split time data out as a separate vector. (GraphData): Rewrite as template. * grapher/GraphWidget.cxx (on_expose_event): Reflect GraphData templatization. Handle events with string values. * grapher/GraphWidget.hxx (GraphWidget): Keep pointers to GraphDataBase objects instead of GraphData. * grapher/StapParser.cxx (parseData): new member function (ioCallback): Handle new discreet event * grapher/StapParser.hxx (StapParser): keep pointers to GraphDataBase objects instead of GraphData * testsuite/systemtap.examples/general/grapher.stp: Display actual key pressed for keyboard event --- grapher/StapParser.hxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'grapher/StapParser.hxx') diff --git a/grapher/StapParser.hxx b/grapher/StapParser.hxx index 624accc7..e11e7302 100644 --- a/grapher/StapParser.hxx +++ b/grapher/StapParser.hxx @@ -7,7 +7,7 @@ namespace systemtap class StapParser { std::string _buffer; - typedef std::map > DataMap; + typedef std::map > DataMap; DataMap _dataSets; CSVData _csv; Gtk::Window& _win; @@ -15,7 +15,8 @@ class StapParser public: StapParser(Gtk::Window& win, GraphWidget& widget) : _win(win), _widget(widget) {} - + void parseData(std::tr1::shared_ptr gdata, + double time, const std::string& dataString); bool ioCallback(Glib::IOCondition ioCondition); }; -- cgit