Changeset 12942 in vbox for trunk/src/VBox/Main
- Timestamp:
- Oct 2, 2008 2:53:11 PM (16 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/Performance.cpp
r12802 r12942 417 417 ComSafeArrayIn(IUnknown *, objects)) 418 418 { 419 /* 420 * Let's work around null/empty safe array mess. I am not sure there is 421 * a way to pass null arrays via webservice, I haven't found one. So I 422 * guess the users will be forced to use empty arrays instead. Constructing 423 * an empty SafeArray is a bit awkward, so what we do in this method is 424 * actually convert null arrays to empty arrays and pass them down to 425 * init() method. If someone knows how to do it better, please be my guest, 426 * fix it. 427 */ 428 if (ComSafeArrayInIsNull(metricNames)) 429 { 430 com::SafeArray <BSTR> nameArray; 431 if (ComSafeArrayInIsNull(objects)) 432 { 433 com::SafeIfaceArray <IUnknown> objectArray; 434 objectArray.reset(0); 435 init(ComSafeArrayAsInParam(nameArray), 436 ComSafeArrayAsInParam(objectArray)); 437 } 438 else 439 { 440 com::SafeIfaceArray <IUnknown> objectArray(ComSafeArrayInArg(objects)); 441 init(ComSafeArrayAsInParam(nameArray), 442 ComSafeArrayAsInParam(objectArray)); 443 } 444 } 445 else 446 { 447 com::SafeArray <INPTR BSTR> nameArray(ComSafeArrayInArg(metricNames)); 448 if (ComSafeArrayInIsNull(objects)) 449 { 450 com::SafeIfaceArray <IUnknown> objectArray; 451 objectArray.reset(0); 452 init(ComSafeArrayAsInParam(nameArray), 453 ComSafeArrayAsInParam(objectArray)); 454 } 455 else 456 { 457 com::SafeIfaceArray <IUnknown> objectArray(ComSafeArrayInArg(objects)); 458 init(ComSafeArrayAsInParam(nameArray), 459 ComSafeArrayAsInParam(objectArray)); 460 } 461 } 462 } 463 464 void Filter::init(ComSafeArrayIn(INPTR BSTR, metricNames), 465 ComSafeArrayIn(IUnknown *, objects)) 466 { 419 467 com::SafeArray <INPTR BSTR> nameArray(ComSafeArrayInArg(metricNames)); 420 421 if (ComSafeArrayInIsNull(objects)) 468 com::SafeIfaceArray <IUnknown> objectArray(ComSafeArrayInArg(objects)); 469 470 if (!objectArray.size()) 422 471 { 423 472 if (nameArray.size()) … … 431 480 else 432 481 { 433 com::SafeIfaceArray <IUnknown> objectArray(ComSafeArrayInArg(objects)); 434 482 435 483 for (size_t i = 0; i < objectArray.size(); ++i) 436 484 switch (nameArray.size()) -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r12889 r12942 10494 10494 </li> 10495 10495 </ul> 10496 10497 For an example of usage refer to the following files in VirtualBox SDK: 10498 <ul> 10499 <li>Python: <tt>bindings/xpcom/python/sample/shellcommon.py</tt></li> 10500 </ul> 10496 10501 </desc> 10497 10502 -
trunk/src/VBox/Main/include/Performance.h
r12678 r12942 380 380 bool match(const ComPtr<IUnknown> object, const std::string &name) const; 381 381 private: 382 void init(ComSafeArrayIn(INPTR BSTR, metricNames), 383 ComSafeArrayIn(IUnknown * , objects)); 384 382 385 typedef std::pair<const ComPtr<IUnknown>, const std::string> FilterElement; 383 386 typedef std::list<FilterElement> ElementList;
Note:
See TracChangeset
for help on using the changeset viewer.