VirtualBox

Ignore:
Timestamp:
Apr 25, 2019 5:11:49 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:7127: Heavy cleanup for UIMediumEnumerator classes: Doxygen, comments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.h

    r78298 r78299  
    3535class UIThreadPool;
    3636
    37 /* Typedefs: */
     37/** A map of CMedium objects ordered by their IDs. */
    3838typedef QMap<QUuid, CMedium> CMediumMap;
    3939
    40 /* Medium-enumerator prototype.
    41  * Manages access to medium information using thread-pool interface. */
     40/** QObject extension operating as medium-enumeration object.
     41  * Manages access to cached UIMedium information via public API.
     42  * Updates cache on corresponding Main events using thread-pool interface. */
    4243class SHARED_LIBRARY_STUFF UIMediumEnumerator : public QIWithRetranslateUI3<QObject>
    4344{
     
    4647signals:
    4748
    48     /* Notifiers: Medium-operations stuff: */
     49    /** Notifies listeners about UIMedium with @a uMediumID created. */
    4950    void sigMediumCreated(const QUuid &uMediumID);
     51    /** Notifies listeners about UIMedium with @a uMediumID deleted. */
    5052    void sigMediumDeleted(const QUuid &uMediumID);
    5153
    52     /* Notifiers: Medium-enumeration stuff: */
     54    /** Notifies listeners about consolidated medium-enumeration process has started. */
    5355    void sigMediumEnumerationStarted();
     56    /** Notifies listeners about UIMedium with @a uMediumID updated. */
    5457    void sigMediumEnumerated(const QUuid &uMediumID);
     58    /** Notifies listeners about consolidated medium-enumeration process has finished. */
    5559    void sigMediumEnumerationFinished();
    5660
     
    6064    UIMediumEnumerator();
    6165
    62     /* API: Medium-access stuff: */
     66    /** Returns cached UIMedium ID list. */
    6367    QList<QUuid> mediumIDs() const;
     68    /** Returns a wrapper of cached UIMedium with specified @a uMediumID. */
    6469    UIMedium medium(const QUuid &uMediumID) const;
     70
     71    /** Creates UIMedium thus caching it internally on the basis of passed @a guiMedium information. */
    6572    void createMedium(const UIMedium &guiMedium);
     73    /** Deletes UIMedium with specified @a uMediumID thus removing it from internal cache. */
    6674    void deleteMedium(const QUuid &uMediumID);
    6775
    68     /* API: Medium-enumeration stuff: */
     76    /** Returns whether consolidated medium-enumeration process is in progress. */
    6977    bool isMediumEnumerationInProgress() const { return m_fMediumEnumerationInProgress; }
     78    /** Makes a request to enumerate specified @a inputMedia.
     79      * @note  Empty list means that full/overall medium-enumeration is requested. */
    7080    void enumerateMedia(const CMediumVector &inputMedia = CMediumVector());
     81    /** Refresh all the lightweight UIMedium information for all the cached UIMedium(s).
     82      * @note  Please note that this is a lightweight version, which doesn't perform
     83      *        heavy state/accessibility checks thus doesn't require to be performed
     84      *        by a worker COM-aware thread. */
    7185    void refreshMedia();
    7286
     
    7892private slots:
    7993
    80     /** Handles machine-data-change and snapshot-change events. */
     94    /** Handles machine-data-change and snapshot-change events for a machine with specified @a uMachineID. */
    8195    void sltHandleMachineUpdate(const QUuid &uMachineID);
    82     /** Handles machine-[un]registration events. */
     96    /** Handles machine-[un]registration events for a machine with specified @a uMachineID.
     97      * @param  fRegistered  Specifies whether the machine was registered or unregistered otherwise. */
    8398    void sltHandleMachineRegistration(const QUuid &uMachineID, const bool fRegistered);
    84     /** Handles snapshot-deleted events. */
     99    /** Handles snapshot-deleted events for a machine with specified @a uMachineID and a snapshot with specified @a uSnapshotID. */
    85100    void sltHandleSnapshotDeleted(const QUuid &uMachineID, const QUuid &uSnapshotID);
    86101
    87     /* Handler: Medium-enumeration stuff: */
     102    /** Handles medium-enumeration @a pTask complete signal. */
    88103    void sltHandleMediumEnumerationTaskComplete(UITask *pTask);
    89104
    90105private:
    91106
    92     /* Helpers: Medium-enumeration stuff: */
     107    /** Creates medium-enumeration task for certain @a guiMedium. */
    93108    void createMediumEnumerationTask(const UIMedium &guiMedium);
     109    /** Adds NULL UIMedium to specified @a outputMedia map. */
    94110    void addNullMediumToMap(UIMediumMap &outputMedia);
     111    /** Adds @a inputMedia to specified @a outputMedia map. */
    95112    void addMediaToMap(const CMediumVector &inputMedia, UIMediumMap &outputMedia);
    96113
    97     /* Helpers: Medium re-caching stuff: */
     114    /** Updates usage for machine with specified @a uMachineID on the basis of cached data.
     115      * @param  previousUIMediumIDs               Brings UIMedium IDs used in cached data.
     116      * @param  fTakeIntoAccountCurrentStateOnly  Brings whether we should take into accound current VM state only. */
    98117    void calculateCachedUsage(const QUuid &uMachineID,
    99118                              QList<QUuid> &previousUIMediumIDs,
    100119                              const bool fTakeIntoAccountCurrentStateOnly) const;
     120    /** Updates usage for machine with specified @a uMachineID on the basis of actual data.
     121      * @param  currentCMediums                   Brings CMedium used in actual data.
     122      * @param  currentCMediumIDs                 Brings CMedium IDs used in actual data.
     123      * @param  fTakeIntoAccountCurrentStateOnly  Brings whether we should take into accound current VM state only. */
    101124    void calculateActualUsage(const QUuid &uMachineID,
    102125                              CMediumMap &currentCMediums,
    103126                              QList<QUuid> &currentCMediumIDs,
    104127                              const bool fTakeIntoAccountCurrentStateOnly) const;
     128    /** Updates usage for machine specified by its @a comSnapshot reference on the basis of actual data.
     129      * @param  currentCMediums                   Brings CMedium used in actual data.
     130      * @param  currentCMediumIDs                 Brings CMedium IDs used in actual data. */
    105131    void calculateActualUsage(const CSnapshot &comSnapshot,
    106132                              CMediumMap &currentCMediums,
    107133                              QList<QUuid> &currentCMediumIDs) const;
     134    /** Updates usage for machine specified by own @a comMachine reference on the basis of actual data.
     135      * @param  currentCMediums                   Brings CMedium used in actual data.
     136      * @param  currentCMediumIDs                 Brings CMedium IDs used in actual data. */
    108137    void calculateActualUsage(const CMachine &comMachine,
    109138                              CMediumMap &currentCMediums,
    110139                              QList<QUuid> &currentCMediumIDs) const;
     140
     141    /** Updates cache using known changes in cached data.
     142      * @param  previousUIMediumIDs               Brings UIMedium IDs used in cached data. */
    111143    void recacheFromCachedUsage(const QList<QUuid> &previousUIMediumIDs);
     144    /** Updates cache using known changes in actual data.
     145      * @param  currentCMediums                   Brings CMedium used in actual data.
     146      * @param  currentCMediumIDs                 Brings CMedium IDs used in actual data. */
    112147    void recacheFromActualUsage(const CMediumMap &currentCMediums,
    113148                                const QList<QUuid> &currentCMediumIDs);
    114149
    115     /* Variables: */
     150    /** Holds whether consolidated medium-enumeration process is in progress. */
    116151    bool  m_fMediumEnumerationInProgress;
     152
     153    /** Holds a set of current medium-enumeration tasks. */
    117154    QSet<UITask*>  m_tasks;
     155
     156    /** Holds a map of current cached (enumerated) media. */
    118157    UIMediumMap  m_media;
    119158};
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