aboutsummaryrefslogtreecommitdiff
path: root/kernel/kapi/devices/device.cpp
blob: 6ac92e79a3079f4345162e8d9b96c6bd724ed36c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <kapi/devices/device.hpp>

#include <kapi/devices.hpp>
#include <kapi/devices/bus.hpp>

#include <kstd/memory.hpp>
#include <kstd/string.hpp>

#include <cstddef>

namespace kapi::devices
{
  device::device(size_t major, size_t minor, kstd::string const & name)
      : m_major(major)
      , m_minor(minor)
      , m_name(name)
  {}

  [[nodiscard]] auto device::major() const -> size_t
  {
    return m_major;
  }

  [[nodiscard]] auto device::minor() const -> size_t
  {
    return m_minor;
  }

  [[nodiscard]] auto device::name() const -> kstd::string const &
  {
    return m_name;
  }

  auto device::set_parent(kstd::observer_ptr<bus> parent) -> void
  {
    m_parent = parent;
  }

  auto device::query_interface(interface) -> void *
  {
    return nullptr;
  }

}  // namespace kapi::devices