diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-21 03:30:40 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-21 03:30:40 -0500 |
| commit | e3fa27827e7647a0ecc466f4d92097fe48fbbb43 (patch) | |
| tree | 33ba30655f555d37e3c970707b27413936e5a9ad /public/frameworks/CoreFoundation.fwrk/headers/Ref.h | |
| parent | c739255b48b3a5b2e184ca1a637f9f1f95c978ff (diff) | |
| parent | efefa7221a3fea3636a64f2bf067e2af75626f34 (diff) | |
Merge pull request #79 from nekernel-org/devv0.0.61
Kernel: OpenHeFS fixes and new components.
Diffstat (limited to 'public/frameworks/CoreFoundation.fwrk/headers/Ref.h')
| -rw-r--r-- | public/frameworks/CoreFoundation.fwrk/headers/Ref.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/public/frameworks/CoreFoundation.fwrk/headers/Ref.h b/public/frameworks/CoreFoundation.fwrk/headers/Ref.h index c1d5aec7..6757daac 100644 --- a/public/frameworks/CoreFoundation.fwrk/headers/Ref.h +++ b/public/frameworks/CoreFoundation.fwrk/headers/Ref.h @@ -5,8 +5,7 @@ ======================================== */ -#ifndef _REF_H_ -#define _REF_H_ +#pragma once #include <CoreFoundation.fwrk/headers/Object.h> #include <libSystem/SystemKit/System.h> @@ -15,6 +14,9 @@ namespace CF { template <typename T> class CFRef; +/// ================================================================================ +/// @brief CFRef class for reference counting. +/// ================================================================================ template <typename T> class CFRef final CF_OBJECT { public: @@ -57,6 +59,9 @@ class CFRef final CF_OBJECT { T* fClass{nullptr}; }; +/// ================================================================================ +/// @brief CFNonNullRef class for non-null reference counting. +/// ================================================================================ template <typename T> class CFNonNullRef final { public: @@ -64,6 +69,7 @@ class CFNonNullRef final { CFNonNullRef(nullPtr) = delete; CFNonNullRef(T* ref) : fRef(ref) { MUST_PASS(ref); } + CFNonNullRef(CFRef<T> ref) : fRef(ref) { MUST_PASS(ref); } CFRef<T>& operator->() { MUST_PASS(fRef); @@ -78,4 +84,3 @@ class CFNonNullRef final { }; } // namespace CF -#endif // ifndef _NEKIT_REF_H_ |
