aboutsummaryrefslogtreecommitdiff
path: root/libs/kstd/include
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2026-04-06 19:04:40 +0200
committerFelix Morgner <felix.morgner@ost.ch>2026-04-06 19:04:40 +0200
commitfe26083101537df306153e7bea7c291a041897f7 (patch)
tree0f26687fb172fc1852e9c4d58c351a76e9ceb50c /libs/kstd/include
parent2a3575a267dede6a364386c0bd6edcff92421f0d (diff)
parentd5c2e101d62f6b4b69c45c127e7a729d246da566 (diff)
downloadteachos-fe26083101537df306153e7bea7c291a041897f7.tar.xz
teachos-fe26083101537df306153e7bea7c291a041897f7.zip
Merge branch 'fmorgner/develop-BA-FS26/apci' into develop-BA-FS26
This patchset introduces basic support for ACPI. Currently, the only user of that support is the CPU discovery subsystem. It uses the processed ACPI information to initialize CPU core devices and their associated local APICs.
Diffstat (limited to 'libs/kstd/include')
-rw-r--r--libs/kstd/include/kstd/flat_map18
-rw-r--r--libs/kstd/include/kstd/units7
2 files changed, 24 insertions, 1 deletions
diff --git a/libs/kstd/include/kstd/flat_map b/libs/kstd/include/kstd/flat_map
index 6ffbbcf..3b13754 100644
--- a/libs/kstd/include/kstd/flat_map
+++ b/libs/kstd/include/kstd/flat_map
@@ -205,6 +205,24 @@ namespace kstd
return const_reverse_iterator{cbegin()};
}
+ //! Check whether this flat map is empty or not
+ [[nodiscard]] auto empty() const noexcept -> bool
+ {
+ return m_containers.keys.empty();
+ }
+
+ //! Get the number of elements in this flat map.
+ [[nodiscard]] auto size() const noexcept -> size_type
+ {
+ return m_containers.keys.size();
+ }
+
+ //! Get the maximum number of elements possible in this flat map
+ [[nodiscard]] auto max_size() const noexcept -> size_type
+ {
+ return std::min(m_containers.keys.max_size(), m_containers.values.max_size());
+ }
+
//! Try to insert a new key-value pair into the map.
//!
//! @param args Arguments to use for constructing the key-value pair.
diff --git a/libs/kstd/include/kstd/units b/libs/kstd/include/kstd/units
index f6dcdb1..bc7e1b9 100644
--- a/libs/kstd/include/kstd/units
+++ b/libs/kstd/include/kstd/units
@@ -14,6 +14,11 @@ namespace kstd
{
using value_type = ValueType;
+ constexpr basic_unit() noexcept
+ : value{}
+ {
+ }
+
explicit constexpr basic_unit(value_type value) noexcept
: value{value}
{}
@@ -142,4 +147,4 @@ namespace kstd
} // namespace kstd
-#endif \ No newline at end of file
+#endif