| 513 | } |
| 514 | |
| 515 | void |
| 516 | Monitor::MonitorDataStorage::manageTransportLink( |
| 517 | TreeNode* node, |
| 518 | int transport_id, |
| 519 | bool& create |
| 520 | ) |
| 521 | { |
| 522 | // Start by finding the participant node. |
| 523 | TreeNode* processNode = node->parent(); |
| 524 | if( processNode) { |
| 525 | // And follow it to the actual process node. |
| 526 | processNode = processNode->parent(); |
| 527 | |
| 528 | } else { |
| 529 | // Horribly corrupt model, something oughta been done about it! |
| 530 | ACE_ERROR((LM_ERROR, |
| 531 | ACE_TEXT("(%P|%t) ERROR: MonitorDataStorage::manageTransportLink() - ") |
| 532 | ACE_TEXT("unable to locate the ancestor process node!\n") |
| 533 | )); |
| 534 | return; |
| 535 | } |
| 536 | |
| 537 | // Then finds its key in the maps. |
| 538 | ProcessKey processKey; |
| 539 | std::pair< bool, ProcessKey> pResult |
| 540 | = this->findKey( this->processToTreeMap_, processNode); |
| 541 | if( pResult.first) { |
| 542 | processKey = pResult.second; |
| 543 | |
| 544 | } else { |
| 545 | // Horribly corrupt model, something oughta been done about it! |
| 546 | ACE_ERROR((LM_ERROR, |
| 547 | ACE_TEXT("(%P|%t) ERROR: MonitorDataStorage::manageTransportLink() - ") |
| 548 | ACE_TEXT("unable to locate the process node in the maps!\n") |
| 549 | )); |
| 550 | return; |
| 551 | } |
| 552 | |
| 553 | // Now we have enough information to build a TransportKey and find or |
| 554 | // create a transport node for our Id value. |
| 555 | TransportKey transportKey( |
| 556 | processKey.host, |
| 557 | processKey.pid, |
| 558 | transport_id |
| 559 | ); |
| 560 | TreeNode* transportNode = this->getTransportNode( transportKey, create); |
| 561 | if( !node) { |
| 562 | return; |
| 563 | } |
| 564 | |
| 565 | // Transport Id display. |
| 566 | QString label( QObject::tr( "Transport")); |
| 567 | int row = node->indexOf( 0, label); |
| 568 | if( row == -1) { |
| 569 | // New entry, add a reference to the actual transport node. |
| 570 | QList<QVariant> list; |
| 571 | list << label << QString( QObject::tr("<error>")); |
| 572 | TreeNode* idNode = new TreeNode( list, node); |
nothing calls this directly
no test coverage detected