summaryrefslogtreecommitdiffhomepage
path: root/dev/Kernel/NewKit/Array.hxx
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-08-18 21:39:29 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-08-18 21:39:29 +0200
commitda70596895d8135e08f8caac6978117697b4c021 (patch)
tree2516785b5434df8453687f05dc8dd877438901ab /dev/Kernel/NewKit/Array.hxx
parent005de79004c9d30e64bdee6e14e06f9d47d1f2ab (diff)
[REFACTOR]
Improved project structure. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel/NewKit/Array.hxx')
-rw-r--r--dev/Kernel/NewKit/Array.hxx61
1 files changed, 0 insertions, 61 deletions
diff --git a/dev/Kernel/NewKit/Array.hxx b/dev/Kernel/NewKit/Array.hxx
deleted file mode 100644
index 1a2f6e86..00000000
--- a/dev/Kernel/NewKit/Array.hxx
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -------------------------------------------
-
- Copyright ZKA Technologies.
-
-------------------------------------------- */
-#pragma once
-
-#include <KernelKit/DebugOutput.hxx>
-#include <NewKit/ErrorOr.hxx>
-#include <NewKit/Defines.hxx>
-
-namespace Kernel
-{
- template <typename T, Size N>
- class Array final
- {
- public:
- explicit Array() = default;
- ~Array() = default;
-
- Array& operator=(const Array&) = default;
- Array(const Array&) = default;
-
- ErrorOr<T*> operator[](Size At)
- {
- if (At > N)
- return {};
-
- return ErrorOr<T*>(&fArray[At]);
- }
-
- Boolean Empty() const
- {
- for (auto Val : fArray)
- {
- if (Val)
- return false;
- }
-
- return true;
- }
-
- SizeT Count() const
- {
- return N;
- }
-
- const T* CData()
- {
- return fArray;
- }
-
- operator bool()
- {
- return !Empty();
- }
-
- private:
- T fArray[N];
- };
-} // namespace Kernel