Contur 2
Educational OS kernel simulator
Loading...
Searching...
No Matches
io_types.h
Go to the documentation of this file.
1
3
4#pragma once
5
6#include <cstdint>
7
8namespace contur {
9
12 {
14 std::int32_t value = -1;
15
17 [[nodiscard]] constexpr bool valid() const noexcept
18 {
19 return value >= 0;
20 }
21
23 friend constexpr bool operator==(IoDescriptor lhs, IoDescriptor rhs) noexcept
24 {
25 return lhs.value == rhs.value;
26 }
27 };
28
30 enum class IoResourceKind : std::uint8_t
31 {
32 File = 0,
36 };
37
38} // namespace contur
Definition block.h:15
IoResourceKind
Resource kinds supported by the kernel I/O layer.
Definition io_types.h:31
Unified descriptor handle returned by the kernel I/O layer.
Definition io_types.h:12
constexpr bool valid() const noexcept
Returns true when descriptor is valid.
Definition io_types.h:17
std::int32_t value
Underlying descriptor value.
Definition io_types.h:14
friend constexpr bool operator==(IoDescriptor lhs, IoDescriptor rhs) noexcept
Equality comparison for descriptor values.
Definition io_types.h:23