| 79 | } |
| 80 | |
| 81 | bool Graph::AddInputNode(const std::string& node_name) |
| 82 | { |
| 83 | Node* node = FindNode(node_name); |
| 84 | |
| 85 | if(node == nullptr) |
| 86 | return false; |
| 87 | |
| 88 | // check to avoid replicate node |
| 89 | |
| 90 | for(unsigned int i = 0; i < input_nodes.size(); i++) |
| 91 | { |
| 92 | if(node == input_nodes[i]) |
| 93 | return true; |
| 94 | } |
| 95 | |
| 96 | input_nodes.push_back(node); |
| 97 | |
| 98 | return true; |
| 99 | } |
| 100 | |
| 101 | bool Graph::AddOutputNode(const std::string& node_name) |
| 102 | { |
no test coverage detected