diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-04-06 14:52:33 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-04-06 14:52:33 +0200 |
| commit | 32f75625830660468287de0f213baee760fc6384 (patch) | |
| tree | aaa8286ee13a4188d826d4efd59482c7b1aa0e73 /Private/NewKit/Ref.hpp | |
| parent | 422b8029eba71b6fbb6b3dcb386b8e115bbd08ef (diff) | |
:boom: Breaking changes, disk API improvemenets and bringing support for
more drivers...
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Private/NewKit/Ref.hpp')
| -rw-r--r-- | Private/NewKit/Ref.hpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Private/NewKit/Ref.hpp b/Private/NewKit/Ref.hpp index 4327081b..30e65e2f 100644 --- a/Private/NewKit/Ref.hpp +++ b/Private/NewKit/Ref.hpp @@ -18,27 +18,27 @@ class Ref final { ~Ref() = default; public: - Ref(T cls, const bool &strong = false) : m_Class(cls), m_Strong(strong) {} + Ref(T cls, const bool &strong = false) : fClass(cls), fStrong(strong) {} Ref &operator=(T ref) { - m_Class = ref; + fClass = ref; return *this; } public: - T operator->() const { return m_Class; } + T operator->() const { return fClass; } - T &Leak() { return m_Class; } + T &Leak() { return fClass; } - T operator*() { return m_Class; } + T operator*() { return fClass; } - bool IsStrong() const { return m_Strong; } + bool IsStrong() const { return fStrong; } - operator bool() { return m_Strong; } + operator bool() { return fStrong; } private: - T m_Class; - bool m_Strong{false}; + T fClass; + bool fStrong{false}; }; template <typename T> @@ -47,17 +47,17 @@ class NonNullRef final { NonNullRef() = delete; NonNullRef(nullPtr) = delete; - NonNullRef(T *ref) : m_Ref(ref, true) {} + NonNullRef(T *ref) : fRef(ref, true) {} Ref<T> &operator->() { - MUST_PASS(m_Ref); - return m_Ref; + MUST_PASS(fRef); + return fRef; } NonNullRef &operator=(const NonNullRef<T> &ref) = delete; NonNullRef(const NonNullRef<T> &ref) = default; private: - Ref<T> m_Ref{nullptr}; + Ref<T> fRef{nullptr}; }; } // namespace NewOS |
