aboutsummaryrefslogtreecommitdiff
path: root/kapi/kapi/devices/bus.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'kapi/kapi/devices/bus.hpp')
-rw-r--r--kapi/kapi/devices/bus.hpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/kapi/kapi/devices/bus.hpp b/kapi/kapi/devices/bus.hpp
index 1f433efc..6356e166 100644
--- a/kapi/kapi/devices/bus.hpp
+++ b/kapi/kapi/devices/bus.hpp
@@ -11,6 +11,7 @@
#include <kstd/vector.hpp>
#include <atomic>
+#include <span>
namespace kapi::devices
{
@@ -36,9 +37,9 @@ namespace kapi::devices
//! Whenever a device is attached to a bus, the bus takes sole ownership of the device.
//!
//! @param child The child device to attach.
- auto add_child(kstd::unique_ptr<device> child) -> void;
+ auto add_child(kstd::shared_ptr<device> child) -> void;
- [[nodiscard]] auto children() const -> kstd::vector<kstd::observer_ptr<device>> const &;
+ [[nodiscard]] auto children() const -> std::span<kstd::shared_ptr<device> const>;
protected:
//! Enumerate the devices on the bus.
@@ -47,8 +48,7 @@ namespace kapi::devices
auto virtual enumerate() -> bool;
private:
- kstd::vector<kstd::unique_ptr<device>> m_devices;
- kstd::vector<kstd::observer_ptr<device>> m_observers;
+ kstd::vector<kstd::shared_ptr<device>> m_devices;
std::atomic_flag m_init_was_called{};
std::atomic_flag m_initialized{};
};