Changeset 6909 in vbox
- Timestamp:
- Feb 11, 2008 8:00:12 PM (17 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMListBox.cpp
r6822 r6909 228 228 clear(); 229 229 230 CMachineEnumerator en = mVBox.GetMachines().Enumerate(); 231 while (en.HasMore()) 232 { 233 CMachine m = en.GetNext(); 234 new VBoxVMListBoxItem (this, m); 235 } 230 CMachineVector vec = mVBox.GetMachines2(); 231 for (CMachineVector::ConstIterator m = vec.begin(); 232 m != vec.end(); ++ m) 233 new VBoxVMListBoxItem (this, *m); 236 234 237 235 sort(); -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui.h
r6784 r6909 1028 1028 /* clear inner list */ 1029 1029 mNetworksList.clear(); 1030 /* loading internal networks list */ 1030 1031 /* load internal network list */ 1031 1032 CVirtualBox vbox = vboxGlobal().virtualBox(); 1032 1033 ulong count = vbox.GetSystemProperties().GetNetworkAdapterCount(); 1033 CMachine Enumerator en = vbox.GetMachines().Enumerate();1034 while (en.HasMore())1035 {1036 CMachine machine = en.GetNext();1034 CMachineVector vec = vbox.GetMachines2(); 1035 for (CMachineVector::ConstIterator m = vec.begin(); 1036 m != vec.end(); ++ m) 1037 { 1037 1038 for (ulong slot = 0; slot < count; ++ slot) 1038 1039 { 1039 CNetworkAdapter adapter = m achine.GetNetworkAdapter (slot);1040 CNetworkAdapter adapter = m->GetNetworkAdapter (slot); 1040 1041 if (adapter.GetAttachmentType() == CEnums::InternalNetworkAttachment && 1041 1042 !mNetworksList.contains (adapter.GetInternalNetwork())) … … 1043 1044 } 1044 1045 } 1046 1045 1047 mLockNetworkListUpdate = false; 1046 1048 } -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r6384 r6909 57 57 58 58 #include <VBox/com/com.h> 59 #include <VBox/com/array.h> 59 60 60 61 #include <algorithm> … … 467 468 } 468 469 469 STDMETHODIMP VirtualBox::COMGETTER(SystemProperties) (ISystemProperties **aSystemProperties) 470 STDMETHODIMP 471 VirtualBox::COMGETTER(SystemProperties) (ISystemProperties **aSystemProperties) 470 472 { 471 473 if (!aSystemProperties) … … 479 481 } 480 482 481 /** @note Locks this object for reading. */ 483 /** 484 * @note Locks this object for reading. 485 */ 482 486 STDMETHODIMP VirtualBox::COMGETTER(Machines) (IMachineCollection **aMachines) 483 487 { … … 498 502 } 499 503 500 /** @note Locks this object for reading. */ 504 /** 505 * @note Locks this object for reading. 506 */ 507 STDMETHODIMP 508 VirtualBox::COMGETTER(Machines2) (ComSafeArrayOut (IMachine *, aMachines)) 509 { 510 if (ComSafeArrayOutIsNull (aMachines)) 511 return E_POINTER; 512 513 AutoCaller autoCaller (this); 514 CheckComRCReturnRC (autoCaller.rc()); 515 516 AutoReaderLock alock (this); 517 518 SafeIfaceArray <IMachine> machines (mData.mMachines); 519 machines.detachTo (ComSafeArrayOutArg (aMachines)); 520 521 return S_OK; 522 } 523 524 /** 525 * @note Locks this object for reading. 526 */ 501 527 STDMETHODIMP VirtualBox::COMGETTER(HardDisks) (IHardDiskCollection **aHardDisks) 502 528 { … … 517 543 } 518 544 519 /** @note Locks this object for reading. */ 545 /** 546 * @note Locks this object for reading. 547 */ 520 548 STDMETHODIMP VirtualBox::COMGETTER(DVDImages) (IDVDImageCollection **aDVDImages) 521 549 { … … 536 564 } 537 565 538 /** @note Locks this object for reading. */ 566 /** 567 * @note Locks this object for reading. 568 */ 539 569 STDMETHODIMP VirtualBox::COMGETTER(FloppyImages) (IFloppyImageCollection **aFloppyImages) 540 570 { … … 555 585 } 556 586 557 /** @note Locks this object for reading. */ 587 /** 588 * @note Locks this object for reading. 589 */ 558 590 STDMETHODIMP VirtualBox::COMGETTER(ProgressOperations) (IProgressCollection **aOperations) 559 591 { … … 574 606 } 575 607 576 /** @note Locks this object for reading. */ 608 /** 609 * @note Locks this object for reading. 610 */ 577 611 STDMETHODIMP VirtualBox::COMGETTER(GuestOSTypes) (IGuestOSTypeCollection **aGuestOSTypes) 578 612 { … … 4061 4095 } 4062 4096 4063 /** 4097 /** 4064 4098 * Helper method to load the setting tree and turn expected exceptions into 4065 4099 * COM errors, according to arguments. 4066 * 4100 * 4067 4101 * Note that this method will not catch unexpected errors so it may still 4068 4102 * throw something. … … 4120 4154 } 4121 4155 4122 /** 4156 /** 4123 4157 * Helper method to save the settings tree and turn expected exceptions to COM 4124 4158 * errors. … … 4126 4160 * Note that this method will not catch unexpected errors so it may still 4127 4161 * throw something. 4128 * 4162 * 4129 4163 * @param aTree Tree to save. 4130 4164 * @param aFile File to save the tree to. … … 4151 4185 } 4152 4186 4153 /** 4187 /** 4154 4188 * Handles unexpected exceptions by turning them into COM errors in release 4155 4189 * builds or by hitting a breakpoint in the release builds. … … 4170 4204 } 4171 4205 * @endcode 4172 * 4206 * 4173 4207 * @param RT_SRC_POS_DECL "RT_SRC_POS" macro instantiation. 4174 4208 */ -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r6852 r6909 43 43 * 44 44 Copyright (C) 2006-2007 innotek GmbH 45 45 46 46 This file is part of VirtualBox Open Source Edition (OSE), as 47 47 available from http://www.virtualbox.org. This file is free software; … … 814 814 wsmap="managed" 815 815 > 816 <desc> The main interface exposed by the product that provides virtual 817 machine management. 816 <desc> 817 The IVirtualBox interface represents the main interface exposed by the 818 product that provides virtual machine management. 818 819 819 820 An instance of IVirtualBox is required for the product to do anything … … 859 860 </attribute> 860 861 861 <attribute name="machines" type="IMachineCollection" readonly="yes"/> 862 <attribute name="machines" type="IMachineCollection" readonly="yes"> 863 <desc> 864 Collection of machine objects registered within this VirtualBox 865 instance. 866 </desc> 867 </attribute> 868 869 <attribute name="machines2" type="IMachine" readonly="yes" safearray="yes"> 870 <desc> 871 Array of machine objects registered within this VirtualBox instance. 872 </desc> 873 </attribute> 862 874 863 875 <attribute name="hardDisks" type="IHardDiskCollection" readonly="yes"> 864 876 <desc> 865 A collection of hard disk objects registered within this 866 VirtualBox instance. 867 This collection contains only "top-level" (basic or independent) 868 hard disk images, but not differencing ones. All differencing 869 images of the given top-level image (i.e. all its children) can 870 be enumerated using <link to="IHardDisk::children"/>. 877 Collection of hard disk objects registered within this VirtualBox 878 instance. 879 880 This collection contains only "top-level" (basic or independent) hard 881 disk images, but not differencing ones. All differencing images of the 882 given top-level image (i.e. all its children) can be enumerated using 883 <link to="IHardDisk::children"/>. 871 884 </desc> 872 885 </attribute> … … 9064 9077 </desc> 9065 9078 </attribute> 9066 9079 9067 9080 <attribute name="writable" type="boolean" readonly="yes"> 9068 9081 <desc> -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r6384 r6909 112 112 STDMETHOD(COMGETTER(SystemProperties)) (ISystemProperties **aSystemProperties); 113 113 STDMETHOD(COMGETTER(Machines)) (IMachineCollection **aMachines); 114 STDMETHOD(COMGETTER(Machines2)) (ComSafeArrayOut (IMachine *, aMachines)); 114 115 STDMETHOD(COMGETTER(HardDisks)) (IHardDiskCollection **aHardDisks); 115 116 STDMETHOD(COMGETTER(DVDImages)) (IDVDImageCollection **aDVDImages); … … 269 270 bool aAddDefaults); 270 271 271 /** 272 /** 272 273 * Shortcut to loadSettingsTree (aTree, aFile, true, true, true). 273 274 * … … 281 282 } 282 283 283 /** 284 /** 284 285 * Shortcut to loadSettingsTree (aTree, aFile, true, false, true). 285 286 * … … 295 296 } 296 297 297 /** 298 /** 298 299 * Shortcut to loadSettingsTree (aTree, aFile, true, false, false). 299 300 * -
trunk/src/VBox/Main/testcase/tstAPI.cpp
r5999 r6909 21 21 #include <VBox/com/com.h> 22 22 #include <VBox/com/string.h> 23 #include <VBox/com/array.h> 23 24 #include <VBox/com/Guid.h> 24 25 #include <VBox/com/ErrorInfo.h> … … 222 223 Utf8Str nullUtf8Str; 223 224 printf ("nullUtf8Str='%s'\n", nullUtf8Str.raw()); 224 225 225 226 Utf8Str simpleUtf8Str = "simpleUtf8Str"; 226 227 printf ("simpleUtf8Str='%s'\n", simpleUtf8Str.raw()); … … 248 249 } 249 250 250 #if 1251 #if 0 251 252 // IUnknown identity test 252 253 //////////////////////////////////////////////////////////////////////////// … … 333 334 CHECK_ERROR_BREAK (virtualBox, COMGETTER(Version) (version.asOutParam())); 334 335 printf ("VirtualBox version = %ls\n", version.raw()); 336 } 337 #endif 338 339 #if 1 340 // Array test 341 //////////////////////////////////////////////////////////////////////////// 342 { 343 printf ("Calling IVirtualBox::Machines...\n"); 344 345 com::SafeArray <ULONG> aaa (10); 346 347 com::SafeIfaceArray <IMachine> machines; 348 CHECK_ERROR_BREAK (virtualBox, 349 COMGETTER(Machines2) (ComSafeArrayAsOutParam (machines))); 350 351 printf ("%u machines registered.\n", machines.size()); 352 353 for (size_t i = 0; i < machines.size(); ++ i) 354 { 355 Bstr name; 356 CHECK_ERROR_BREAK (machines [i], COMGETTER(Name) (name.asOutParam())); 357 printf ("machines[%u]='%s'\n", i, Utf8Str (name).raw()); 358 } 335 359 } 336 360 #endif
Note:
See TracChangeset
for help on using the changeset viewer.