VirtualBox

Ignore:
Timestamp:
Oct 29, 2008 3:45:03 PM (16 years ago)
Author:
vboxsync
Message:

Main: Moved last USB classes to the new locking scheme.

File:
1 edited

Legend:

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

    r8155 r13659  
     1/* $Id$ */
     2
    13/** @file
    24 *
     
    68
    79/*
    8  * Copyright (C) 2006-2007 Sun Microsystems, Inc.
     10 * Copyright (C) 2006-2008 Sun Microsystems, Inc.
    911 *
    1012 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2628#include "VirtualBoxBase.h"
    2729#include "Collection.h"
    28 #include <VBox/vrdpapi.h>
     30
     31struct _VRDPUSBDEVICEDESC;
     32typedef _VRDPUSBDEVICEDESC VRDPUSBDEVICEDESC;
    2933
    3034class ATL_NO_VTABLE RemoteUSBDevice :
     35    public VirtualBoxBaseNEXT,
    3136    public VirtualBoxSupportErrorInfoImpl <RemoteUSBDevice, IHostUSBDevice>,
    3237    public VirtualBoxSupportTranslation <RemoteUSBDevice>,
    33     public VirtualBoxBase,
    3438    public IHostUSBDevice
    3539{
    3640public:
    3741
    38     DECLARE_NOT_AGGREGATABLE(RemoteUSBDevice)
     42    VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (OUSBDevice)
     43
     44    DECLARE_NOT_AGGREGATABLE (RemoteUSBDevice)
    3945
    4046    DECLARE_PROTECT_FINAL_CONSTRUCT()
    4147
    42     BEGIN_COM_MAP(RemoteUSBDevice)
    43         COM_INTERFACE_ENTRY(ISupportErrorInfo)
    44         COM_INTERFACE_ENTRY(IHostUSBDevice)
    45         COM_INTERFACE_ENTRY(IUSBDevice)
     48    BEGIN_COM_MAP (RemoteUSBDevice)
     49        COM_INTERFACE_ENTRY (ISupportErrorInfo)
     50        COM_INTERFACE_ENTRY (IHostUSBDevice)
     51        COM_INTERFACE_ENTRY (IUSBDevice)
    4652    END_COM_MAP()
    4753
     
    7581
    7682    // public methods only for internal purposes
    77     bool dirty (void) { return mDirty; }
    78     void dirty (bool aDirty) { mDirty = aDirty; }
    79 
    80     uint16_t devId (void) { return mDevId; }
    81     uint32_t clientId (void) { return mClientId; }
    82 
    83     bool captured (void) { return mState == USBDeviceState_Captured; }
     83    bool dirty (void) const { return mData.dirty; }
     84    void dirty (bool aDirty) { mData.dirty = aDirty; }
     85
     86    uint16_t devId (void) const { return mData.devId; }
     87    uint32_t clientId (void) { return mData.clientId; }
     88
     89    bool captured (void) const { return mData.state == USBDeviceState_Captured; }
    8490    void captured (bool aCaptured)
    8591    {
    8692        if (aCaptured)
    8793        {
    88             Assert(mState == USBDeviceState_Available);
    89             mState = USBDeviceState_Captured;
     94            Assert(mData.state == USBDeviceState_Available);
     95            mData.state = USBDeviceState_Captured;
    9096        }
    9197        else
    9298        {
    93             Assert(mState == USBDeviceState_Captured);
    94             mState = USBDeviceState_Available;
     99            Assert(mData.state == USBDeviceState_Captured);
     100            mData.state = USBDeviceState_Available;
    95101        }
    96102    }
     
    101107private:
    102108
    103     Guid mId;
    104 
    105     uint16_t mVendorId;
    106     uint16_t mProductId;
    107     uint16_t mRevision;
    108 
    109     Bstr mManufacturer;
    110     Bstr mProduct;
    111     Bstr mSerialNumber;
    112 
    113     Bstr mAddress;
    114 
    115     uint16_t mPort;
    116     uint16_t mVersion;
    117     uint16_t mPortVersion;
    118 
    119     USBDeviceState_T mState;
    120 
    121     bool mDirty;
    122     uint16_t mDevId;
    123     uint32_t mClientId;
     109    struct Data
     110    {
     111        Data() : vendorId (0), productId (0), revision (0), port (0), version (1),
     112                 portVersion (1), dirty (FALSE), devId (0), clientId (0) {}
     113
     114        const Guid id;
     115
     116        const uint16_t vendorId;
     117        const uint16_t productId;
     118        const uint16_t revision;
     119
     120        const Bstr manufacturer;
     121        const Bstr product;
     122        const Bstr serialNumber;
     123
     124        const Bstr address;
     125
     126        const uint16_t port;
     127        const uint16_t version;
     128        const uint16_t portVersion;
     129
     130        USBDeviceState_T state;
     131        bool dirty;
     132
     133        const uint16_t devId;
     134        const uint32_t clientId;
     135    };
     136
     137    Data mData;
    124138};
    125139
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