VirtualBox

Changeset 2929 in vbox for trunk/src/VBox/Main/include


Ignore:
Timestamp:
May 30, 2007 1:31:16 PM (18 years ago)
Author:
vboxsync
Message:

Main: Removed devNode from the host DVD drive description (it's up to UI to decide how to visually represent things); switched HostDVDDrive and HostFloppyDrive objects to the new locking scheme.

Location:
trunk/src/VBox/Main/include
Files:
2 edited

Legend:

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

    r2917 r2929  
    2727
    2828class ATL_NO_VTABLE HostDVDDrive :
     29    public VirtualBoxBaseNEXT,
    2930    public VirtualBoxSupportErrorInfoImpl <HostDVDDrive, IHostDVDDrive>,
    3031    public VirtualBoxSupportTranslation <HostDVDDrive>,
    31     public VirtualBoxBase,
    3232    public IHostDVDDrive
    3333{
    3434public:
    3535
    36     HostDVDDrive();
    37     virtual ~HostDVDDrive();
     36    VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (HostDVDDrive)
    3837
    39     DECLARE_NOT_AGGREGATABLE(HostDVDDrive)
     38    DECLARE_NOT_AGGREGATABLE (HostDVDDrive)
    4039
    4140    DECLARE_PROTECT_FINAL_CONSTRUCT()
     
    4847    NS_DECL_ISUPPORTS
    4948
     49    DECLARE_EMPTY_CTOR_DTOR (HostDVDDrive)
     50
     51    HRESULT FinalConstruct();
     52    void FinalRelease();
     53
    5054    // public initializer/uninitializer for internal purposes only
    51     HRESULT init (INPTR BSTR driveName);
    52     HRESULT init (INPTR BSTR driveName, INPTR BSTR driveDescription);
     55    HRESULT init (INPTR BSTR aName, INPTR BSTR aDescription = NULL);
     56    void uninit();
    5357
    5458    // IHostDVDDrive properties
    55     STDMETHOD(COMGETTER(Name)) (BSTR *driveName);
    56     STDMETHOD(COMGETTER(Description)) (BSTR *driveDescription);
     59    STDMETHOD(COMGETTER(Name)) (BSTR *aName);
     60    STDMETHOD(COMGETTER(Description)) (BSTR *aDescription);
    5761
    5862    // public methods for internal purposes only
    5963
    60     const Bstr &driveName() const { return mDriveName; }
     64    /* @note Must be called from under the object read lock. */
     65    const Bstr &name() const { return mName; }
    6166
    6267    // for VirtualBoxSupportErrorInfoImpl
     
    6570private:
    6671
    67     Bstr mDriveName;
    68     Bstr mDriveDescription;
     72    const Bstr mName;
     73    const Bstr mDescription;
    6974};
    7075
    7176COM_DECL_READONLY_ENUM_AND_COLLECTION_BEGIN (HostDVDDrive)
    7277
    73     STDMETHOD(FindByName) (INPTR BSTR name, IHostDVDDrive **drive)
     78    STDMETHOD(FindByName) (INPTR BSTR aName, IHostDVDDrive **aDrive)
    7479    {
    75         if (!name)
     80        if (!aName)
    7681            return E_INVALIDARG;
    77         if (!drive)
     82        if (!aDrive)
    7883            return E_POINTER;
    7984
    80         *drive = NULL;
     85        *aDrive = NULL;
    8186        Vector::value_type found;
    8287        Vector::iterator it = vec.begin();
     
    8590            Bstr n;
    8691            (*it)->COMGETTER(Name) (n.asOutParam());
    87             if (n == name)
     92            if (n == aName)
    8893                found = *it;
    8994            ++ it;
     
    9297        if (!found)
    9398            return setError (E_INVALIDARG, HostDVDDriveCollection::tr (
    94                 "The host DVD drive named '%ls' could not be found"), name);
     99                "The host DVD drive named '%ls' could not be found"), aName);
    95100
    96         return found.queryInterfaceTo (drive);
     101        return found.queryInterfaceTo (aDrive);
    97102    }
    98103
  • trunk/src/VBox/Main/include/HostFloppyDriveImpl.h

    r1 r2929  
    2727
    2828class ATL_NO_VTABLE HostFloppyDrive :
     29    public VirtualBoxBaseNEXT,
    2930    public VirtualBoxSupportErrorInfoImpl <HostFloppyDrive, IHostFloppyDrive>,
    3031    public VirtualBoxSupportTranslation <HostFloppyDrive>,
    31     public VirtualBoxBase,
    3232    public IHostFloppyDrive
    3333{
    3434public:
    3535
    36     HostFloppyDrive();
    37     virtual ~HostFloppyDrive();
     36    VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (HostFloppyDrive)
    3837
    39     DECLARE_NOT_AGGREGATABLE(HostFloppyDrive)
     38    DECLARE_NOT_AGGREGATABLE (HostFloppyDrive)
    4039
    4140    DECLARE_PROTECT_FINAL_CONSTRUCT()
     
    4847    NS_DECL_ISUPPORTS
    4948
     49    DECLARE_EMPTY_CTOR_DTOR (HostFloppyDrive)
     50
     51    HRESULT FinalConstruct();
     52    void FinalRelease();
     53
    5054    // public initializer/uninitializer for internal purposes only
    51     HRESULT init (INPTR BSTR driveName);
     55    HRESULT init (INPTR BSTR aName);
     56    void uninit();
    5257
    5358    // IHostDVDDrive properties
    54     STDMETHOD(COMGETTER(Name)) (BSTR *driveName);
     59    STDMETHOD(COMGETTER(Name)) (BSTR *aName);
    5560
    5661    // public methods for internal purposes only
    5762
    58     const Bstr &driveName() const { return mDriveName; }
     63    /* @note Must be called from under the object read lock. */
     64    const Bstr &name() const { return mName; }
    5965
    6066    // for VirtualBoxSupportErrorInfoImpl
     
    6369private:
    6470
    65     Bstr mDriveName;
     71    const Bstr mName;
    6672};
    6773
    6874COM_DECL_READONLY_ENUM_AND_COLLECTION_BEGIN (HostFloppyDrive)
    6975
    70     STDMETHOD(FindByName) (INPTR BSTR name, IHostFloppyDrive **drive)
     76    STDMETHOD(FindByName) (INPTR BSTR aName, IHostFloppyDrive **aDrive)
    7177    {
    72         if (!name)
     78        if (!aName)
    7379            return E_INVALIDARG;
    74         if (!drive)
     80        if (!aDrive)
    7581            return E_POINTER;
    7682
    77         *drive = NULL;
     83        *aDrive = NULL;
    7884        Vector::value_type found;
    7985        Vector::iterator it = vec.begin();
     
    8288            Bstr n;
    8389            (*it)->COMGETTER(Name) (n.asOutParam());
    84             if (n == name)
     90            if (n == aName)
    8591                found = *it;
    8692            ++ it;
     
    8995        if (!found)
    9096            return setError (E_INVALIDARG, HostFloppyDriveCollection::tr (
    91                 "The host floppy drive named '%ls' could not be found"), name);
     97                "The host floppy drive named '%ls' could not be found"), aName);
    9298
    93         return found.queryInterfaceTo (drive);
     99        return found.queryInterfaceTo (aDrive);
    94100    }
    95101
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