VirtualBox

Changeset 23223 in vbox for trunk/include


Ignore:
Timestamp:
Sep 22, 2009 3:50:03 PM (15 years ago)
Author:
vboxsync
Message:

API: big medium handling change and lots of assorted other cleanups and fixes

Location:
trunk/include
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/com/VirtualBoxErrorInfo.h

    r22173 r23223  
    77
    88/*
    9  * Copyright (C) 2008 Sun Microsystems, Inc.
     9 * Copyright (C) 2008-2009 Sun Microsystems, Inc.
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5656 */
    5757class ATL_NO_VTABLE VirtualBoxErrorInfo
    58 #if !defined (VBOX_WITH_XPCOM)
    5958    : public CComObjectRootEx <CComMultiThreadModel>
    60 #else
    61     : public CComObjectRootEx
    62 #endif
    6359    , public IVirtualBoxErrorInfo
    6460{
     
    7369        COM_INTERFACE_ENTRY (IVirtualBoxErrorInfo)
    7470    END_COM_MAP()
    75 
    76     NS_DECL_ISUPPORTS
    7771
    7872    VirtualBoxErrorInfo() : mResultCode (S_OK) {}
     
    127121 */
    128122class ATL_NO_VTABLE VirtualBoxErrorInfoGlue
    129 #if !defined (VBOX_WITH_XPCOM)
    130123    : public CComObjectRootEx <CComMultiThreadModel>
    131 #else
    132     : public CComObjectRootEx
    133 #endif
    134124    , public IVirtualBoxErrorInfo
    135125{
     
    144134        COM_INTERFACE_ENTRY (IVirtualBoxErrorInfo)
    145135    END_COM_MAP()
    146 
    147     NS_DECL_ISUPPORTS
    148136
    149137    VirtualBoxErrorInfoGlue() {}
  • trunk/include/VBox/com/defs.h

    r22305 r23223  
    8484/* these are XPCOM only, one for every interface implemented */
    8585#define NS_DECL_ISUPPORTS
    86 #define NS_DECL_IVIRTUALBOX
    87 #define NS_DECL_IMACHINECOLLECTION
    88 #define NS_DECL_IMACHINE
    8986
    9087/** Returns @c true if @a rc represents a warning result code */
     
    245242#define DECLARE_REGISTRY_RESOURCEID(a)
    246243#define DECLARE_NOT_AGGREGATABLE(a)
    247 #define DECLARE_PROTECT_FINAL_CONSTRUCT(a)
     244#define DECLARE_PROTECT_FINAL_CONSTRUCT()
    248245#define BEGIN_COM_MAP(a)
    249246#define COM_INTERFACE_ENTRY(a)
    250247#define COM_INTERFACE_ENTRY2(a,b)
    251 #define END_COM_MAP(a)
     248#define END_COM_MAP() NS_DECL_ISUPPORTS
    252249
    253250#define HRESULT     nsresult
     
    339336#define COM_IIDOF(I) NS_GET_IID (I)
    340337
    341 /* Two very simple ATL emulator classes to provide
     338/* A few very simple ATL emulator classes to provide
    342339 * FinalConstruct()/FinalRelease() functionality on Linux. */
    343340
    344 class CComObjectRootEx
     341class CComMultiThreadModel
     342{
     343};
     344
     345template <class Base> class CComObjectRootEx : public Base
    345346{
    346347public:
  • trunk/include/VBox/com/ptr.h

    r22708 r23223  
    8484    static void addref(C *p)
    8585    {
    86         int cRefs = p->AddRef();
    87         LOGREF("ADDREF ", p, cRefs);
     86        p->AddRef();
    8887    }
    8988    static void release(C *p)
    9089    {
    91         int cRefs = p->Release();
    92         LOGREF("RELEASE", p, cRefs);
     90        p->Release();
    9391    }
    9492};
  • trunk/include/VBox/settings.h

    r23179 r23223  
    175175    bool            fAutoReset;         // optional, only for diffs, default is false
    176176    PropertiesMap   properties;
    177     HardDiskType_T  hdType;
     177    MediumType_T    hdType;
    178178
    179179    MediaList       llChildren;         // only used with hard disks
     
    274274};
    275275
    276 struct DVDDrive
    277 {
    278     DVDDrive()
    279         : fPassThrough(false)
    280     {}
    281 
    282     bool            fPassThrough;
    283     com::Guid       uuid;               // if != NULL, UUID of mounted ISO image
    284     com::Utf8Str    strHostDriveSrc;    // if != NULL, value of <HostDrive>/@src
    285 };
    286 
    287 struct FloppyDrive
    288 {
    289     FloppyDrive()
    290         : fEnabled(true)
    291     {}
    292 
    293     bool            fEnabled;           // optional, defaults to true
    294     com::Guid       uuid;               // if != NULL, UUID of mounted ISO image
    295     com::Utf8Str    strHostDriveSrc;    // if != NULL, value of <HostDrive>/@src
    296 };
    297 
    298276struct USBController
    299277{
     
    435413    bool                fAccelerate3D,
    436414                        fAccelerate2DVideo;     // requires settings version 1.8 (VirtualBox 3.1)
    437     uint32_t            cFirmwareType;          // ditto
     415    FirmwareType_T      firmwareType;           // requires settings version 1.9 (VirtualBox 3.1)
    438416
    439417    VRDPSettings        vrdpSettings;
    440418
    441419    BIOSSettings        biosSettings;
    442     DVDDrive            dvdDrive;
    443     FloppyDrive         floppyDrive;
    444420    USBController       usbController;
    445421    NetworkAdaptersList llNetworkAdapters;
     
    460436};
    461437
     438/**
     439 * A device attached to a storage controller. This can either be a
     440 * hard disk or a DVD drive or a floppy drive and also specifies
     441 * which medium is "in" the drive; as a result, this is a combination
     442 * of the Main IMedium and IMediumAttachment interfaces.
     443 */
    462444struct AttachedDevice
    463445{
    464446    AttachedDevice()
    465         : type(HardDisk),
     447        : deviceType(DeviceType_Null),
     448          fPassThrough(false),
    466449          lPort(0),
    467450          lDevice(0)
    468451    {}
    469452
    470     enum { HardDisk }   type;           // @todo: implement DVD attachments here
     453    DeviceType_T        deviceType;         // only HardDisk, DVD or Floppy are allowed
     454
     455    // DVDs can be in pass-through mode:
     456    bool                fPassThrough;
     457
    471458    int32_t             lPort;
    472459    int32_t             lDevice;
     460
     461    // if an image file is attached to the device (ISO, RAW, or hard disk image such as VDI),
     462    // this is its UUID; it depends on deviceType which media registry this then needs to
     463    // be looked up in. If no image file (only permitted for DVDs and floppies), then the UUID is NULL
    473464    com::Guid           uuid;
     465
     466    // for DVDs and floppies, the attachment can also be a host device:
     467    com::Utf8Str        strHostDriveSrc;        // if != NULL, value of <HostDrive>/@src
    474468};
    475469typedef std::list<AttachedDevice> AttachedDevicesList;
     
    541535    void readHardDiskAttachments_pre1_7(const xml::ElementNode &elmHardDiskAttachments, Storage &strg);
    542536    void readStorageControllers(const xml::ElementNode &elmStorageControllers, Storage &strg);
     537    void readDVDAndFloppies_pre1_9(const xml::ElementNode &elmHardware, Storage &strg);
    543538    void readSnapshot(const xml::ElementNode &elmSnapshot, Snapshot &snap);
    544539    void readMachine(const xml::ElementNode &elmMachine);
    545540
    546     void writeHardware(xml::ElementNode &elmParent, const Hardware &hw);
     541    void writeHardware(xml::ElementNode &elmParent, const Hardware &hw, const Storage &strg);
    547542    void writeStorageControllers(xml::ElementNode &elmParent, const Storage &st);
    548543    void writeSnapshot(xml::ElementNode &elmParent, const Snapshot &snap);
  • trunk/include/iprt/ministring_cpp.h

    r22173 r23223  
    212212    }
    213213
    214     /**
    215      * Appends a copy of @a that to "this".
    216      * @param that
    217      */
    218     MiniString& append(const MiniString &that)
    219     {
    220         size_t cbThis = length();
    221         size_t cbThat = that.length();
    222 
    223         if (cbThat)
    224         {
    225             size_t cbBoth = cbThis + cbThat + 1;
    226 
    227             reserve(cbBoth);
    228                 // calls realloc(cbBoth) and sets m_cbAllocated
    229 
    230             memcpy(m_psz + cbThis, that.m_psz, cbThat);
    231             m_psz[cbThis + cbThat] = '\0';
    232             m_cbLength = cbBoth - 1;
    233         }
    234         return *this;
    235     }
     214    MiniString& append(const MiniString &that);
     215    MiniString& append(char c);
    236216
    237217    /**
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