diff options
author | Tim Moore <timoore@redhat.com> | 2009-12-08 12:44:03 +0100 |
---|---|---|
committer | Tim Moore <timoore@redhat.com> | 2009-12-08 23:25:20 +0100 |
commit | cfd482078cd4805076cc6fd7e4e8642b97a03b25 (patch) | |
tree | 2d12ccdcfb9eee27d73f1c09d4da72e70fec82c4 /grapher/Graph.cxx | |
parent | 72a9e5a2d3788f5465eb5e1610f2402744054f2e (diff) | |
download | systemtap-steved-cfd482078cd4805076cc6fd7e4e8642b97a03b25.tar.gz systemtap-steved-cfd482078cd4805076cc6fd7e4e8642b97a03b25.tar.xz systemtap-steved-cfd482078cd4805076cc6fd7e4e8642b97a03b25.zip |
refactor list of data sets out of GraphWidget into a global data structure.
Also, add a sigc signal for broadcasting data set changes.
* grapher/GraphData.hxx (GraphDataList) new typedef
(getGraphData, graphDataSignal): new functions
* grapher/Graph.hxx (DatasetList): remove typedef in favor of
systemtap::GraphDataList
* grapher/GraphWidget.cxx (GraphWidget, onGraphDataChanged): Use
graphDataSignal to notice new data sets that need to be added. Use
the global data set list instead of one embedded in GraphWidget.
* grapher/StapParser.hxx: delete the _widget member; use signals to
broadcast that there are new data sets instead of calling into the widget.
Diffstat (limited to 'grapher/Graph.cxx')
-rw-r--r-- | grapher/Graph.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/grapher/Graph.cxx b/grapher/Graph.cxx index 2d203ead..ea1bd091 100644 --- a/grapher/Graph.cxx +++ b/grapher/Graph.cxx @@ -16,6 +16,9 @@ namespace systemtap { using namespace std; using namespace std::tr1; + + GraphDataList GraphDataBase::graphData; + sigc::signal<void> GraphDataBase::graphDataChanged; Graph::Graph(double x, double y) : _width(600), _height(200), _graphX(0), _graphY(0), @@ -40,7 +43,7 @@ namespace systemtap int linesPossible = (int)(_graphWidth / (_lineWidth + 2.0)); // Find latest time. int64_t latestTime = 0; - for (DatasetList::iterator ditr = _datasets.begin(), + for (GraphDataList::iterator ditr = _datasets.begin(), de = _datasets.end(); ditr != de; ++ditr) @@ -54,7 +57,7 @@ namespace systemtap } int64_t minDiff = 0; int64_t maxTotal = 0; - for (DatasetList::iterator ditr = _datasets.begin(), + for (GraphDataList::iterator ditr = _datasets.begin(), de = _datasets.end(); ditr != de; ++ditr) @@ -92,7 +95,7 @@ namespace systemtap cr->translate(_xOffset, _yOffset); cr->set_line_width(_lineWidth); - for (DatasetList::iterator itr = _datasets.begin(), e = _datasets.end(); + for (GraphDataList::iterator itr = _datasets.begin(), e = _datasets.end(); itr != e; ++itr) { |