summaryrefslogtreecommitdiffstats
path: root/grapher/GraphData.hxx
diff options
context:
space:
mode:
authorTim Moore <timoore@redhat.com>2009-12-08 12:44:03 +0100
committerTim Moore <timoore@redhat.com>2009-12-08 23:25:20 +0100
commitcfd482078cd4805076cc6fd7e4e8642b97a03b25 (patch)
tree2d12ccdcfb9eee27d73f1c09d4da72e70fec82c4 /grapher/GraphData.hxx
parent72a9e5a2d3788f5465eb5e1610f2402744054f2e (diff)
downloadsystemtap-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/GraphData.hxx')
-rw-r--r--grapher/GraphData.hxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/grapher/GraphData.hxx b/grapher/GraphData.hxx
index fbb2bb8f..fb1ca9f5 100644
--- a/grapher/GraphData.hxx
+++ b/grapher/GraphData.hxx
@@ -19,10 +19,14 @@
#include <boost/circular_buffer.hpp>
+#include <gtkmm.h>
+
#include "GraphStyle.hxx"
namespace systemtap
{
+ struct GraphDataBase;
+ typedef std::vector<std::tr1::shared_ptr<GraphDataBase> > GraphDataList;
struct GraphDataBase
{
virtual ~GraphDataBase() {}
@@ -43,6 +47,9 @@ namespace systemtap
std::string xAxisText;
std::string yAxisText;
TimeList times;
+ static GraphDataList graphData;
+ // signal stuff for telling everyone about changes to the data set list
+ static sigc::signal<void> graphDataChanged;
};
template<typename T>
@@ -69,5 +76,12 @@ namespace systemtap
Element;
std::vector<Element> elements;
};
+
+ inline GraphDataList& getGraphData() { return GraphDataBase::graphData; }
+
+ inline sigc::signal<void>& graphDataSignal()
+ {
+ return GraphDataBase::graphDataChanged;
+ }
}
#endif