VirtualBox

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


Ignore:
Timestamp:
Apr 15, 2010 9:18:31 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
60109
Message:

Main/HostHardwareLinux: generalised the VBoxMainHotplugWaiter class to allow for runtime implementation selection

File:
1 edited

Legend:

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

    r25728 r28349  
    4444        /** The device node of the drive. */
    4545        iprt::MiniString mDevice;
    46         /** The hal unique device identifier, if available. */
     46        /** A unique identifier for the device, if available.  This should be
     47         * kept consistant accross different probing methods of a given
     48         * platform if at all possible. */
    4749        iprt::MiniString mUdi;
    4850        /** A textual description of the drive. */
     
    124126        /** The device node of the device. */
    125127        iprt::MiniString mDevice;
    126         /** The sysfs path of the device. */
     128        /** The system identifier of the device.  Specific to the probing
     129         * method. */
    127130        iprt::MiniString mSysfsPath;
    128131        /** Type for the list of interfaces. */
    129132        typedef std::vector<iprt::MiniString> InterfaceList;
    130         /** The sysfs paths of the device's interfaces. */
     133        /** The system IDs of the device's interfaces. */
    131134        InterfaceList mInterfaces;
    132135
    133136        /** Constructors */
    134137        USBDeviceInfo(const iprt::MiniString &aDevice,
    135                       const iprt::MiniString &aSysfsPath)
     138                      const iprt::MiniString &aSystemID)
    136139            : mDevice(aDevice),
    137               mSysfsPath(aSysfsPath)
     140              mSysfsPath(aSystemID)
    138141        { }
    139142    };
     
    172175/** Convenience typedef. */
    173176typedef VBoxMainUSBDeviceInfo::USBDeviceInfo::InterfaceList USBInterfaceList;
     177
     178/** Implementation of the hotplug waiter class below */
     179class VBoxMainHotplugWaiterImpl
     180{
     181public:
     182    VBoxMainHotplugWaiterImpl (void) {}
     183    virtual ~VBoxMainHotplugWaiterImpl (void) {}
     184    /** @copydoc VBoxMainHotplugWaiter::Wait */
     185    virtual int Wait (RTMSINTERVAL cMillies) = 0;
     186    /** @copydoc VBoxMainHotplugWaiter::Interrupt */
     187    virtual void Interrupt (void) = 0;
     188};
    174189
    175190/**
     
    181196class VBoxMainHotplugWaiter
    182197{
    183     /** Opaque context struct. */
    184     struct Context;
    185 
    186     /** Opaque waiter context. */
    187     Context *mContext;
    188 public:
    189     /** Constructor */
     198    /** Class implementation. */
     199    VBoxMainHotplugWaiterImpl *mImpl;
     200public:
     201    /** Constructor.  Responsible for selecting the implementation. */
    190202    VBoxMainHotplugWaiter (void);
    191203    /** Destructor. */
    192     ~VBoxMainHotplugWaiter (void);
     204    ~VBoxMainHotplugWaiter (void)
     205    {
     206        delete mImpl;
     207    }
    193208    /**
    194209     * Wait for a hotplug event.
     
    202217     * @param    cMillies   How long to wait for at most.
    203218     */
    204     int Wait (RTMSINTERVAL cMillies);
     219    int Wait (RTMSINTERVAL cMillies)
     220    {
     221        return mImpl->Wait(cMillies);
     222    }
    205223    /**
    206224     * Interrupts an active wait.  In the current implementation, the wait
    207225     * may not return until up to two seconds after calling this method.
    208226     */
    209     void Interrupt (void);
     227    void Interrupt (void)
     228    {
     229        mImpl->Interrupt();
     230    }
    210231};
    211232
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette