Modified the NodeTree with a unique id used in construction of the DOT representation, so that two different nodes with the same name don't end up as the same on the graph.
This commit is contained in:
1 parent
a307e1f143
commit
ee9b8b8c39
4 files changed
+37
-1
No files matched your search
@@ -5,8 +5,11 @@
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#include <util.h>
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
class NodeTree {
|
||||
public:
|
||||
@@ -32,9 +35,13 @@ class NodeTree {
|
||||
|
||||
private:
|
||||
std::string DOTGraphStringHelper();
|
||||
std::string getDOTName();
|
||||
std::string name;
|
||||
NodeTree* parent;
|
||||
std::vector<NodeTree*> children;
|
||||
|
||||
static int idCounter;
|
||||
int id;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -9,5 +9,7 @@
|
||||
#include <sstream>
|
||||
|
||||
std::string intToString(int theInt);
|
||||
std::string truncateEnd(std::string to_truncate);
|
||||
std::string removeBeginning(std::string to_remove);
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user