| 1280 | } |
| 1281 | |
| 1282 | int |
| 1283 | Node::inputIndex(const NodePtr& n) const |
| 1284 | { |
| 1285 | if (!n) { |
| 1286 | return -1; |
| 1287 | } |
| 1288 | |
| 1289 | ///Only called by the main-thread |
| 1290 | assert( QThread::currentThread() == qApp->thread() ); |
| 1291 | assert(_imp->inputsInitialized); |
| 1292 | |
| 1293 | NodePtr parent = _imp->multiInstanceParent.lock(); |
| 1294 | if (parent) { |
| 1295 | return parent->inputIndex(n); |
| 1296 | } |
| 1297 | |
| 1298 | ///No need to lock this is only called by the main-thread |
| 1299 | for (std::size_t i = 0; i < _imp->inputs.size(); ++i) { |
| 1300 | if (_imp->inputs[i].lock() == n) { |
| 1301 | return i; |
| 1302 | } |
| 1303 | } |
| 1304 | |
| 1305 | |
| 1306 | return -1; |
| 1307 | } |
| 1308 | |
| 1309 | const std::vector<std::string> & |
| 1310 | Node::getInputLabels() const |
no test coverage detected