VirtualBox

Changeset 21622 in vbox


Ignore:
Timestamp:
Jul 15, 2009 7:04:07 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
50147
Message:

Main: cleanup: merge VirtualBoxBase{WithTypedChildren}NEXT onto VirtualBoxBase{WithTypedChildren}, adjust Host and Snapshot implementations according to new parents (new locking scheme)

Location:
trunk/src/VBox/Main
Files:
47 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ApplianceImpl.cpp

    r21612 r21622  
    345345void Appliance::uninit()
    346346{
     347    /* Enclose the state transition Ready->InUninit->NotReady */
     348    AutoUninitSpan autoUninitSpan (this);
     349    if (autoUninitSpan.uninitDone())
     350        return;
     351
    347352    delete m;
    348353    m = NULL;
  • trunk/src/VBox/Main/HostImpl.cpp

    r21492 r21622  
    152152void Host::FinalRelease()
    153153{
    154     if (isReady())
    155         uninit();
     154    uninit();
    156155}
    157156
     
    164163 * @param aParent   VirtualBox parent object.
    165164 */
    166 HRESULT Host::init (VirtualBox *aParent)
    167 {
    168     LogFlowThisFunc (("isReady=%d\n", isReady()));
    169 
    170     ComAssertRet (aParent, E_INVALIDARG);
    171 
    172     AutoWriteLock alock (this);
    173     ComAssertRet (!isReady(), E_FAIL);
     165HRESULT Host::init(VirtualBox *aParent)
     166{
     167    LogFlowThisFunc (("aParent=%p\n", aParent));
     168
     169    /* Enclose the state transition NotReady->InInit->Ready */
     170    AutoInitSpan autoInitSpan (this);
     171    AssertReturn (autoInitSpan.isOk(), E_FAIL);
    174172
    175173    mParent = aParent;
     
    260258#endif /* VBOX_WITH_CROGL */
    261259
    262     setReady(true);
     260    /* Confirm a successful initialization */
     261    autoInitSpan.setSucceeded();
     262
    263263    return S_OK;
    264264}
     
    270270void Host::uninit()
    271271{
    272     LogFlowThisFunc (("isReady=%d\n", isReady()));
    273 
    274     AssertReturn (isReady(), (void) 0);
     272    LogFlowThisFunc (("\n"));
     273
     274    /* Enclose the state transition Ready->InUninit->NotReady */
     275    AutoUninitSpan autoUninitSpan (this);
     276    if (autoUninitSpan.uninitDone())
     277        return;
    275278
    276279#ifdef VBOX_WITH_RESOURCE_USAGE_API
     
    295298    mUSBDeviceFilters.clear();
    296299#endif
    297 
    298     setReady (FALSE);
    299300}
    300301
     
    311312{
    312313    CheckComArgOutSafeArrayPointerValid(aDrives);
     314
     315    AutoCaller autoCaller (this);
     316    CheckComRCReturnRC (autoCaller.rc());
     317
    313318    AutoWriteLock alock (this);
    314     CHECK_READY();
    315     std::list <ComObjPtr <HostDVDDrive> > list;
     319
     320    std::list< ComObjPtr<HostDVDDrive> > list;
    316321    HRESULT rc = S_OK;
    317322    try
     
    439444{
    440445    CheckComArgOutPointerValid(aDrives);
    441     AutoWriteLock alock (this);
    442     CHECK_READY();
    443 
    444     std::list <ComObjPtr <HostFloppyDrive> > list;
     446
     447    AutoCaller autoCaller(this);
     448    CheckComRCReturnRC(autoCaller.rc());
     449
     450    AutoWriteLock alock(this);
     451
     452    std::list<ComObjPtr <HostFloppyDrive> > list;
    445453    HRESULT rc = S_OK;
    446454
     
    554562        return E_POINTER;
    555563
     564    AutoCaller autoCaller (this);
     565    CheckComRCReturnRC (autoCaller.rc());
     566
    556567    AutoWriteLock alock (this);
    557     CHECK_READY();
    558568
    559569    std::list <ComObjPtr <HostNetworkInterface> > list;
     
    833843    CheckComArgOutSafeArrayPointerValid(aUSBDevices);
    834844
     845    AutoCaller autoCaller (this);
     846    CheckComRCReturnRC (autoCaller.rc());
     847
    835848    AutoWriteLock alock (this);
    836     CHECK_READY();
    837849
    838850    MultiResult rc = checkUSBProxyService();
     
    858870    CheckComArgOutSafeArrayPointerValid(aUSBDeviceFilters);
    859871
     872    AutoCaller autoCaller (this);
     873    CheckComRCReturnRC (autoCaller.rc());
     874
    860875    AutoWriteLock alock (this);
    861     CHECK_READY();
    862876
    863877    MultiResult rc = checkUSBProxyService();
     
    889903{
    890904    CheckComArgOutPointerValid(aCount);
    891     AutoWriteLock alock (this);
    892     CHECK_READY();
     905//     AutoCaller autoCaller (this);
     906//     CheckComRCReturnRC (autoCaller.rc());
     907
     908//     AutoReadLock alock (this);
     909
    893910    *aCount = RTMpGetPresentCount();
    894911    return S_OK;
     
    904921{
    905922    CheckComArgOutPointerValid(aCount);
    906     AutoWriteLock alock (this);
    907     CHECK_READY();
     923//     AutoCaller autoCaller (this);
     924//     CheckComRCReturnRC (autoCaller.rc());
     925
     926//     AutoReadLock alock (this);
     927
    908928    *aCount = RTMpGetOnlineCount();
    909929    return S_OK;
     
    920940{
    921941    CheckComArgOutPointerValid(aSpeed);
    922     AutoWriteLock alock (this);
    923     CHECK_READY();
     942//     AutoCaller autoCaller (this);
     943//     CheckComRCReturnRC (autoCaller.rc());
     944
     945//     AutoReadLock alock (this);
     946
    924947    *aSpeed = RTMpGetMaxFrequency(aCpuId);
    925948    return S_OK;
     
    935958{
    936959    CheckComArgOutPointerValid(aDescription);
    937     AutoWriteLock alock (this);
    938     CHECK_READY();
     960//     AutoCaller autoCaller (this);
     961//     CheckComRCReturnRC (autoCaller.rc());
     962
     963//     AutoReadLock alock (this);
     964
    939965    /** @todo */
    940966    ReturnComNotImplemented();
     
    951977{
    952978    CheckComArgOutPointerValid(aSupported);
    953     AutoWriteLock alock (this);
    954     CHECK_READY();
     979    AutoCaller autoCaller (this);
     980    CheckComRCReturnRC (autoCaller.rc());
     981
     982    AutoReadLock alock (this);
    955983
    956984    switch (aFeature)
     
    9831011{
    9841012    CheckComArgOutPointerValid(aSize);
     1013    AutoCaller autoCaller (this);
     1014    CheckComRCReturnRC (autoCaller.rc());
     1015
    9851016    AutoWriteLock alock (this);
    986     CHECK_READY();
     1017
    9871018    /* @todo This is an ugly hack. There must be a function in IPRT for that. */
    9881019    pm::CollectorHAL *hal = pm::createHAL();
     
    10051036{
    10061037    CheckComArgOutPointerValid(aAvailable);
     1038    AutoCaller autoCaller (this);
     1039    CheckComRCReturnRC (autoCaller.rc());
     1040
    10071041    AutoWriteLock alock (this);
    1008     CHECK_READY();
     1042
    10091043    /* @todo This is an ugly hack. There must be a function in IPRT for that. */
    10101044    pm::CollectorHAL *hal = pm::createHAL();
     
    10271061{
    10281062    CheckComArgOutPointerValid(aOs);
    1029     AutoWriteLock alock (this);
    1030     CHECK_READY();
     1063//     AutoCaller autoCaller (this);
     1064//     CheckComRCReturnRC (autoCaller.rc());
     1065
     1066//     AutoReadLock alock (this);
    10311067
    10321068    char szOSName[80];
     
    10471083{
    10481084    CheckComArgOutPointerValid(aVersion);
    1049     AutoWriteLock alock (this);
    1050     CHECK_READY();
     1085//     AutoCaller autoCaller (this);
     1086//     CheckComRCReturnRC (autoCaller.rc());
     1087
     1088//     AutoReadLock alock (this);
    10511089
    10521090    /* Get the OS release. Reserve some buffer space for the service pack. */
     
    10841122{
    10851123    CheckComArgOutPointerValid(aUTCTime);
    1086     AutoWriteLock alock (this);
    1087     CHECK_READY();
     1124//     AutoCaller autoCaller (this);
     1125//     CheckComRCReturnRC (autoCaller.rc());
     1126
     1127//     AutoReadLock alock (this);
     1128
    10881129    RTTIMESPEC now;
    10891130    *aUTCTime = RTTimeSpecGetMilli(RTTimeNow(&now));
     1131
    10901132    return S_OK;
    10911133}
     
    10941136{
    10951137    CheckComArgOutPointerValid(aSupported);
    1096 
    1097     AutoWriteLock alock(this);
    1098     CHECK_READY();
     1138    AutoCaller autoCaller (this);
     1139    CheckComRCReturnRC (autoCaller.rc());
     1140
     1141    AutoReadLock alock (this);
    10991142
    11001143    *aSupported = f3DAccelerationSupported;
     
    11121155    CheckComArgOutPointerValid(aProgress);
    11131156
     1157    AutoCaller autoCaller (this);
     1158    CheckComRCReturnRC (autoCaller.rc());
     1159
    11141160    AutoWriteLock alock (this);
    1115     CHECK_READY();
    11161161
    11171162    int r = NetIfCreateHostOnlyNetworkInterface (mParent, aHostNetworkInterface, aProgress);
     
    11321177    CheckComArgOutPointerValid(aProgress);
    11331178
     1179    AutoCaller autoCaller (this);
     1180    CheckComRCReturnRC (autoCaller.rc());
     1181
    11341182    AutoWriteLock alock (this);
    1135     CHECK_READY();
    11361183
    11371184    /* first check whether an interface with the given name already exists */
     
    11591206    CheckComArgOutPointerValid(aFilter);
    11601207
     1208    AutoCaller autoCaller (this);
     1209    CheckComRCReturnRC (autoCaller.rc());
     1210
    11611211    AutoWriteLock alock (this);
    1162     CHECK_READY();
    11631212
    11641213    ComObjPtr <HostUSBDeviceFilter> filter;
     
    11851234
    11861235    /* Note: HostUSBDeviceFilter and USBProxyService also uses this lock. */
     1236    AutoCaller autoCaller (this);
     1237    CheckComRCReturnRC (autoCaller.rc());
     1238
    11871239    AutoWriteLock alock (this);
    1188     CHECK_READY();
    11891240
    11901241    MultiResult rc = checkUSBProxyService();
     
    12341285
    12351286    /* Note: HostUSBDeviceFilter and USBProxyService also uses this lock. */
     1287    AutoCaller autoCaller (this);
     1288    CheckComRCReturnRC (autoCaller.rc());
     1289
    12361290    AutoWriteLock alock (this);
    1237     CHECK_READY();
    12381291
    12391292    MultiResult rc = checkUSBProxyService();
     
    12911344    using namespace settings;
    12921345
     1346    AutoCaller autoCaller (this);
     1347    CheckComRCReturnRC (autoCaller.rc());
     1348
    12931349    AutoWriteLock alock (this);
    1294     CHECK_READY();
    12951350
    12961351    AssertReturn (!aGlobal.isNull(), E_FAIL);
     
    13531408    using namespace settings;
    13541409
     1410    AutoCaller autoCaller (this);
     1411    CheckComRCReturnRC (autoCaller.rc());
     1412
    13551413    AutoWriteLock alock (this);
    1356     CHECK_READY();
    13571414
    13581415    ComAssertRet (!aGlobal.isNull(), E_FAIL);
     
    14311488                                       BOOL aActiveChanged /* = FALSE */)
    14321489{
     1490    AutoCaller autoCaller (this);
     1491    CheckComRCReturnRC (autoCaller.rc());
     1492
    14331493    AutoWriteLock alock (this);
    1434     CHECK_READY();
    14351494
    14361495    if (aFilter->mInList)
     
    20092068HRESULT Host::checkUSBProxyService()
    20102069{
     2070    AutoCaller autoCaller (this);
     2071    CheckComRCReturnRC (autoCaller.rc());
     2072
    20112073    AutoWriteLock alock (this);
    2012     CHECK_READY();
    20132074
    20142075    AssertReturn (mUSBProxyService, E_FAIL);
  • trunk/src/VBox/Main/MachineImpl.cpp

    r21607 r21622  
    51255125
    51265126        /* initialize the snapshot */
    5127         rc = snapshot->init (uuid, name, description, timeStamp,
    5128                              snapshotMachine, aParentSnapshot);
    5129         CheckComRCReturnRC (rc);
     5127        rc = snapshot->init(mParent, // VirtualBox object
     5128                            uuid,
     5129                            name,
     5130                            description,
     5131                            timeStamp,
     5132                            snapshotMachine,
     5133                            aParentSnapshot);
     5134        CheckComRCReturnRC(rc);
    51305135    }
    51315136
     
    91999204    ComObjPtr <Snapshot> snapshot;
    92009205    snapshot.createObject();
    9201     rc = snapshot->init (snapshotId, aName, aDescription,
    9202                          *RTTimeNow (&time), snapshotMachine,
    9203                          mData->mCurrentSnapshot);
     9206    rc = snapshot->init(mParent,
     9207                        snapshotId,
     9208                        aName,
     9209                        aDescription,
     9210                        *RTTimeNow(&time),
     9211                        snapshotMachine,
     9212                        mData->mCurrentSnapshot);
    92049213    AssertComRCReturnRC (rc);
    92059214
  • trunk/src/VBox/Main/SnapshotImpl.cpp

    r21404 r21622  
    6565 *  @param  aParent        parent snapshot (NULL if no parent)
    6666 */
    67 HRESULT Snapshot::init (const Guid &aId, IN_BSTR aName, IN_BSTR aDescription,
    68                         RTTIMESPEC aTimeStamp, SnapshotMachine *aMachine,
    69                         Snapshot *aParent)
     67HRESULT Snapshot::init(VirtualBox *aVirtualBox,
     68                       const Guid &aId,
     69                       IN_BSTR aName,
     70                       IN_BSTR aDescription,
     71                       RTTIMESPEC aTimeStamp,
     72                       SnapshotMachine *aMachine,
     73                       Snapshot *aParent)
    7074{
    7175    LogFlowMember (("Snapshot::init(aParent=%p)\n", aParent));
     
    7377    ComAssertRet (!aId.isEmpty() && aName && aMachine, E_INVALIDARG);
    7478
    75     AutoWriteLock alock (this);
    76     ComAssertRet (!isReady(), E_FAIL);
     79    /* Enclose the state transition NotReady->InInit->Ready */
     80    AutoInitSpan autoInitSpan (this);
     81    AssertReturn (autoInitSpan.isOk(), E_FAIL);
     82
     83    /* share parent weakly */
     84    unconst (mVirtualBox) = aVirtualBox;
    7785
    7886    mParent = aParent;
     
    8795        aParent->addDependentChild (this);
    8896
    89     setReady (true);
     97    /* Confirm a successful initialization when it's the case */
     98    autoInitSpan.setSucceeded();
    9099
    91100    return S_OK;
     
    101110    LogFlowMember (("Snapshot::uninit()\n"));
    102111
    103     AutoWriteLock alock (this);
    104 
    105     LogFlowMember (("Snapshot::uninit(): isReady=%d\n", isReady()));
    106     if (!isReady())
    107         return;
     112    /* Enclose the state transition Ready->InUninit->NotReady */
     113//     AutoUninitSpan autoUninitSpan (this);         @todo this creates a deadlock, investigate what this does actually
     114//     if (autoUninitSpan.uninitDone())
     115//         return;
    108116
    109117    // uninit all children
    110118    uninitDependentChildren();
    111119
    112     setReady (false);
    113 
    114120    if (mParent)
    115121    {
    116         alock.leave();
    117122        mParent->removeDependentChild (this);
    118         alock.enter();
    119123        mParent.setNull();
    120124    }
     
    134138void Snapshot::discard()
    135139{
    136     LogFlowMember (("Snapshot::discard()\n"));
     140    AutoCaller autoCaller (this);
     141    if (FAILED(autoCaller.rc()))
     142        return;
    137143
    138144    AutoWriteLock alock (this);
    139     AssertReturn (isReady(), (void) 0);
    140145
    141146    {
     
    169174    CheckComArgOutPointerValid(aId);
    170175
    171     AutoWriteLock alock (this);
    172     CHECK_READY();
     176    AutoCaller autoCaller (this);
     177    CheckComRCReturnRC (autoCaller.rc());
     178
     179    AutoReadLock alock (this);
    173180
    174181    mData.mId.toUtf16().cloneTo (aId);
     
    180187    CheckComArgOutPointerValid(aName);
    181188
    182     AutoWriteLock alock (this);
    183     CHECK_READY();
     189    AutoCaller autoCaller (this);
     190    CheckComRCReturnRC (autoCaller.rc());
     191
     192    AutoReadLock alock (this);
    184193
    185194    mData.mName.cloneTo (aName);
     
    195204    CheckComArgNotNull(aName);
    196205
     206    AutoCaller autoCaller (this);
     207    CheckComRCReturnRC (autoCaller.rc());
     208
    197209    AutoWriteLock alock (this);
    198     CHECK_READY();
    199210
    200211    if (mData.mName != aName)
     
    214225    CheckComArgOutPointerValid(aDescription);
    215226
     227    AutoCaller autoCaller (this);
     228    CheckComRCReturnRC (autoCaller.rc());
     229
     230    AutoReadLock alock (this);
     231
     232    mData.mDescription.cloneTo (aDescription);
     233    return S_OK;
     234}
     235
     236STDMETHODIMP Snapshot::COMSETTER(Description) (IN_BSTR aDescription)
     237{
     238    CheckComArgNotNull(aDescription);
     239
     240    AutoCaller autoCaller (this);
     241    CheckComRCReturnRC (autoCaller.rc());
     242
    216243    AutoWriteLock alock (this);
    217     CHECK_READY();
    218 
    219     mData.mDescription.cloneTo (aDescription);
    220     return S_OK;
    221 }
    222 
    223 STDMETHODIMP Snapshot::COMSETTER(Description) (IN_BSTR aDescription)
    224 {
    225     CheckComArgNotNull(aDescription);
    226 
    227     AutoWriteLock alock (this);
    228     CHECK_READY();
    229244
    230245    if (mData.mDescription != aDescription)
     
    244259    CheckComArgOutPointerValid(aTimeStamp);
    245260
    246     AutoWriteLock alock (this);
    247     CHECK_READY();
     261    AutoCaller autoCaller (this);
     262    CheckComRCReturnRC (autoCaller.rc());
     263
     264    AutoReadLock alock (this);
    248265
    249266    *aTimeStamp = RTTimeSpecGetMilli (&mData.mTimeStamp);
     
    255272    CheckComArgOutPointerValid(aOnline);
    256273
    257     AutoWriteLock alock (this);
    258     CHECK_READY();
     274    AutoCaller autoCaller (this);
     275    CheckComRCReturnRC (autoCaller.rc());
     276
     277    AutoReadLock alock (this);
    259278
    260279    *aOnline = !stateFilePath().isNull();
     
    266285    CheckComArgOutPointerValid(aMachine);
    267286
    268     AutoWriteLock alock (this);
    269     CHECK_READY();
     287    AutoCaller autoCaller (this);
     288    CheckComRCReturnRC (autoCaller.rc());
     289
     290    AutoReadLock alock (this);
    270291
    271292    mData.mMachine.queryInterfaceTo (aMachine);
     
    277298    CheckComArgOutPointerValid(aParent);
    278299
    279     AutoWriteLock alock (this);
    280     CHECK_READY();
     300    AutoCaller autoCaller (this);
     301    CheckComRCReturnRC (autoCaller.rc());
     302
     303    AutoReadLock alock (this);
    281304
    282305    mParent.queryInterfaceTo (aParent);
     
    288311    CheckComArgOutSafeArrayPointerValid(aChildren);
    289312
    290     AutoWriteLock alock (this);
    291     CHECK_READY();
    292 
    293     AutoWriteLock chLock (childrenLock ());
     313    AutoCaller autoCaller (this);
     314    CheckComRCReturnRC (autoCaller.rc());
     315
     316    AutoReadLock alock (this);
     317    AutoReadLock chLock (childrenLock ());
    294318
    295319    SafeIfaceArray <ISnapshot> collection (children());
     
    317341ULONG Snapshot::descendantCount()
    318342{
    319     AutoWriteLock alock(this);
    320     AssertReturn (isReady(), 0);
    321 
    322     AutoWriteLock chLock (childrenLock ());
     343    AutoCaller autoCaller (this);
     344    AssertComRC(autoCaller.rc());
     345
     346    AutoReadLock alock (this);
     347
     348    AutoReadLock chLock (childrenLock ());
    323349
    324350    ULONG count = (ULONG)children().size();
     
    337363 *  etc. of this snapshot. This snapshot itself is also included in the search.
    338364 */
    339 ComObjPtr <Snapshot> Snapshot::findChildOrSelf (IN_GUID aId)
     365ComObjPtr<Snapshot> Snapshot::findChildOrSelf (IN_GUID aId)
    340366{
    341367    ComObjPtr <Snapshot> child;
    342368
    343     AutoWriteLock alock (this);
    344     AssertReturn (isReady(), child);
     369    AutoCaller autoCaller (this);
     370    AssertComRC(autoCaller.rc());
     371
     372    AutoReadLock alock (this);
    345373
    346374    if (mData.mId == aId)
     
    369397    AssertReturn (aName, child);
    370398
    371     AutoWriteLock alock (this);
    372     AssertReturn (isReady(), child);
     399    AutoCaller autoCaller (this);
     400    AssertComRC(autoCaller.rc());
     401
     402    AutoReadLock alock (this);
    373403
    374404    if (mData.mName == aName)
     
    405435    AssertReturnVoid (aNewPath);
    406436
     437    AutoCaller autoCaller (this);
     438    AssertComRC(autoCaller.rc());
     439
    407440    AutoWriteLock alock (this);
    408     AssertReturnVoid (isReady());
    409441
    410442    Utf8Str path = mData.mMachine->mSSData->mStateFilePath;
     
    430462}
    431463
    432 /* vi: set tabstop=4 shiftwidth=4 expandtab: */
     464/**
     465    * Returns VirtualBox::mSnapshotsTreeLockHandle(), for convenience. Don't forget
     466    * to follow these locking rules:
     467    *
     468    * 1. The write lock on this handle must be either held alone on the thread
     469    *    or requested *after* the VirtualBox object lock. Mixing with other
     470    *    locks is prohibited.
     471    *
     472    * 2. The read lock on this handle may be intermixed with any other lock
     473    *    with the exception that it must be requested *after* the VirtualBox
     474    *    object lock.
     475    */
     476RWLockHandle* Snapshot::treeLock()
     477{
     478    return mVirtualBox->snapshotTreeLockHandle();
     479}
     480
     481/** Reimplements VirtualBoxWithTypedChildren::childrenLock() to return
     482    *  treeLock(). */
     483RWLockHandle* Snapshot::childrenLock()
     484{
     485    return treeLock();
     486}
     487
     488
  • trunk/src/VBox/Main/USBControllerImpl.cpp

    r20976 r21622  
    317317class ATL_NO_VTABLE USBDeviceFilter :
    318318    public VirtualBoxBaseNEXT,
    319     public VirtualBoxSupportErrorInfoImpl <USBDeviceFilter, IUSBDeviceFilter>,
    320     public VirtualBoxSupportTranslation <USBDeviceFilter>,
     319    public VirtualBoxSupportErrorInfoImpl<USBDeviceFilter, IUSBDeviceFilter>,
     320    public VirtualBoxSupportTranslation<USBDeviceFilter>,
    321321    public IUSBDeviceFilter
    322322{
  • trunk/src/VBox/Main/VirtualBoxBase.cpp

    r17911 r21622  
    11531153 * @note Locks #childrenLock() for reading.
    11541154 */
    1155 VirtualBoxBaseNEXT *
    1156 VirtualBoxBaseWithChildrenNEXT::getDependentChild (const ComPtr <IUnknown> &aUnk)
     1155VirtualBoxBase* VirtualBoxBaseWithChildrenNEXT::getDependentChild(const ComPtr<IUnknown> &aUnk)
    11571156{
    11581157    AssertReturn (!aUnk.isNull(), NULL);
     
    11741173
    11751174/** Helper for addDependentChild(). */
    1176 void VirtualBoxBaseWithChildrenNEXT::doAddDependentChild (
    1177     IUnknown *aUnk, VirtualBoxBaseNEXT *aChild)
     1175void VirtualBoxBaseWithChildrenNEXT::doAddDependentChild(IUnknown *aUnk,
     1176                                                         VirtualBoxBase *aChild)
    11781177{
    11791178    AssertReturnVoid (aUnk != NULL);
  • trunk/src/VBox/Main/include/ApplianceImpl.h

    r21612 r21622  
    3434class ATL_NO_VTABLE Appliance :
    3535    public VirtualBoxBaseWithChildrenNEXT,
    36     public VirtualBoxSupportErrorInfoImpl <Appliance, IAppliance>,
    37     public VirtualBoxSupportTranslation <Appliance>,
     36    public VirtualBoxSupportErrorInfoImpl<Appliance, IAppliance>,
     37    public VirtualBoxSupportTranslation<Appliance>,
    3838    VBOX_SCRIPTABLE_IMPL(IAppliance)
    3939{
     
    142142
    143143class ATL_NO_VTABLE VirtualSystemDescription :
    144     public VirtualBoxBaseWithChildrenNEXT,
    145     public VirtualBoxSupportErrorInfoImpl <VirtualSystemDescription, IVirtualSystemDescription>,
    146     public VirtualBoxSupportTranslation <VirtualSystemDescription>,
     144    public VirtualBoxBaseWithChildren,
     145    public VirtualBoxSupportErrorInfoImpl<VirtualSystemDescription, IVirtualSystemDescription>,
     146    public VirtualBoxSupportTranslation<VirtualSystemDescription>,
    147147    VBOX_SCRIPTABLE_IMPL(IVirtualSystemDescription)
    148148{
  • trunk/src/VBox/Main/include/AudioAdapterImpl.h

    r19239 r21622  
    3030
    3131class ATL_NO_VTABLE AudioAdapter :
    32     public VirtualBoxBaseNEXT,
    33     public VirtualBoxSupportErrorInfoImpl <AudioAdapter, IAudioAdapter>,
    34     public VirtualBoxSupportTranslation <AudioAdapter>,
     32    public VirtualBoxBase,
     33    public VirtualBoxSupportErrorInfoImpl<AudioAdapter, IAudioAdapter>,
     34    public VirtualBoxSupportTranslation<AudioAdapter>,
    3535    VBOX_SCRIPTABLE_IMPL(IAudioAdapter)
    3636{
  • trunk/src/VBox/Main/include/BIOSSettingsImpl.h

    r19239 r21622  
    3131
    3232class ATL_NO_VTABLE BIOSSettings :
    33     public VirtualBoxSupportErrorInfoImpl <BIOSSettings, IBIOSSettings>,
    34     public VirtualBoxSupportTranslation <BIOSSettings>,
    35     public VirtualBoxBaseNEXT,
     33    public VirtualBoxSupportErrorInfoImpl<BIOSSettings, IBIOSSettings>,
     34    public VirtualBoxSupportTranslation<BIOSSettings>,
     35    public VirtualBoxBase,
    3636    VBOX_SCRIPTABLE_IMPL(IBIOSSettings)
    3737{
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r21173 r21622  
    7979class ATL_NO_VTABLE Console :
    8080    public VirtualBoxBaseWithChildrenNEXT,
    81     public VirtualBoxSupportErrorInfoImpl <Console, IConsole>,
    82     public VirtualBoxSupportTranslation <Console>,
     81    public VirtualBoxSupportErrorInfoImpl<Console, IConsole>,
     82    public VirtualBoxSupportTranslation<Console>,
    8383    VBOX_SCRIPTABLE_IMPL(IConsole)
    8484{
  • trunk/src/VBox/Main/include/ConsoleVRDPServer.h

    r19239 r21622  
    233233
    234234class ATL_NO_VTABLE RemoteDisplayInfo :
    235     public VirtualBoxBaseNEXT,
    236     public VirtualBoxSupportErrorInfoImpl <RemoteDisplayInfo, IRemoteDisplayInfo>,
    237     public VirtualBoxSupportTranslation <RemoteDisplayInfo>,
     235    public VirtualBoxBase,
     236    public VirtualBoxSupportErrorInfoImpl<RemoteDisplayInfo, IRemoteDisplayInfo>,
     237    public VirtualBoxSupportTranslation<RemoteDisplayInfo>,
    238238    VBOX_SCRIPTABLE_IMPL(IRemoteDisplayInfo)
    239239{
  • trunk/src/VBox/Main/include/DHCPServerImpl.h

    r19239 r21622  
    3535
    3636class ATL_NO_VTABLE DHCPServer :
    37     public VirtualBoxBaseNEXT,
    38     public VirtualBoxSupportErrorInfoImpl <DHCPServer, IDHCPServer>,
    39     public VirtualBoxSupportTranslation <DHCPServer>,
     37    public VirtualBoxBase,
     38    public VirtualBoxSupportErrorInfoImpl<DHCPServer, IDHCPServer>,
     39    public VirtualBoxSupportTranslation<DHCPServer>,
    4040    VBOX_SCRIPTABLE_IMPL(IDHCPServer)
    4141{
  • trunk/src/VBox/Main/include/DVDDriveImpl.h

    r19239 r21622  
    3232
    3333class ATL_NO_VTABLE DVDDrive :
    34     public VirtualBoxBaseNEXT,
    35     public VirtualBoxSupportErrorInfoImpl <DVDDrive, IDVDDrive>,
    36     public VirtualBoxSupportTranslation <DVDDrive>,
     34    public VirtualBoxBase,
     35    public VirtualBoxSupportErrorInfoImpl<DVDDrive, IDVDDrive>,
     36    public VirtualBoxSupportTranslation<DVDDrive>,
    3737    VBOX_SCRIPTABLE_IMPL(IDVDDrive)
    3838{
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r21227 r21622  
    8383
    8484class ATL_NO_VTABLE Display :
    85     public VirtualBoxBaseNEXT,
     85    public VirtualBoxBase,
    8686    VBOX_SCRIPTABLE_IMPL(IConsoleCallback),
    87     public VirtualBoxSupportErrorInfoImpl <Display, IDisplay>,
    88     public VirtualBoxSupportTranslation <Display>,
     87    public VirtualBoxSupportErrorInfoImpl<Display, IDisplay>,
     88    public VirtualBoxSupportTranslation<Display>,
    8989    VBOX_SCRIPTABLE_IMPL(IDisplay)
    9090{
  • trunk/src/VBox/Main/include/FloppyDriveImpl.h

    r19239 r21622  
    3232
    3333class ATL_NO_VTABLE FloppyDrive :
    34     public VirtualBoxBaseNEXT,
    35     public VirtualBoxSupportErrorInfoImpl <FloppyDrive, IFloppyDrive>,
    36     public VirtualBoxSupportTranslation <FloppyDrive>,
     34    public VirtualBoxBase,
     35    public VirtualBoxSupportErrorInfoImpl<FloppyDrive, IFloppyDrive>,
     36    public VirtualBoxSupportTranslation<FloppyDrive>,
    3737    VBOX_SCRIPTABLE_IMPL(IFloppyDrive)
    3838{
  • trunk/src/VBox/Main/include/FramebufferImpl.h

    r21465 r21622  
    2929
    3030class ATL_NO_VTABLE Framebuffer :
    31     public VirtualBoxBaseNEXT,
    32     public VirtualBoxSupportErrorInfoImpl <Framebuffer, IFramebuffer>,
    33     public VirtualBoxSupportTranslation <Framebuffer>,
     31    public VirtualBoxBase,
     32    public VirtualBoxSupportErrorInfoImpl<Framebuffer, IFramebuffer>,
     33    public VirtualBoxSupportTranslation<Framebuffer>,
    3434    VBOX_SCRIPTABLE_IMPL(IFramebuffer)
    3535{
     
    7676                                   BOOL *aSupported) = 0;
    7777
    78     STDMETHOD(GetVisibleRegion)(BYTE *aRectangles, ULONG aCount, 
    79                                ULONG *aCountCopied) = 0; 
     78    STDMETHOD(GetVisibleRegion)(BYTE *aRectangles, ULONG aCount,
     79                               ULONG *aCountCopied) = 0;
    8080    STDMETHOD(SetVisibleRegion)(BYTE *aRectangles, ULONG aCount) = 0;
    8181
  • trunk/src/VBox/Main/include/GuestImpl.h

    r19239 r21622  
    3131
    3232class ATL_NO_VTABLE Guest :
    33     public VirtualBoxSupportErrorInfoImpl <Guest, IGuest>,
    34     public VirtualBoxSupportTranslation <Guest>,
    35     public VirtualBoxBaseNEXT,
     33    public VirtualBoxSupportErrorInfoImpl<Guest, IGuest>,
     34    public VirtualBoxSupportTranslation<Guest>,
     35    public VirtualBoxBase,
    3636    VBOX_SCRIPTABLE_IMPL(IGuest)
    3737{
  • trunk/src/VBox/Main/include/GuestOSTypeImpl.h

    r21607 r21622  
    2929
    3030class ATL_NO_VTABLE GuestOSType :
    31     public VirtualBoxBaseNEXT,
    32     public VirtualBoxSupportErrorInfoImpl <GuestOSType, IGuestOSType>,
    33     public VirtualBoxSupportTranslation <GuestOSType>,
     31    public VirtualBoxBase,
     32    public VirtualBoxSupportErrorInfoImpl<GuestOSType, IGuestOSType>,
     33    public VirtualBoxSupportTranslation<GuestOSType>,
    3434    VBOX_SCRIPTABLE_IMPL(IGuestOSType)
    3535{
  • trunk/src/VBox/Main/include/HardDiskAttachmentImpl.h

    r19239 r21622  
    2828
    2929class ATL_NO_VTABLE HardDiskAttachment :
    30     public VirtualBoxBaseNEXT,
     30    public VirtualBoxBase,
    3131    public com::SupportErrorInfoImpl<HardDiskAttachment, IHardDiskAttachment>,
    3232    public VirtualBoxSupportTranslation<HardDiskAttachment>,
  • trunk/src/VBox/Main/include/HardDiskFormatImpl.h

    r19239 r21622  
    4343 */
    4444class ATL_NO_VTABLE HardDiskFormat :
    45     public VirtualBoxBaseNEXT,
    46     public VirtualBoxSupportErrorInfoImpl <HardDiskFormat, IHardDiskFormat>,
    47     public VirtualBoxSupportTranslation <HardDiskFormat>,
     45    public VirtualBoxBase,
     46    public VirtualBoxSupportErrorInfoImpl<HardDiskFormat, IHardDiskFormat>,
     47    public VirtualBoxSupportTranslation<HardDiskFormat>,
    4848    VBOX_SCRIPTABLE_IMPL(IHardDiskFormat)
    4949{
  • trunk/src/VBox/Main/include/HardDiskImpl.h

    r20842 r21622  
    4646class ATL_NO_VTABLE HardDisk
    4747    : public com::SupportErrorInfoDerived<MediumBase, HardDisk, IHardDisk>
    48     , public VirtualBoxBaseWithTypedChildrenNEXT<HardDisk>
     48    , public VirtualBoxBaseWithTypedChildren<HardDisk>
    4949    , public VirtualBoxSupportTranslation<HardDisk>
    5050    , VBOX_SCRIPTABLE_IMPL(IHardDisk)
     
    5252public:
    5353
    54     typedef VirtualBoxBaseWithTypedChildrenNEXT <HardDisk>::DependentChildren
    55         List;
     54    typedef VirtualBoxBaseWithTypedChildren<HardDisk>::DependentChildren List;
    5655
    5756    class MergeChain;
  • trunk/src/VBox/Main/include/HostDVDDriveImpl.h

    r19239 r21622  
    2626
    2727class ATL_NO_VTABLE HostDVDDrive :
    28     public VirtualBoxBaseNEXT,
    29     public VirtualBoxSupportErrorInfoImpl <HostDVDDrive, IHostDVDDrive>,
    30     public VirtualBoxSupportTranslation <HostDVDDrive>,
     28    public VirtualBoxBase,
     29    public VirtualBoxSupportErrorInfoImpl<HostDVDDrive, IHostDVDDrive>,
     30    public VirtualBoxSupportTranslation<HostDVDDrive>,
    3131    VBOX_SCRIPTABLE_IMPL(IHostDVDDrive)
    3232{
  • trunk/src/VBox/Main/include/HostFloppyDriveImpl.h

    r19239 r21622  
    2626
    2727class ATL_NO_VTABLE HostFloppyDrive :
    28     public VirtualBoxBaseNEXT,
    29     public VirtualBoxSupportErrorInfoImpl <HostFloppyDrive, IHostFloppyDrive>,
    30     public VirtualBoxSupportTranslation <HostFloppyDrive>,
     28    public VirtualBoxBase,
     29    public VirtualBoxSupportErrorInfoImpl<HostFloppyDrive, IHostFloppyDrive>,
     30    public VirtualBoxSupportTranslation<HostFloppyDrive>,
    3131    VBOX_SCRIPTABLE_IMPL(IHostFloppyDrive)
    3232{
  • trunk/src/VBox/Main/include/HostImpl.h

    r20042 r21622  
    5252class ATL_NO_VTABLE Host :
    5353    public VirtualBoxBaseWithChildren,
    54     public VirtualBoxSupportErrorInfoImpl <Host, IHost>,
    55     public VirtualBoxSupportTranslation <Host>,
     54    public VirtualBoxSupportErrorInfoImpl<Host, IHost>,
     55    public VirtualBoxSupportTranslation<Host>,
    5656    VBOX_SCRIPTABLE_IMPL(IHost)
    5757{
  • trunk/src/VBox/Main/include/HostNetworkInterfaceImpl.h

    r19239 r21622  
    3535
    3636class ATL_NO_VTABLE HostNetworkInterface :
    37     public VirtualBoxBaseNEXT,
    38     public VirtualBoxSupportErrorInfoImpl <HostNetworkInterface, IHostNetworkInterface>,
    39     public VirtualBoxSupportTranslation <HostNetworkInterface>,
     37    public VirtualBoxBase,
     38    public VirtualBoxSupportErrorInfoImpl<HostNetworkInterface, IHostNetworkInterface>,
     39    public VirtualBoxSupportTranslation<HostNetworkInterface>,
    4040    VBOX_SCRIPTABLE_IMPL(IHostNetworkInterface)
    4141{
  • trunk/src/VBox/Main/include/KeyboardImpl.h

    r19239 r21622  
    4848
    4949class ATL_NO_VTABLE Keyboard :
    50     public VirtualBoxBaseNEXT,
    51     public VirtualBoxSupportErrorInfoImpl <Keyboard, IKeyboard>,
    52     public VirtualBoxSupportTranslation <Keyboard>,
     50    public VirtualBoxBase,
     51    public VirtualBoxSupportErrorInfoImpl<Keyboard, IKeyboard>,
     52    public VirtualBoxSupportTranslation<Keyboard>,
    5353    VBOX_SCRIPTABLE_IMPL(IKeyboard)
    5454{
  • trunk/src/VBox/Main/include/MachineDebuggerImpl.h

    r19239 r21622  
    3030
    3131class ATL_NO_VTABLE MachineDebugger :
    32     public VirtualBoxBaseNEXT,
    33     public VirtualBoxSupportErrorInfoImpl <MachineDebugger, IMachineDebugger>,
    34     public VirtualBoxSupportTranslation <MachineDebugger>,
     32    public VirtualBoxBase,
     33    public VirtualBoxSupportErrorInfoImpl<MachineDebugger, IMachineDebugger>,
     34    public VirtualBoxSupportTranslation<MachineDebugger>,
    3535    VBOX_SCRIPTABLE_IMPL(IMachineDebugger)
    3636{
  • trunk/src/VBox/Main/include/MachineImpl.h

    r21446 r21622  
    7878class ATL_NO_VTABLE Machine :
    7979    public VirtualBoxBaseWithChildrenNEXT,
    80     public VirtualBoxSupportErrorInfoImpl <Machine, IMachine>,
    81     public VirtualBoxSupportTranslation <Machine>,
     80    public VirtualBoxSupportErrorInfoImpl<Machine, IMachine>,
     81    public VirtualBoxSupportTranslation<Machine>,
    8282    VBOX_SCRIPTABLE_IMPL(IMachine)
    8383{
     
    873873 */
    874874class ATL_NO_VTABLE SessionMachine :
    875     public VirtualBoxSupportTranslation <SessionMachine>,
     875    public VirtualBoxSupportTranslation<SessionMachine>,
    876876    public Machine,
    877877    VBOX_SCRIPTABLE_IMPL(IInternalMachineControl)
     
    10481048 */
    10491049class ATL_NO_VTABLE SnapshotMachine :
    1050     public VirtualBoxSupportTranslation <SnapshotMachine>,
     1050    public VirtualBoxSupportTranslation<SnapshotMachine>,
    10511051    public Machine
    10521052{
  • trunk/src/VBox/Main/include/MediumImpl.h

    r19239 r21622  
    4747    virtual public VirtualBoxBaseProto,
    4848    public com::SupportErrorInfoBase,
    49     public VirtualBoxSupportTranslation <MediumBase>,
     49    public VirtualBoxSupportTranslation<MediumBase>,
    5050    VBOX_SCRIPTABLE_IMPL(IMedium)
    5151{
     
    212212class ATL_NO_VTABLE ImageMediumBase
    213213    : public MediumBase
    214     , public VirtualBoxBaseNEXT
     214    , public VirtualBoxBase
    215215{
    216216public:
     
    293293 */
    294294class ATL_NO_VTABLE FloppyImage
    295     : public com::SupportErrorInfoDerived <ImageMediumBase, FloppyImage, IFloppyImage>
    296     , public VirtualBoxSupportTranslation <FloppyImage>
     295    : public com::SupportErrorInfoDerived<ImageMediumBase, FloppyImage, IFloppyImage>
     296    , public VirtualBoxSupportTranslation<FloppyImage>
    297297    , VBOX_SCRIPTABLE_IMPL(IFloppyImage)
    298298{
  • trunk/src/VBox/Main/include/MouseImpl.h

    r19614 r21622  
    5050
    5151class ATL_NO_VTABLE Mouse :
    52     public VirtualBoxBaseNEXT,
    53     public VirtualBoxSupportErrorInfoImpl <Mouse, IMouse>,
    54     public VirtualBoxSupportTranslation <Mouse>,
     52    public VirtualBoxBase,
     53    public VirtualBoxSupportErrorInfoImpl<Mouse, IMouse>,
     54    public VirtualBoxSupportTranslation<Mouse>,
    5555    VBOX_SCRIPTABLE_IMPL(IMouse)
    5656{
  • trunk/src/VBox/Main/include/NetworkAdapterImpl.h

    r19239 r21622  
    3131
    3232class ATL_NO_VTABLE NetworkAdapter :
    33     public VirtualBoxBaseNEXT,
    34     public VirtualBoxSupportErrorInfoImpl <NetworkAdapter, INetworkAdapter>,
    35     public VirtualBoxSupportTranslation <NetworkAdapter>,
     33    public VirtualBoxBase,
     34    public VirtualBoxSupportErrorInfoImpl<NetworkAdapter, INetworkAdapter>,
     35    public VirtualBoxSupportTranslation<NetworkAdapter>,
    3636    VBOX_SCRIPTABLE_IMPL(INetworkAdapter)
    3737{
  • trunk/src/VBox/Main/include/ParallelPortImpl.h

    r19239 r21622  
    2929
    3030class ATL_NO_VTABLE ParallelPort :
    31     public VirtualBoxBaseNEXT,
    32     public VirtualBoxSupportErrorInfoImpl <ParallelPort, IParallelPort>,
    33     public VirtualBoxSupportTranslation <ParallelPort>,
     31    public VirtualBoxBase,
     32    public VirtualBoxSupportErrorInfoImpl<ParallelPort, IParallelPort>,
     33    public VirtualBoxSupportTranslation<ParallelPort>,
    3434    VBOX_SCRIPTABLE_IMPL(IParallelPort)
    3535{
  • trunk/src/VBox/Main/include/PerformanceImpl.h

    r21395 r21622  
    5252
    5353class ATL_NO_VTABLE PerformanceMetric :
    54     public VirtualBoxBaseNEXT,
    55     public VirtualBoxSupportTranslation <PerformanceMetric>,
     54    public VirtualBoxBase,
     55    public VirtualBoxSupportTranslation<PerformanceMetric>,
    5656    VBOX_SCRIPTABLE_IMPL(IPerformanceMetric)
    5757{
     
    121121
    122122class ATL_NO_VTABLE PerformanceCollector :
    123     public VirtualBoxBaseNEXT,
    124     public VirtualBoxSupportErrorInfoImpl <PerformanceCollector, IPerformanceCollector>,
    125     public VirtualBoxSupportTranslation <PerformanceCollector>,
     123    public VirtualBoxBase,
     124    public VirtualBoxSupportErrorInfoImpl<PerformanceCollector, IPerformanceCollector>,
     125    public VirtualBoxSupportTranslation<PerformanceCollector>,
    126126    VBOX_SCRIPTABLE_IMPL(IPerformanceCollector)
    127127{
  • trunk/src/VBox/Main/include/ProgressImpl.h

    r20220 r21622  
    4040 */
    4141class ATL_NO_VTABLE ProgressBase :
    42     public VirtualBoxBaseNEXT,
     42    public VirtualBoxBase,
    4343    public com::SupportErrorInfoBase,
    44     public VirtualBoxSupportTranslation <ProgressBase>,
     44    public VirtualBoxSupportTranslation<ProgressBase>,
    4545    VBOX_SCRIPTABLE_IMPL(IProgress)
    4646{
     
    133133 */
    134134class ATL_NO_VTABLE Progress :
    135     public com::SupportErrorInfoDerived <ProgressBase, Progress, IProgress>,
    136     public VirtualBoxSupportTranslation <Progress>
     135    public com::SupportErrorInfoDerived<ProgressBase, Progress, IProgress>,
     136    public VirtualBoxSupportTranslation<Progress>
    137137{
    138138
     
    305305 */
    306306class ATL_NO_VTABLE CombinedProgress :
    307     public com::SupportErrorInfoDerived <ProgressBase, CombinedProgress, IProgress>,
    308     public VirtualBoxSupportTranslation <CombinedProgress>
     307    public com::SupportErrorInfoDerived<ProgressBase, CombinedProgress, IProgress>,
     308    public VirtualBoxSupportTranslation<CombinedProgress>
    309309{
    310310
  • trunk/src/VBox/Main/include/RemoteUSBDeviceImpl.h

    r19239 r21622  
    3232
    3333class ATL_NO_VTABLE RemoteUSBDevice :
    34     public VirtualBoxBaseNEXT,
    35     public VirtualBoxSupportErrorInfoImpl <RemoteUSBDevice, IHostUSBDevice>,
    36     public VirtualBoxSupportTranslation <RemoteUSBDevice>,
     34    public VirtualBoxBase,
     35    public VirtualBoxSupportErrorInfoImpl<RemoteUSBDevice, IHostUSBDevice>,
     36    public VirtualBoxSupportTranslation<RemoteUSBDevice>,
    3737    VBOX_SCRIPTABLE_IMPL(IHostUSBDevice)
    3838{
  • trunk/src/VBox/Main/include/SerialPortImpl.h

    r21607 r21622  
    3131
    3232class ATL_NO_VTABLE SerialPort :
    33     public VirtualBoxBaseNEXT,
    34     public VirtualBoxSupportErrorInfoImpl <SerialPort, ISerialPort>,
    35     public VirtualBoxSupportTranslation <SerialPort>,
     33    public VirtualBoxBase,
     34    public VirtualBoxSupportErrorInfoImpl<SerialPort, ISerialPort>,
     35    public VirtualBoxSupportTranslation<SerialPort>,
    3636    VBOX_SCRIPTABLE_IMPL(ISerialPort)
    3737{
  • trunk/src/VBox/Main/include/SessionImpl.h

    r21520 r21622  
    4242
    4343class ATL_NO_VTABLE Session :
    44     public VirtualBoxBaseNEXT,
    45     public VirtualBoxSupportErrorInfoImpl <Session, ISession>,
    46     public VirtualBoxSupportTranslation <Session>,
     44    public VirtualBoxBase,
     45    public VirtualBoxSupportErrorInfoImpl<Session, ISession>,
     46    public VirtualBoxSupportTranslation<Session>,
    4747    VBOX_SCRIPTABLE_IMPL(ISession),
    4848    VBOX_SCRIPTABLE_IMPL(IInternalSessionControl)
     
    6262    BEGIN_COM_MAP(Session)
    6363        COM_INTERFACE_ENTRY2(IDispatch, ISession)
    64         COM_INTERFACE_ENTRY2(IDispatch, IInternalSessionControl)       
     64        COM_INTERFACE_ENTRY2(IDispatch, IInternalSessionControl)
    6565        COM_INTERFACE_ENTRY(IInternalSessionControl)
    6666        COM_INTERFACE_ENTRY(ISupportErrorInfo)
  • trunk/src/VBox/Main/include/SharedFolderImpl.h

    r19239 r21622  
    3131
    3232class ATL_NO_VTABLE SharedFolder :
    33     public VirtualBoxBaseNEXT,
    34     public VirtualBoxSupportErrorInfoImpl <SharedFolder, ISharedFolder>,
    35     public VirtualBoxSupportTranslation <SharedFolder>,
     33    public VirtualBoxBase,
     34    public VirtualBoxSupportErrorInfoImpl<SharedFolder, ISharedFolder>,
     35    public VirtualBoxSupportTranslation<SharedFolder>,
    3636    VBOX_SCRIPTABLE_IMPL(ISharedFolder)
    3737{
  • trunk/src/VBox/Main/include/SnapshotImpl.h

    r19239 r21622  
    3030
    3131class SnapshotMachine;
     32class VirtualBox;
    3233
    3334class ATL_NO_VTABLE Snapshot :
    34     public VirtualBoxSupportErrorInfoImpl <Snapshot, ISnapshot>,
    35     public VirtualBoxSupportTranslation <Snapshot>,
    36     public VirtualBoxBaseWithTypedChildren <Snapshot>,
     35    public VirtualBoxSupportErrorInfoImpl<Snapshot, ISnapshot>,
     36    public VirtualBoxSupportTranslation<Snapshot>,
     37    public VirtualBoxBaseWithTypedChildren<Snapshot>,
    3738    VBOX_SCRIPTABLE_IMPL(ISnapshot)
    3839{
     
    5152    };
    5253
    53     typedef VirtualBoxBaseWithTypedChildren <Snapshot>::DependentChildren
    54         SnapshotList;
     54    typedef VirtualBoxBaseWithTypedChildren<Snapshot>::DependentChildren SnapshotList;
    5555
    5656    DECLARE_NOT_AGGREGATABLE(Snapshot)
     
    6666    NS_DECL_ISUPPORTS
    6767
     68    Snapshot()
     69    { };
     70    ~Snapshot()
     71    { };
     72
    6873    HRESULT FinalConstruct();
    6974    void FinalRelease();
    7075
    7176    // public initializer/uninitializer only for internal purposes
    72     HRESULT init (const Guid &aId, IN_BSTR aName, IN_BSTR aDescription,
    73                   RTTIMESPEC aTimeStamp, SnapshotMachine *aMachine,
    74                   Snapshot *aParent);
     77    HRESULT init(VirtualBox *aVirtualBox,
     78                 const Guid &aId,
     79                 IN_BSTR aName,
     80                 IN_BSTR aDescription,
     81                 RTTIMESPEC aTimeStamp,
     82                 SnapshotMachine *aMachine,
     83                 Snapshot *aParent);
    7584    void uninit();
    7685
     
    100109    ComObjPtr <Snapshot> parent() const { return (Snapshot *) mParent; }
    101110
    102     /** Shortcut to #dependentChildrenLock() */
    103     RWLockHandle *childrenLock() const { return dependentChildrenLock(); }
    104 
    105111    /**
    106112     *  Shortcut to #dependentChildren().
     
    118124    static const wchar_t *getComponentName() { return L"Snapshot"; }
    119125
     126    RWLockHandle *treeLock();
     127    RWLockHandle *childrenLock();
     128
    120129private:
    121130
    122     ComObjPtr <Snapshot, ComWeakRef> mParent;
     131    /** weak VirtualBox parent */
     132    const ComObjPtr<VirtualBox, ComWeakRef> mVirtualBox;
     133
     134    ComObjPtr<Snapshot, ComWeakRef> mParent;
    123135
    124136    Data mData;
  • trunk/src/VBox/Main/include/StorageControllerImpl.h

    r19239 r21622  
    3333class ATL_NO_VTABLE StorageController :
    3434    public VirtualBoxBaseWithChildrenNEXT,
    35     public VirtualBoxSupportErrorInfoImpl <StorageController, IStorageController>,
    36     public VirtualBoxSupportTranslation <StorageController>,
     35    public VirtualBoxSupportErrorInfoImpl<StorageController, IStorageController>,
     36    public VirtualBoxSupportTranslation<StorageController>,
    3737    VBOX_SCRIPTABLE_IMPL(IStorageController)
    3838{
  • trunk/src/VBox/Main/include/SystemPropertiesImpl.h

    r21446 r21622  
    3535
    3636class ATL_NO_VTABLE SystemProperties :
    37     public VirtualBoxBaseNEXT,
    38     public VirtualBoxSupportErrorInfoImpl <SystemProperties, ISystemProperties>,
    39     public VirtualBoxSupportTranslation <SystemProperties>,
     37    public VirtualBoxBase,
     38    public VirtualBoxSupportErrorInfoImpl<SystemProperties, ISystemProperties>,
     39    public VirtualBoxSupportTranslation<SystemProperties>,
    4040    VBOX_SCRIPTABLE_IMPL(ISystemProperties)
    4141{
  • trunk/src/VBox/Main/include/USBControllerImpl.h

    r19239 r21622  
    4444class ATL_NO_VTABLE USBController :
    4545    public VirtualBoxBaseWithChildrenNEXT,
    46     public VirtualBoxSupportErrorInfoImpl <USBController, IUSBController>,
    47     public VirtualBoxSupportTranslation <USBController>,
     46    public VirtualBoxSupportErrorInfoImpl<USBController, IUSBController>,
     47    public VirtualBoxSupportTranslation<USBController>,
    4848    VBOX_SCRIPTABLE_IMPL(IUSBController)
    4949{
  • trunk/src/VBox/Main/include/USBDeviceImpl.h

    r19239 r21622  
    3333 */
    3434class ATL_NO_VTABLE OUSBDevice :
    35     public VirtualBoxBaseNEXT,
     35    public VirtualBoxBase,
    3636    public VirtualBoxSupportErrorInfoImpl<OUSBDevice, IUSBDevice>,
    3737    public VirtualBoxSupportTranslation<OUSBDevice>,
  • trunk/src/VBox/Main/include/VFSExplorerImpl.h

    r20963 r21622  
    3030
    3131class ATL_NO_VTABLE VFSExplorer :
    32     public VirtualBoxBaseNEXT,
    33     public VirtualBoxSupportErrorInfoImpl <VFSExplorer, IVFSExplorer>,
    34     public VirtualBoxSupportTranslation <VFSExplorer>,
     32    public VirtualBoxBase,
     33    public VirtualBoxSupportErrorInfoImpl<VFSExplorer, IVFSExplorer>,
     34    public VirtualBoxSupportTranslation<VFSExplorer>,
    3535    VBOX_SCRIPTABLE_IMPL(IVFSExplorer)
    3636{
  • trunk/src/VBox/Main/include/VRDPServerImpl.h

    r19239 r21622  
    3232
    3333class ATL_NO_VTABLE VRDPServer :
    34     public VirtualBoxBaseNEXT,
    35     public VirtualBoxSupportErrorInfoImpl <VRDPServer, IVRDPServer>,
    36     public VirtualBoxSupportTranslation <VRDPServer>,
     34    public VirtualBoxBase,
     35    public VirtualBoxSupportErrorInfoImpl<VRDPServer, IVRDPServer>,
     36    public VirtualBoxSupportTranslation<VRDPServer>,
    3737    VBOX_SCRIPTABLE_IMPL(IVRDPServer)
    3838{
  • trunk/src/VBox/Main/include/VirtualBoxBase.h

    r20964 r21622  
    466466////////////////////////////////////////////////////////////////////////////////
    467467
    468 /// @todo (dmik) remove after we switch to VirtualBoxBaseNEXT completely
    469 /**
    470  *  Checks whether this object is ready or not. Objects are typically ready
    471  *  after they are successfully created by their parent objects and become
    472  *  not ready when the respective parent itself becomes not ready or gets
    473  *  destroyed while a reference to the child is still held by the caller
    474  *  (which prevents it from destruction).
    475  *
    476  *  When this object is not ready, the macro sets error info and returns
    477  *  E_ACCESSDENIED (the translatable error message is defined in null context).
    478  *  Otherwise, the macro does nothing.
    479  *
    480  *  This macro <b>must</b> be used at the beginning of all interface methods
    481  *  (right after entering the class lock) in classes derived from both
    482  *  VirtualBoxBase and VirtualBoxSupportErrorInfoImpl.
    483  */
    484 #define CHECK_READY() \
    485     do { \
    486         if (!isReady()) \
    487             return setError (E_ACCESSDENIED, tr ("The object is not ready")); \
    488     } while (0)
    489 
    490468/**
    491469 *  Declares an empty constructor and destructor for the given class.
     
    12401218////////////////////////////////////////////////////////////////////////////////
    12411219
    1242 /// @todo (dmik) remove after we switch to VirtualBoxBaseNEXT completely
    12431220class ATL_NO_VTABLE VirtualBoxBase
    12441221    : virtual public VirtualBoxBaseProto
     
    12521229public:
    12531230    VirtualBoxBase()
    1254     {
    1255         mReady = false;
    1256     }
     1231    {}
     1232
    12571233    virtual ~VirtualBoxBase()
    1258     {
    1259     }
     1234    {}
    12601235
    12611236    /**
     
    12661241     *  method's implementation must call setReady (false),
    12671242     */
    1268     virtual void uninit() {}
    1269 
    1270 
    1271     // sets the ready state of the object
    1272     void setReady(bool isReady)
    1273     {
    1274         mReady = isReady;
    1275     }
    1276     // get the ready state of the object
    1277     bool isReady()
    1278     {
    1279         return mReady;
    1280     }
     1243    virtual void uninit()
     1244    {}
    12811245
    12821246    static const char *translate (const char *context, const char *sourceText,
    12831247                                  const char *comment = 0);
    1284 
    1285 private:
    1286 
    1287     // flag determining whether an object is ready
    1288     // for usage, i.e. methods may be called
    1289     bool mReady;
    1290     // mutex semaphore to lock the object
    1291 };
    1292 
    1293 /**
    1294  *  Temporary class to disable deprecated methods of VirtualBoxBase.
    1295  *  Can be used as a base for components that are completely switched to
    1296  *  the new locking scheme (VirtualBoxBaseProto).
    1297  *
    1298  *  @todo remove after we switch to VirtualBoxBaseNEXT completely.
    1299  */
    1300 class VirtualBoxBaseNEXT : public VirtualBoxBase
    1301 {
    1302 private:
    1303 
    1304     void lock();
    1305     void unlock();
    1306     void setReady (bool isReady);
    1307     bool isReady();
    13081248};
    13091249
     
    13831323
    13841324template <class C>
    1385 const char *VirtualBoxSupportTranslation <C>::sClassName = NULL;
     1325const char *VirtualBoxSupportTranslation<C>::sClassName = NULL;
    13861326
    13871327/**
     
    13981338                                  const char *aComment = NULL) \
    13991339    { \
    1400         return VirtualBoxSupportTranslation <C>::tr (aSourceText, aComment); \
     1340        return VirtualBoxSupportTranslation<C>::tr (aSourceText, aComment); \
    14011341    }
    14021342
     
    20832023 *       has gone.
    20842024 */
    2085 class VirtualBoxBaseWithChildrenNEXT : public VirtualBoxBaseNEXT
     2025class VirtualBoxBaseWithChildrenNEXT : public VirtualBoxBase
    20862026{
    20872027public:
     
    21912131    void uninitDependentChildren();
    21922132
    2193     VirtualBoxBaseNEXT *getDependentChild (const ComPtr <IUnknown> &aUnk);
     2133    VirtualBoxBase *getDependentChild(const ComPtr <IUnknown> &aUnk);
    21942134
    21952135private:
    2196 
    2197     /// @todo temporarily reinterpret VirtualBoxBase * as VirtualBoxBaseNEXT *
    2198     //  until ported HardDisk and Progress to the new scheme.
    2199     void doAddDependentChild (IUnknown *aUnk, VirtualBoxBase *aChild)
    2200     {
    2201         doAddDependentChild (aUnk,
    2202                              reinterpret_cast <VirtualBoxBaseNEXT *> (aChild));
    2203     }
    2204 
    2205     void doAddDependentChild (IUnknown *aUnk, VirtualBoxBaseNEXT *aChild);
     2136    void doAddDependentChild(IUnknown *aUnk, VirtualBoxBase *aChild);
    22062137    void doRemoveDependentChild (IUnknown *aUnk);
    22072138
    2208     typedef std::map <IUnknown *, VirtualBoxBaseNEXT *> DependentChildren;
     2139    typedef std::map<IUnknown*, VirtualBoxBase*> DependentChildren;
    22092140    DependentChildren mDependentChildren;
    22102141};
    22112142
    22122143////////////////////////////////////////////////////////////////////////////////
    2213 
    2214 /**
    2215  *  Base class to track component's children of some particular type.
    2216  *
    2217  *  This class is similar to VirtualBoxBaseWithChildren, with the exception
    2218  *  that all children must be of the same type. For this reason, it's not
    2219  *  necessary to use a map to store children, so a list is used instead.
    2220  *
    2221  *  As opposed to VirtualBoxBaseWithChildren, children added by
    2222  *  #addDependentChild() are <b>strongly</b> referenced, so that they cannot
    2223  *  be externally destructed until #removeDependentChild() is called.
    2224  *
    2225  *  Also, this class doesn't have the
    2226  *  VirtualBoxBaseWithChildrenNEXT::getDependentChild() method because it would
    2227  *  be not fast for long lists.
    2228  *
    2229  *  @param C    type of child objects (must inherit VirtualBoxBase AND
    2230  *              implement some interface)
    2231  *
    2232  *  @deprecated Use VirtualBoxBaseWithTypedChildrenNEXT for new classes.
    2233  */
    2234 template <class C>
    2235 class VirtualBoxBaseWithTypedChildren : public VirtualBoxBase
    2236 {
    2237 public:
    2238 
    2239     typedef std::list <ComObjPtr <C> > DependentChildren;
    2240 
    2241     VirtualBoxBaseWithTypedChildren() : mInUninit (false) {}
    2242 
    2243     virtual ~VirtualBoxBaseWithTypedChildren() {}
    2244 
    2245     /**
    2246      *  Adds the given child to the list of dependent children.
    2247      *  Must be called from the child's init() method,
    2248      *  from under the child's lock.
    2249      *
    2250      *  @param C    the child object to add (must inherit VirtualBoxBase AND
    2251      *              implement some interface)
    2252      */
    2253     void addDependentChild (C *child)
    2254     {
    2255         AssertReturn (child, (void) 0);
    2256 
    2257         AutoWriteLock alock (mMapLock);
    2258         if (mInUninit)
    2259             return;
    2260 
    2261         mDependentChildren.push_back (child);
    2262     }
    2263 
    2264     /**
    2265      *  Removes the given child from the list of dependent children.
    2266      *  Must be called from the child's uninit() method,
    2267      *  under the child's lock.
    2268      *
    2269      *  @param C    the child object to remove (must inherit VirtualBoxBase AND
    2270      *              implement some interface)
    2271      */
    2272     void removeDependentChild (C *child)
    2273     {
    2274         AssertReturn (child, (void) 0);
    2275 
    2276         AutoWriteLock alock (mMapLock);
    2277         if (mInUninit)
    2278             return;
    2279 
    2280         mDependentChildren.remove (child);
    2281     }
    2282 
    2283 protected:
    2284 
    2285     /**
    2286      *  Returns an internal lock handle to lock the list of children
    2287      *  returned by #dependentChildren() using AutoReadLock/AutoWriteLock:
    2288      *  <code>
    2289      *      AutoReadLock alock (dependentChildrenLock());
    2290      *  </code>
    2291      *
    2292      *  This is necessary for example to access the list of children returned by
    2293      *  #dependentChildren().
    2294      */
    2295     RWLockHandle *dependentChildrenLock() const { return &mMapLock; }
    2296 
    2297     /**
    2298      *  Returns the read-only list of all dependent children.
    2299      *  @note
    2300      *      Access the returned list (iterate, get size etc.) only after
    2301      *      doing |AutoWriteLock alock (dependentChildrenLock());|!
    2302      */
    2303     const DependentChildren &dependentChildren() const { return mDependentChildren; }
    2304 
    2305     /**
    2306      *  Uninitializes all dependent children registered with #addDependentChild().
    2307      *
    2308      *  @note
    2309      *      This method will call uninit() methods of children. If these methods
    2310      *      access the parent object, uninitDependentChildren() must be called
    2311      *      either at the beginning of the parent uninitialization sequence (when
    2312      *      it is still operational) or after setReady(false) is called to
    2313      *      indicate the parent is out of action.
    2314      */
    2315     void uninitDependentChildren()
    2316     {
    2317         AutoWriteLock alock (this);
    2318         AutoWriteLock mapLock (mMapLock);
    2319 
    2320         if (mDependentChildren.size())
    2321         {
    2322             // set flag to ignore #removeDependentChild() called from child->uninit()
    2323             mInUninit = true;
    2324 
    2325             // leave the locks to let children waiting for #removeDependentChild() run
    2326             mapLock.leave();
    2327             alock.leave();
    2328 
    2329             for (typename DependentChildren::iterator it = mDependentChildren.begin();
    2330                 it != mDependentChildren.end(); ++ it)
    2331             {
    2332                 C *child = (*it);
    2333                 Assert (child);
    2334                 if (child)
    2335                     child->uninit();
    2336             }
    2337             mDependentChildren.clear();
    2338 
    2339             alock.enter();
    2340             mapLock.enter();
    2341 
    2342             mInUninit = false;
    2343         }
    2344     }
    2345 
    2346     /**
    2347      *  Removes (detaches) all dependent children registered with
    2348      *  #addDependentChild(), without uninitializing them.
    2349      *
    2350      *  @note This method must be called from under the main object's lock
    2351      */
    2352     void removeDependentChildren()
    2353     {
    2354         AutoWriteLock alock (mMapLock);
    2355         mDependentChildren.clear();
    2356     }
    2357 
    2358 private:
    2359 
    2360     DependentChildren mDependentChildren;
    2361 
    2362     bool mInUninit;
    2363     mutable RWLockHandle mMapLock;
    2364 };
    23652144
    23662145////////////////////////////////////////////////////////////////////////////////
     
    23922171 */
    23932172template <class C>
    2394 class VirtualBoxBaseWithTypedChildrenNEXT : public VirtualBoxBaseNEXT
     2173class VirtualBoxBaseWithTypedChildren : public VirtualBoxBase
    23952174{
    23962175public:
     
    23982177    typedef std::list <ComObjPtr <C> > DependentChildren;
    23992178
    2400     VirtualBoxBaseWithTypedChildrenNEXT() {}
    2401 
    2402     virtual ~VirtualBoxBaseWithTypedChildrenNEXT() {}
     2179    VirtualBoxBaseWithTypedChildren()
     2180    {}
     2181
     2182    virtual ~VirtualBoxBaseWithTypedChildren()
     2183    {}
    24032184
    24042185    /**
  • trunk/src/VBox/Main/include/VirtualBoxImpl.h

    r21520 r21622  
    6464class ATL_NO_VTABLE VirtualBox :
    6565    public VirtualBoxBaseWithChildrenNEXT,
    66     public VirtualBoxSupportErrorInfoImpl <VirtualBox, IVirtualBox>,
    67     public VirtualBoxSupportTranslation <VirtualBox>,
     66    public VirtualBoxSupportErrorInfoImpl<VirtualBox, IVirtualBox>,
     67    public VirtualBoxSupportTranslation<VirtualBox>,
    6868    VBOX_SCRIPTABLE_IMPL(IVirtualBox)
    6969#ifdef RT_OS_WINDOWS
     
    359359    RWLockHandle *hardDiskTreeLockHandle() { return &mHardDiskTreeLockHandle; }
    360360
     361    RWLockHandle *snapshotTreeLockHandle() { return &mSnapshotTreeLockHandle; }
     362
    361363    /* for VirtualBoxSupportErrorInfoImpl */
    362364    static const wchar_t *getComponentName() { return L"VirtualBox"; }
     
    507509    RWLockHandle mHardDiskTreeLockHandle;
    508510    RWLockHandle mChildrenMapLockHandle;
     511    RWLockHandle mSnapshotTreeLockHandle;
    509512
    510513    static Bstr sVersion;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette