VirtualBox

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


Ignore:
Timestamp:
May 30, 2007 4:59:36 PM (18 years ago)
Author:
vboxsync
Message:

Main: Preparations for async USB handling.

File:
1 edited

Legend:

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

    r1 r2939  
    2525#include "VirtualBoxBase.h"
    2626#include "USBDeviceFilterImpl.h"
    27 /* #include "USBProxyService.h" circular on Host/HostUSBDevice, the includer must include this. */
     27/* #include "USBProxyService.h" circular on Host/HostUSBDevice, the includer
     28 * must include this. */
    2829#include "Collection.h"
    2930
     
    3435
    3536/**
    36  * Object class used for the Host USBDevices property.
     37 * Object class used to hold Host USB Device properties.
    3738 */
    3839class ATL_NO_VTABLE HostUSBDevice :
     40    public VirtualBoxBaseNEXT,
    3941    public VirtualBoxSupportErrorInfoImpl <HostUSBDevice, IHostUSBDevice>,
    4042    public VirtualBoxSupportTranslation <HostUSBDevice>,
    41     public VirtualBoxBase,
    4243    public IHostUSBDevice
    4344{
    4445public:
    4546
    46     HostUSBDevice();
    47     virtual ~HostUSBDevice();
     47    VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (HostUSBDevice)
    4848
    4949    DECLARE_NOT_AGGREGATABLE(HostUSBDevice)
     
    5959    NS_DECL_ISUPPORTS
    6060
     61    DECLARE_EMPTY_CTOR_DTOR (HostUSBDevice)
     62
     63    HRESULT FinalConstruct();
     64    void FinalRelease();
     65
    6166    // public initializer/uninitializer for internal purposes only
    6267    HRESULT init(PUSBDEVICE aUsb, USBProxyService *aUSBProxyService);
     68    void uninit();
    6369
    6470    // IUSBDevice properties
     
    7985    // public methods only for internal purposes
    8086
    81     const Guid &id() { return mId; }
    82     USBDeviceState_T state() { return mState; }
     87    /* @note Must be called from under the object read lock. */
     88    const Guid &id() const { return mId; }
     89
     90    /* @note Must be called from under the object read lock. */
     91    USBDeviceState_T state() const { return mState; }
     92
     93    /* @note Must be called from under the object read lock. */
     94    USBDeviceState_T pendingState() const { return mPendingState; }
     95
     96    /* @note Must be called from under the object read lock. */
    8397    ComObjPtr <SessionMachine, ComWeakRef> &machine() { return mMachine; }
     98
     99/// @todo remove
     100#if 0
     101    /* @note Must be called from under the object read lock. */
    84102    bool isIgnored() { return mIgnored; }
     103#endif
     104
     105    /* @note Must be called from under the object read lock. */
     106    bool isStatePending() const { return mIsStatePending; }
     107
     108    /* @note Must be called from under the object read lock. */
     109    PCUSBDEVICE usbData() const { return mUsb; }
    85110
    86111    Utf8Str name();
    87112
     113/// @todo remove
     114#if 0
    88115    void setIgnored();
     116#endif
     117
    89118    bool setCaptured (SessionMachine *aMachine);
    90119    int  setHostDriven();
    91120    int  reset();
    92121
     122/// @todo remove
     123#if 0
    93124    void setHostState (USBDeviceState_T aState);
     125#endif
    94126
    95127    bool isMatch (const USBDeviceFilter::Data &aData);
     
    105137private:
    106138
    107     Guid mId;
     139    const Guid mId;
    108140    USBDeviceState_T mState;
     141    USBDeviceState_T mPendingState;
    109142    ComObjPtr <SessionMachine, ComWeakRef> mMachine;
    110     bool mIgnored;
     143    bool mIsStatePending : 1;
     144/// @todo remove
     145#if 0
     146    bool mIgnored : 1;
     147#endif
     148
    111149    /** Pointer to the USB Proxy Service instance. */
    112150    USBProxyService *mUSBProxyService;
     
    114152    /** Pointer to the USB Device structure owned by this device.
    115153     * Only used for host devices. */
    116     PUSBDEVICE m_pUsb;
     154    PUSBDEVICE mUsb;
    117155};
    118156
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