36 [[nodiscard]]
DeviceId id() const noexcept override;
37 [[nodiscard]] std::string_view
name() const noexcept override;
40 [[nodiscard]]
bool isReady() const noexcept override;
46 [[nodiscard]]
bool hasData() const noexcept;
~NetworkDevice() override
bool hasData() const noexcept
Returns true if the buffer has unread data.
std::string_view name() const noexcept override
Returns the human-readable device name.
std::size_t bufferSize() const noexcept
Returns the number of values currently in the buffer.
Result< RegisterValue > read() override
Reads a value from the device.
NetworkDevice(std::size_t bufferCapacity=256)
Constructs a network device with the given buffer capacity.
bool isReady() const noexcept override
Returns true if the device is ready for I/O operations.
NetworkDevice(NetworkDevice &&) noexcept
Result< void > write(RegisterValue value) override
Writes a value to the device.
NetworkDevice & operator=(const NetworkDevice &)=delete
static constexpr DeviceId NETWORK_DEVICE_ID
Default network device ID.
std::unique_ptr< Impl > impl_
NetworkDevice(const NetworkDevice &)=delete
A result type that holds either a success value of type T or an ErrorCode.
IDevice — abstract interface for I/O devices.
std::int32_t RegisterValue
Value stored in a CPU register.
std::uint16_t DeviceId
Unique identifier for an I/O device.