class io.UsbMonitor

class UsbMonitor {
    // fields

    io.UsbMonEvents readonly volatile m_activeEvents;
    std.Error const* readonly volatile m_ioError;
    bool readonly m_isOpen;

    // properties

    uint_t autoget property m_addressFilter;
    uint_t autoget property m_readParallelism;
    size_t autoget property m_kernelBufferSize;
    size_t autoget property m_readBlockSize;
    size_t autoget property m_readBufferSize;
    io.UsbMonOptions autoget property m_options;

    // construction

    construct();
    destruct();

    // methods

    bool errorcode open(
        string_t captureDeviceName,
        size_t snapshotLength = 0
    );

    void close();

    size_t errorcode read(
        void* p,
        size_t size
    );

    long errorcode wait(
        io.UsbMonEvents eventMask,
        void function* handler(io.UsbMonEvents triggeredEvents)
    );

    bool errorcode cancelWait(long handle);

    io.UsbMonEvents blockingWait(
        io.UsbMonEvents eventMask,
        uint_t timeout = -1
    );

    io.UsbMonEvents async asyncWait(io.UsbMonEvents eventMask);
};