HostUSBDeviceImpl.h revision 8fb7401164a3b87c2464c9e38d199f9fd9f5cfad
/** @file
*
* VirtualBox IHostUSBDevice COM interface implementation
*/
/*
* Copyright (C) 2006-2007 innotek GmbH
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License as published by the Free Software Foundation,
* in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
* distribution. VirtualBox OSE is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY of any kind.
*
* If you received this file as part of a commercial VirtualBox
* distribution, then only the terms of your commercial VirtualBox
* license agreement apply instead of the previous paragraph.
*/
#ifndef ____H_HOSTUSBDEVICEIMPL
#define ____H_HOSTUSBDEVICEIMPL
#include "VirtualBoxBase.h"
#include "USBDeviceFilterImpl.h"
/* #include "USBProxyService.h" circular on Host/HostUSBDevice, the includer
* must include this. */
#include "Collection.h"
/**
* Object class used to hold Host USB Device properties.
*/
{
void FinalRelease();
// public initializer/uninitializer for internal purposes only
void uninit();
// IUSBDevice properties
// IHostUSBDevice properties
/** Additional internal states.
* The async detach stuff for Darwin is a two stage journey with a variation
* (filters) depending on who won the race to lock the Host object.
*
* @remark Trying out mac os x style enum naming convention here. nice or what?
*/
typedef enum
{
/** Nothing is pending here, check mPendingState. */
/** 1st stage of the detch, waiting for the logical detach notification. */
/** 1st stage of the detch, waiting for the logical detach notification - re-run filters.
* Prev: kDetachingPendingDetach */
/** 2nd stage of the detach, waiting for the logical attach notification.
* Prev: kDetachingPendingDetach */
/** 2nd stage of the detach, waiting for the logical attach notification - re-run filters.
* Prev: kDetachingPendingDetachFilters */
// public methods only for internal purposes
/** @note Must be called from under the object read lock. */
/** @note Must be called from under the object read lock. */
/** @note Must be called from under the object read lock. */
/** @note Must be called from under the object read lock. */
/** @note Must be called from under the object read lock. */
/** @note Must be called from under the object read lock. */
bool isStatePending() const { return mIsStatePending; }
/** @note Must be called from under the object read lock. */
void requestRelease();
void requestHold();
void setHeld();
void onDetachedPhys();
void handlePendingStateChange();
void cancelPendingState(bool aTimeout = false);
bool aIsStrict = true);
void checkForAsyncTimeout();
// for VirtualBoxSupportErrorInfoImpl
/** Same as mPendingState but for the internal states. */
/** RTTimeNanoTS() of when mIsStatePending was set or mDetaching changed
* from kNotDetaching. For operations that cannot be cancelled it's 0. */
bool mIsStatePending : 1;
/** Pointer to the USB Proxy Service instance. */
/** Pointer to the USB Device structure owned by this device.
* Only used for host devices. */
#ifdef __LINUX__
#endif
};
{
return E_INVALIDARG;
if (!aDevice)
return E_POINTER;
{
++ it;
}
if (!found)
"Could not find a USB device with UUID {%s}"),
}
{
if (!aAddress)
return E_INVALIDARG;
if (!aDevice)
return E_POINTER;
{
++ it;
}
if (!found)
"Could not find a USB device with address '%ls'"),
aAddress);
}
#endif // ____H_HOSTUSBDEVICEIMPL