VirtualBox

Changeset 30760 in vbox


Ignore:
Timestamp:
Jul 9, 2010 1:12:04 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
63543
Message:

Main: separate internal machine data structs into MachineImplPrivate.h to significantly speed up compilation and for better interface separation; remove obsolete ConsoleEvents.h file

Location:
trunk
Files:
1 deleted
51 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/settings.h

    r29873 r30760  
    841841public:
    842842    com::Guid               uuid;
     843
     844    com::Utf8Str            strStateFile;
     845    com::Guid               uuidCurrentSnapshot;
     846
    843847    com::Utf8Str            strName;
    844848    bool                    fNameSync;
    845849    com::Utf8Str            strDescription;
    846850    com::Utf8Str            strOsType;
    847     com::Utf8Str            strStateFile;
    848     com::Guid               uuidCurrentSnapshot;
    849851    com::Utf8Str            strSnapshotFolder;
    850852    bool                    fTeleporterEnabled;
  • trunk/src/VBox/Frontends/VBoxBFE/Makefile.kmk

    r28800 r30760  
    2424#
    2525VBOXBFE_MAIN_CPP = MouseImpl.cpp
    26 VBOXBFE_MAIN_H   = MouseImpl.h ConsoleEvents.h
     26VBOXBFE_MAIN_H   = MouseImpl.h
    2727
    2828#
  • trunk/src/VBox/Main/ApplianceImpl.cpp

    r30716 r30760  
    2020#include <iprt/cpp/utils.h>
    2121
    22 #include <VBox/com/array.h>
    23 
    24 #include "ApplianceImpl.h"
    2522#include "VFSExplorerImpl.h"
    2623#include "VirtualBoxImpl.h"
     
    2926#include "MachineImpl.h"
    3027
     28#include "ApplianceImplPrivate.h"
     29
    3130#include "AutoCaller.h"
    3231#include "Logging.h"
    3332
    34 #include "ApplianceImplPrivate.h"
     33#include "VBox/settings.h"
     34
     35#include <VBox/com/array.h>
    3536
    3637using namespace std;
  • trunk/src/VBox/Main/ApplianceImplExport.cpp

    r30746 r30760  
    1717 */
    1818
     19#include <iprt/file.h>
    1920#include <iprt/path.h>
    2021#include <iprt/dir.h>
     
    2324#include <iprt/manifest.h>
    2425
    25 #include <VBox/version.h>
    26 
    27 #include "ApplianceImpl.h"
     26#include "AudioAdapterImpl.h"
    2827#include "VirtualBoxImpl.h"
    29 
    3028#include "ProgressImpl.h"
    31 #include "MachineImpl.h"
     29#include "MachineImplPrivate.h"
     30#include "MediumAttachmentImpl.h"
     31
     32#include "ApplianceImplPrivate.h"
    3233
    3334#include "AutoCaller.h"
    3435#include "Logging.h"
    3536
    36 #include "ApplianceImplPrivate.h"
     37#include <VBox/version.h>
     38#include <VBox/com/array.h>
    3739
    3840using namespace std;
     
    275277//     <const name="CDROM" value="19" />
    276278
    277         MediaData::AttachmentList::iterator itA;
     279        MediumAttachmentsList::iterator itA;
    278280        for (itA = mMediaData->mAttachments.begin();
    279281             itA != mMediaData->mAttachments.end();
  • trunk/src/VBox/Main/ApplianceImplImport.cpp

    r30746 r30760  
    2424#include <iprt/manifest.h>
    2525
    26 #include <VBox/com/array.h>
    27 
    28 #include "ApplianceImpl.h"
    2926#include "VirtualBoxImpl.h"
    3027#include "GuestOSTypeImpl.h"
     
    3229#include "MachineImpl.h"
    3330
     31#include "ApplianceImplPrivate.h"
     32
    3433#include "AutoCaller.h"
    3534#include "Logging.h"
    36 
    37 #include "ApplianceImplPrivate.h"
    3835
    3936#include <VBox/param.h>
    4037#include <VBox/version.h>
    4138#include <VBox/settings.h>
     39
     40#include <VBox/com/array.h>
    4241
    4342using namespace std;
  • trunk/src/VBox/Main/ConsoleVRDPServer.cpp

    r30714 r30760  
    1616 */
    1717
     18#include "RemoteUSBBackend.h"
    1819#include "ConsoleVRDPServer.h"
    1920#include "ConsoleImpl.h"
  • trunk/src/VBox/Main/DHCPServerImpl.cpp

    r30681 r30760  
    1818 */
    1919
    20 #include "DHCPServerRunner.h"
    2120#include "DHCPServerImpl.h"
    2221#include "AutoCaller.h"
  • trunk/src/VBox/Main/HostImpl.cpp

    r30743 r30760  
    140140#include <VBox/sup.h>
    141141
     142#include <VBox/com/array.h>
    142143#include "VBox/com/MultiResult.h"
    143144
  • trunk/src/VBox/Main/HostPower.cpp

    r28800 r30760  
    2929
    3030#include <iprt/mem.h>
     31
     32#ifdef VBOX_WITH_RESOURCE_USAGE_API
     33 #include "Performance.h"
     34 #include "PerformanceImpl.h"
     35#endif /* VBOX_WITH_RESOURCE_USAGE_API */
    3136
    3237HostPowerService::HostPowerService (VirtualBox *aVirtualBox)
  • trunk/src/VBox/Main/MachineImpl.cpp

    r30739 r30760  
    3434#include "Logging.h"
    3535#include "VirtualBoxImpl.h"
    36 #include "MachineImpl.h"
    37 #include "ProgressImpl.h"
    38 #include "ProgressProxyImpl.h"
     36#include "MachineImplPrivate.h"
     37
     38#include "VirtualBoxErrorInfoImpl.h"
     39
     40#include "AudioAdapterImpl.h"
     41#include "BIOSSettingsImpl.h"
     42#include "GuestImpl.h"
     43#include "GuestOSTypeImpl.h"
     44#include "HostImpl.h"
    3945#include "MediumAttachmentImpl.h"
    4046#include "MediumImpl.h"
    4147#include "MediumLock.h"
     48#include "NetworkAdapterImpl.h"
     49#include "ParallelPortImpl.h"
     50#include "ProgressProxyImpl.h"
    4251#include "USBControllerImpl.h"
    43 #include "HostImpl.h"
     52#include "SerialPortImpl.h"
    4453#include "SharedFolderImpl.h"
    45 #include "GuestOSTypeImpl.h"
    46 #include "VirtualBoxErrorInfoImpl.h"
    47 #include "GuestImpl.h"
    4854#include "StorageControllerImpl.h"
     55#include "VRDPServerImpl.h"
    4956
    5057#ifdef VBOX_WITH_USB
     
    5259#endif
    5360
     61#ifdef VBOX_WITH_RESOURCE_USAGE_API
     62# include "Performance.h"
     63# include "PerformanceImpl.h"
     64#endif /* VBOX_WITH_RESOURCE_USAGE_API */
     65
    5466#include "AutoCaller.h"
    5567#include "Performance.h"
    5668
    5769#include <iprt/asm.h>
     70#include <iprt/file.h>
    5871#include <iprt/path.h>
    5972#include <iprt/dir.h>
     
    29102923        if (aType == DeviceType_HardDisk && mMediaData.isBackedUp())
    29112924        {
    2912             const MediaData::AttachmentList &oldAtts = mMediaData.backedUpData()->mAttachments;
     2925            const MediumAttachmentsList &oldAtts = mMediaData.backedUpData()->mAttachments;
    29132926
    29142927            /* check if the medium was attached to the VM before we started
     
    29502963            if (mMediaData.isBackedUp())
    29512964            {
    2952                 const MediaData::AttachmentList &oldAtts = mMediaData.backedUpData()->mAttachments;
    2953 
    2954                 MediaData::AttachmentList::const_iterator foundIt = oldAtts.end();
     2965                const MediumAttachmentsList &oldAtts = mMediaData.backedUpData()->mAttachments;
     2966
     2967                MediumAttachmentsList::const_iterator foundIt = oldAtts.end();
    29552968                uint32_t foundLevel = 0;
    29562969
    2957                 for (MediaData::AttachmentList::const_iterator it = oldAtts.begin();
     2970                for (MediumAttachmentsList::const_iterator it = oldAtts.begin();
    29582971                     it != oldAtts.end();
    29592972                     ++it)
     
    30253038                AutoReadLock snapLock(snap COMMA_LOCKVAL_SRC_POS);
    30263039
    3027                 const MediaData::AttachmentList &snapAtts = snap->getSnapshotMachine()->mMediaData->mAttachments;
    3028 
    3029                 MediaData::AttachmentList::const_iterator foundIt = snapAtts.end();
     3040                const MediumAttachmentsList &snapAtts = snap->getSnapshotMachine()->mMediaData->mAttachments;
     3041
     3042                MediumAttachmentsList::const_iterator foundIt = snapAtts.end();
    30303043                uint32_t foundLevel = 0;
    30313044
    3032                 for (MediaData::AttachmentList::const_iterator it = snapAtts.begin();
     3045                for (MediumAttachmentsList::const_iterator it = snapAtts.begin();
    30333046                     it != snapAtts.end();
    30343047                     ++it)
     
    43744387                                                       ComSafeArrayOut(IMediumAttachment*, aAttachments))
    43754388{
    4376     MediaData::AttachmentList atts;
     4389    MediumAttachmentsList atts;
    43774390
    43784391    HRESULT rc = getMediumAttachmentsOfController(aName, atts);
     
    45404553    /* We can remove the controller only if there is no device attached. */
    45414554    /* check if the device slot is already busy */
    4542     for (MediaData::AttachmentList::const_iterator it = mMediaData->mAttachments.begin();
     4555    for (MediumAttachmentsList::const_iterator it = mMediaData->mAttachments.begin();
    45434556         it != mMediaData->mAttachments.end();
    45444557         ++it)
     
    50385051
    50395052/**
     5053 * Returns true if the machine is registered.
     5054 *
     5055 * @note This method doesn't check this object's readiness. Intended to be
     5056 * used by ready Machine children (whose readiness is bound to the parent's
     5057 * one) or after doing addCaller() manually.
     5058 */
     5059bool Machine::isRegistered() const
     5060{
     5061    return !!mData->mRegistered;
     5062}
     5063
     5064/**
     5065 * Returns this machine ID.
     5066 *
     5067 * @note This method doesn't check this object's readiness. Intended to be
     5068 * used by ready Machine children (whose readiness is bound to the parent's
     5069 * one) or after adding a caller manually.
     5070 */
     5071const Guid& Machine::getId() const
     5072{
     5073    return mData->mUuid;
     5074}
     5075
     5076/**
     5077 * Returns this machine's full settings file path.
     5078 *
     5079 * @note This method doesn't lock this object or check its readiness.
     5080 * Intended to be used only after doing addCaller() manually and locking it
     5081 * for reading.
     5082 */
     5083const Utf8Str& Machine::getSettingsFileFull() const
     5084{
     5085    return mData->m_strConfigFileFull;
     5086}
     5087
     5088/**
     5089 * Returns this machine name.
     5090 *
     5091 * @note This method doesn't lock this object or check its readiness.
     5092 * Intended to be used only after doing addCaller() manually and locking it
     5093 * for reading.
     5094 */
     5095const Bstr& Machine::getName() const
     5096{
     5097    return mUserData->mName;
     5098}
     5099
     5100
     5101/**
    50405102 * Adds the given IsModified_* flag to the dirty flags of the machine.
     5103 *
    50415104 * This must be called either during loadSettings or under the machine write lock.
     5105 *
    50425106 * @param fl
    50435107 */
     
    57095773}
    57105774
     5775HRESULT Machine::getDirectControl(ComPtr<IInternalSessionControl> &directControl)
     5776{
     5777    directControl = mData->mSession.mDirectControl;
     5778
     5779    if (directControl.isNull())
     5780        return E_ACCESSDENIED;
     5781
     5782    return S_OK;
     5783}
     5784
    57115785/**
    57125786 * Returns @c true if the given machine has an open direct session and returns
     
    63606434       )
    63616435    {
    6362         for (MediaData::AttachmentList::const_iterator it = mMediaData->mAttachments.begin();
     6436        for (MediumAttachmentsList::const_iterator it = mMediaData->mAttachments.begin();
    63636437             it != mMediaData->mAttachments.end();
    63646438             ++it)
     
    73077381
    73087382HRESULT Machine::getMediumAttachmentsOfController(CBSTR aName,
    7309                                                   MediaData::AttachmentList &atts)
     7383                                                  MediumAttachmentsList &atts)
    73107384{
    73117385    AutoCaller autoCaller(this);
     
    73147388    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    73157389
    7316     for (MediaData::AttachmentList::iterator it = mMediaData->mAttachments.begin();
     7390    for (MediumAttachmentsList::iterator it = mMediaData->mAttachments.begin();
    73177391         it != mMediaData->mAttachments.end();
    73187392         ++it)
     
    80708144                                    settings::StorageController &data)
    80718145{
    8072     MediaData::AttachmentList atts;
     8146    MediumAttachmentsList atts;
    80738147
    80748148    HRESULT rc = getMediumAttachmentsOfController(Bstr(aStorageController->getName()), atts);
     
    80768150
    80778151    data.llAttachedDevices.clear();
    8078     for (MediaData::AttachmentList::const_iterator it = atts.begin();
     8152    for (MediumAttachmentsList::const_iterator it = atts.begin();
    80798153         it != atts.end();
    80808154         ++it)
     
    82368310            /* lock all attached hard disks early to detect "in use"
    82378311             * situations before creating actual diffs */
    8238             for (MediaData::AttachmentList::const_iterator it = mMediaData->mAttachments.begin();
     8312            for (MediumAttachmentsList::const_iterator it = mMediaData->mAttachments.begin();
    82398313                 it != mMediaData->mAttachments.end();
    82408314                 ++it)
     
    82768350        /* remember the current list (note that we don't use backup() since
    82778351         * mMediaData may be already backed up) */
    8278         MediaData::AttachmentList atts = mMediaData->mAttachments;
     8352        MediumAttachmentsList atts = mMediaData->mAttachments;
    82798353
    82808354        /* start from scratch */
     
    82838357        /* go through remembered attachments and create diffs for normal hard
    82848358         * disks and attach them */
    8285         for (MediaData::AttachmentList::const_iterator it = atts.begin();
     8359        for (MediumAttachmentsList::const_iterator it = atts.begin();
    82868360             it != atts.end();
    82878361             ++it)
     
    84278501    HRESULT rc = S_OK;
    84288502
    8429     MediaData::AttachmentList implicitAtts;
    8430 
    8431     const MediaData::AttachmentList &oldAtts = mMediaData.backedUpData()->mAttachments;
     8503    MediumAttachmentsList implicitAtts;
     8504
     8505    const MediumAttachmentsList &oldAtts = mMediaData.backedUpData()->mAttachments;
    84328506
    84338507    /* enumerate new attachments */
    8434     for (MediaData::AttachmentList::const_iterator it = mMediaData->mAttachments.begin();
     8508    for (MediumAttachmentsList::const_iterator it = mMediaData->mAttachments.begin();
    84358509         it != mMediaData->mAttachments.end();
    84368510         ++it)
     
    84858559        alock.leave();
    84868560
    8487         for (MediaData::AttachmentList::const_iterator it = implicitAtts.begin();
     8561        for (MediumAttachmentsList::const_iterator it = implicitAtts.begin();
    84888562             it != implicitAtts.end();
    84898563             ++it)
     
    85208594 * @return
    85218595 */
    8522 MediumAttachment* Machine::findAttachment(const MediaData::AttachmentList &ll,
     8596MediumAttachment* Machine::findAttachment(const MediumAttachmentsList &ll,
    85238597                                          IN_BSTR aControllerName,
    85248598                                          LONG aControllerPort,
    85258599                                          LONG aDevice)
    85268600{
    8527    for (MediaData::AttachmentList::const_iterator it = ll.begin();
     8601   for (MediumAttachmentsList::const_iterator it = ll.begin();
    85288602         it != ll.end();
    85298603         ++it)
     
    85488622 * @return
    85498623 */
    8550 MediumAttachment* Machine::findAttachment(const MediaData::AttachmentList &ll,
     8624MediumAttachment* Machine::findAttachment(const MediumAttachmentsList &ll,
    85518625                                          ComObjPtr<Medium> pMedium)
    85528626{
    8553    for (MediaData::AttachmentList::const_iterator it = ll.begin();
     8627   for (MediumAttachmentsList::const_iterator it = ll.begin();
    85548628         it != ll.end();
    85558629         ++it)
     
    85758649 * @return
    85768650 */
    8577 MediumAttachment* Machine::findAttachment(const MediaData::AttachmentList &ll,
     8651MediumAttachment* Machine::findAttachment(const MediumAttachmentsList &ll,
    85788652                                          Guid &id)
    85798653{
    8580    for (MediaData::AttachmentList::const_iterator it = ll.begin();
     8654   for (MediumAttachmentsList::const_iterator it = ll.begin();
    85818655         it != ll.end();
    85828656         ++it)
     
    86208694        return;
    86218695
    8622     MediaData::AttachmentList &oldAtts = mMediaData.backedUpData()->mAttachments;
     8696    MediumAttachmentsList &oldAtts = mMediaData.backedUpData()->mAttachments;
    86238697    bool fMediaNeedsLocking = false;
    86248698
    86258699    /* enumerate new attachments */
    8626     for (MediaData::AttachmentList::const_iterator it = mMediaData->mAttachments.begin();
     8700    for (MediumAttachmentsList::const_iterator it = mMediaData->mAttachments.begin();
    86278701            it != mMediaData->mAttachments.end();
    86288702            ++it)
     
    86808754        {
    86818755            /* was this medium attached before? */
    8682             for (MediaData::AttachmentList::iterator oldIt = oldAtts.begin();
     8756            for (MediumAttachmentsList::iterator oldIt = oldAtts.begin();
    86838757                    oldIt != oldAtts.end();
    86848758                    ++oldIt)
     
    86998773    /* enumerate remaining old attachments and de-associate from the
    87008774     * current machine state */
    8701     for (MediaData::AttachmentList::const_iterator it = oldAtts.begin();
     8775    for (MediumAttachmentsList::const_iterator it = oldAtts.begin();
    87028776         it != oldAtts.end();
    87038777         ++it)
     
    87788852
    87798853    /* enumerate new attachments */
    8780     for (MediaData::AttachmentList::const_iterator it = mMediaData->mAttachments.begin();
     8854    for (MediumAttachmentsList::const_iterator it = mMediaData->mAttachments.begin();
    87818855            it != mMediaData->mAttachments.end();
    87828856            ++it)
     
    1086110935
    1086210936    /* Collect locking information for all medium objects attached to the VM. */
    10863     for (MediaData::AttachmentList::const_iterator it = mMediaData->mAttachments.begin();
     10937    for (MediumAttachmentsList::const_iterator it = mMediaData->mAttachments.begin();
    1086410938         it != mMediaData->mAttachments.end();
    1086510939         ++it)
  • trunk/src/VBox/Main/MediumFormatImpl.cpp

    r30681 r30760  
    2323
    2424#include <VBox/VBoxHDD.h>
     25
     26#include <VBox/com/array.h>
    2527
    2628#include <iprt/cpp/utils.h>
  • trunk/src/VBox/Main/MediumImpl.cpp

    r30739 r30760  
    1717
    1818#include "MediumImpl.h"
     19#include "MediumFormatImpl.h"
    1920#include "ProgressImpl.h"
    2021#include "SystemPropertiesImpl.h"
    2122#include "VirtualBoxImpl.h"
     23#include "MediumLock.h"
    2224
    2325#include "AutoCaller.h"
  • trunk/src/VBox/Main/MouseImpl.cpp

    r30681 r30760  
    2121#include "DisplayImpl.h"
    2222#include "VMMDev.h"
     23#include "ConsoleImpl.h"
    2324
    2425#include "AutoCaller.h"
     
    5859    uint32_t                    u32DevCaps;
    5960};
    60 
    6161
    6262// constructor / destructor
  • trunk/src/VBox/Main/NATEngineImpl.cpp

    r28864 r30760  
    2727#include <VBox/err.h>
    2828#include <VBox/settings.h>
    29 
     29#include "VBox/com/array.h"
    3030
    3131// constructor / destructor
  • trunk/src/VBox/Main/Performance.cpp

    r29631 r30760  
    133133        ComPtr<IInternalSessionControl> directControl;
    134134
    135         ret = mMachine->getDirectControl(&directControl);
     135        ret = mMachine->getDirectControl(directControl);
    136136        if (ret != S_OK)
    137137            return ret;
  • trunk/src/VBox/Main/PerformanceImpl.cpp

    r29620 r30760  
    2727#include <VBox/err.h>
    2828#include <VBox/settings.h>
     29
     30#include <VBox/com/array.h>
    2931
    3032#include <vector>
  • trunk/src/VBox/Main/SnapshotImpl.cpp

    r30681 r30760  
    2121#include "SnapshotImpl.h"
    2222
    23 #include "MachineImpl.h"
     23#include "Global.h"
     24
     25#include "AudioAdapterImpl.h"
     26#include "BIOSSettingsImpl.h"
     27#include "MachineImplPrivate.h"
    2428#include "MediumImpl.h"
     29#include "MediumAttachmentImpl.h"
    2530#include "MediumFormatImpl.h"
    26 #include "Global.h"
     31#include "NetworkAdapterImpl.h"
     32#include "ParallelPortImpl.h"
    2733#include "ProgressImpl.h"
     34#include "SerialPortImpl.h"
     35#include "StorageControllerImpl.h"
     36#include "VRDPServerImpl.h"
    2837
    2938// @todo these three includes are required for about one or two lines, try
     
    3544#include "AutoCaller.h"
    3645
     46#include <iprt/file.h>
    3747#include <iprt/path.h>
    3848#include <iprt/cpp/utils.h>
     
    4050#include <VBox/param.h>
    4151#include <VBox/err.h>
     52
     53#include <VBox/com/array.h>
    4254
    4355#include <VBox/settings.h>
     
    896908    /* associate hard disks with the snapshot
    897909     * (Machine::uninitDataAndChildObjects() will deassociate at destruction) */
    898     for (MediaData::AttachmentList::const_iterator it = mMediaData->mAttachments.begin();
     910    for (MediumAttachmentsList::const_iterator it = mMediaData->mAttachments.begin();
    899911         it != mMediaData->mAttachments.end();
    900912         ++it)
     
    15951607    ULONG ulOpCount = 1;            // one for preparations
    15961608    ULONG ulTotalWeight = 1;        // one for preparations
    1597     for (MediaData::AttachmentList::iterator it = pSnapMachine->mMediaData->mAttachments.begin();
     1609    for (MediumAttachmentsList::iterator it = pSnapMachine->mMediaData->mAttachments.begin();
    15981610         it != pSnapMachine->mMediaData->mAttachments.end();
    15991611         ++it)
     
    18251837        std::list< ComObjPtr<MediumAttachment> > llDiffAttachmentsToDelete;
    18261838
    1827         for (MediaData::AttachmentList::const_iterator it = mMediaData.backedUpData()->mAttachments.begin();
     1839        for (MediumAttachmentsList::const_iterator it = mMediaData.backedUpData()->mAttachments.begin();
    18281840             it != mMediaData.backedUpData()->mAttachments.end();
    18291841             ++it)
     
    20532065
    20542066    // count normal hard disks and add their sizes to the weight
    2055     for (MediaData::AttachmentList::iterator it = pSnapMachine->mMediaData->mAttachments.begin();
     2067    for (MediumAttachmentsList::iterator it = pSnapMachine->mMediaData->mAttachments.begin();
    20562068         it != pSnapMachine->mMediaData->mAttachments.end();
    20572069         ++it)
     
    22692281        // merge it with its one and only child (the diff image holding the
    22702282        // changes written after the snapshot was taken).
    2271         for (MediaData::AttachmentList::iterator it = pSnapMachine->mMediaData->mAttachments.begin();
     2283        for (MediumAttachmentsList::iterator it = pSnapMachine->mMediaData->mAttachments.begin();
    22722284             it != pSnapMachine->mMediaData->mAttachments.end();
    22732285             ++it)
  • trunk/src/VBox/Main/SystemPropertiesImpl.cpp

    r30681 r30760  
    2121#include "VirtualBoxImpl.h"
    2222#include "MachineImpl.h"
     23#include "MediumFormatImpl.h"
     24
    2325#include "AutoCaller.h"
    2426#include "Logging.h"
     
    3739#include <VBox/settings.h>
    3840#include <VBox/VBoxHDD.h>
     41
     42#include <VBox/com/array.h>
    3943
    4044// defines
  • trunk/src/VBox/Main/USBControllerImpl.cpp

    r30739 r30760  
    3434#include <VBox/err.h>
    3535#include <VBox/settings.h>
     36#include <VBox/com/array.h>
    3637
    3738#include <algorithm>
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r30746 r30760  
    6262#include "SystemPropertiesImpl.h"
    6363#include "GuestOSTypeImpl.h"
    64 #include "DHCPServerRunner.h"
    6564#include "DHCPServerImpl.h"
    6665#ifdef VBOX_WITH_RESOURCE_USAGE_API
    67 #include "PerformanceImpl.h"
     66# include "PerformanceImpl.h"
    6867#endif /* VBOX_WITH_RESOURCE_USAGE_API */
    6968#include "EventImpl.h"
     
    251250typedef std::map<Guid, ComPtr<IProgress> > ProgressMap;
    252251typedef std::map<Guid, ComObjPtr<Medium> > HardDiskMap;
     252
     253typedef std::list< VirtualBoxCallbackRegistration > CallbackList;
    253254
    254255/**
  • trunk/src/VBox/Main/glue/errorprint.cpp

    r30681 r30760  
    2525#include <iprt/stream.h>
    2626#include <iprt/path.h>
     27
     28#ifndef DEBUG
     29// string used by ComAssert macro (VirtualBoxBase.h)
     30const char *g_pcszComAssertFailedString
     31    = "Assertion failed: [%s] at '%s' (%d) in %s.\nPlease contact the product vendor!";
     32const char *g_pcszComAssertMsgFailedString
     33    = "Assertion failed: [%s] at '%s' (%d) in %s.\n%s\nPlease contact the product vendor!";
     34#endif
    2735
    2836namespace com
  • trunk/src/VBox/Main/include/ApplianceImpl.h

    r30739 r30760  
    2424#include "VirtualBoxBase.h"
    2525
    26 /* VBox forward declarations */
    27 class Progress;
    28 class VirtualSystemDescription;
    29 struct VirtualSystemDescriptionEntry;
    30 
    3126namespace ovf
    3227{
     
    3530    class OVFReader;
    3631    struct DiskImage;
    37 }
    38 
    39 namespace xml
    40 {
    41     class ElementNode;
    42 }
    43 
    44 namespace settings
    45 {
    46     class MachineConfigFile;
    4732}
    4833
  • trunk/src/VBox/Main/include/ApplianceImplPrivate.h

    r30008 r30760  
    1919#define ____H_APPLIANCEIMPLPRIVATE
    2020
    21 class VirtualSystemDescription;
    22 
     21#include "ApplianceImpl.h"
    2322#include "ovfreader.h"
    2423
  • trunk/src/VBox/Main/include/AudioAdapterImpl.h

    r30739 r30760  
    2222
    2323#include "VirtualBoxBase.h"
    24 
    25 namespace settings
    26 {
    27     struct AudioAdapter;
    28 }
    2924
    3025class ATL_NO_VTABLE AudioAdapter :
  • trunk/src/VBox/Main/include/BIOSSettingsImpl.h

    r30739 r30760  
    2222
    2323#include "VirtualBoxBase.h"
    24 
    25 class GuestOSType;
    2624
    2725namespace settings
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r30739 r30760  
    2424#include "EventImpl.h"
    2525
    26 class Guest;
    27 class Keyboard;
    28 class Mouse;
    29 class Display;
    30 class MachineDebugger;
    31 class TeleporterStateSrc;
    32 class OUSBDevice;
    33 class RemoteUSBDevice;
    34 class SharedFolder;
    35 class RemoteDisplayInfo;
    36 class AudioSniffer;
    37 class ConsoleVRDPServer;
    38 class ConsoleCallbackRegistration;      /* See ConsoleImpl.cpp. */
    39 class VMMDev;
    40 class Progress;
    41 
    4226#include <VBox/vrdpapi.h>
    4327#include <VBox/pdmdrv.h>
     
    5236struct VUSBIRHCONFIG;
    5337typedef struct VUSBIRHCONFIG *PVUSBIRHCONFIG;
    54 
    55 #include <list>
    5638
    5739// defines
  • trunk/src/VBox/Main/include/ConsoleVRDPServer.h

    r30739 r30760  
    2121#define ____H_CONSOLEVRDPSERVER
    2222
    23 #include "RemoteUSBBackend.h"
     23class Console;
     24class RemoteUSBBackend;
     25
    2426#include <hgcm/HGCM.h>
    2527
     
    5355{
    5456public:
    55     ConsoleVRDPServer (Console *console);
    56     ~ConsoleVRDPServer ();
     57    ConsoleVRDPServer(Console *console);
     58    ~ConsoleVRDPServer();
    5759
    5860    int Launch (void);
  • trunk/src/VBox/Main/include/DHCPServerImpl.h

    r30739 r30760  
    2222
    2323#include "VirtualBoxBase.h"
     24
     25#include "DHCPServerRunner.h"
    2426
    2527#ifdef VBOX_WITH_HOSTNETIF_API
  • trunk/src/VBox/Main/include/GuestImpl.h

    r30758 r30760  
    4141    GUESTSTATTYPE_MAX         = 9
    4242} GUESTSTATTYPE;
    43 
    44 class Console;
    45 #ifdef VBOX_WITH_GUEST_CONTROL
    46 class Progress;
    47 #endif
    4843
    4944class ATL_NO_VTABLE Guest :
  • trunk/src/VBox/Main/include/HostImpl.h

    r30739 r30760  
    2020
    2121#include "VirtualBoxBase.h"
    22 
    23 class HostUSBDeviceFilter;
    24 class USBProxyService;
    25 class SessionMachine;
    26 class Progress;
    27 class PerformanceCollector;
    28 
    29 namespace settings
    30 {
    31     struct Host;
    32 }
    33 
    34 #include <list>
    3522
    3623class ATL_NO_VTABLE Host :
  • trunk/src/VBox/Main/include/KeyboardImpl.h

    r30739 r30760  
    2020
    2121#include "VirtualBoxBase.h"
    22 #include "ConsoleEvents.h"
    2322
    2423#include <VBox/pdmdrv.h>
     
    2625/** Limit of simultaneously attached devices (just USB and/or PS/2). */
    2726enum { KEYBOARD_MAX_DEVICES = 2 };
    28 
    29 /** Simple keyboard event class. */
    30 class KeyboardEvent
    31 {
    32 public:
    33     KeyboardEvent() : scan(-1) {}
    34     KeyboardEvent(int _scan) : scan(_scan) {}
    35     bool isValid()
    36     {
    37         return (scan & ~0x80) && !(scan & ~0xFF);
    38     }
    39     int scan;
    40 };
    41 // template instantiation
    42 typedef ConsoleEventBuffer<KeyboardEvent> KeyboardEventBuffer;
    4327
    4428class Console;
  • trunk/src/VBox/Main/include/MachineDebuggerImpl.h

    r30739 r30760  
    2222
    2323#include "VirtualBoxBase.h"
    24 
    25 class Console;
    2624
    2725class ATL_NO_VTABLE MachineDebugger :
  • trunk/src/VBox/Main/include/MachineImpl.h

    r30739 r30760  
    2121#include "VirtualBoxBase.h"
    2222#include "SnapshotImpl.h"
    23 #include "VRDPServerImpl.h"
    24 #include "MediumAttachmentImpl.h"
    25 #include "MediumLock.h"
    26 #include "NetworkAdapterImpl.h"
    27 #include "AudioAdapterImpl.h"
    28 #include "SerialPortImpl.h"
    29 #include "ParallelPortImpl.h"
    30 #include "BIOSSettingsImpl.h"
    31 #include "StorageControllerImpl.h"          // required for MachineImpl.h to compile on Windows
    32 #include "VBox/settings.h"
    33 #ifdef VBOX_WITH_RESOURCE_USAGE_API
    34 #include "Performance.h"
    35 #include "PerformanceImpl.h"
    36 #endif /* VBOX_WITH_RESOURCE_USAGE_API */
    3723
    3824// generated header
     
    4127#include "VBox/com/ErrorInfo.h"
    4228
    43 #include <iprt/file.h>
    44 #include <iprt/thread.h>
    45 #include <iprt/time.h>
    46 
    4729#include <list>
    48 
    49 // defines
    50 ////////////////////////////////////////////////////////////////////////////////
    51 
    52 // helper declarations
    53 ////////////////////////////////////////////////////////////////////////////////
    54 
    55 class Progress;
    56 class ProgressProxy;
    57 class Keyboard;
    58 class Mouse;
    59 class Display;
    60 class MachineDebugger;
    61 class USBController;
    62 class Snapshot;
    63 class SharedFolder;
    64 class HostUSBDevice;
    65 class StorageController;
    66 
    67 class SessionMachine;
    68 
    69 namespace settings
    70 {
    71     class MachineConfigFile;
    72     struct Snapshot;
    73     struct Hardware;
    74     struct Storage;
    75     struct StorageController;
    76     struct MachineRegistryEntry;
    77 }
    7830
    7931// Machine class
     
    9345    };
    9446
    95     /**
    96      * Internal machine data.
    97      *
    98      * Only one instance of this data exists per every machine -- it is shared
    99      * by the Machine, SessionMachine and all SnapshotMachine instances
    100      * associated with the given machine using the util::Shareable template
    101      * through the mData variable.
    102      *
    103      * @note |const| members are persistent during lifetime so can be
    104      * accessed without locking.
    105      *
    106      * @note There is no need to lock anything inside init() or uninit()
    107      * methods, because they are always serialized (see AutoCaller).
    108      */
    109     struct Data
    110     {
    111         /**
    112          * Data structure to hold information about sessions opened for the
    113          * given machine.
    114          */
    115         struct Session
    116         {
    117             /** Control of the direct session opened by openSession() */
    118             ComPtr<IInternalSessionControl> mDirectControl;
    119 
    120             typedef std::list<ComPtr<IInternalSessionControl> > RemoteControlList;
    121 
    122             /** list of controls of all opened remote sessions */
    123             RemoteControlList mRemoteControls;
    124 
    125             /** openRemoteSession() and OnSessionEnd() progress indicator */
    126             ComObjPtr<ProgressProxy> mProgress;
    127 
    128             /**
    129              * PID of the session object that must be passed to openSession() to
    130              * finalize the openRemoteSession() request (i.e., PID of the
    131              * process created by openRemoteSession())
    132              */
    133             RTPROCESS mPid;
    134 
    135             /** Current session state */
    136             SessionState_T mState;
    137 
    138             /** Session type string (for indirect sessions) */
    139             Bstr mType;
    140 
    141             /** Session machine object */
    142             ComObjPtr<SessionMachine> mMachine;
    143 
    144             /** Medium object lock collection. */
    145             MediumLockListMap mLockedMedia;
    146         };
    147 
    148         Data();
    149         ~Data();
    150 
    151         const Guid          mUuid;
    152         BOOL                mRegistered;
    153 
    154         /** Flag indicating that the config file is read-only. */
    155         Utf8Str             m_strConfigFile;
    156         Utf8Str             m_strConfigFileFull;
    157 
    158         // machine settings XML file
    159         settings::MachineConfigFile *pMachineConfigFile;
    160         uint32_t            flModifications;
    161 
    162         BOOL                mAccessible;
    163         com::ErrorInfo      mAccessError;
    164 
    165         MachineState_T      mMachineState;
    166         RTTIMESPEC          mLastStateChange;
    167 
    168         /* Note: These are guarded by VirtualBoxBase::stateLockHandle() */
    169         uint32_t            mMachineStateDeps;
    170         RTSEMEVENTMULTI     mMachineStateDepsSem;
    171         uint32_t            mMachineStateChangePending;
    172 
    173         BOOL                mCurrentStateModified;
    174         /** Guest properties have been modified and need saving since the
    175          * machine was started, or there are transient properties which need
    176          * deleting and the machine is being shut down. */
    177         BOOL                mGuestPropertiesModified;
    178 
    179         Session             mSession;
    180 
    181         ComObjPtr<Snapshot> mFirstSnapshot;
    182         ComObjPtr<Snapshot> mCurrentSnapshot;
    183     };
    184 
    185     /**
    186      *  Saved state data.
    187      *
    188      *  It's actually only the state file path string, but it needs to be
    189      *  separate from Data, because Machine and SessionMachine instances
    190      *  share it, while SnapshotMachine does not.
    191      *
    192      *  The data variable is |mSSData|.
    193      */
    194     struct SSData
    195     {
    196         Utf8Str mStateFilePath;
    197     };
    198 
    199     /**
    200      *  User changeable machine data.
    201      *
    202      *  This data is common for all machine snapshots, i.e. it is shared
    203      *  by all SnapshotMachine instances associated with the given machine
    204      *  using the util::Backupable template through the |mUserData| variable.
    205      *
    206      *  SessionMachine instances can alter this data and discard changes.
    207      *
    208      *  @note There is no need to lock anything inside init() or uninit()
    209      *  methods, because they are always serialized (see AutoCaller).
    210      */
    211     struct UserData
    212     {
    213         UserData();
    214         ~UserData();
    215 
    216         Bstr    mName;
    217         BOOL    mNameSync;
    218         Bstr    mDescription;
    219         Bstr    mOSTypeId;
    220         Bstr    mSnapshotFolder;
    221         Bstr    mSnapshotFolderFull;
    222         BOOL    mTeleporterEnabled;
    223         ULONG   mTeleporterPort;
    224         Bstr    mTeleporterAddress;
    225         Bstr    mTeleporterPassword;
    226         BOOL    mRTCUseUTC;
    227     };
    228 
    229     /**
    230      *  Hardware data.
    231      *
    232      *  This data is unique for a machine and for every machine snapshot.
    233      *  Stored using the util::Backupable template in the |mHWData| variable.
    234      *
    235      *  SessionMachine instances can alter this data and discard changes.
    236      */
    237     struct HWData
    238     {
    239         /**
    240          * Data structure to hold information about a guest property.
    241          */
    242         struct GuestProperty {
    243             /** Property name */
    244             Utf8Str strName;
    245             /** Property value */
    246             Utf8Str strValue;
    247             /** Property timestamp */
    248             ULONG64 mTimestamp;
    249             /** Property flags */
    250             ULONG mFlags;
    251         };
    252 
    253         HWData();
    254         ~HWData();
    255 
    256         Bstr                 mHWVersion;
    257         Guid                 mHardwareUUID;   /**< If Null, use mData.mUuid. */
    258         ULONG                mMemorySize;
    259         ULONG                mMemoryBalloonSize;
    260         BOOL                 mPageFusionEnabled;
    261         ULONG                mVRAMSize;
    262         ULONG                mMonitorCount;
    263         BOOL                 mHWVirtExEnabled;
    264         BOOL                 mHWVirtExExclusive;
    265         BOOL                 mHWVirtExNestedPagingEnabled;
    266         BOOL                 mHWVirtExLargePagesEnabled;
    267         BOOL                 mHWVirtExVPIDEnabled;
    268         BOOL                 mAccelerate2DVideoEnabled;
    269         BOOL                 mPAEEnabled;
    270         BOOL                 mSyntheticCpu;
    271         ULONG                mCPUCount;
    272         BOOL                 mCPUHotPlugEnabled;
    273         BOOL                 mAccelerate3DEnabled;
    274         BOOL                 mHpetEnabled;
    275 
    276         BOOL                 mCPUAttached[SchemaDefs::MaxCPUCount];
    277 
    278         settings::CpuIdLeaf  mCpuIdStdLeafs[10];
    279         settings::CpuIdLeaf  mCpuIdExtLeafs[10];
    280 
    281         DeviceType_T         mBootOrder[SchemaDefs::MaxBootPosition];
    282 
    283         typedef std::list< ComObjPtr<SharedFolder> > SharedFolderList;
    284         SharedFolderList     mSharedFolders;
    285 
    286         ClipboardMode_T      mClipboardMode;
    287 
    288         typedef std::list<GuestProperty> GuestPropertyList;
    289         GuestPropertyList    mGuestProperties;
    290         Utf8Str              mGuestPropertyNotificationPatterns;
    291 
    292         FirmwareType_T       mFirmwareType;
    293         KeyboardHidType_T    mKeyboardHidType;
    294         PointingHidType_T    mPointingHidType;
    295 
    296         BOOL                 mIoCacheEnabled;
    297         ULONG                mIoCacheSize;
    298         ULONG                mIoBandwidthMax;
    299     };
    300 
    301     /**
    302      *  Hard disk and other media data.
    303      *
    304      *  The usage policy is the same as for HWData, but a separate structure
    305      *  is necessary because hard disk data requires different procedures when
    306      *  taking or deleting snapshots, etc.
    307      *
    308      *  The data variable is |mMediaData|.
    309      */
    310     struct MediaData
    311     {
    312         MediaData();
    313         ~MediaData();
    314 
    315         typedef std::list< ComObjPtr<MediumAttachment> > AttachmentList;
    316         AttachmentList mAttachments;
    317     };
     47    struct Data;            // machine data
     48    struct SSData;          // saved state data
     49    struct UserData;        // user data
     50    struct HWData;          // hardware data
     51    struct MediaData;       // media data
    31852
    31953    VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(Machine, IMachine)
     
    531265    //  that use it. Note: they should enter Machine lock to keep the returned
    532266    //  information valid!
    533     bool isRegistered() { return !!mData->mRegistered; }
     267    bool isRegistered() const;
    534268
    535269    // unsafe inline public methods for internal purposes only (ensure there is
     
    545279    VirtualBox* getVirtualBox() const { return mParent; }
    546280
     281    const Guid& getId() const;
     282
    547283    /**
    548      * Returns this machine ID.
    549      *
    550      * @note This method doesn't check this object's readiness. Intended to be
    551      * used by ready Machine children (whose readiness is bound to the parent's
    552      * one) or after adding a caller manually.
     284     * Virtual method that returns the snapshot a Machine object is attached
     285     * to. This implementation returns Guid::Empty, but the SnapshotMachine
     286     * override will return a real snapshot ID.
    553287     */
    554     const Guid& getId() const { return mData->mUuid; }
    555 
    556     /**
    557      * Returns the snapshot ID this machine represents or an empty UUID if this
    558      * instance is not SnapshotMachine.
    559      *
    560      * @note This method doesn't check this object's readiness. Intended to be
    561      * used by ready Machine children (whose readiness is bound to the parent's
    562      * one) or after adding a caller manually.
    563      */
    564     inline const Guid& getSnapshotId() const;
    565 
    566     /**
    567      * Returns this machine's full settings file path.
    568      *
    569      * @note This method doesn't lock this object or check its readiness.
    570      * Intended to be used only after doing addCaller() manually and locking it
    571      * for reading.
    572      */
    573     const Utf8Str& getSettingsFileFull() const { return mData->m_strConfigFileFull; }
    574 
    575     /**
    576      * Returns this machine name.
    577      *
    578      * @note This method doesn't lock this object or check its readiness.
    579      * Intended to be used only after doing addCaller() manually and locking it
    580      * for reading.
    581      */
    582     const Bstr& getName() const { return mUserData->mName; }
     288    virtual const Guid& getSnapshotId() const
     289    {
     290        return Guid::Empty;
     291    }
     292
     293    const Utf8Str& getSettingsFileFull() const;
     294
     295    const Bstr& getName() const;
    583296
    584297    enum
     
    624337    HRESULT openExistingSession(IInternalSessionControl *aControl);
    625338
    626     HRESULT getDirectControl(ComPtr<IInternalSessionControl> *directControl)
    627     {
    628         HRESULT rc;
    629         *directControl = mData->mSession.mDirectControl;
    630 
    631         if (!*directControl)
    632             rc = E_ACCESSDENIED;
    633         else
    634             rc = S_OK;
    635 
    636         return rc;
    637     }
     339    HRESULT getDirectControl(ComPtr<IInternalSessionControl> &directControl);
    638340
    639341#if defined(RT_OS_WINDOWS)
     
    641343    bool isSessionOpen(ComObjPtr<SessionMachine> &aMachine,
    642344                       ComPtr<IInternalSessionControl> *aControl = NULL,
    643                        HANDLE *aIPCSem = NULL, bool aAllowClosing = false);
     345                       HANDLE *aIPCSem = NULL,
     346                       bool aAllowClosing = false);
    644347    bool isSessionSpawning(RTPROCESS *aPID = NULL);
    645348
     
    653356    bool isSessionOpen(ComObjPtr<SessionMachine> &aMachine,
    654357                       ComPtr<IInternalSessionControl> *aControl = NULL,
    655                        HMTX *aIPCSem = NULL, bool aAllowClosing = false);
     358                       HMTX *aIPCSem = NULL,
     359                       bool aAllowClosing = false);
    656360
    657361    bool isSessionSpawning(RTPROCESS *aPID = NULL);
     
    728432
    729433    HRESULT getMediumAttachmentsOfController(CBSTR aName,
    730                                              MediaData::AttachmentList &aAttachments);
     434                                             MediumAttachmentsList &aAttachments);
    731435
    732436    enum
     
    760464    HRESULT deleteImplicitDiffs(bool *pfNeedsSaveSettings);
    761465
    762     MediumAttachment* findAttachment(const MediaData::AttachmentList &ll,
     466    MediumAttachment* findAttachment(const MediumAttachmentsList &ll,
    763467                                     IN_BSTR aControllerName,
    764468                                     LONG aControllerPort,
    765469                                     LONG aDevice);
    766     MediumAttachment* findAttachment(const MediaData::AttachmentList &ll,
     470    MediumAttachment* findAttachment(const MediumAttachmentsList &ll,
    767471                                     ComObjPtr<Medium> pMedium);
    768     MediumAttachment* findAttachment(const MediaData::AttachmentList &ll,
     472    MediumAttachment* findAttachment(const MediumAttachmentsList &ll,
    769473                                     Guid &id);
    770474
     
    1102806    // a caller and a read lock before calling them!)
    1103807
    1104     const Guid& getSnapshotId() const { return mSnapshotId; }
     808    /**
     809     * Override of Machine::getSnapshotId(). Whereas the parent returns an empty Guid,
     810     * this returns the snapshot that this machine is attached to.
     811     * @return
     812     */
     813    virtual const Guid& getSnapshotId() const
     814    {
     815        return mSnapshotId;
     816    }
    1105817
    1106818private:
     
    1111823};
    1112824
    1113 // third party methods that depend on SnapshotMachine definiton
    1114 
    1115 inline const Guid &Machine::getSnapshotId() const
    1116 {
    1117     return (isSnapshotMachine())
    1118                 ? static_cast<const SnapshotMachine*>(this)->getSnapshotId()
    1119                 : Guid::Empty;
    1120 }
    1121 
    1122 
    1123825#endif // ____H_MACHINEIMPL
    1124 /* vi: set tabstop=4 shiftwidth=4 expandtab: */
  • trunk/src/VBox/Main/include/MediumFormatImpl.h

    r30739 r30760  
    2222
    2323#include "VirtualBoxBase.h"
    24 
    25 #include <VBox/com/array.h>
    26 
    27 #include <list>
    2824
    2925struct VDBACKENDINFO;
  • trunk/src/VBox/Main/include/MediumImpl.h

    r30739 r30760  
    2222
    2323#include "VirtualBoxBase.h"
    24 #include "MediumLock.h"
    25 
    26 class Progress;
    27 class MediumFormat;
    28 
    29 namespace settings
    30 {
    31     struct Medium;
    32 }
    3324
    3425////////////////////////////////////////////////////////////////////////////////
  • trunk/src/VBox/Main/include/MediumLock.h

    r28800 r30760  
    2121#define ____H_MEDIUMLOCK
    2222
    23 /* interface definitions */
    24 #include "VBox/com/VirtualBox.h"
    2523#include "VirtualBoxBase.h"
    2624#include "AutoCaller.h"
    27 
    28 #include <iprt/types.h>
    29 
    30 #include <list>
    31 #include <map>
    32 
    33 class Medium;
    34 class MediumAttachment;
    3525
    3626/**
  • trunk/src/VBox/Main/include/MouseImpl.h

    r30739 r30760  
    2020
    2121#include "VirtualBoxBase.h"
    22 #include "ConsoleEvents.h"
    23 #include "ConsoleImpl.h"
    2422#include <VBox/pdmdrv.h>
    2523
     
    2927typedef struct DRVMAINMOUSE DRVMAINMOUSE, *PDRVMAINMOUSE;
    3028
    31 /** Simple mouse event class. */
    32 class MouseEvent
    33 {
    34 public:
    35     MouseEvent() : dx(0), dy(0), dz(0), dw(0), state(-1) {}
    36     MouseEvent(int32_t _dx, int32_t _dy, int32_t _dz, int32_t _dw, int32_t _state) :
    37         dx(_dx), dy(_dy), dz(_dz), dw(_dw), state(_state) {}
    38     bool isValid()
    39     {
    40         return state != -1;
    41     }
    42     /* Note: dw is the horizontal scroll wheel */
    43     int32_t dx, dy, dz, dw;
    44     int32_t state;
    45 };
    46 // template instantiation
    47 typedef ConsoleEventBuffer<MouseEvent> MouseEventBuffer;
     29class Console;
    4830
    4931class ATL_NO_VTABLE Mouse :
  • trunk/src/VBox/Main/include/NATEngineImpl.h

    r30739 r30760  
    2424#include "VirtualBoxBase.h"
    2525#include <VBox/settings.h>
    26 
    27 namespace settings
    28 {
    29     struct NAT;
    30 }
    3126
    3227class ATL_NO_VTABLE NATEngine :
  • trunk/src/VBox/Main/include/NetworkAdapterImpl.h

    r30739 r30760  
    2222
    2323#include "VirtualBoxBase.h"
    24 #include "NATEngineImpl.h"
    25 
    26 class GuestOSType;
    27 
    28 namespace settings
    29 {
    30     struct NetworkAdapter;
    31 }
    3224
    3325class ATL_NO_VTABLE NetworkAdapter :
  • trunk/src/VBox/Main/include/ParallelPortImpl.h

    r30739 r30760  
    2121
    2222#include "VirtualBoxBase.h"
    23 
    24 namespace settings
    25 {
    26     struct ParallelPort;
    27 }
    2823
    2924class ATL_NO_VTABLE ParallelPort :
     
    5146
    5247    // public initializer/uninitializer for internal purposes only
    53     HRESULT init (Machine *aParent, ULONG aSlot);
    54     HRESULT init (Machine *aParent, ParallelPort *aThat);
     48    HRESULT init(Machine *aParent, ULONG aSlot);
     49    HRESULT init(Machine *aParent, ParallelPort *aThat);
    5550    HRESULT initCopy (Machine *parent, ParallelPort *aThat);
    5651    void uninit();
  • trunk/src/VBox/Main/include/PerformanceImpl.h

    r30739 r30760  
    2323#include "VirtualBoxBase.h"
    2424
    25 #include <VBox/com/com.h>
    26 #include <VBox/com/array.h>
    27 //#ifdef VBOX_WITH_RESOURCE_USAGE_API
     25// #include <VBox/com/com.h>
     26// #include <VBox/com/array.h>
    2827#include <iprt/timer.h>
    29 //#endif /* VBOX_WITH_RESOURCE_USAGE_API */
    30 
    31 #include <list>
    32 
    33 namespace pm
    34 {
    35     class Metric;
    36     class BaseMetric;
    37     class CollectorHAL;
    38 }
    3928
    4029#undef min
     
    4332/* Each second we obtain new CPU load stats. */
    4433#define VBOX_USAGE_SAMPLER_MIN_INTERVAL 1000
    45 
    46 class HostUSBDevice;
    4734
    4835class ATL_NO_VTABLE PerformanceMetric :
  • trunk/src/VBox/Main/include/RemoteUSBBackend.h

    r28800 r30760  
    3333//} RDLState;
    3434
    35 class Console;
    36 class ConsoleVRDPServer;
    37 
    3835DECLCALLBACK(int) USBClientResponseCallback (void *pv, uint32_t u32ClientId, uint8_t code, const void *pvRet, uint32_t cbRet);
    39 
    4036
    4137/* How many remote devices can be attached to a remote client.
  • trunk/src/VBox/Main/include/SerialPortImpl.h

    r30739 r30760  
    2222
    2323#include "VirtualBoxBase.h"
    24 
    25 class GuestOSType;
    26 
    27 namespace settings
    28 {
    29     struct SerialPort;
    30 }
    3124
    3225class ATL_NO_VTABLE SerialPort :
  • trunk/src/VBox/Main/include/SessionImpl.h

    r30739 r30760  
    2020
    2121#include "VirtualBoxBase.h"
    22 #include "ConsoleImpl.h"
    2322
    2423#ifdef RT_OS_WINDOWS
  • trunk/src/VBox/Main/include/SharedFolderImpl.h

    r30739 r30760  
    2121#include "VirtualBoxBase.h"
    2222#include <VBox/shflsvc.h>
    23 
    24 class Console;
    2523
    2624class ATL_NO_VTABLE SharedFolder :
  • trunk/src/VBox/Main/include/SnapshotImpl.h

    r30739 r30760  
    2424
    2525#include <iprt/time.h>
    26 
    27 class SnapshotMachine;
    28 
    29 namespace settings
    30 {
    31     struct Snapshot;
    32 }
    3326
    3427class ATL_NO_VTABLE Snapshot :
  • trunk/src/VBox/Main/include/SystemPropertiesImpl.h

    r30739 r30760  
    2222
    2323#include "VirtualBoxBase.h"
    24 #include "MediumFormatImpl.h"
    25 
    26 #include <VBox/com/array.h>
    27 
    28 #include <list>
    29 
    30 namespace settings
    31 {
    32     struct SystemProperties;
    33 }
    3424
    3525class ATL_NO_VTABLE SystemProperties :
  • trunk/src/VBox/Main/include/USBControllerImpl.h

    r30739 r30760  
    2222
    2323#include "VirtualBoxBase.h"
    24 
    25 class HostUSBDevice;
    26 class USBDeviceFilter;
    27 
    28 namespace settings
    29 {
    30     struct USBController;
    31 }
    3224
    3325class ATL_NO_VTABLE USBController :
  • trunk/src/VBox/Main/include/VirtualBoxBase.h

    r30739 r30760  
    3030#include "VBox/com/VirtualBox.h"
    3131
    32 // avoid including VBox/settings.h and VBox/xml.h;
    33 // only declare the classes
     32// empty-declare a bunch of classes that are commonly used in VirtualBox
     33// headers; this avoids having to include all the headers in every
     34// single implementation .cpp file
     35
    3436namespace xml
    3537{
    36 class File;
     38    class ElementNode;
     39    class File;
    3740}
    3841
     
    4346class AutoUninitSpan;
    4447
     48class AudioSniffer;
     49class AudioAdapter;
     50class Appliance;
     51class BIOSSettings;
     52class Console;
     53class ConsoleCallbackRegistration;
     54class ConsoleVRDPServer;
     55class DHCPServer;
     56class Display;
     57class Guest;
     58class GuestOSType;
     59class Host;
     60class HostUSBDevice;
     61class HostUSBDeviceFilter;
     62class Keyboard;
     63class Machine;
     64class MachineDebugger;
     65class Medium;
     66class MediumAttachment;
     67class MediumFormat;
     68class MediumLockList;
     69class Mouse;
     70class NetworkAdapter;
     71class NATEngine;
     72class OUSBDevice;
     73class ParallelPort;
     74class PerformanceCollector;
     75class Progress;
     76class ProgressProxy;
     77class RemoteDisplayInfo;
     78class RemoteUSBDevice;
     79class SerialPort;
     80class SessionMachine;
     81class SharedFolder;
     82class Snapshot;
     83class SnapshotMachine;
     84class StorageController;
     85class SystemProperties;
     86class USBController;
     87class USBDeviceFilter;
     88class USBProxyService;
     89class TeleporterStateSrc;
     90class VMMDev;
    4591class VirtualBox;
    46 class Machine;
    47 class Medium;
    48 class Host;
     92class VirtualSystemDescription;
     93struct VirtualSystemDescriptionEntry;
     94class VRDPServer;
     95
    4996typedef std::list< ComObjPtr<Medium> > MediaList;
     97typedef std::list< ComObjPtr<MediumAttachment> > MediumAttachmentsList;
     98
     99namespace settings
     100{
     101    struct AudioAdapter;
     102    struct Hardware;
     103    struct Host;
     104    class  MainConfigFile;
     105    class  MachineConfigFile;
     106    struct MachineRegistryEntry;
     107    struct Medium;
     108    struct NAT;
     109    struct NetworkAdapter;
     110    struct ParallelPort;
     111    struct SerialPort;
     112    struct Snapshot;
     113    struct Storage;
     114    struct StorageController;
     115    struct SystemProperties;
     116    struct USBController;
     117}
     118
     119namespace pm
     120{
     121    class Metric;
     122    class BaseMetric;
     123    class CollectorHAL;
     124    class CollectorGuestHAL;
     125}
    50126
    51127////////////////////////////////////////////////////////////////////////////////
     
    139215////////////////////////////////////////////////////////////////////////////////
    140216
     217#ifndef DEBUG
     218    // the following two are defined in glue/errorprint.cpp because they are included
     219    // in the ComAssert macro below thousands of times in release builds
     220extern const char *g_pcszComAssertFailedString;
     221    // "Assertion failed: [%s] at '%s' (%d) in %s.\nPlease contact the product vendor!"
     222extern const char *g_pcszComAssertMsgFailedString;
     223    // "Assertion failed: [%s] at '%s' (%d) in %s.\n%s\nPlease contact the product vendor!"
     224#endif
     225
    141226/**
    142227 *  Special version of the Assert macro to be used within VirtualBoxBase
     
    158243        if (RT_UNLIKELY(!(expr))) \
    159244            setError(E_FAIL, \
    160                      "Assertion failed: [%s] at '%s' (%d) in %s.\nPlease contact the product vendor!", \
     245                     g_pcszComAssertFailedString, \
    161246                     #expr, __FILE__, __LINE__, __PRETTY_FUNCTION__); \
    162247    } while (0)
     
    179264        if (RT_UNLIKELY(!(expr))) \
    180265            setError(E_FAIL, \
    181                      "Assertion failed: [%s] at '%s' (%d) in %s.\n%s.\nPlease contact the product vendor!", \
    182                      #expr, __FILE__, __LINE__, __PRETTY_FUNCTION__); \
     266                     g_pcszComAssertMsgFailedString, \
     267                     #expr, __FILE__, __LINE__, __PRETTY_FUNCTION__, Utf8StrFmt a .c_str()); \
    183268    } while (0)
    184269#endif
  • trunk/src/VBox/Main/include/VirtualBoxImpl.h

    r30739 r30760  
    3333}
    3434
    35 class SessionMachine;
    36 class GuestOSType;
    37 class SharedFolder;
    38 class Progress;
    39 class Host;
    40 class SystemProperties;
    41 class DHCPServer;
    42 class PerformanceCollector;
    43 class VirtualBoxCallbackRegistration; /* see VirtualBoxImpl.cpp */
    44 
    4535typedef std::list< ComObjPtr<SessionMachine> > SessionMachinesList;
    4636
     
    5040
    5141struct VMClientWatcherData;
    52 
    53 namespace settings
    54 {
    55     class MainConfigFile;
    56 }
    5742
    5843class ATL_NO_VTABLE VirtualBox :
     
    6853public:
    6954
    70     typedef std::list< VirtualBoxCallbackRegistration > CallbackList;
    7155    typedef std::list< ComPtr<IInternalSessionControl> > InternalControlList;
    7256
  • trunk/src/VBox/Main/xpcom/server.cpp

    r30739 r30760  
    4141#include <iprt/message.h>
    4242#include <iprt/stream.h>
     43#include <iprt/file.h>
    4344#include <iprt/path.h>
    4445#include <iprt/timer.h>
     
    6061#include <VirtualBox_XPCOM.h>
    6162#include <VirtualBoxImpl.h>
    62 #include <MachineImpl.h>
    63 #include <VFSExplorerImpl.h>
    64 #include <ApplianceImpl.h>
    65 #include <SnapshotImpl.h>
    66 #include <MediumImpl.h>
    67 #include <MediumFormatImpl.h>
    68 #include <ProgressCombinedImpl.h>
    69 #include <ProgressProxyImpl.h>
    70 #include <VRDPServerImpl.h>
    71 #include <SharedFolderImpl.h>
    72 #include <HostImpl.h>
    73 #include <HostNetworkInterfaceImpl.h>
    74 #include <GuestOSTypeImpl.h>
    75 #include <NetworkAdapterImpl.h>
    76 #include <NATEngineImpl.h>
    77 #include <SerialPortImpl.h>
    78 #include <ParallelPortImpl.h>
    79 #include <USBControllerImpl.h>
     63
     64#include "AudioAdapterImpl.h"
     65#include "ApplianceImpl.h"
     66#include "BIOSSettingsImpl.h"
     67#include "GuestOSTypeImpl.h"
     68#include "DHCPServerImpl.h"
     69#include "HostImpl.h"
     70#include "HostNetworkInterfaceImpl.h"
     71#include "MachineImpl.h"
     72#include "MediumImpl.h"
     73#include "MediumAttachmentImpl.h"
     74#include "MediumFormatImpl.h"
     75#include "NATEngineImpl.h"
     76#include "NetworkAdapterImpl.h"
     77#include "ParallelPortImpl.h"
     78#include "ProgressCombinedImpl.h"
     79#include "ProgressProxyImpl.h"
     80#include "VRDPServerImpl.h"
     81#include "SerialPortImpl.h"
     82#include "SharedFolderImpl.h"
     83#include "SnapshotImpl.h"
     84#include "StorageControllerImpl.h"
     85#include "SystemPropertiesImpl.h"
    8086#include "USBDeviceFilterImpl.h"
    81 #include "DHCPServerRunner.h"
    82 #include "DHCPServerImpl.h"
     87#include "USBControllerImpl.h"
     88#include "VFSExplorerImpl.h"
     89
    8390#ifdef VBOX_WITH_USB
    8491# include <HostUSBDeviceImpl.h>
    8592# include <USBDeviceImpl.h>
    8693#endif
    87 #include <StorageControllerImpl.h>
    88 #include <AudioAdapterImpl.h>
    89 #include <SystemPropertiesImpl.h>
     94
     95#ifdef VBOX_WITH_RESOURCE_USAGE_API
     96# include "Performance.h"
     97# include "PerformanceImpl.h"
     98#endif /* VBOX_WITH_RESOURCE_USAGE_API */
    9099
    91100/* implement nsISupports parts of our objects with support for nsIClassInfo */
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