VirtualBox

Ignore:
Timestamp:
Mar 11, 2009 9:56:29 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
44161
Message:

Main: Rework storage controller handling to allow an arbitrary number of different storage controllers and remove code duplication:

  • XML format changed
  • New StorageController class
  • Removed SATAController (obsolete)
  • Removed the IDE controller code from BIOSSettings, handled in StorageController now
File:
1 edited

Legend:

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

    r16867 r17669  
    3939        : public std::unary_function <ComObjPtr<HardDiskAttachment>, bool>
    4040    {
    41         explicit EqualsTo (StorageBus_T aBus, LONG aChannel, LONG aDevice)
    42             : bus (aBus), channel (aChannel), device (aDevice) {}
     41        explicit EqualsTo (CBSTR aController, LONG aPort, LONG aDevice)
     42            : controller(aController), port (aPort), device (aDevice) {}
    4343
    4444        bool operator() (const argument_type &aThat) const
    4545        {
    46             return aThat->bus() == bus && aThat->channel() == channel &&
     46            return aThat->controller() == controller && aThat->port() == port &&
    4747                   aThat->device() == device;
    4848        }
    4949
    50         const StorageBus_T bus;
    51         const LONG channel;
     50        const Bstr controller;
     51        const LONG port;
    5252        const LONG device;
    5353    };
     
    8282
    8383    // public initializer/uninitializer for internal purposes only
    84     HRESULT init(HardDisk *aHD, StorageBus_T aBus, LONG aChannel,
     84    HRESULT init(HardDisk *aHD, IN_BSTR aController, LONG aPort,
    8585                 LONG aDevice, bool aImplicit = false);
    8686    void uninit();
     
    8888    // IHardDiskAttachment properties
    8989    STDMETHOD(COMGETTER(HardDisk))   (IHardDisk **aHardDisk);
    90     STDMETHOD(COMGETTER(Bus))        (StorageBus_T *aBus);
    91     STDMETHOD(COMGETTER(Channel))    (LONG *aChannel);
     90    STDMETHOD(COMGETTER(Controller)) (BSTR *aController);
     91    STDMETHOD(COMGETTER(Port))       (LONG *aPort);
    9292    STDMETHOD(COMGETTER(Device))     (LONG *aDevice);
    9393
     
    9999
    100100    const ComObjPtr<HardDisk> &hardDisk() const { return m.hardDisk; }
    101     StorageBus_T bus() const { return m.bus; }
    102     LONG channel() const { return m.channel; }
     101    Bstr controller() const { return m.controller; }
     102    LONG port()   const { return m.port; }
    103103    LONG device() const { return m.device; }
    104104
     
    117117    struct Data
    118118    {
    119         Data() : bus (StorageBus_Null), channel (0), device (0)
     119        Data() : port (0), device (0)
    120120               , implicit (false) {}
    121121
     
    123123        /// rid of locks at all in this simple readonly structure-like interface
    124124        ComObjPtr<HardDisk> hardDisk;
    125         const StorageBus_T bus;
    126         const LONG channel;
     125        const Bstr controller;
     126        const LONG port;
    127127        const LONG device;
    128128
Note: See TracChangeset for help on using the changeset viewer.

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