Changeset 10725 in vbox for trunk/src/VBox/Main/Performance.cpp
- Timestamp:
- Jul 17, 2008 1:27:48 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/Performance.cpp
r10713 r10725 483 483 com::SafeIfaceArray <IUnknown> objectArray(ComSafeArrayInArg(objects)); 484 484 com::SafeArray <INPTR BSTR> nameArray(ComSafeArrayInArg(metricNames)); 485 for (size_t i = 0; i < objectArray.size(); ++i) 486 processMetricList(std::string(com::Utf8Str(nameArray[i])), objectArray[i]); 485 if (objectArray.isNull()) 486 { 487 if (nameArray.size()) 488 { 489 for (size_t i = 0; i < nameArray.size(); ++i) 490 processMetricList(std::string(com::Utf8Str(nameArray[i])), ComPtr<IUnknown>()); 491 } 492 else 493 processMetricList(std::string("*"), ComPtr<IUnknown>()); 494 } 495 else 496 { 497 for (size_t i = 0; i < objectArray.size(); ++i) 498 switch (nameArray.size()) 499 { 500 case 0: 501 processMetricList(std::string("*"), objectArray[i]); 502 break; 503 case 1: 504 processMetricList(std::string(com::Utf8Str(nameArray[0])), objectArray[i]); 505 break; 506 default: 507 processMetricList(std::string(com::Utf8Str(nameArray[i])), objectArray[i]); 508 break; 509 } 510 } 487 511 } 488 512 … … 503 527 bool Filter::match(const ComPtr<IUnknown> object, const std::string &name) const 504 528 { 505 return true; 506 } 529 ElementList::const_iterator it; 530 531 printf("Filter::match(%p, %s)\n", static_cast<const IUnknown*> (object), name.c_str()); 532 for (it = mElements.begin(); it != mElements.end(); it++) 533 { 534 printf("...matching against(%p, %s)\n", static_cast<const IUnknown*> ((*it).first), (*it).second.c_str()); 535 if ((*it).first.isNull() || (*it).first == object) 536 { 537 // Objects match, compare names 538 if ((*it).second == "*" || (*it).second == name) 539 { 540 printf("...found!\n"); 541 return true; 542 } 543 } 544 } 545 printf("...no matches!\n"); 546 return false; 547 }
Note:
See TracChangeset
for help on using the changeset viewer.