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:
Nathan Braswell
2013-06-23 05:54:58 -04:00
parent a307e1f143
commit ee9b8b8c39
4 changed files with 37 additions and 1 deletions

View File

@@ -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

View File

@@ -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