VirtualBox

Changeset 66126 in vbox for trunk/src/VBox/Main/include


Ignore:
Timestamp:
Mar 16, 2017 2:06:27 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
114027
Message:

Main/Machine+Snapshot+Appliance+StorageController: eliminate the one-member struct MediaData, as a preparation for later eliminating the Backupable<> template use in combination with anything containing a ComObjPtr (since these are not handled in a sensible way when creating a session or a snapshot anyway, needing more effort to fix than do right from the beginning). Additionally a lot of iterator loop cleanups, making proper use of scoping and const_iterator whenever possible. Also take the opportunity to improve the readability of some quite long lines. No behavior change intended.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/MachineImpl.h

    r65158 r66126  
    55
    66/*
    7  * Copyright (C) 2006-2016 Oracle Corporation
     7 * Copyright (C) 2006-2017 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    235235     *
    236236     *  SessionMachine instances can alter this data and discard changes.
     237     *
     238     *  @todo r=klaus move all "pointer" objects out of this struct, as they
     239     *  need non-obvious handling when creating a new session or when taking
     240     *  a snapshot. Better do this right straight away, not relying on the
     241     *  template magic which doesn't work right in this case.
    237242     */
    238243    struct HWData
     
    327332    };
    328333
    329     /**
    330      *  Hard disk and other media data.
    331      *
    332      *  The usage policy is the same as for HWData, but a separate structure
    333      *  is necessary because hard disk data requires different procedures when
    334      *  taking or deleting snapshots, etc.
    335      *
    336      *  The data variable is |mMediaData|.
    337      */
    338     struct MediaData
    339     {
    340         MediaData();
    341         ~MediaData();
    342 
    343         typedef std::list<ComObjPtr<MediumAttachment> > AttachmentList;
    344         AttachmentList mAttachments;
    345     };
     334    typedef std::list<ComObjPtr<MediumAttachment> > MediumAttachmentList;
    346335
    347336    DECLARE_EMPTY_CTOR_DTOR(Machine)
     
    601590
    602591    HRESULT i_getMediumAttachmentsOfController(const Utf8Str &aName,
    603                                                MediaData::AttachmentList &aAttachments);
     592                                               MediumAttachmentList &aAttachments);
    604593
    605594    HRESULT i_getUSBControllerByName(const Utf8Str &aName,
     
    694683    HRESULT i_deleteImplicitDiffs(bool aOnline);
    695684
    696     MediumAttachment* i_findAttachment(const MediaData::AttachmentList &ll,
     685    MediumAttachment* i_findAttachment(const MediumAttachmentList &ll,
    697686                                       const Utf8Str &aControllerName,
    698687                                       LONG aControllerPort,
    699688                                       LONG aDevice);
    700     MediumAttachment* i_findAttachment(const MediaData::AttachmentList &ll,
     689    MediumAttachment* i_findAttachment(const MediumAttachmentList &ll,
    701690                                       ComObjPtr<Medium> pMedium);
    702     MediumAttachment* i_findAttachment(const MediaData::AttachmentList &ll,
     691    MediumAttachment* i_findAttachment(const MediumAttachmentList &ll,
    703692                                       Guid &id);
    704693
     
    762751    Backupable<UserData>    mUserData;
    763752    Backupable<HWData>      mHWData;
    764     Backupable<MediaData>   mMediaData;
     753
     754    /**
     755     * Hard disk and other media data.
     756     *
     757     * The usage policy is the same as for mHWData, but a separate field
     758     * is necessary because hard disk data requires different procedures when
     759     * taking or deleting snapshots, etc.
     760     *
     761     * @todo r=klaus change this to a regular list and use the normal way to
     762     * handle the settings when creating a session or taking a snapshot.
     763     * Same thing applies to mStorageControllers and mUSBControllers.
     764     */
     765    Backupable<MediumAttachmentList> mMediumAttachments;
    765766
    766767    // the following fields need special backup/rollback/commit handling,
Note: See TracChangeset for help on using the changeset viewer.

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