forked from OpenDDS/OpenDDS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraphGenerator.h
More file actions
63 lines (45 loc) · 1.41 KB
/
Copy pathGraphGenerator.h
File metadata and controls
63 lines (45 loc) · 1.41 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
*
*
* Distributed under the OpenDDS License.
* See: http://www.opendds.org/license.html
*/
#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include <vector>
#include <map>
#include <string>
#include <sstream>
#include "TreeNode.h"
#include "GvOptions.h"
#include "iostream"
#include "fstream"
#include "stack"
namespace Monitor {
class GraphGenerator {
public:
// generate the new graph
void draw();
GraphGenerator (TreeNode *, GvOptionsData, bool honorDisplayFlag = false);
private:
TreeNode *root_;
GvOptionsData gvOpt_;
bool honorDisplayFlag_; // if true only graph treeNodes that have display flag set
// find readers and writers
// recursive so it need the TreeNode arg
void connectNodes();
void generate(TreeNode *);
std::string qcolorToHex(const QColor&); // helper for generate
void htmlEncode(std::string &s); // remove special characters <, >, etc
std::string abbr(const std::string &);
std::string nodeName(int offset = 0);
std::ofstream fout;
// these are used for finding connections in the graphs
std::map<std::string, std::string> rMap_; // readers to writers
std::map<std::string, std::string> wMap_; // writers to readers
std::map<std::string, std::string> nMap_; // readers and writers to nodeNames
// when we create a sub graph push "}" so we can pop it later
std::stack<std::string> lifo_;
};
}; // namespace Monitor