summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/NewKit/ArrayList.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-05-29 10:51:53 +0200
committerGitHub <noreply@github.com>2025-05-29 10:51:53 +0200
commit5c0bb7ee7b1b0fee02cc179fb21f4c57a61d6c2d (patch)
treecb17577bcdc9714c97a84ce417a075117097f146 /dev/kernel/NewKit/ArrayList.h
parentd608230b1350b064ceb01e6572519b108f6139b0 (diff)
parent3167f59dbb401d6a79b1524537e04218baf49ee3 (diff)
Merge pull request #32 from nekernel-org/dev
0.0.2e3
Diffstat (limited to 'dev/kernel/NewKit/ArrayList.h')
-rw-r--r--dev/kernel/NewKit/ArrayList.h44
1 files changed, 0 insertions, 44 deletions
diff --git a/dev/kernel/NewKit/ArrayList.h b/dev/kernel/NewKit/ArrayList.h
deleted file mode 100644
index d07e534c..00000000
--- a/dev/kernel/NewKit/ArrayList.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -------------------------------------------
-
- Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved.
-
-------------------------------------------- */
-
-#pragma once
-
-#include <NewKit/Defines.h>
-
-namespace Kernel {
-template <typename T>
-class ArrayList final {
- public:
- explicit ArrayList(T* list, SizeT length) : fList(reinterpret_cast<T>(list)) {}
-
- ~ArrayList() = default;
-
- ArrayList& operator=(const ArrayList&) = default;
- ArrayList(const ArrayList&) = default;
-
- T* Data() { return fList; }
-
- const T* CData() { return fList; }
-
- T& operator[](SizeT index) const {
- MUST_PASS(index < this->Count());
- return fList[index];
- }
-
- operator bool() { return fList; }
-
- SizeT Count() const { return fLen; }
-
- private:
- T* fList{nullptr};
- SizeT fLen{0};
-};
-
-template <typename ValueType>
-ArrayList<ValueType> make_list(ValueType val) {
- return ArrayList<ValueType>{val};
-}
-} // namespace Kernel