class io.DeviceMonitor

class DeviceMonitor {
    // fields

    bool readonly m_isConnected;
    string_t readonly m_deviceName;
    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;
    bool autoget property m_isEnabled;
    string_t autoget property m_fileNameFilter;

    // construction

    construct();
    destruct();

    // methods

    bool errorcode open();
    bool errorcode connect(string_t 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
    );

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