summaryrefslogtreecommitdiffstats
path: root/grapher/GraphData.hxx
blob: e4c08cfd94c3bdeebc815c9ee2239cc503dcc230 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef SYSTEMTAP_GRAPHDATA_HXX
#define SYSTEMTAP_GRAPHDATA_HXX 1

#include <string>
#include <utility>
#include <vector>
#include <tr1/memory>

namespace systemtap
{
  struct GraphDataBase
  {
    virtual ~GraphDataBase() {}
    enum Style
      { BAR,
        DOT,
        EVENT
      };
    GraphDataBase() : scale(1.0), style(BAR)
    {
      color[0] = 0.0;  color[1] = 1.0;  color[2] = 0.0;
    }
    typedef std::vector<double> TimeList;
    // size of grid square at "normal" viewing
    double scale;
    double color[3];
    Style style;
    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