From 83d870e58457a1d335a1d9b9966a6a1887cc297b Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 24 Nov 2025 03:02:43 +0100 Subject: feat! breaking changes on kernel sources. Signed-off-by: Amlal El Mahrouss --- dev/kernel/NeKit/Ref.h | 77 -------------------------------------------------- 1 file changed, 77 deletions(-) delete mode 100644 dev/kernel/NeKit/Ref.h (limited to 'dev/kernel/NeKit/Ref.h') diff --git a/dev/kernel/NeKit/Ref.h b/dev/kernel/NeKit/Ref.h deleted file mode 100644 index dac701e0..00000000 --- a/dev/kernel/NeKit/Ref.h +++ /dev/null @@ -1,77 +0,0 @@ - -/* ======================================== - - Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license. - -======================================== */ - -#ifndef _NEKIT_REF_H_ -#define _NEKIT_REF_H_ - -#include -#include -#include -#include - -namespace Kernel { -/// =========================================================== /// -/// @brief Reference wrapper class. /// -/// =========================================================== /// -template -class Ref final { - public: - explicit Ref() = default; - ~Ref() = default; - - public: - Ref(T* cls) : fClass(*cls) {} - Ref(T cls) : fClass(cls) {} - - Ref& operator=(T ref) { - fClass = ref; - return *this; - } - - NE_COPY_DEFAULT(Ref) - - public: - T operator->() const { return fClass; } - - T& Leak() noexcept { return fClass; } - - T& TryLeak() noexcept { return fClass; } - - T operator*() { return fClass; } - - operator bool() noexcept { return true; } - - private: - T fClass; -}; - -template -class NonNullRef final { - public: - NonNullRef() = delete; - NonNullRef(nullPtr) = delete; - - NonNullRef(T* ref) : fRef(ref) { MUST_PASS(ref); } - NonNullRef(Ref ref) : fRef(ref) { MUST_PASS(ref); } - - Ref& operator->() { - MUST_PASS(fRef); - return fRef; - } - - NonNullRef& operator=(const NonNullRef& ref) = delete; - NonNullRef(const NonNullRef& ref) = default; - - private: - Ref fRef{}; -}; - -using RefAny = Ref; -using NonNullRefAny = NonNullRef; -} // namespace Kernel - -#endif // ifndef _NEKIT_REF_H_ -- cgit v1.2.3