From 09dd11ddf800898c00ecb04a65fb5cd10fb481fa Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 8 May 2024 12:32:41 +0200 Subject: MHR-23: :boom: changes, reworked project tree. Signed-off-by: Amlal El Mahrouss --- Private/NewKit/Ref.hpp | 89 -------------------------------------------------- 1 file changed, 89 deletions(-) delete mode 100644 Private/NewKit/Ref.hpp (limited to 'Private/NewKit/Ref.hpp') diff --git a/Private/NewKit/Ref.hpp b/Private/NewKit/Ref.hpp deleted file mode 100644 index b062cf09..00000000 --- a/Private/NewKit/Ref.hpp +++ /dev/null @@ -1,89 +0,0 @@ - -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#pragma once - -#include -#include - -namespace NewOS -{ - template - class Ref final - { - public: - Ref() = default; - ~Ref() = default; - - public: - Ref(T cls, const bool& strong = false) - : fClass(cls), fStrong(strong) - { - } - - Ref& operator=(T ref) - { - fClass = ref; - return *this; - } - - public: - T operator->() const - { - return fClass; - } - - T& Leak() - { - return fClass; - } - - T operator*() - { - return fClass; - } - - bool IsStrong() const - { - return fStrong; - } - - operator bool() - { - return fStrong; - } - - private: - T fClass; - bool fStrong{false}; - }; - - template - class NonNullRef final - { - public: - NonNullRef() = delete; - NonNullRef(nullPtr) = delete; - - NonNullRef(T* ref) - : fRef(ref, true) - { - } - - Ref& operator->() - { - MUST_PASS(fRef); - return fRef; - } - - NonNullRef& operator=(const NonNullRef& ref) = delete; - NonNullRef(const NonNullRef& ref) = default; - - private: - Ref fRef{nullptr}; - }; -} // namespace NewOS -- cgit v1.2.3