Files
serenity/Kernel/Devices/BaseDevices.h
Liav A. 96e1391c23 Kernel/Devices: Remove the DeviceManagement singleton
This change has many improvements:
- We don't use `LockRefPtr` to hold instances of many base devices as
  with the DeviceManagement class. Instead, we have a saner pattern of
  holding them in a `NonnullRefPtr<T> const`, in a small-text footprint
  class definition in the `Device.cpp` file.
- The awkwardness of using `::the()` each time we need to get references
  to mostly-static objects (like the Event queue) in runtime is now gone
  in the migration to using the `Device` class.
- Acquiring a device feel more obvious because we use now the Device
  class for this method. The method name is improved as well.
2024-10-05 12:26:48 +02:00

24 lines
546 B
C++

/*
* Copyright (c) 2024, Liav A. <liavalb@hotmail.co.il>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/NonnullRefPtr.h>
#include <AK/Types.h>
#include <Kernel/Devices/Generic/ConsoleDevice.h>
#include <Kernel/Devices/Generic/DeviceControlDevice.h>
#include <Kernel/Devices/Generic/NullDevice.h>
namespace Kernel {
struct BaseDevices {
NonnullRefPtr<NullDevice> const null_device;
NonnullRefPtr<ConsoleDevice> const console_device;
NonnullRefPtr<DeviceControlDevice> const device_control_device;
};
}