std::size_t deviceCount() const noexcept
Returns the number of registered devices.
DeviceManager(const DeviceManager &)=delete
Result< RegisterValue > read(DeviceId id)
Reads a value from the device with the given ID.
Result< void > write(DeviceId id, RegisterValue value)
Writes a value to the device with the given ID.
std::optional< std::reference_wrapper< IDevice > > getDevice(DeviceId id) noexcept
Returns a non-owning reference to the device with the given ID, if present.
std::unique_ptr< Impl > impl_
DeviceManager & operator=(const DeviceManager &)=delete
Result< void > registerDevice(std::unique_ptr< IDevice > device)
Registers a device. Takes ownership.
DeviceManager(DeviceManager &&) noexcept
Result< void > unregisterDevice(DeviceId id)
Removes and destroys a device by ID.
bool hasDevice(DeviceId id) const noexcept
Returns true if a device with the given ID is registered.
Abstract interface for a simulated I/O device.
A result type that holds either a success value of type T or an ErrorCode.
Error codes and Result<T> type for fallible operations.
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.
Common type aliases, sentinel constants, and forward declarations used throughout the Contur 2 kernel...