-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathgraphvizbuilder.h
49 lines (32 loc) · 965 Bytes
/
graphvizbuilder.h
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 GRAPHVIZBUILDER_H
#define GRAPHVIZBUILDER_H
#include <iostream>
#include <stack>
#include <QString>
#include <QMap>
#include <QSharedPointer>
#include <graphviz/gvc.h>
#include "builder.h"
namespace Templar {
class GraphvizBuilder : public Builder
{
public:
typedef int NodeId;
typedef QMap<NodeId, QSharedPointer<graph_t> > NodeIdToGraph;
GraphvizBuilder();
virtual void traceEntry(const TraceEntry& entry);
NodeIdToGraph getNodeGraphMap() { return nodeToGraph; }
QSharedPointer<GVC_t> getGvc() { return gvc; }
private:
void initGraph();
void templateBegin(const TraceEntry& entry);
void templateEnd();
private:
QSharedPointer<GVC_t> gvc;
NodeIdToGraph nodeToGraph;
QSharedPointer<graph_t> actualGraph;
//TODO unused variable: unsigned int counter;
std::stack<node_t*> nodeStack;
};
} // namespace Templar
#endif // GRAPHVIZBUILDER_H