VirtualBox

Changeset 78403 in vbox for trunk/src


Ignore:
Timestamp:
May 6, 2019 6:48:00 PM (6 years ago)
Author:
vboxsync
Message:

Main/MediumImpl.cpp: Move those Medium::*Task::executeTask() stub implementations into the class declaration as that is much much easier to read & trace. Removed code for pure virtual base function. Fixed logging warning from previous commit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/MediumImpl.cpp

    r78401 r78403  
    340340};
    341341
    342 HRESULT Medium::Task::executeTask()
    343 {
    344     return E_NOTIMPL;//ReturnComNotImplemented()
    345 }
    346 
    347342class Medium::CreateBaseTask : public Medium::Task
    348343{
     
    364359
    365360private:
    366     HRESULT executeTask();
     361    HRESULT executeTask()
     362    {
     363        return mMedium->i_taskCreateBaseHandler(*this);
     364    }
    367365};
    368366
     
    403401
    404402private:
    405     HRESULT executeTask();
     403    HRESULT executeTask()
     404    {
     405        return mMedium->i_taskCreateDiffHandler(*this);
     406    }
     407
    406408    AutoCaller mTargetCaller;
    407409    bool mfKeepMediumLockList;
     
    466468
    467469private:
    468     HRESULT executeTask();
     470    HRESULT executeTask()
     471    {
     472        return mMedium->i_taskCloneHandler(*this);
     473    }
     474
    469475    AutoCaller mTargetCaller;
    470476    AutoCaller mParentCaller;
     
    501507
    502508private:
    503     HRESULT executeTask();
     509    HRESULT executeTask()
     510    {
     511        return mMedium->i_taskMoveHandler(*this);
     512    }
     513
    504514    bool mfKeepMediumLockList;
    505515};
     
    530540
    531541private:
    532     HRESULT executeTask();
     542    HRESULT executeTask()
     543    {
     544        return mMedium->i_taskCompactHandler(*this);
     545    }
     546
    533547    bool mfKeepMediumLockList;
    534548};
     
    562576
    563577private:
    564     HRESULT executeTask();
     578    HRESULT executeTask()
     579    {
     580        return mMedium->i_taskResizeHandler(*this);
     581    }
     582
    565583    bool mfKeepMediumLockList;
    566584};
     
    590608
    591609private:
    592     HRESULT executeTask();
     610    HRESULT executeTask()
     611    {
     612        return mMedium->i_taskResetHandler(*this);
     613    }
     614
    593615    bool mfKeepMediumLockList;
    594616};
     
    618640
    619641private:
    620     HRESULT executeTask();
     642    HRESULT executeTask()
     643    {
     644        return mMedium->i_taskDeleteHandler(*this);
     645    }
     646
    621647    bool mfKeepMediumLockList;
    622648};
     
    665691
    666692private:
    667     HRESULT executeTask();
     693    HRESULT executeTask()
     694    {
     695        return mMedium->i_taskMergeHandler(*this);
     696    }
     697
    668698    AutoCaller mTargetCaller;
    669699    AutoCaller mParentForTargetCaller;
     
    732762
    733763private:
    734     HRESULT executeTask();
     764    HRESULT executeTask()
     765    {
     766        return mMedium->i_taskImportHandler(*this);
     767    }
     768
    735769    AutoCaller mParentCaller;
    736770    bool mfKeepTargetMediumLockList;
     
    784818
    785819private:
    786     HRESULT executeTask();
     820    HRESULT executeTask()
     821    {
     822        return mMedium->i_taskEncryptHandler(*this);
     823    }
     824
    787825    AutoCaller mParentCaller;
    788826};
    789827
    790 /**
    791  * Implementation code for the "create base" task.
    792  */
    793 HRESULT Medium::CreateBaseTask::executeTask()
    794 {
    795     return mMedium->i_taskCreateBaseHandler(*this);
    796 }
    797 
    798 /**
    799  * Implementation code for the "create diff" task.
    800  */
    801 HRESULT Medium::CreateDiffTask::executeTask()
    802 {
    803     return mMedium->i_taskCreateDiffHandler(*this);
    804 }
    805 
    806 /**
    807  * Implementation code for the "clone" task.
    808  */
    809 HRESULT Medium::CloneTask::executeTask()
    810 {
    811     return mMedium->i_taskCloneHandler(*this);
    812 }
    813 
    814 /**
    815  * Implementation code for the "move" task.
    816  */
    817 HRESULT Medium::MoveTask::executeTask()
    818 {
    819     return mMedium->i_taskMoveHandler(*this);
    820 }
    821 
    822 /**
    823  * Implementation code for the "compact" task.
    824  */
    825 HRESULT Medium::CompactTask::executeTask()
    826 {
    827     return mMedium->i_taskCompactHandler(*this);
    828 }
    829 
    830 /**
    831  * Implementation code for the "resize" task.
    832  */
    833 HRESULT Medium::ResizeTask::executeTask()
    834 {
    835     return mMedium->i_taskResizeHandler(*this);
    836 }
    837 
    838 
    839 /**
    840  * Implementation code for the "reset" task.
    841  */
    842 HRESULT Medium::ResetTask::executeTask()
    843 {
    844     return mMedium->i_taskResetHandler(*this);
    845 }
    846 
    847 /**
    848  * Implementation code for the "delete" task.
    849  */
    850 HRESULT Medium::DeleteTask::executeTask()
    851 {
    852     return mMedium->i_taskDeleteHandler(*this);
    853 }
    854 
    855 /**
    856  * Implementation code for the "merge" task.
    857  */
    858 HRESULT Medium::MergeTask::executeTask()
    859 {
    860     return mMedium->i_taskMergeHandler(*this);
    861 }
    862 
    863 /**
    864  * Implementation code for the "import" task.
    865  */
    866 HRESULT Medium::ImportTask::executeTask()
    867 {
    868     return mMedium->i_taskImportHandler(*this);
    869 }
    870 
    871 /**
    872  * Implementation code for the "encrypt" task.
    873  */
    874 HRESULT Medium::EncryptTask::executeTask()
    875 {
    876     return mMedium->i_taskEncryptHandler(*this);
    877 }
    878828
    879829////////////////////////////////////////////////////////////////////////////////
     
    96339583        m->pVirtualBox->i_onMediumConfigChanged(this);
    96349584
    9635     LogFlowFunc(("LEAVE: mrc=%Rhrc\n", mrc));
     9585    LogFlowFunc(("LEAVE: mrc=%Rhrc\n", (HRESULT)mrc));
    96369586    return mrc;
    96379587}
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