VirtualBox

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


Ignore:
Timestamp:
May 24, 2007 4:16:41 PM (18 years ago)
Author:
vboxsync
Message:

Main: Switched USBController to the new locking model.

File:
1 edited

Legend:

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

    r2805 r2845  
    3333class HostUSBDevice;
    3434
     35/**
     36 *  @note we cannot use VirtualBoxBaseWithTypedChildren <USBDeviceFilter> as a
     37 *  base class, because we want a quick (map-based) way of validating
     38 *  IUSBDeviceFilter pointers passed from outside as method parameters that
     39 *  VirtualBoxBaseWithChildren::getDependentChild() gives us.
     40 */
     41
    3542class ATL_NO_VTABLE USBController :
    36     public VirtualBoxBaseWithChildren,
    37     public VirtualBoxSupportErrorInfoImpl<USBController, IUSBController>,
    38     public VirtualBoxSupportTranslation<USBController>,
     43    public VirtualBoxBaseWithChildrenNEXT,
     44    public VirtualBoxSupportErrorInfoImpl <USBController, IUSBController>,
     45    public VirtualBoxSupportTranslation <USBController>,
    3946    public IUSBController
    4047{
     
    4451    {
    4552        /* Constructor. */
    46         Data() : m_fEnabled(FALSE) { }
     53        Data() : mEnabled (FALSE) { }
    4754
    4855        bool operator== (const Data &that) const
    4956        {
    50             return this == &that || m_fEnabled == that.m_fEnabled;
     57            return this == &that || mEnabled == that.mEnabled;
    5158        }
    5259
    5360        /** Enabled indicator. */
    54         BOOL                            m_fEnabled;
     61        BOOL mEnabled;
    5562    };
    5663
    5764public:
    5865
    59     DECLARE_NOT_AGGREGATABLE(USBController)
     66    VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (USBController)
     67
     68    DECLARE_NOT_AGGREGATABLE (USBController)
    6069
    6170    DECLARE_PROTECT_FINAL_CONSTRUCT()
    6271
    6372    BEGIN_COM_MAP(USBController)
    64         COM_INTERFACE_ENTRY(ISupportErrorInfo)
    65         COM_INTERFACE_ENTRY(IUSBController)
     73        COM_INTERFACE_ENTRY (ISupportErrorInfo)
     74        COM_INTERFACE_ENTRY (IUSBController)
    6675    END_COM_MAP()
    6776
    6877    NS_DECL_ISUPPORTS
     78
     79    DECLARE_EMPTY_CTOR_DTOR (USBController)
    6980
    7081    HRESULT FinalConstruct();
     
    7283
    7384    // public initializer/uninitializer for internal purposes only
    74     HRESULT init (Machine *parent);
    75     HRESULT init (Machine *parent, USBController *that);
    76     HRESULT initCopy (Machine *parent, USBController *that);
     85    HRESULT init (Machine *aParent);
     86    HRESULT init (Machine *aParent, USBController *aThat);
     87    HRESULT initCopy (Machine *aParent, USBController *aThat);
    7788    void uninit();
    7889
    7990    // IUSBController properties
    80     STDMETHOD(COMGETTER(Enabled))(BOOL *a_pfEnabled);
    81     STDMETHOD(COMSETTER(Enabled))(BOOL a_fEnabled);
    82     STDMETHOD(COMGETTER(USBStandard))(USHORT *a_pusUSBStandard);
    83     STDMETHOD(COMGETTER(DeviceFilters))(IUSBDeviceFilterCollection **aDevicesFilters);
     91    STDMETHOD(COMGETTER(Enabled)) (BOOL *aEnabled);
     92    STDMETHOD(COMSETTER(Enabled)) (BOOL aEnabled);
     93    STDMETHOD(COMGETTER(USBStandard)) (USHORT *aUSBStandard);
     94    STDMETHOD(COMGETTER(DeviceFilters)) (IUSBDeviceFilterCollection **aDevicesFilters);
    8495
    8596    // IUSBController methods
     
    90101    // public methods only for internal purposes
    91102
    92     ComObjPtr <Machine, ComWeakRef> &parent() { return m_Parent; };
     103    const ComObjPtr <Machine, ComWeakRef> &parent() { return mParent; };
    93104
    94105    HRESULT loadSettings (CFGNODE aMachine);
     
    101112    void copyFrom (USBController *aThat);
    102113
    103     const Backupable<Data> &data() { return m_Data; }
     114    const Backupable<Data> &data() { return mData; }
    104115
    105116    HRESULT onMachineRegistered (BOOL aRegistered);
     
    130141
    131142    /** Parent object. */
    132     ComObjPtr<Machine, ComWeakRef>  m_Parent;
     143    const ComObjPtr<Machine, ComWeakRef> mParent;
    133144    /** Peer object. */
    134     ComObjPtr<USBController>        m_Peer;
     145    const ComObjPtr <USBController> mPeer;
    135146    /** Data. */
    136     Backupable<Data>                m_Data;
     147    Backupable <Data> mData;
    137148
    138149    // the following fields need special backup/rollback/commit handling,
     
    140151
    141152    typedef std::list <ComObjPtr <USBDeviceFilter> > DeviceFilterList;
    142     Backupable <DeviceFilterList> m_DeviceFilters;
     153    Backupable <DeviceFilterList> mDeviceFilters;
    143154};
    144155
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