class io.DeviceMonitor

class DeviceMonitor {
    // fields

    char const* readonly m_deviceName;
    bool readonly m_isConnected;
    io.DeviceMonitorEvents readonly volatile m_activeEvents;
    std.Error const* readonly volatile m_ioError;
    bool readonly m_isOpen;

    // properties

    uint_t autoget property m_readParallelism;
    size_t autoget property m_readBlockSize;
    size_t autoget property m_readBufferSize;
    size_t autoget property m_pendingNotifySizeLimit;
    char const* autoget property m_fileNameFilter;
    bool autoget property m_isEnabled;

    // construction

    construct();
    destruct();

    // methods

    bool errorcode open();
    bool errorcode connect(char const* deviceName);
    void close();

    void setIoctlDescTable(
        io.psx.DeviceMonitorIoctlDesc const* ioctlDesc,
        size_t count
    );

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

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

    bool errorcode cancelWait(long handle);

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

    import io.DeviceMonitor.DeviceMonitorEvents async asyncWait(io.DeviceMonitorEvents eventMask);
};