diff --git a/.cache/clangd/index/Main.cpp.8DF821074DA7C9F4.idx b/.cache/clangd/index/Main.cpp.8DF821074DA7C9F4.idx
new file mode 100644
index 0000000..9def6af
Binary files /dev/null and b/.cache/clangd/index/Main.cpp.8DF821074DA7C9F4.idx differ
diff --git a/.cache/clangd/index/dummy.cpp.B9E4701905B53878.idx b/.cache/clangd/index/dummy.cpp.B9E4701905B53878.idx
new file mode 100644
index 0000000..a81445f
Binary files /dev/null and b/.cache/clangd/index/dummy.cpp.B9E4701905B53878.idx differ
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..5dcdeb6
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,12 @@
+---
+BasedOnStyle: Microsoft
+IndentWidth: 4
+---
+Language: Cpp
+FixNamespaceComments: true
+NamespaceIndentation: All
+SeparateDefinitionBlocks: Always
+SortIncludes: CaseSensitive
+SpaceAfterCStyleCast: true
+SpaceAfterLogicalNot: false
+SpaceAfterTemplateKeyword: false
diff --git a/.gitignore b/.gitignore
index 46fefa8..09581fc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,3 +46,4 @@
# Built Visual Studio Code Extensions
*.vsix
+build/
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 0000000..d77eff2
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,20 @@
+{
+ // Use IntelliSense to learn about possible attributes.
+ // Hover to view descriptions of existing attributes.
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "C/C++: debiug",
+ "type": "cppvsdbg",
+ "request": "launch",
+ "program": "${workspaceFolder}/build/bin/IACoreTest.exe",
+ "args": [],
+ "stopAtEntry": false,
+ "cwd": "${workspaceFolder}/",
+ "environment": [],
+ "preLaunchTask": "build",
+ "console": "integratedTerminal"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..5383c6a
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,72 @@
+{
+ "files.associations": {
+ "stdexcept": "cpp",
+ "chrono": "cpp",
+ "forward_list": "cpp",
+ "initializer_list": "cpp",
+ "list": "cpp",
+ "vector": "cpp",
+ "xhash": "cpp",
+ "xiosbase": "cpp",
+ "xstring": "cpp",
+ "xutility": "cpp",
+ "format": "cpp",
+ "functional": "cpp",
+ "filesystem": "cpp",
+ "unordered_map": "cpp",
+ "algorithm": "cpp",
+ "iterator": "cpp",
+ "xmemory": "cpp",
+ "cmath": "cpp",
+ "atomic": "cpp",
+ "bit": "cpp",
+ "cctype": "cpp",
+ "charconv": "cpp",
+ "clocale": "cpp",
+ "codecvt": "cpp",
+ "compare": "cpp",
+ "concepts": "cpp",
+ "cstddef": "cpp",
+ "cstdint": "cpp",
+ "cstdio": "cpp",
+ "cstdlib": "cpp",
+ "cstring": "cpp",
+ "ctime": "cpp",
+ "cwchar": "cpp",
+ "exception": "cpp",
+ "fstream": "cpp",
+ "iomanip": "cpp",
+ "ios": "cpp",
+ "iosfwd": "cpp",
+ "istream": "cpp",
+ "limits": "cpp",
+ "locale": "cpp",
+ "memory": "cpp",
+ "new": "cpp",
+ "optional": "cpp",
+ "ratio": "cpp",
+ "sstream": "cpp",
+ "stop_token": "cpp",
+ "streambuf": "cpp",
+ "string": "cpp",
+ "system_error": "cpp",
+ "thread": "cpp",
+ "tuple": "cpp",
+ "type_traits": "cpp",
+ "typeinfo": "cpp",
+ "utility": "cpp",
+ "xfacet": "cpp",
+ "xlocale": "cpp",
+ "xlocbuf": "cpp",
+ "xlocinfo": "cpp",
+ "xlocmes": "cpp",
+ "xlocmon": "cpp",
+ "xlocnum": "cpp",
+ "xloctime": "cpp",
+ "xtr1common": "cpp",
+ "iostream": "cpp",
+ "map": "cpp",
+ "ostream": "cpp",
+ "xtree": "cpp"
+ }
+}
\ No newline at end of file
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
new file mode 100644
index 0000000..4b7c314
--- /dev/null
+++ b/.vscode/tasks.json
@@ -0,0 +1,19 @@
+{
+ "tasks": [
+ {
+ "label": "build",
+ "type": "shell",
+ "command": "cmake -S. -B./build -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ && cmake --build build",
+ "group": {
+ "kind": "build",
+ "isDefault": true
+ }
+ }
+ ],
+ "options": {
+ "env": {
+ "INCLUDE": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/include;C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/ATLMFC/include;C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/VS/include;C:/Program Files (x86)/Windows Kits/10/include/10.0.26100.0/ucrt;C:/Program Files (x86)/Windows Kits/10//include/10.0.26100.0//um;C:/Program Files (x86)/Windows Kits/10//include/10.0.26100.0//shared;C:/Program Files (x86)/Windows Kits/10//include/10.0.26100.0//winrt;C:/Program Files (x86)/Windows Kits/10//include/10.0.26100.0//cppwinrt;C:/Program Files (x86)/Windows Kits/NETFXSDK/4.8/include/um",
+ "LIB": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/ATLMFC/lib/x64;C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/lib/x64;C:/Program Files (x86)/Windows Kits/NETFXSDK/4.8/lib/um/x64;C:/Program Files (x86)/Windows Kits/10/lib/10.0.26100.0/ucrt/x64;C:/Program Files (x86)/Windows Kits/10//lib/10.0.26100.0//um/x64"
+ }
+ }
+}
\ No newline at end of file
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..4dab6bb
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,12 @@
+cmake_minimum_required(VERSION 3.28 FATAL_ERROR)
+
+set(CMAKE_CXX_STANDARD 20)
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+
+project(IACore)
+add_subdirectory(Src/IACore)
+add_subdirectory(Src/IACoreTest)
diff --git a/Src/IACore/CMakeLists.txt b/Src/IACore/CMakeLists.txt
new file mode 100644
index 0000000..ab59054
--- /dev/null
+++ b/Src/IACore/CMakeLists.txt
@@ -0,0 +1,4 @@
+
+add_library(IACore STATIC imp/cpp/dummy.cpp)
+
+target_include_directories(IACore PUBLIC inc/hpp imp/inl)
diff --git a/Src/IACore/imp/cpp/dummy.cpp b/Src/IACore/imp/cpp/dummy.cpp
new file mode 100644
index 0000000..e69de29
diff --git a/Src/IACore/imp/inl/iacore/algorithm/binary-search.inl b/Src/IACore/imp/inl/iacore/algorithm/binary-search.inl
new file mode 100644
index 0000000..5cb460f
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/algorithm/binary-search.inl
@@ -0,0 +1,52 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "interface/binary-search.interface.inl"
+
+namespace ia
+{
+ template
+ requires valid_contiguous_iterator_type
+ iterator_type BinarySearchLeft(IN iterator_type begin, IN iterator_type end, IN CONST typename iterator_type::value_type& v)
+ {
+ SSIZE_T l = 0, r = end - begin;
+ while(l < r)
+ {
+ const auto m = static_cast((l+r)/2);
+ const auto t = *(begin + m) < v;
+ l = t ? m + 1 : l;
+ r = t ? r : m;
+ }
+ return begin + l;
+ }
+
+ template
+ requires valid_contiguous_iterator_type
+ iterator_type BinarySearchRight(IN iterator_type begin, IN iterator_type end, IN CONST typename iterator_type::value_type& v)
+ {
+ SSIZE_T l = 0, r = end - begin;
+ while(l < r)
+ {
+ const auto m = static_cast((l+r)/2);
+ const auto t = *(begin + m) > v;
+ r = t ? m : r;
+ l = t ? l : m + 1;
+ }
+ return begin + (r - 1);
+ }
+}
diff --git a/Src/IACore/imp/inl/iacore/algorithm/interface/binary-search.interface.inl b/Src/IACore/imp/inl/iacore/algorithm/interface/binary-search.interface.inl
new file mode 100644
index 0000000..076d1c5
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/algorithm/interface/binary-search.interface.inl
@@ -0,0 +1,30 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include
+
+namespace ia
+{
+ template
+ requires valid_contiguous_iterator_type
+ iterator_type BinarySearchLeft(IN iterator_type begin, IN iterator_type end, IN CONST typename iterator_type::value_type& v);
+
+ template
+ requires valid_contiguous_iterator_type
+ iterator_type BinarySearchRight(IN iterator_type begin, IN iterator_type end, IN CONST typename iterator_type::value_type& v);
+}
diff --git a/Src/IACore/imp/inl/iacore/algorithm/interface/quick-sort.interface.inl b/Src/IACore/imp/inl/iacore/algorithm/interface/quick-sort.interface.inl
new file mode 100644
index 0000000..40505ef
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/algorithm/interface/quick-sort.interface.inl
@@ -0,0 +1,26 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include
+
+namespace ia
+{
+ template
+ requires valid_contiguous_iterator_type
+ VOID QuickSort(IN iterator_type begin, IN iterator_type end);
+}
diff --git a/Src/IACore/imp/inl/iacore/algorithm/quick-sort.inl b/Src/IACore/imp/inl/iacore/algorithm/quick-sort.inl
new file mode 100644
index 0000000..9034f41
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/algorithm/quick-sort.inl
@@ -0,0 +1,68 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "interface/quick-sort.interface.inl"
+
+namespace ia::__internal
+{
+ template
+ VOID quick_sort_partition(IN pointer_type data, IN SSIZE_T l, IN SSIZE_T r, OUT SSIZE_T& p_left, OUT SSIZE_T& p_right)
+ {
+ auto m = l;
+ p_left = l, p_right = r;
+ const auto p = data[(l+r)/2];
+ while(m <= p_right)
+ {
+ const auto t = data[m];
+ if(t < p)
+ {
+ ia_swap(data[m], data[p_left]);
+ p_left++;
+ }
+ else if(t > p)
+ {
+ ia_swap(data[m], data[p_right]);
+ p_right--;
+ continue;
+ }
+ m++;
+ }
+ }
+
+ template
+ VOID quick_sort_aux(IN pointer_type data, IN SSIZE_T start, IN SSIZE_T end)
+ {
+ SSIZE_T p_left { 0 }, p_right { 0 };
+ if(start >= 0 && start < end)
+ {
+ quick_sort_partition(data, start, end, p_left, p_right);
+ quick_sort_aux(data, start, p_left - 1);
+ quick_sort_aux(data, p_right + 1, end);
+ }
+ }
+}
+
+namespace ia
+{
+ template
+ requires valid_contiguous_iterator_type
+ VOID QuickSort(IN iterator_type begin, IN iterator_type end)
+ {
+ __internal::quick_sort_aux(&(begin[0]), 0, end - begin - 1);
+ }
+}
\ No newline at end of file
diff --git a/Src/IACore/imp/inl/iacore/array/array.inl b/Src/IACore/imp/inl/iacore/array/array.inl
new file mode 100644
index 0000000..421ff1f
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/array/array.inl
@@ -0,0 +1,21 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "interface/array.interface.inl"
+
+namespace ia {}
diff --git a/Src/IACore/imp/inl/iacore/array/interface/array.interface.inl b/Src/IACore/imp/inl/iacore/array/interface/array.interface.inl
new file mode 100644
index 0000000..d43cc10
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/array/interface/array.interface.inl
@@ -0,0 +1,56 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include
+
+namespace ia
+{
+ template, CONST SIZE_T _alignment = 1>
+ requires valid_allocator_type<_allocator_type, _value_type>
+ class Array: public FixedContainer<_value_type, _allocator_type, _alignment>
+ {
+ using Base = FixedContainer<_value_type, _allocator_type, _alignment>;
+
+ public:
+ using size_type = Base::size_type;
+ using ssize_type = Base::ssize_type;
+ using value_type = Base::value_type;
+ using buffer_type = Base::buffer_type;
+ using pointer_type = Base::pointer_type;
+ using reference_type = Base::reference_type;
+ using allocator_type = Base::allocator_type;
+ using const_pointer_type = Base::const_pointer_type;
+ using const_reference_type = Base::const_reference_type;
+ using iterator = Base::iterator;
+ using const_iterator = Base::const_iterator;
+ using reverse_iterator = Base::reverse_iterator;
+ using reverse_const_iterator = Base::reverse_const_iterator;
+ using comparator_type = Base::comparator_type;
+
+ public:
+ Array(): Base() {}
+ Array(IN size_type count): Base(count) {}
+ Array(IN initializer_list v): Base(v) {}
+ Array(IN Array&& r): Base(r) {}
+ Array(IN CONST Array& r): Base(r) {}
+ ~Array() {}
+
+ VOID operator=(IN CONST Array& r) { Base::copy_from(r); }
+ VOID operator=(IN Array&& r) { Base::take_from(IA_MOVE(r)); }
+ };
+}
diff --git a/Src/IACore/imp/inl/iacore/bytestring/bytestring.inl b/Src/IACore/imp/inl/iacore/bytestring/bytestring.inl
new file mode 100644
index 0000000..d97afcb
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/bytestring/bytestring.inl
@@ -0,0 +1,247 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "interface/bytestring.interface.inl"
+
+namespace ia
+{
+ template
+ ByteString FixedByteString<_size>::operator+(IN CONST IIByteString& other) CONST
+ {
+ ByteString res;
+ res.resize(length() + other.length());
+ ia_memcpy(res.data(), data(), length());
+ ia_memcpy(&res.data()[length()], other.data(), other.length());
+ return res;
+ }
+
+ ByteString ByteString::operator+(IN CONST IIByteString& other) CONST
+ {
+ ByteString res;
+ res.resize(length() + other.length());
+ ia_memcpy(res.data(), data(), length());
+ ia_memcpy(&res.data()[length()], other.data(), other.length());
+ return res;
+ }
+
+ ByteString& ByteString::operator+=(IN CONST IIByteString& other)
+ {
+ const auto l = length();
+ resize(l + other.length());
+ ia_memcpy(&data()[l], other.data(), other.length());
+ return *this;
+ }
+}
+
+namespace ia
+{
+ UINT16 IIByteString::swapEndianness16(IN UINT16 v)
+ {
+ const auto t = reinterpret_cast(&v);
+ std::swap(t[0], t[1]);
+ return v;
+ }
+
+ UINT32 IIByteString::swapEndianness32(IN UINT32 v)
+ {
+ const auto t = reinterpret_cast(&v);
+ std::swap(t[0], t[3]);
+ std::swap(t[1], t[2]);
+ return v;
+ }
+
+ UINT64 IIByteString::swapEndianness64(IN UINT64 v)
+ {
+ const auto t = reinterpret_cast(&v);
+ std::swap(t[0], t[7]);
+ std::swap(t[1], t[6]);
+ std::swap(t[2], t[5]);
+ std::swap(t[3], t[4]);
+ return v;
+ }
+
+ VOID IIByteString::swapEndianness16()
+ {
+ IA_ASSERT_MSG(!(length() % 2), "length must be 2-byte aligned");
+ const auto t = reinterpret_cast(data());
+ const auto l = length() >> 1;
+ for(SIZE_T i = 0; i < l; i++)
+ t[i] = swapEndianness16(t[i]);
+ }
+
+ VOID IIByteString::swapEndianness32()
+ {
+ IA_ASSERT_MSG(!(length() % 4), "length must be 4-byte aligned");
+ const auto t = reinterpret_cast(data());
+ const auto l = length() >> 2;
+ for(SIZE_T i = 0; i < l; i++)
+ t[i] = swapEndianness32(t[i]);
+ }
+
+ VOID IIByteString::swapEndianness64()
+ {
+ IA_ASSERT_MSG(!(length() % 8), "length must be 8-byte aligned");
+ const auto t = reinterpret_cast(data());
+ const auto l = length() >> 3;
+ for(SIZE_T i = 0; i < l; i++)
+ t[i] = swapEndianness64(t[i]);
+ }
+}
+
+namespace ia
+{
+ VOID IIByteString::fillFromHexString(IN CONST String& v)
+ {
+ STATIC CONSTEXPR UINT8 HEX_LUT[] = {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 255, 255, 255, 255, 255, 255, 255, 10, 11, 12, 13, 14, 15, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 10, 11, 12, 13, 14, 15, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255};
+
+ auto data = v.data();
+ const auto l = (v.length() >> 1) + (v.length() % 2);
+ if(l > length()) resize(l);
+ SIZE_T i { 0 };
+ for(CHAR c; (c = *data); data++)
+ {
+ auto t = HEX_LUT[c];
+ IAC_CHECK_SANITY(t < 16);
+ UINT8 byte = (t << 4);
+ data++;
+ c = *data;
+ if(!c) {
+ this->data()[i++] = byte;
+ break;
+ }
+ t = HEX_LUT[c];
+ IAC_CHECK_SANITY(t < 16);
+ byte |= (t & 0x0F);
+ this->data()[i++] = byte;
+ }
+ if(i < length()) ia_memset(&this->data()[i], 0, length() - i);
+ }
+
+ VOID IIByteString::fillFromUTF8String(IN CONST String& v)
+ {
+ fillFromMemory((PCUINT8)v.data(), v.length());
+ }
+
+ VOID IIByteString::fillFromMemory(IN PCUINT8 data, IN SIZE_T dataSize)
+ {
+ if(dataSize > length()) resize(dataSize);
+ else if(dataSize < length())
+ ia_memset(&this->data()[dataSize], 0, length() - dataSize);
+ ia_memcpy(this->data(), data, dataSize);
+ }
+
+ String IIByteString::toHexString() CONST
+ {
+ STATIC CONSTEXPR CHAR HEX_LUT[] = "0123456789ABCDEF";
+ String res;
+ for(SIZE_T i = 0; i < length(); i++)
+ {
+ res += HEX_LUT[(data()[i] >> 4) & 0x0F];
+ res += HEX_LUT[data()[i] & 0x0F];
+ }
+ return res;
+ }
+
+ String IIByteString::toBinString() CONST
+ {
+ String res; res.resize(8 * length());
+ for(SIZE_T i = 0; i < length(); i++)
+ {
+ auto byte = data()[i];
+ for(INT32 j = 0; j < 8; j++)
+ {
+ res[i * 8 + j] = (byte & 0x80) ? '1' : '0';
+ byte <<= 1;
+ }
+ }
+ return res;
+ }
+}
+
+namespace ia
+{
+ VOID IIByteString::put(IN SIZE_T position, IN PCUINT8 data, IN SIZE_T dataLength)
+ {
+ IAC_CHECK_OVERFLOW(position + dataLength, length());
+ memcpy(&this->data()[position], data, dataLength);
+ }
+
+ VOID IIByteString::put8(IN SIZE_T position, IN UINT8 data)
+ {
+ IAC_CHECK_OVERFLOW(position + 1, length());
+ this->data()[position] = data;
+ }
+
+ VOID IIByteString::put16le(IN SIZE_T position, IN UINT16 data)
+ {
+ IAC_CHECK_OVERFLOW(position + 2, length());
+ this->data()[position + 0] = data;
+ this->data()[position + 1] = data >> 8;
+ }
+
+ VOID IIByteString::put32le(IN SIZE_T position, IN UINT32 data)
+ {
+ IAC_CHECK_OVERFLOW(position + 4, length());
+ this->data()[position + 0] = data;
+ this->data()[position + 1] = data >> 8;
+ this->data()[position + 2] = data >> 16;
+ this->data()[position + 3] = data >> 24;
+ }
+
+ VOID IIByteString::put64le(IN SIZE_T position, IN UINT64 data)
+ {
+ IAC_CHECK_OVERFLOW(position + 8, length());
+ this->data()[position + 0] = data;
+ this->data()[position + 1] = data >> 8;
+ this->data()[position + 2] = data >> 16;
+ this->data()[position + 3] = data >> 24;
+ this->data()[position + 4] = data >> 32;
+ this->data()[position + 5] = data >> 40;
+ this->data()[position + 6] = data >> 48;
+ this->data()[position + 7] = data >> 56;
+ }
+
+ VOID IIByteString::put16be(IN SIZE_T position, IN UINT16 data)
+ {
+ IAC_CHECK_OVERFLOW(position + 2, length());
+ this->data()[position + 1] = data;
+ this->data()[position + 0] = data >> 8;
+ }
+
+ VOID IIByteString::put32be(IN SIZE_T position, IN UINT32 data)
+ {
+ IAC_CHECK_OVERFLOW(position + 4, length());
+ this->data()[position + 3] = data;
+ this->data()[position + 2] = data >> 8;
+ this->data()[position + 1] = data >> 16;
+ this->data()[position + 0] = data >> 24;
+ }
+
+ VOID IIByteString::put64be(IN SIZE_T position, IN UINT64 data)
+ {
+ IAC_CHECK_OVERFLOW(position + 8, length());
+ this->data()[position + 7] = data;
+ this->data()[position + 6] = data >> 8;
+ this->data()[position + 5] = data >> 16;
+ this->data()[position + 4] = data >> 24;
+ this->data()[position + 3] = data >> 32;
+ this->data()[position + 2] = data >> 40;
+ this->data()[position + 1] = data >> 48;
+ this->data()[position + 0] = data >> 56;
+ }
+}
diff --git a/Src/IACore/imp/inl/iacore/bytestring/interface/bytestring.interface.inl b/Src/IACore/imp/inl/iacore/bytestring/interface/bytestring.interface.inl
new file mode 100644
index 0000000..fb6be0c
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/bytestring/interface/bytestring.interface.inl
@@ -0,0 +1,124 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include
+#include
+
+namespace ia
+{
+ class IIByteString
+ {
+ public:
+ PURE_VIRTUAL(PUINT8 data());
+ PURE_VIRTUAL(SIZE_T length() CONST);
+ PURE_VIRTUAL(CONST PCUINT8 data() CONST);
+ PURE_VIRTUAL(VOID resize(IN SIZE_T newSize));
+ PURE_VIRTUAL(UINT8& operator[](IN SIZE_T index));
+ PURE_VIRTUAL(CONST UINT8& operator[](IN SIZE_T index) CONST);
+
+ public:
+ INLINE VOID fillFromHexString(IN CONST String& v);
+ INLINE VOID fillFromUTF8String(IN CONST String& v);
+ INLINE VOID fillFromMemory(IN PCUINT8 data, IN SIZE_T dataSize);
+
+ INLINE String toHexString() CONST;
+ INLINE String toBinString() CONST;
+
+ public:
+ STATIC INLINE UINT16 swapEndianness16(IN UINT16 v);
+ STATIC INLINE UINT32 swapEndianness32(IN UINT32 v);
+ STATIC INLINE UINT64 swapEndianness64(IN UINT64 v);
+
+ public:
+ INLINE VOID swapEndianness16();
+ INLINE VOID swapEndianness32();
+ INLINE VOID swapEndianness64();
+
+ public:
+ INLINE VOID put8(IN SIZE_T position, IN UINT8 data);
+ INLINE VOID put(IN SIZE_T position, IN PCUINT8 data, IN SIZE_T dataLength);
+
+ INLINE VOID put16le(IN SIZE_T position, IN UINT16 data);
+ INLINE VOID put32le(IN SIZE_T position, IN UINT32 data);
+ INLINE VOID put64le(IN SIZE_T position, IN UINT64 data);
+
+ INLINE VOID put16be(IN SIZE_T position, IN UINT16 data);
+ INLINE VOID put32be(IN SIZE_T position, IN UINT32 data);
+ INLINE VOID put64be(IN SIZE_T position, IN UINT64 data);
+
+ public:
+ SIZE_T size() CONST { return length(); }
+ };
+
+ class ByteString;
+
+ template
+ class FixedByteString: public IIByteString
+ {
+ public:
+ STATIC FixedByteString<_size> fromHexString(IN CONST String& v) { FixedByteString<_size> res; res.fillFromHexString(v); return IA_MOVE(res); }
+ STATIC FixedByteString<_size> fromUTF8String(IN CONST String& v) { FixedByteString<_size> res; res.fillFromUTF8String(v); return IA_MOVE(res); }
+ STATIC FixedByteString<_size> fromMemory(IN PCUINT8 data, IN SIZE_T dataSize) { FixedByteString<_size> res; res.fillFromMemory(data, dataSize); return IA_MOVE(res); }
+
+ public:
+ VOID resize(IN SIZE_T newSize) { THROW_INVALID_USAGE("attempting to resize a fixed byte string"); }
+
+ PUINT8 data() { return m_data; }
+ SIZE_T length() CONST { return _size; }
+ CONST PCUINT8 data() CONST { return m_data; }
+
+ UINT8& operator[](IN SIZE_T index) { return m_data[index]; }
+ CONST UINT8& operator[](IN SIZE_T index) CONST { return m_data[index]; }
+
+ public:
+ INLINE ByteString operator+(IN CONST IIByteString& other) CONST;
+
+ private:
+ UINT8 m_data[_size];
+ };
+
+ class ByteString: public IIByteString
+ {
+ public:
+ STATIC ByteString fromHexString(IN CONST String& v) { ByteString res; res.fillFromHexString(v); return IA_MOVE(res); }
+ STATIC ByteString fromUTF8String(IN CONST String& v) { ByteString res; res.fillFromUTF8String(v); return IA_MOVE(res); }
+ STATIC ByteString fromMemory(IN PCUINT8 data, IN SIZE_T dataSize) { ByteString res; res.fillFromMemory(data, dataSize); return IA_MOVE(res); }
+
+ public:
+ ByteString() {}
+ ByteString(IN CONST IIByteString& v) { fillFromMemory(v.data(), v.length()); }
+
+ public:
+ VOID resize(IN SIZE_T newSize) { m_data.resize(newSize); }
+
+ PUINT8 data() { return m_data.data(); }
+ SIZE_T length() CONST { return m_data.size(); }
+ CONST PCUINT8 data() CONST { return m_data.data(); }
+
+ UINT8& operator[](IN SIZE_T index) { return m_data[index]; }
+ CONST UINT8& operator[](IN SIZE_T index) CONST { return m_data[index]; }
+
+ public:
+ INLINE ByteString operator+(IN CONST IIByteString& other) CONST;
+
+ INLINE ByteString& operator+=(IN CONST IIByteString& other);
+
+ private:
+ Vector m_data;
+ };
+}
diff --git a/Src/IACore/imp/inl/iacore/container/dynamic.inl b/Src/IACore/imp/inl/iacore/container/dynamic.inl
new file mode 100644
index 0000000..55a9acb
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/container/dynamic.inl
@@ -0,0 +1,350 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "interface/dynamic.interface.inl"
+
+#define put_element(start, element) new (&Base::m_data[start]) value_type(element);
+#define move_element(start, element) new (&Base::m_data[start]) value_type(IA_MOVE(element));
+#define move_elements(start, data, count) for(size_type i = 0; i < count; i++) new (&Base::m_data[start + i]) value_type(IA_MOVE((data)[i]));
+
+#define __template_iterator template requires valid_forward_iterator_type
+#define __template template requires valid_allocator_type<_allocator_type, _value_type>
+#define __ia__identifier DynamicContainer<_value_type, _allocator_type, _alignment>
+#define define_member_function(return_type, name, ...) __template return_type __ia__identifier::name(__VA_ARGS__)
+#define define_const_member_function(return_type, name, ...) __template return_type __ia__identifier::name(__VA_ARGS__) CONST
+
+namespace ia
+{
+ define_member_function(, DynamicContainer)
+ {
+ }
+
+ define_member_function(, DynamicContainer, IN size_type count)
+ {
+ resize(count);
+ }
+
+ define_member_function(, DynamicContainer, IN initializer_list v)
+ {
+ reserve(v.size());
+ for(const auto& value: v) new (&Base::m_data[Base::m_count++]) value_type(value);
+ }
+
+ define_member_function(, ~DynamicContainer,)
+ {
+ reset();
+ }
+
+ define_member_function(VOID, copy_from, IN CONST __ia__identifier& r)
+ {
+ Base::m_allocator = r.m_allocator.selectOnContainerCopy();
+ reserve(r.capacity());
+ for(Base::m_count = 0; Base::m_count < r.m_count; Base::m_count++)
+ new (&Base::m_data[Base::m_count]) value_type(r.m_data[Base::m_count]);
+ }
+
+ define_member_function(VOID, take_from, IN __ia__identifier&& r)
+ {
+ ia_swap(Base::m_data, r.m_data);
+ ia_swap(Base::m_count, r.m_count);
+ ia_swap(Base::m_allocator, r.m_allocator);
+ ia_swap(m_capacity, r.m_capacity);
+ }
+
+ define_member_function(VOID, reset,)
+ {
+ Base::reset();
+ m_capacity = 0;
+ }
+
+ define_member_function(__ia__identifier::pointer_type, take,)
+ {
+ auto res = Base::m_data;
+ Base::m_data = nullptr;
+ reset();
+ return res;
+ }
+}
+
+namespace ia
+{
+ define_member_function(VOID, append, IN value_type&& v)
+ {
+ grow(1);
+ new (&Base::m_data[Base::m_count++]) value_type(IA_MOVE(v));
+ }
+
+ define_member_function(VOID, append, IN const_reference_type v)
+ {
+ grow(1);
+ new (&Base::m_data[Base::m_count++]) value_type(v);
+ }
+
+ define_member_function(VOID, append, IN size_type n, IN const_reference_type v)
+ {
+ grow(n);
+ for(size_type i = 0; i < n; i++)
+ new (&Base::m_data[Base::m_count++]) value_type(v);
+ }
+
+ define_member_function(VOID, append, IN size_type n, IN const_pointer_type v)
+ {
+ grow(n);
+ for(size_type i = 0; i < n; i++)
+ new (&Base::m_data[Base::m_count++]) value_type(v[i]);
+ }
+
+ define_member_function(VOID, append, IN initializer_list v)
+ {
+ grow(v.size());
+ for(auto it = v.begin(); it != v.end(); it++)
+ new (&Base::m_data[Base::m_count++]) value_type(*it);
+ }
+
+ define_member_function(__template_iterator VOID, append, IN iterator_type first, IN iterator_type last)
+ {
+ grow(last - first);
+ for(auto it = first; it != last; it++)
+ new (&Base::m_data[Base::m_count++]) value_type(*it);
+ }
+
+ define_member_function(__ia__identifier::iterator, insert, IN const_iterator p, IN value_type&& v)
+ {
+ const auto insert_at = p - Base::cbegin();
+ IA_ASSERT(insert_at <= Base::m_count);
+ pointer_type oldData {};
+ if(grow(1, &oldData))
+ {
+ move_elements(0, oldData, insert_at);
+ move_elements(insert_at + 1, &oldData[insert_at], Base::m_count - insert_at);
+ dealloc<_alignment>(Base::m_allocator, oldData);
+ }
+ else
+ {
+ for(ssize_type i = Base::m_count - 1; i >= insert_at; i--)
+ move_element(i + 1, Base::m_data[i]);
+ }
+ move_element(insert_at, v);
+ Base::m_count++;
+ return { Base::m_data + insert_at + 1 };
+ }
+
+ define_member_function(__ia__identifier::iterator, insert, IN const_iterator p, IN const_reference_type v)
+ {
+ const auto insert_at = p - Base::cbegin();
+ IA_ASSERT(insert_at <= Base::m_count);
+ pointer_type oldData {};
+ if(grow(1, &oldData))
+ {
+ move_elements(0, oldData, insert_at);
+ move_elements(insert_at + 1, &oldData[insert_at], Base::m_count - insert_at);
+ dealloc<_alignment>(Base::m_allocator, oldData);
+ }
+ else
+ {
+ for(ssize_type i = Base::m_count - 1; i >= insert_at; i--)
+ move_element(i + 1, Base::m_data[i]);
+ }
+ put_element(insert_at, v);
+ Base::m_count++;
+ return { Base::m_data + insert_at + 1 };
+ }
+
+ define_member_function(__ia__identifier::iterator, insert, IN const_iterator p, IN size_type n, IN const_reference_type v)
+ {
+ const auto insert_at = p - Base::cbegin();
+ IA_ASSERT(insert_at <= Base::m_count);
+ pointer_type oldData {};
+ if(grow(n, &oldData))
+ {
+ move_elements(0, oldData, insert_at);
+ move_elements(insert_at + n, &oldData[insert_at], Base::m_count - insert_at);
+ dealloc<_alignment>(Base::m_allocator, oldData);
+ }
+ else
+ {
+ for(ssize_type i = Base::m_count - 1; i >= insert_at; i--)
+ move_element(i + n, Base::m_data[i]);
+ }
+ for(size_type i = 0; i < n; i++) put_element(insert_at + i, v);
+ Base::m_count += n;
+ return { Base::m_data + insert_at + n };
+ }
+
+ define_member_function(__ia__identifier::iterator, insert, IN const_iterator p, IN size_type n, IN const_pointer_type v)
+ {
+ const auto insert_at = p - Base::cbegin();
+ IA_ASSERT(insert_at <= Base::m_count);
+ pointer_type oldData {};
+ if(grow(n, &oldData))
+ {
+ move_elements(0, oldData, insert_at);
+ move_elements(insert_at + n, &oldData[insert_at], Base::m_count - insert_at);
+ dealloc<_alignment>(Base::m_allocator, oldData);
+ }
+ else
+ {
+ for(ssize_type i = Base::m_count - 1; i >= insert_at; i--)
+ move_element(i + n, Base::m_data[i]);
+ }
+ for(size_type i = 0; i < n; i++) put_element(insert_at + i, v[i]);
+ Base::m_count += n;
+ return { Base::m_data + insert_at + n };
+ }
+
+ define_member_function(__ia__identifier::iterator, insert, IN const_iterator p, IN initializer_list v)
+ {
+ const auto insert_at = p - Base::cbegin();
+ IA_ASSERT(insert_at <= Base::m_count);
+ const auto n = v.size();
+ pointer_type oldData {};
+ if(grow(n, &oldData))
+ {
+ move_elements(0, oldData, insert_at);
+ move_elements(insert_at + n, &oldData[insert_at], Base::m_count - insert_at);
+ dealloc<_alignment>(Base::m_allocator, oldData);
+ }
+ else
+ {
+ for(ssize_type i = Base::m_count - 1; i >= insert_at; i--)
+ move_element(i + n, Base::m_data[i]);
+ }
+ ssize_type i { insert_at };
+ for(auto it = v.begin(); it != v.end(); it++, i++) put_element(i, *it);
+ Base::m_count += n;
+ return { Base::m_data + insert_at + n };
+ }
+
+ define_member_function(__template_iterator __ia__identifier::iterator, insert, IN const_iterator p, IN iterator_type first, IN iterator_type last)
+ {
+ const auto insert_at = p - Base::cbegin();
+ IA_ASSERT(insert_at <= Base::m_count);
+ const auto n = last - first;
+ pointer_type oldData {};
+ if(grow(n, &oldData))
+ {
+ move_elements(0, oldData, insert_at);
+ move_elements(insert_at + n, &oldData[insert_at], Base::m_count - insert_at);
+ dealloc<_alignment>(Base::m_allocator, oldData);
+ }
+ else
+ {
+ for(ssize_type i = Base::m_count - 1; i >= insert_at; i--)
+ move_element(i + n, Base::m_data[i]);
+ }
+ ssize_type i { insert_at };
+ for(auto it = first; it != last; it++, i++) put_element(i, *it);
+ Base::m_count += n;
+ return { Base::m_data + insert_at + n };
+ }
+
+ define_member_function(__ia__identifier::iterator, erase, IN const_iterator p, IN size_type n)
+ {
+ const auto erase_at = p - Base::cbegin();
+ IA_ASSERT((erase_at + n) <= Base::m_count);
+ for(size_type i = 0; i < n; i++) Base::m_data[erase_at + i].~value_type();
+ for(size_type i = erase_at + n; i < Base::m_count; i++) move_element(i - n, Base::m_data[i]);
+ Base::m_count -= n;
+ shrink();
+ return { Base::m_data + erase_at + n };
+ }
+
+ define_member_function(__ia__identifier::iterator, erase, IN const_iterator first, IN const_iterator last)
+ {
+ const auto n = last - first;
+ const auto erase_at = first - Base::cbegin();
+ IA_ASSERT((erase_at + n) <= Base::m_count);
+ for(size_type i = 0; i < n; i++) Base::m_data[erase_at + i].~value_type();
+ for(size_type i = erase_at + n; i < Base::m_count; i++) move_element(i - n, Base::m_data[i]);
+ Base::m_count -= n;
+ shrink();
+ return { Base::m_data + erase_at + n };
+ }
+
+ define_member_function(BOOL, grow, IN size_type size)
+ {
+ // [IATODO]: [IMPL] [URGENT] Proper grow using reallocation counts
+ return reserve(Base::m_count + size);
+ }
+
+ define_member_function(BOOL, grow, IN size_type size, OUT pointer_type* oldData)
+ {
+ // [IATODO]: [IMPL] [URGENT] Proper grow using reallocation counts
+ return reserve(Base::m_count + size, oldData);
+ }
+
+ define_member_function(VOID, shrink)
+ {
+
+ }
+}
+
+namespace ia
+{
+ define_member_function(BOOL, resize, IN size_type newCount)
+ {
+ const auto did_reallocate = reserve(newCount);
+ for(; Base::m_count < newCount; Base::m_count++) Base::m_allocator.construct(&Base::m_data[Base::m_count]);
+ return did_reallocate;
+ }
+
+ define_member_function(BOOL, reserve, IN size_type newCapacity)
+ {
+ const auto oldData = Base::m_data;
+ if(newCapacity <= m_capacity) return false;
+ Base::m_data = alloc<_alignment>(Base::m_allocator, newCapacity);
+ m_capacity = newCapacity;
+ if(!oldData) return true;
+ for(size_type i = 0; i < Base::m_count; i++)
+ new (&Base::m_data[i]) value_type(IA_MOVE(oldData[i]));
+ dealloc<_alignment>(Base::m_allocator, oldData);
+ return true;
+ }
+
+ define_member_function(BOOL, resize, IN size_type newCount, OUT pointer_type* oldData)
+ {
+ const auto did_reallocate = reserve(newCount, oldData);
+ Base::m_count = newCount;
+ return did_reallocate;
+ }
+
+ define_member_function(BOOL, reserve, IN size_type newCapacity, OUT pointer_type* oldData)
+ {
+ *oldData = Base::m_data;
+ if(newCapacity <= m_capacity) return false;
+ Base::m_data = alloc<_alignment>(Base::m_allocator, newCapacity);
+ m_capacity = newCapacity;
+ return true;
+ }
+
+ define_member_function(VOID, clear,)
+ {
+ if(Base::m_data) Base::m_allocator.destruct(Base::m_data, Base::m_count);
+ Base::m_count = 0;
+ }
+}
+
+#undef put_element
+#undef move_element
+#undef move_elements
+
+#undef __template_iterator
+#undef __template
+#undef __ia__identifier
+#undef define_member_function
+#undef define_const_member_function
diff --git a/Src/IACore/imp/inl/iacore/container/fixed.inl b/Src/IACore/imp/inl/iacore/container/fixed.inl
new file mode 100644
index 0000000..f73e66a
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/container/fixed.inl
@@ -0,0 +1,230 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "interface/fixed.interface.inl"
+
+#define __template template requires valid_allocator_type<_allocator_type, _value_type>
+#define __ia__identifier FixedContainer<_value_type, _allocator_type, _alignment>
+#define define_member_function(return_type, name, ...) __template return_type __ia__identifier::name(__VA_ARGS__)
+#define define_const_member_function(return_type, name, ...) __template return_type __ia__identifier::name(__VA_ARGS__) CONST
+
+namespace ia
+{
+ define_member_function(, FixedContainer)
+ {
+ }
+
+ define_member_function(, FixedContainer, IN size_type count)
+ {
+ m_count = count;
+ m_data = alloc<_alignment>(m_allocator, m_count);
+ m_allocator.construct(m_data, m_count);
+ }
+
+ define_member_function(, FixedContainer, IN initializer_list v)
+ {
+ m_data = alloc<_alignment>(m_allocator, v.size());
+ for(const auto& value: v) new (&m_data[m_count++]) value_type(value);
+ }
+
+ define_member_function(, ~FixedContainer,)
+ {
+ reset();
+ }
+
+ define_member_function(VOID, reset,)
+ {
+ if(m_data)
+ {
+ m_allocator.destruct(m_data, m_count);
+ dealloc<_alignment>(m_allocator, m_data);
+ m_data = nullptr;
+ }
+ m_count = 0;
+ }
+
+ define_member_function(__ia__identifier::pointer_type, take,)
+ {
+ auto res = m_data;
+ m_data = nullptr;
+ reset();
+ return res;
+ }
+
+ define_member_function(VOID, copy_from, IN CONST __ia__identifier& r)
+ {
+ m_allocator = r.m_allocator.selectOnContainerCopy();
+ m_data = alloc<_alignment>(m_allocator, (m_count = r.m_count));
+ for(size_type i = 0; i < m_count; i++)
+ new (&m_data[i]) value_type(r.m_data[i]);
+ }
+
+ define_member_function(VOID, take_from, IN __ia__identifier&& r)
+ {
+ ia_swap(m_data, r.m_data);
+ ia_swap(m_count, r.m_count);
+ ia_swap(m_allocator, r.m_allocator);
+ }
+}
+
+namespace ia
+{
+ define_member_function(__ia__identifier::iterator, find, IN comparator_type c, IN size_type offset)
+ {
+ return cfind(c, offset);
+ }
+
+ define_member_function(__ia__identifier::iterator, rfind, IN comparator_type c, IN size_type offset)
+ {
+ return crfind(c, offset);
+ }
+
+ define_member_function(template __ia__identifier::iterator, find, IN CONST compare_type& v, IN size_type offset)
+ {
+ return cfind(v, offset);
+ }
+
+ define_member_function(template __ia__identifier::iterator, rfind, IN CONST compare_type& v, IN size_type offset)
+ {
+ return crfind(v, offset);
+ }
+
+ define_const_member_function(__ia__identifier::const_iterator, cfind, IN comparator_type c, IN size_type offset)
+ {
+ for(size_type i = offset; i < m_count; i++)
+ if(!c(m_data[i])) return { &m_data[i] };
+ return end();
+ }
+
+ define_const_member_function(__ia__identifier::const_iterator, crfind, IN comparator_type c, IN size_type offset)
+ {
+ for(ssize_type i = m_count - 1; i >= offset; i--)
+ if(!c(m_data[i])) return { &m_data[i] };
+ return end();
+ }
+
+ define_const_member_function(template __ia__identifier::const_iterator, cfind, IN CONST compare_type& v, IN size_type offset)
+ {
+ for(size_type i = offset; i < m_count; i++)
+ if(v == m_data[i]) return { &m_data[i] };
+ return end();
+ }
+
+ define_const_member_function(template __ia__identifier::const_iterator, crfind, IN CONST compare_type& v, IN size_type offset)
+ {
+ for(ssize_type i = m_count - 1; i >= offset; i--)
+ if(v == m_data[i]) return { &m_data[i] };
+ return end();
+ }
+
+ define_const_member_function(BOOL, contains, IN comparator_type v)
+ {
+ for(size_type i = 0; i < m_count; i++)
+ if(!c(m_data[i])) return true;
+ return false;
+ }
+
+ define_const_member_function(template BOOL, contains, IN CONST compare_type& v)
+ {
+ for(size_type i = 0; i < m_count; i++)
+ if(v == m_data[i]) return true;
+ return false;
+ }
+
+ define_const_member_function(BOOL, operator==, IN CONST FixedContainer& o)
+ {
+ if(m_count != o.size()) return false;
+ const auto data = o.data();
+ for(size_type i = 0; i < o.size(); i++)
+ if(m_data[i] != data[i]) return false;
+ return true;
+ }
+
+ define_const_member_function(UINT64, hash,)
+ {
+ return IIHashable::fnv_1a((PCUINT8)m_data, m_count * sizeof(value_type));
+ }
+}
+
+namespace ia
+{
+ define_member_function(__ia__identifier::iterator, begin,)
+ {
+ return cbegin();
+ }
+
+ define_member_function(__ia__identifier::iterator, end,)
+ {
+ return cend();
+ }
+
+ define_member_function(__ia__identifier::reverse_iterator, rbegin,)
+ {
+ return crbegin();
+ }
+
+ define_member_function(__ia__identifier::reverse_iterator, rend,)
+ {
+ return crend();
+ }
+
+ define_const_member_function(__ia__identifier::const_iterator, begin,)
+ {
+ return cbegin();
+ }
+
+ define_const_member_function(__ia__identifier::const_iterator, end,)
+ {
+ return cend();
+ }
+
+ define_const_member_function(__ia__identifier::const_iterator, cbegin,)
+ {
+ return { m_data };
+ }
+
+ define_const_member_function(__ia__identifier::const_iterator, cend,)
+ {
+ return { m_data + m_count };
+ }
+
+ define_const_member_function(__ia__identifier::reverse_const_iterator, rbegin,)
+ {
+ return crbegin();
+ }
+
+ define_const_member_function(__ia__identifier::reverse_const_iterator, rend,)
+ {
+ return crend();
+ }
+
+ define_const_member_function(__ia__identifier::reverse_const_iterator, crbegin,)
+ {
+ return { m_data + m_count - 1 };
+ }
+
+ define_const_member_function(__ia__identifier::reverse_const_iterator, crend,)
+ {
+ return { m_data - 1 };
+ }
+}
+
+#undef __template
+#undef __ia__identifier
+#undef define_member_function
+#undef define_const_member_function
\ No newline at end of file
diff --git a/Src/IACore/imp/inl/iacore/container/interface/dynamic.interface.inl b/Src/IACore/imp/inl/iacore/container/interface/dynamic.interface.inl
new file mode 100644
index 0000000..29bd358
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/container/interface/dynamic.interface.inl
@@ -0,0 +1,101 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "fixed.interface.inl"
+
+namespace ia
+{
+ template, CONST SIZE_T _alignment = 1>
+ requires valid_allocator_type<_allocator_type, _value_type>
+ class DynamicContainer: public FixedContainer<_value_type, _allocator_type, _alignment>
+ {
+ using Base = FixedContainer<_value_type, _allocator_type, _alignment>;
+
+ public:
+ using size_type = Base::size_type;
+ using ssize_type = Base::ssize_type;
+ using value_type = Base::value_type;
+ using buffer_type = Base::buffer_type;
+ using pointer_type = Base::pointer_type;
+ using reference_type = Base::reference_type;
+ using allocator_type = Base::allocator_type;
+ using const_pointer_type = Base::const_pointer_type;
+ using const_reference_type = Base::const_reference_type;
+ using iterator = Base::iterator;
+ using const_iterator = Base::const_iterator;
+ using reverse_iterator = Base::reverse_iterator;
+ using reverse_const_iterator = Base::reverse_const_iterator;
+ using comparator_type = Base::comparator_type;
+
+ public:
+ DynamicContainer();
+ DynamicContainer(IN size_type count);
+ DynamicContainer(IN initializer_list v);
+ DynamicContainer(IN DynamicContainer&& r) { take_from(IA_MOVE(r)); }
+ DynamicContainer(IN CONST DynamicContainer& r) { copy_from(r); }
+ ~DynamicContainer();
+
+ VOID operator=(IN DynamicContainer&& r) { take_from(IA_MOVE(r)); }
+ VOID operator=(IN CONST DynamicContainer& r) { copy_from(r); }
+
+ public:
+ VOID append(IN value_type&& v);
+ VOID append(IN const_reference_type v);
+ VOID append(IN size_type n, IN const_reference_type v);
+ VOID append(IN size_type n, IN const_pointer_type v);
+ VOID append(IN initializer_list v);
+ template requires valid_forward_iterator_type
+ VOID append(IN iterator_type first, IN iterator_type last);
+
+ iterator insert(IN const_iterator p, IN value_type&& v);
+ iterator insert(IN const_iterator p, IN const_reference_type v);
+ iterator insert(IN const_iterator p, IN size_type n, IN const_reference_type v);
+ iterator insert(IN const_iterator p, IN size_type n, IN const_pointer_type v);
+ iterator insert(IN const_iterator p, IN initializer_list v);
+ template requires valid_forward_iterator_type
+ iterator insert(IN const_iterator p, IN iterator_type first, IN iterator_type last);
+
+ iterator erase(IN const_iterator p, IN size_type n = 1);
+ iterator erase(IN const_iterator first, IN const_iterator last);
+
+ public:
+ BOOL resize(IN size_type newCount);
+ BOOL reserve(IN size_type newCapacity);
+
+ VOID clear();
+ VIRTUAL VOID reset();
+ VIRTUAL pointer_type take();
+
+ public:
+ VIRTUAL size_type capacity() CONST { return m_capacity; }
+
+ protected:
+ BOOL resize(IN size_type newCount, OUT pointer_type* oldData);
+ BOOL reserve(IN size_type newCapacity, OUT pointer_type* oldData);
+
+ BOOL grow(IN size_type size);
+ BOOL grow(IN size_type size, OUT pointer_type* oldData);
+ VOID shrink();
+
+ VIRTUAL VOID take_from(IN DynamicContainer&& r);
+ VIRTUAL VOID copy_from(IN CONST DynamicContainer& r);
+
+ protected:
+ size_type m_capacity { 0 };
+ };
+}
diff --git a/Src/IACore/imp/inl/iacore/container/interface/fixed.interface.inl b/Src/IACore/imp/inl/iacore/container/interface/fixed.interface.inl
new file mode 100644
index 0000000..bd2a48f
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/container/interface/fixed.interface.inl
@@ -0,0 +1,139 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include
+#include
+#include
+
+#include "iterator.interface.inl"
+
+namespace ia
+{
+ template, CONST SIZE_T _alignment = 1>
+ requires valid_allocator_type<_allocator_type, _value_type>
+ class FixedContainer: public IIHashable
+ {
+ public:
+ using size_type = SIZE_T;
+ using ssize_type = SSIZE_T;
+ using value_type = _value_type;
+ using buffer_type = value_type*;
+ using pointer_type = value_type*;
+ using reference_type = value_type&;
+ using allocator_type = _allocator_type;
+ using const_pointer_type = CONST value_type*;
+ using const_reference_type = CONST value_type&;
+ using iterator = ContainerIterator;
+ using const_iterator = ContainerConstIterator;
+ using reverse_iterator = ContainerIterator;
+ using reverse_const_iterator = ContainerConstIterator;
+ using comparator_type = std::function;
+ STATIC CONSTEXPR size_type alignment = _alignment;
+
+ public:
+ FixedContainer();
+ FixedContainer(IN size_type count);
+ FixedContainer(IN initializer_list v);
+ FixedContainer(IN FixedContainer&& r) { take_from(IA_MOVE(r)); }
+ FixedContainer(IN CONST FixedContainer& r) { copy_from(r); }
+ ~FixedContainer();
+
+ VOID operator=(IN FixedContainer&& r) { take_from(IA_MOVE(r)); }
+ VOID operator=(IN CONST FixedContainer& r) { copy_from(r); }
+
+ public:
+ iterator begin();
+ iterator end();
+ const_iterator begin() CONST;
+ const_iterator end() CONST;
+ const_iterator cbegin() CONST;
+ const_iterator cend() CONST;
+
+ reverse_iterator rbegin();
+ reverse_iterator rend();
+ reverse_const_iterator rbegin() CONST;
+ reverse_const_iterator rend() CONST;
+ reverse_const_iterator crbegin() CONST;
+ reverse_const_iterator crend() CONST;
+
+ public:
+ value_type& front() { IA_ASSERT(m_count > 0); return m_data[0]; }
+ CONST value_type& front() CONST { IA_ASSERT(m_count > 0); return m_data[0]; }
+
+ value_type& back() { IA_ASSERT(m_count > 0); return m_data[m_count - 1]; }
+ CONST value_type& back() CONST { IA_ASSERT(m_count > 0); return m_data[m_count - 1]; }
+
+ value_type& operator[](IN size_type index) { IA_ASSERT(index < m_count); return m_data[index]; }
+ CONST value_type& operator[](IN size_type index) CONST { IA_ASSERT(index < m_count); return m_data[index]; }
+
+ public:
+ template
+ iterator find(IN CONST compare_type& v, IN size_type offset = 0);
+ iterator find(IN comparator_type c, IN size_type offset = 0);
+ template
+ iterator rfind(IN CONST compare_type& v, IN size_type offset = 0);
+ iterator rfind(IN comparator_type c, IN size_type offset = 0);
+
+ template
+ const_iterator find(IN CONST compare_type& v, IN size_type offset = 0) CONST { return cfind(v, offset); }
+ const_iterator find(IN comparator_type c, IN size_type offset = 0) CONST { return cfind(c, offset); }
+ template
+ const_iterator rfind(IN CONST compare_type& v, IN size_type offset = 0) CONST { return crfind(v, offset); }
+ const_iterator rfind(IN comparator_type c, IN size_type offset = 0) CONST { return crfind(c, offset); }
+
+ template
+ const_iterator cfind(IN CONST compare_type& v, IN size_type offset = 0) CONST;
+ const_iterator cfind(IN comparator_type c, IN size_type offset = 0) CONST;
+ template
+ const_iterator crfind(IN CONST compare_type& v, IN size_type offset = 0) CONST;
+ const_iterator crfind(IN comparator_type c, IN size_type offset = 0) CONST;
+
+ template
+ BOOL contains(IN CONST compare_type& v) CONST;
+ BOOL contains(IN CONST comparator_type c) CONST;
+
+ public:
+ UINT64 hash() CONST;
+
+ public:
+ BOOL operator==(IN CONST FixedContainer& o) CONST;
+
+ public:
+ pointer_type data() { return m_data; }
+ const_pointer_type CONST data() CONST { return m_data; }
+ VIRTUAL size_type size() CONST { return m_count; }
+ VIRTUAL BOOL empty() CONST { return !m_count; }
+
+ allocator_type& allocator() { return m_allocator; }
+ VOID allocator(IN CONST allocator_type& v) { m_allocator = v; }
+
+ public:
+ VIRTUAL VOID reset();
+ VIRTUAL pointer_type take();
+
+ VIRTUAL VOID take_from(IN FixedContainer&& r);
+ VIRTUAL VOID copy_from(IN CONST FixedContainer& r);
+
+ protected:
+ size_type m_count { 0 };
+ buffer_type m_data { nullptr };
+
+ protected:
+ allocator_type m_allocator {};
+ };
+}
diff --git a/Src/IACore/imp/inl/iacore/container/interface/iterator.interface.inl b/Src/IACore/imp/inl/iacore/container/interface/iterator.interface.inl
new file mode 100644
index 0000000..1c95cbb
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/container/interface/iterator.interface.inl
@@ -0,0 +1,133 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include
+
+namespace ia
+{
+ template
+ class ContainerIterator;
+
+ template
+ class ContainerConstIterator: public virtual ContiguousIterator, _value_type, CONST _value_type&, CONST _value_type*>
+ {
+ using Base = ContiguousIterator, _value_type, CONST _value_type&, CONST _value_type*>;
+
+ public:
+ using size_type = Base::size_type;
+ using ssize_type = Base::ssize_type;
+ using value_type = _value_type;
+ using pointer_type = CONST _value_type*;
+ using reference_type = CONST _value_type&;
+ using self_type = ContainerConstIterator<_value_type, _is_reverse>;
+
+ public:
+ ContainerConstIterator(IN pointer_type dataRef): m_dataPtr(dataRef) {}
+ ContainerConstIterator(IN CONST ContainerConstIterator& o): m_dataPtr(o.m_dataPtr) {}
+ ContainerConstIterator(IN CONST ContainerIterator<_value_type, _is_reverse>& o): m_dataPtr(o.m_dataPtr) {}
+
+ public:
+ pointer_type operator->() CONST { return m_dataPtr; }
+ reference_type operator*() CONST { return *m_dataPtr; }
+ reference_type operator[](IN ssize_type index) CONST { return m_dataPtr[index]; }
+
+ public:
+ self_type& operator++() { increment(); return *this; }
+ self_type operator++(IN INT32) { auto res = *this; increment(); return res; }
+ self_type& operator--() { decrement(); return *this; }
+ self_type operator--(IN INT32) { auto res = *this; decrement(); return res; }
+
+ self_type operator+(IN size_type off) CONST { if constexpr(_is_reverse) return { m_dataPtr - off }; else return { m_dataPtr + off }; }
+ self_type operator-(IN size_type off) CONST { if constexpr(_is_reverse) return { m_dataPtr + off }; else return { m_dataPtr - off }; }
+ self_type& operator+=(IN size_type off) { increment(off); return *this; }
+ self_type& operator-=(IN size_type off) { decrement(off); return *this; }
+
+ ssize_type operator-(IN CONST self_type& o) CONST { return m_dataPtr - o.m_dataPtr; }
+
+ public:
+ BOOL operator==(IN CONST self_type& o) CONST { return m_dataPtr == o.m_dataPtr; }
+ BOOL operator!=(IN CONST self_type& o) CONST { return m_dataPtr != o.m_dataPtr; }
+ BOOL operator<=(IN CONST self_type& o) CONST { return m_dataPtr <= o.m_dataPtr; }
+ BOOL operator>=(IN CONST self_type& o) CONST { return m_dataPtr >= o.m_dataPtr; }
+ BOOL operator<(IN CONST self_type& o) CONST { return m_dataPtr < o.m_dataPtr; }
+ BOOL operator>(IN CONST self_type& o) CONST { return m_dataPtr > o.m_dataPtr; }
+
+ protected:
+ pointer_type m_dataPtr { nullptr };
+
+ private:
+ ALWAYS_INLINE VOID increment(IN size_type count = 1) { if constexpr(_is_reverse) m_dataPtr-=count; else m_dataPtr+=count; }
+ ALWAYS_INLINE VOID decrement(IN size_type count = 1) { if constexpr(_is_reverse) m_dataPtr+=count; else m_dataPtr-=count; }
+
+ friend class ContainerIterator<_value_type, _is_reverse>;
+ };
+
+ template
+ class ContainerIterator: public virtual ContiguousIterator, _value_type, _value_type&, _value_type*>
+ {
+ using Base = ContiguousIterator, _value_type, _value_type&, _value_type*>;
+
+ public:
+ using size_type = Base::size_type;
+ using ssize_type = Base::ssize_type;
+ using value_type = _value_type;
+ using pointer_type = _value_type*;
+ using reference_type = _value_type&;
+ using self_type = ContainerIterator<_value_type, _is_reverse>;
+
+ public:
+ ContainerIterator(IN pointer_type dataRef): m_dataPtr(dataRef) {}
+ ContainerIterator(IN CONST self_type& o): m_dataPtr(o.m_dataPtr) {}
+ ContainerIterator(IN CONST ContainerConstIterator& o): m_dataPtr(const_cast(o.m_dataPtr)) {}
+
+ public:
+ pointer_type operator->() CONST { return m_dataPtr; }
+ reference_type operator*() CONST { return *m_dataPtr; }
+ reference_type operator[](IN ssize_type index) CONST { return m_dataPtr[index]; }
+
+ public:
+ self_type& operator++() { increment(); return *this; }
+ self_type operator++(IN INT32) { auto res = *this; increment(); return res; }
+ self_type& operator--() { decrement(); return *this; }
+ self_type operator--(IN INT32) { auto res = *this; decrement(); return res; }
+
+ self_type operator+(IN size_type off) CONST { if constexpr(_is_reverse) return { m_dataPtr - off }; else return { m_dataPtr + off }; }
+ self_type operator-(IN size_type off) CONST { if constexpr(_is_reverse) return { m_dataPtr + off }; else return { m_dataPtr - off }; }
+ self_type& operator+=(IN size_type off) { increment(off); return *this; }
+ self_type& operator-=(IN size_type off) { decrement(off); return *this; }
+
+ ssize_type operator-(IN CONST self_type& o) CONST { return m_dataPtr - o.m_dataPtr; }
+
+ public:
+ BOOL operator==(IN CONST self_type& o) CONST { return m_dataPtr == o.m_dataPtr; }
+ BOOL operator!=(IN CONST self_type& o) CONST { return m_dataPtr != o.m_dataPtr; }
+ BOOL operator<=(IN CONST self_type& o) CONST { return m_dataPtr <= o.m_dataPtr; }
+ BOOL operator>=(IN CONST self_type& o) CONST { return m_dataPtr >= o.m_dataPtr; }
+ BOOL operator<(IN CONST self_type& o) CONST { return m_dataPtr < o.m_dataPtr; }
+ BOOL operator>(IN CONST self_type& o) CONST { return m_dataPtr > o.m_dataPtr; }
+
+ protected:
+ pointer_type m_dataPtr { nullptr };
+
+ private:
+ ALWAYS_INLINE VOID increment(IN size_type count = 1) { if constexpr(_is_reverse) m_dataPtr-=count; else m_dataPtr+=count; }
+ ALWAYS_INLINE VOID decrement(IN size_type count = 1) { if constexpr(_is_reverse) m_dataPtr+=count; else m_dataPtr-=count; }
+
+ friend class ContainerConstIterator<_value_type, _is_reverse>;
+ };
+}
diff --git a/Src/IACore/imp/inl/iacore/container/iterator.inl b/Src/IACore/imp/inl/iacore/container/iterator.inl
new file mode 100644
index 0000000..6bebec3
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/container/iterator.inl
@@ -0,0 +1,21 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "interface/iterator.interface.inl"
+
+namespace ia {}
diff --git a/Src/IACore/imp/inl/iacore/hashable/iihashable.inl b/Src/IACore/imp/inl/iacore/hashable/iihashable.inl
new file mode 100644
index 0000000..e5bc2fc
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/hashable/iihashable.inl
@@ -0,0 +1,37 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "interface/iihashable.interface.inl"
+
+namespace ia
+{
+ template
+ concept hashable_type = std::derived_from<_type, IIHashable>;
+
+ INLINE UINT64 IIHashable::fnv_1a(IN PCUINT8 data, IN SIZE_T dataLength)
+ {
+ // Implemented as described at http://isthe.com/chongo/tech/comp/fnv/#google_vignette
+ UINT64 hash = 14695981039346656037llu;
+ for(SIZE_T i = 0; i < dataLength; i++)
+ {
+ hash = hash ^ data[i];
+ hash = hash * 1099511628211ul;
+ }
+ return hash;
+ }
+}
\ No newline at end of file
diff --git a/Src/IACore/imp/inl/iacore/hashable/interface/iihashable.interface.inl b/Src/IACore/imp/inl/iacore/hashable/interface/iihashable.interface.inl
new file mode 100644
index 0000000..fd58c7d
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/hashable/interface/iihashable.interface.inl
@@ -0,0 +1,31 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include
+
+namespace ia
+{
+ class IIHashable
+ {
+ public:
+ PURE_VIRTUAL(UINT64 hash() CONST);
+
+ public:
+ STATIC INLINE UINT64 fnv_1a(IN PCUINT8 data, IN SIZE_T dataLength);
+ };
+}
\ No newline at end of file
diff --git a/Src/IACore/imp/inl/iacore/iterator/interface/iterator.interface.inl b/Src/IACore/imp/inl/iacore/iterator/interface/iterator.interface.inl
new file mode 100644
index 0000000..91e7bf0
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/iterator/interface/iterator.interface.inl
@@ -0,0 +1,105 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include
+
+namespace ia
+{
+ template
+ class Iterator
+ {
+ public:
+ using size_type = SIZE_T;
+ using ssize_type = SSIZE_T;
+ using value_type = _value_type;
+ using reference_type = _reference_type;
+ using pointer_type = _pointer_type;
+
+ //public:
+ // PURE_VIRTUAL(iterator_type& operator=(IN CONST iterator_type&));
+
+ public:
+ PURE_VIRTUAL(pointer_type operator->() CONST);
+ PURE_VIRTUAL(reference_type operator*() CONST);
+ };
+
+ template
+ class ForwardIterator: public virtual Iterator
+ {
+ public:
+ using value_type = _value_type;
+ using reference_type = _reference_type;
+ using pointer_type = _pointer_type;
+
+ public:
+ PURE_VIRTUAL(iterator_type& operator++());
+ PURE_VIRTUAL(iterator_type operator++(IN INT32));
+
+ public:
+ PURE_VIRTUAL(BOOL operator==(IN CONST iterator_type&) CONST);
+ PURE_VIRTUAL(BOOL operator!=(IN CONST iterator_type&) CONST);
+ };
+
+ template
+ class BidirectionalIterator: public virtual ForwardIterator
+ {
+ public:
+ using value_type = _value_type;
+ using reference_type = _reference_type;
+ using pointer_type = _pointer_type;
+
+ public:
+ PURE_VIRTUAL(iterator_type& operator--());
+ PURE_VIRTUAL(iterator_type operator--(IN INT32));
+ };
+
+ template
+ class RandomAccessIterator: public virtual BidirectionalIterator
+ {
+ public:
+ using value_type = _value_type;
+ using reference_type = _reference_type;
+ using pointer_type = _pointer_type;
+
+ public:
+ PURE_VIRTUAL(iterator_type& operator+=(IN SIZE_T));
+ PURE_VIRTUAL(iterator_type& operator-=(IN SIZE_T));
+
+ public:
+ PURE_VIRTUAL(BOOL operator<(IN CONST iterator_type&) CONST);
+ PURE_VIRTUAL(BOOL operator>(IN CONST iterator_type&) CONST);
+ PURE_VIRTUAL(BOOL operator<=(IN CONST iterator_type&) CONST);
+ PURE_VIRTUAL(BOOL operator>=(IN CONST iterator_type&) CONST);
+
+ PURE_VIRTUAL(iterator_type operator+(IN SIZE_T) CONST);
+ PURE_VIRTUAL(iterator_type operator-(IN SIZE_T) CONST);
+ PURE_VIRTUAL(reference_type operator[](IN SSIZE_T) CONST);
+ };
+
+ template
+ class ContiguousIterator: public virtual RandomAccessIterator
+ {
+ public:
+ using value_type = _value_type;
+ using reference_type = _reference_type;
+ using pointer_type = _pointer_type;
+
+ public:
+ PURE_VIRTUAL(SSIZE_T operator-(IN CONST iterator_type&) CONST);
+ };
+}
diff --git a/Src/IACore/imp/inl/iacore/iterator/iterator.inl b/Src/IACore/imp/inl/iacore/iterator/iterator.inl
new file mode 100644
index 0000000..bf19325
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/iterator/iterator.inl
@@ -0,0 +1,42 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "interface/iterator.interface.inl"
+
+namespace ia
+{
+ template
+ concept valid_iterator_type =
+ std::derived_from>;
+
+ template
+ concept valid_forward_iterator_type =
+ std::derived_from>;
+
+ template
+ concept valid_bidirectional_iterator_type =
+ std::derived_from>;
+
+ template
+ concept valid_random_access_iterator_type =
+ std::derived_from>;
+
+ template
+ concept valid_contiguous_iterator_type =
+ std::derived_from>;
+}
diff --git a/Src/IACore/imp/inl/iacore/lib/interface/math.interface.inl b/Src/IACore/imp/inl/iacore/lib/interface/math.interface.inl
new file mode 100644
index 0000000..a856364
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/lib/interface/math.interface.inl
@@ -0,0 +1,34 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include
+
+namespace ia
+{
+ template
+ Tr floor(IN Tv v);
+ template
+ Tr ceil(IN Tv v);
+ template
+ Tr round(IN Tv v);
+
+ template
+ T1 min(IN T1 a, IN T2 b);
+ template
+ T1 max(IN T1 a, IN T2 b);
+}
\ No newline at end of file
diff --git a/Src/IACore/imp/inl/iacore/lib/interface/mem.interface.inl b/Src/IACore/imp/inl/iacore/lib/interface/mem.interface.inl
new file mode 100644
index 0000000..c4ab32f
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/lib/interface/mem.interface.inl
@@ -0,0 +1,60 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include
+
+/*
+* -----------------------------------
+* IMPORTANT
+* -----------------------------------
+* This code is an initial DRAFT and
+* has not yet been IA reviewed.
+*
+* Till this notice is removed from here,
+* DO NOT USE this code in production.
+*
+* [IATODO]: [URGENT] [REVIEW]
+*/
+
+namespace ia
+{
+ INLINE PVOID memset_8(OUT PVOID dst, IN UINT8 v, IN SIZE_T n);
+ INLINE PVOID memset_16(OUT PVOID dst, IN UINT16 v, IN SIZE_T n);
+ INLINE PVOID memset_32(OUT PVOID dst, IN UINT32 v, IN SIZE_T n);
+ INLINE PVOID memset_64(OUT PVOID dst, IN UINT64 v, IN SIZE_T n);
+
+ INLINE PVOID memcpy(OUT PVOID dst, IN PCVOID src, IN SIZE_T n);
+ INLINE PVOID memcpy(OUT PVOID dst, IN SIZE_T dst_len, IN PCVOID src, IN SIZE_T src_len);
+
+ INLINE PVOID memmov(INOUT PVOID dst, INOUT PCVOID src, IN SIZE_T n);
+ INLINE PVOID memmov(INOUT PVOID dst, IN SIZE_T dst_len, INOUT PCVOID src, IN SIZE_T src_len);
+
+ INLINE PVOID memchr(IN PCVOID s, IN CHAR c, IN SIZE_T n);
+ INLINE PVOID memcchr(IN PCVOID s, IN CHAR _c, IN SIZE_T n);
+ INLINE PVOID memmem(IN PCVOID l, IN SIZE_T l_len, IN PCVOID s, IN SIZE_T s_len);
+
+ INLINE INT memcmp(IN PCVOID s1, IN PCVOID s2, IN SIZE_T n);
+
+ ALWAYS_INLINE PVOID memset(OUT PVOID dst, IN UINT8 v, IN SIZE_T n) { return memset_8(dst, v, n); }
+ ALWAYS_INLINE PVOID memzero(OUT PVOID dst, IN SIZE_T n) { return memset(dst, 0, n); }
+ ALWAYS_INLINE PVOID memmove(INOUT PVOID dst, INOUT PCVOID src, IN SIZE_T n) { return memmov(dst, src, n); }
+ ALWAYS_INLINE PVOID memmove(INOUT PVOID dst, IN SIZE_T dst_len, INOUT PCVOID src, IN SIZE_T src_len) { return memmov(dst, dst_len, src, src_len); }
+
+ template
+ VOID swap(INOUT T& l, INOUT T& r);
+}
\ No newline at end of file
diff --git a/Src/IACore/imp/inl/iacore/lib/interface/str.interface.inl b/Src/IACore/imp/inl/iacore/lib/interface/str.interface.inl
new file mode 100644
index 0000000..5da08f5
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/lib/interface/str.interface.inl
@@ -0,0 +1,46 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include
+
+/*
+* -----------------------------------
+* IMPORTANT
+* -----------------------------------
+* This code is an initial DRAFT and
+* has not yet been IA reviewed.
+*
+* Till this notice is removed from here,
+* DO NOT USE this code in production.
+*
+* [IATODO]: [URGENT] [REVIEW]
+*/
+
+namespace ia
+{
+ INLINE SIZE_T strlen(IN PCCHAR str);
+
+ INLINE INT strcmp(IN PCCHAR s1, IN PCCHAR s2);
+ INLINE INT strncmp(IN PCCHAR s1, IN PCCHAR s2, IN SIZE_T n);
+
+ INLINE PCHAR stpcpy(OUT PCHAR dst, IN PCCHAR src);
+ INLINE PCHAR strcpy(OUT PCHAR dst, IN PCCHAR src);
+
+ INLINE PCHAR strcat(INOUT PCHAR s1, IN PCCHAR s2);
+ INLINE PCHAR strcat(OUT PCHAR dst, IN PCCHAR s1, IN PCCHAR s2);
+}
\ No newline at end of file
diff --git a/Src/IACore/imp/inl/iacore/lib/math.inl b/Src/IACore/imp/inl/iacore/lib/math.inl
new file mode 100644
index 0000000..53fc001
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/lib/math.inl
@@ -0,0 +1,48 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "interface/math.interface.inl"
+
+namespace ia
+{
+ template
+ Tr floor(IN Tv v)
+ {
+ return static_cast(v);
+ }
+
+ template
+ Tr ceil(IN Tv v)
+ {
+ Tr res = v;
+ if(v == (Tv)res) return res;
+ return res + 1;
+ }
+
+ template
+ Tr round(IN Tv v)
+ {
+ return ((v - static_cast(v)) >= 0.5) ? v + 1 : v;
+ }
+
+ template
+ T1 min(IN T1 a, IN T2 b) { return (a > b) ? b : a; }
+
+ template
+ T1 max(IN T1 a, IN T2 b) { return (a < b) ? b : a; }
+}
\ No newline at end of file
diff --git a/Src/IACore/imp/inl/iacore/lib/mem.inl b/Src/IACore/imp/inl/iacore/lib/mem.inl
new file mode 100644
index 0000000..0686744
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/lib/mem.inl
@@ -0,0 +1,177 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "interface/mem.interface.inl"
+
+namespace ia
+{
+ PVOID memset_8(OUT PVOID dst, IN UINT8 v, IN SIZE_T n)
+ {
+ /* Implementation is based on the code found in FreeBSD libk repository */
+ auto d = static_cast(dst);
+ while(n--) *d++ = v;
+ return dst;
+ }
+
+ PVOID memset_16(OUT PVOID dst, IN UINT16 v, IN SIZE_T n)
+ {
+ auto d = static_cast(dst);
+ while(n--) *d++ = v;
+ return dst;
+ }
+
+ PVOID memset_32(OUT PVOID dst, IN UINT32 v, IN SIZE_T n)
+ {
+ auto d = static_cast(dst);
+ while(n--) *d++ = v;
+ return dst;
+ }
+
+ PVOID memset_64(OUT PVOID dst, IN UINT64 v, IN SIZE_T n)
+ {
+ auto d = static_cast(dst);
+ while(n--) *d++ = v;
+ return dst;
+ }
+
+ PVOID memcpy(OUT PVOID dst, IN PCVOID src, IN SIZE_T n)
+ {
+ auto s = static_cast(src);
+ auto d = static_cast(dst);
+ while(n--) *d++ = *s++;
+ return dst;
+ }
+
+ PVOID memcpy(OUT PVOID dst, IN SIZE_T dst_len, IN PCVOID src, IN SIZE_T src_len)
+ {
+ auto n = (dst_len > src_len) ? src_len : dst_len;
+ auto s = static_cast(src);
+ auto d = static_cast(dst);
+ while(n--) *d++ = *s++;
+ return dst;
+ }
+
+ PVOID memmov(INOUT PVOID dst, INOUT PCVOID src, IN SIZE_T n)
+ {
+ const auto t = new UINT8[n];
+ auto s = static_cast(src);
+ auto tn = n;
+ auto tt = t;
+ while(tn--) *tt++ = *s++;
+ auto d = static_cast(dst);
+ tt = t;
+ while(n--) *d++ = *tt++;
+ delete[] t;
+ return dst;
+ }
+
+ PVOID memmov(INOUT PVOID dst, IN SIZE_T dst_len, INOUT PCVOID src, IN SIZE_T src_len)
+ {
+ auto n = (dst_len > src_len) ? src_len : dst_len;
+ const auto t = new UINT8[n];
+ auto s = static_cast(src);
+ auto tn = n;
+ auto tt = t;
+ while(tn--) *tt++ = *s++;
+ auto d = static_cast(dst);
+ tt = t;
+ while(n--) *d++ = *tt++;
+ delete[] t;
+ return dst;
+ }
+
+ PVOID memchr(IN PCVOID s, IN CHAR c, IN SIZE_T n)
+ {
+ /* Implementation is based on the code found in FreeBSD libk repository */
+ if B_UNLIKELY(!n) return nullptr;
+ auto p = static_cast(s);
+ do {
+ if (*p++ == c)
+ return ((PVOID)(PUINT)(p - 1));
+ } while (--n != 0);
+ return nullptr; // IATODO: URGENT Fix
+ }
+
+ PVOID memcchr(IN PCVOID s, IN CHAR _c, IN SIZE_T n)
+ {
+ /* Implementation is based on the code found in FreeBSD libk repository */
+ if B_UNLIKELY(!n) return nullptr;
+ auto c = static_cast(_c);
+ auto w = static_cast(_c);
+ w |= w << 8; w |= w << 16; w |= w << 32;
+ auto lp = reinterpret_cast(
+ reinterpret_cast(s) & ~(sizeof(long) - 1));
+ auto p = static_cast(s);
+ const auto e = reinterpret_cast((UINT64)(s) + n);
+#define TEST_BYTE if(*p != c) goto done; p++;
+ if(*lp++ != w) while(p < reinterpret_cast(lp)) { TEST_BYTE; }
+ while(reinterpret_cast(lp) < e)
+ {
+ if(*lp++ != w)
+ {
+ p = reinterpret_cast(lp);
+ TEST_BYTE;
+ TEST_BYTE;
+ TEST_BYTE;
+ TEST_BYTE;
+ TEST_BYTE;
+ TEST_BYTE;
+ TEST_BYTE;
+ goto done;
+ }
+ }
+ return nullptr;
+#undef TEST_BYTE
+ done:
+ return (p < e) ? DECONST(PVOID, static_cast(p)) : nullptr;
+ }
+
+ PVOID memmem(IN PCVOID l, IN SIZE_T l_len, IN PCVOID s, IN SIZE_T s_len)
+ {
+ /* Implementation is based on the code found in FreeBSD libk repository */
+ if B_UNLIKELY(l_len == 0 || s_len == 0 || l_len < s_len) return nullptr;
+ auto cs = static_cast(s);
+ if B_UNLIKELY(s_len == 1) return memchr(l, (int)*cs, l_len);
+ auto cl = static_cast(l);
+ auto last = DECONST(PCHAR, cl) + l_len - s_len;
+ for (auto cur = DECONST(PCHAR, cl); cur <= last; cur++)
+ if (cur[0] == cs[0] && memcmp(cur, cs, s_len) == 0)
+ return cur;
+ return nullptr;
+ }
+
+ INT memcmp(IN PCVOID s1, IN PCVOID s2, IN SIZE_T n)
+ {
+ /* Implementation is based on the code found in FreeBSD libk repository */
+ if B_UNLIKELY(!n) return 0;
+ auto p1 = static_cast(s1), p2 = static_cast(s2);
+ do {
+ if (*p1++ != *p2++)
+ return (*--p1 - *--p2);
+ } while (--n != 0);
+ return 0;
+ }
+
+ template
+ VOID swap(INOUT T& l, INOUT T& r)
+ {
+ T t = r;
+ r = l;
+ l = t;
+ }
+}
\ No newline at end of file
diff --git a/Src/IACore/imp/inl/iacore/lib/str.inl b/Src/IACore/imp/inl/iacore/lib/str.inl
new file mode 100644
index 0000000..39b5363
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/lib/str.inl
@@ -0,0 +1,85 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "interface/str.interface.inl"
+
+namespace ia
+{
+ SIZE_T strlen(IN PCCHAR str)
+ {
+ PCCHAR s = str;
+ while(*s++);
+ return s - str - 1;
+ }
+
+ INT strcmp(IN PCCHAR s1, IN PCCHAR s2)
+ {
+ // [IATODO]: [URGENT] [OPTIMIZE]
+ const auto a = strlen(s1), b = strlen(s2);
+ return strncmp(s1, s2, (a > b) ? a : b);
+ }
+
+ INT strncmp(IN PCCHAR s1, IN PCCHAR s2, IN SIZE_T n)
+ {
+ // [IATODO]: [URGENT] [VERIFY]
+ const auto a = reinterpret_cast(s1),
+ b = reinterpret_cast(s2);
+ for(SIZE_T i = 0; i < n; i++)
+ {
+ const auto d = a[i] - b[i];
+ if(d) return d;
+ }
+ return 0;
+ }
+
+ PCHAR stpcpy(OUT PCHAR dst, IN PCCHAR src)
+ {
+ for(CHAR c = 0; (c = *src); src++)
+ {
+ *dst++ = c;
+ }
+ *dst = 0;
+ return dst;
+ }
+
+ PCHAR strcpy(OUT PCHAR dst, IN PCCHAR src)
+ {
+ const auto originalDst = dst;
+ for(CHAR c = 0; (c = *src); src++)
+ {
+ *dst++ = c;
+ }
+ *dst = 0;
+ return originalDst;
+ }
+
+ PCHAR strcat(INOUT PCHAR s1, IN PCCHAR s2)
+ {
+ // [IATODO]: [URGENT] [OPTIMIZE]
+ return strcat(s1, s1, s2);
+ }
+
+ PCHAR strcat(OUT PCHAR dst, IN PCCHAR s1, IN PCCHAR s2)
+ {
+ // [IATODO]: [URGENT] [OPTIMIZE]
+ const auto originalDst = dst;
+ dst = stpcpy(dst, s1);
+ dst = stpcpy(dst, s2);
+ return originalDst;
+ }
+}
\ No newline at end of file
diff --git a/Src/IACore/imp/inl/iacore/list/entry.inl b/Src/IACore/imp/inl/iacore/list/entry.inl
new file mode 100644
index 0000000..4d1b5ba
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/list/entry.inl
@@ -0,0 +1,31 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "interface/entry.interface.inl"
+
+namespace ia
+{
+ template
+ ListEntry<_value_type>::ListEntry() {}
+
+ template
+ ListEntry<_value_type>::ListEntry(IN _value_type&& v): m_value(IA_MOVE(v)) {}
+
+ template
+ ListEntry<_value_type>::ListEntry(IN CONST _value_type& v): m_value(v) {}
+}
diff --git a/Src/IACore/imp/inl/iacore/list/interface/entry.interface.inl b/Src/IACore/imp/inl/iacore/list/interface/entry.interface.inl
new file mode 100644
index 0000000..662479b
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/list/interface/entry.interface.inl
@@ -0,0 +1,59 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include
+
+namespace ia
+{
+ // [IATODO: IMPL] (Allocator must be fore _value_type, not ListEntry<_value_type>)
+ template
+ class ListEntry;
+
+ template>, CONST SIZE_T _alignment = 1>
+ requires valid_allocator_type<_allocator_type, ListEntry<_value_type>>
+ class List;
+
+ template
+ class ListEntry
+ {
+ public:
+ ListEntry();
+ ListEntry(IN _value_type&& v);
+ ListEntry(IN CONST _value_type& v);
+
+ public:
+ operator _value_type&() { return m_value; }
+ operator _value_type*() { return &m_value; }
+
+ operator CONST _value_type&() CONST { return m_value; }
+ operator CONST _value_type*() CONST { return &m_value; }
+
+ _value_type& operator*() { return m_value; }
+ _value_type* operator->() { return &m_value; }
+
+ CONST _value_type& operator*() CONST { return m_value; }
+ CONST _value_type* operator->() CONST { return &m_value; }
+
+ private:
+ ListEntry* m_next {};
+ ListEntry* m_prev {};
+ _value_type m_value;
+
+ friend class List<_value_type>;
+ };
+}
\ No newline at end of file
diff --git a/Src/IACore/imp/inl/iacore/list/interface/list.interface.inl b/Src/IACore/imp/inl/iacore/list/interface/list.interface.inl
new file mode 100644
index 0000000..c3e8df8
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/list/interface/list.interface.inl
@@ -0,0 +1,114 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include
+
+//#include "iterator.interface.inl"
+#include "entry.interface.inl"
+
+namespace ia
+{
+ template
+ requires valid_allocator_type<_allocator_type, ListEntry<_value_type>>
+ class List
+ {
+ public:
+ using size_type = SIZE_T;
+ using ssize_type = SSIZE_T;
+ using value_type = ListEntry<_value_type>;
+ using pointer_type = value_type*;
+ using reference_type = value_type&;
+ using allocator_type = _allocator_type;
+ using const_pointer_type = CONST value_type*;
+ using const_reference_type = CONST value_type&;
+
+ STATIC CONSTEXPR size_type alignment = _alignment;
+
+ public:
+ List();
+ List(IN List&& o);
+ List(IN CONST List& o);
+ ~List();
+
+ VOID operator=(IN List&& o);
+ VOID operator=(IN CONST List& o);
+
+ public:
+ STATIC ListEntry<_value_type>* next(IN ListEntry<_value_type>* e) { return e->m_next; }
+ STATIC ListEntry<_value_type>* prev(IN ListEntry<_value_type>* e) { return e->m_prev; }
+
+ STATIC CONST ListEntry<_value_type>* next(IN CONST ListEntry<_value_type>* e) { return e->m_next; }
+ STATIC CONST ListEntry<_value_type>* prev(IN CONST ListEntry<_value_type>* e) { return e->m_prev; }
+
+ public:
+ BOOL erase(IN SIZE_T index);
+
+ pointer_type append(IN _value_type&& v);
+ pointer_type append(IN const_reference_type v);
+
+ pointer_type insert(IN SIZE_T index, IN _value_type&& v);
+ pointer_type insert(IN SIZE_T index, IN const_reference_type v);
+
+ public:
+ template
+ pointer_type find(IN CONST compare_type& v, IN size_type offset = 0);
+ template
+ pointer_type rfind(IN CONST compare_type& v, IN size_type offset = 0);
+
+ template
+ const_pointer_type cfind(IN CONST compare_type& v, IN size_type offset = 0) CONST;
+ template
+ const_pointer_type crfind(IN CONST compare_type& v, IN size_type offset = 0) CONST;
+
+ template
+ const_pointer_type find(IN CONST compare_type& v, IN size_type offset = 0) CONST { return cfind(v, offset); }
+ template
+ const_pointer_type rfind(IN CONST compare_type& v, IN size_type offset = 0) CONST { return crfind(v, offset); }
+
+ template
+ BOOL contains(IN CONST compare_type& v) CONST;
+
+ public:
+ size_type size() CONST { return m_count; }
+
+ pointer_type first() { return m_first; }
+ const_pointer_type first() CONST { return m_first; }
+
+ pointer_type last() { return m_last; }
+ const_pointer_type last() CONST { return m_last; }
+
+ allocator_type& allocator() { return m_allocator; }
+ VOID allocator(IN CONST allocator_type& v) { m_allocator = v; }
+
+ protected:
+ VIRTUAL VOID take_from(IN List&& r);
+ VIRTUAL VOID copy_from(IN CONST List& r);
+
+ private:
+ pointer_type getNodeByIndex(IN SIZE_T index) CONST;
+ pointer_type getNodeByReverseIndex(IN SIZE_T index) CONST;
+
+ protected:
+ size_type m_count {};
+ pointer_type m_first {};
+ pointer_type m_last {};
+
+ protected:
+ allocator_type m_allocator {};
+ };
+}
\ No newline at end of file
diff --git a/Src/IACore/imp/inl/iacore/list/list.inl b/Src/IACore/imp/inl/iacore/list/list.inl
new file mode 100644
index 0000000..887b6b5
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/list/list.inl
@@ -0,0 +1,212 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "entry.inl"
+#include "interface/list.interface.inl"
+
+#define __template template requires valid_allocator_type<_allocator_type, ListEntry<_value_type>>
+#define __ia_identifier List<_value_type, _allocator_type, _alignment>
+#define define_member_function(return_type, name, ...) __template return_type __ia_identifier::name(__VA_ARGS__)
+#define define_const_member_function(return_type, name, ...) __template return_type __ia_identifier::name(__VA_ARGS__) CONST
+
+namespace ia
+{
+ define_member_function(VOID, copy_from, IN CONST __ia_identifier& r)
+ {
+ m_allocator = r.m_allocator.selectOnContainerCopy();
+ m_count = r.m_count;
+ m_first = r.m_first;
+ m_last = r.m_last;
+ }
+
+ define_member_function(VOID, take_from, IN __ia_identifier&& r)
+ {
+ ia_swap(m_count, r.m_count);
+ ia_swap(m_first, r.m_first);
+ ia_swap(m_last, r.m_last);
+ ia_swap(m_allocator, r.m_allocator);
+ }
+
+ define_member_function(, List, )
+ {
+ m_count = 0;
+ }
+
+ define_member_function(, List, IN List&& o)
+ {
+ take_from(IA_MOVE(o));
+ }
+
+ define_member_function(, List, IN CONST List& o)
+ {
+ copy_from(o);
+ }
+
+ define_member_function(, ~List, )
+ {
+ auto current = m_first;
+ while(current)
+ {
+ const auto t = current->m_next;
+ dealloc<_alignment>(m_allocator, current);
+ current = t;
+ IA_ASSERT((current != m_last) || (!current || !current->m_next));
+ }
+ }
+
+ define_member_function(VOID, operator=, IN List&& o)
+ {
+ take_from(IA_MOVE(o));
+ }
+
+ define_member_function(VOID, operator=, IN CONST List& o)
+ {
+ copy_from(o);
+ }
+}
+
+namespace ia
+{
+ define_member_function(BOOL, erase, IN SIZE_T index)
+ {
+ const auto t = getNodeByIndex(index);
+ if(!t) return false;
+ t->m_prev->m_next = t->m_next;
+ t->m_next->m_prev = t->m_prev;
+ dealloc<_alignment>(m_allocator, t);
+ m_count--;
+ return true;
+ }
+
+ define_member_function(__ia_identifier::pointer_type, append, IN _value_type&& v)
+ {
+ // [IATODO: IMP] (URGENT) MOCK
+ if(m_last)
+ {
+ const auto n = new (alloc<_alignment>(m_allocator, 1)) ListEntry<_value_type>(IA_MOVE(v));
+ m_last->m_next = n;
+ const auto t = m_last;
+ m_last = m_last->m_next;
+ m_last->m_prev = t;
+ return n;
+ }
+ else if(m_first)
+ {
+ m_last = new (alloc<_alignment>(m_allocator, 1)) ListEntry<_value_type>(IA_MOVE(v));
+ m_last->m_prev = m_first;
+ m_first->m_next = m_last;
+ return m_last;
+ }
+ else
+ {
+ m_first = new (alloc<_alignment>(m_allocator, 1)) ListEntry<_value_type>(IA_MOVE(v));
+ return m_first;
+ }
+ m_count++;
+ }
+
+ define_member_function(__ia_identifier::pointer_type, append, IN const_reference_type v)
+ {
+ return append(IA_MOVE(_value_type(v)));
+ }
+
+ define_member_function(__ia_identifier::pointer_type, insert, IN SIZE_T index, IN _value_type&& v)
+ {
+ const auto t = getNodeByIndex(index);
+ if(!t)
+ return append(IA_MOVE(v));
+ const auto n = new (alloc<_alignment>(m_allocator, 1)) ListEntry<_value_type>(IA_MOVE(v));
+ n->m_prev = t->m_prev;
+ n->m_next = t;
+ t->m_prev->m_next = n;
+ t->m_prev = n;
+ m_count++;
+ return n;
+ }
+
+ define_member_function(__ia_identifier::pointer_type, insert, IN SIZE_T index, IN const_reference_type v)
+ {
+ return insert(index, IA_MOVE(_value_type(v)));
+ }
+}
+
+namespace ia
+{
+ define_member_function(template __ia_identifier::pointer_type, find, IN CONST compare_type& v, IN size_type offset)
+ {
+ for(auto it = getNodeByIndex(offset); it; it = it->m_next)
+ if(static_cast<_value_type>(*it) == v) return it;
+ return nullptr;
+ }
+
+ define_member_function(template __ia_identifier::pointer_type, rfind, IN CONST compare_type& v, IN size_type offset)
+ {
+ for(auto it = getNodeByReverseIndex(offset); it; it = it->m_prev)
+ if(static_cast<_value_type>(*it) == v) return it;
+ return nullptr;
+ }
+
+ define_const_member_function(template __ia_identifier::const_pointer_type, cfind, IN CONST compare_type& v, IN size_type offset)
+ {
+ for(auto it = getNodeByIndex(offset); it; it = it->m_next)
+ if(static_cast<_value_type>(*it) == v) return it;
+ return nullptr;
+ }
+
+ define_const_member_function(template __ia_identifier::const_pointer_type, crfind, IN CONST compare_type& v, IN size_type offset)
+ {
+ for(auto it = getNodeByReverseIndex(offset); it; it = it->m_prev)
+ if(static_cast<_value_type>(*it) == v) return it;
+ return nullptr;
+ }
+
+ define_const_member_function(template BOOL, contains, IN CONST compare_type& v)
+ {
+ for(auto it = m_first; it; it = it->m_next)
+ if(static_cast<_value_type>(*it) == v) return true;
+ return false;
+ }
+}
+
+namespace ia
+{
+ define_const_member_function(__ia_identifier::pointer_type, getNodeByIndex, IN SIZE_T index)
+ {
+ SIZE_T i { 0 };
+ for(auto it = m_first; it; it = it->m_next, i++)
+ {
+ if(i == index) return it;
+ }
+ return nullptr;
+ }
+
+ define_const_member_function(__ia_identifier::pointer_type, getNodeByReverseIndex, IN SIZE_T index)
+ {
+ SIZE_T i { 0 };
+ for(auto it = m_last; it; it = it->m_prev, i++)
+ {
+ if(i == index) return it;
+ }
+ return nullptr;
+ }
+}
+
+#undef __template
+#undef __ia_identifier
+#undef define_member_function
+#undef define_const_member_function
\ No newline at end of file
diff --git a/Src/IACore/imp/inl/iacore/map/interface/map.interface.inl b/Src/IACore/imp/inl/iacore/map/interface/map.interface.inl
new file mode 100644
index 0000000..edd4e86
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/map/interface/map.interface.inl
@@ -0,0 +1,86 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include
+#include
+#include
+
+namespace ia
+{
+ template, CONST SIZE_T _alignment = 1>
+ requires hashable_type<_key_type> && valid_allocator_type<_allocator_type, _value_type>
+ class Map
+ {
+ STATIC CONSTEXPR SIZE_T BUCKET_COUNT = 1000;
+
+ struct KeyValuePair { KeyValuePair() {} KeyValuePair(IN CONST _key_type& key, IN _value_type&& value): Key(key), Value(IA_MOVE(value)) {} _key_type Key; _value_type Value; };
+
+ public:
+ using size_type = SIZE_T;
+ using ssize_type = SSIZE_T;
+ using key_type = _key_type;
+ using value_type = _value_type;
+ using allocator_type = _allocator_type;
+ using iterator = Vector*>::iterator;
+ using const_iterator = Vector*>::const_iterator;
+ using reverse_iterator = Vector*>::reverse_iterator;
+ using reverse_const_iterator = Vector*>::reverse_const_iterator;
+
+ STATIC CONSTEXPR size_type alignment = _alignment;
+
+ public:
+ Map();
+ ~Map();
+
+ public:
+ VOID set(IN CONST key_type& key, IN value_type&& value);
+ VOID set(IN CONST key_type& key, IN CONST value_type& value) { set(key, IA_MOVE(value_type(value))); }
+
+ CONST value_type* get(IN CONST key_type& key) CONST;
+ value_type* get(IN CONST key_type& key) { return const_cast(((CONST Map*)(this))->get(key)); }
+
+ BOOL contains(IN CONST key_type& key) CONST;
+
+ public:
+ _value_type& operator[](IN CONST _key_type& key) { const auto t = get(key); if(t) return *t; set(key, value_type()); return (*m_insertedOrder.back())->Value; }
+ CONST _value_type& operator[](IN CONST _key_type& key) CONST { const auto t = get(key); if(!t) throw "no such key"; return *t; }
+
+ public:
+ iterator begin() { return m_insertedOrder.begin(); }
+ iterator end() { return m_insertedOrder.end(); }
+ const_iterator begin() CONST { return m_insertedOrder.begin(); }
+ const_iterator end() CONST { return m_insertedOrder.end(); }
+ const_iterator cbegin() CONST { return m_insertedOrder.cbegin(); }
+ const_iterator cend() CONST { return m_insertedOrder.cend(); }
+
+ reverse_iterator rbegin() { return m_insertedOrder.rbegin(); }
+ reverse_iterator rend() { return m_insertedOrder.rend(); }
+ reverse_const_iterator rbegin() CONST { return m_insertedOrder.rbegin(); }
+ reverse_const_iterator rend() CONST { return m_insertedOrder.rend(); }
+ reverse_const_iterator crbegin() CONST { return m_insertedOrder.crbegin(); }
+ reverse_const_iterator crend() CONST { return m_insertedOrder.crend(); }
+
+ private:
+ ALWAYS_INLINE List& getBucket(IN CONST key_type& key); // [IATODO: IMPL] Add a helper macro for const version function definition
+ ALWAYS_INLINE CONST List& getBucket(IN CONST key_type& key) CONST;
+
+ private:
+ Vector> m_buckets;
+ Vector*> m_insertedOrder;
+ };
+}
diff --git a/Src/IACore/imp/inl/iacore/map/map.inl b/Src/IACore/imp/inl/iacore/map/map.inl
new file mode 100644
index 0000000..89363ec
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/map/map.inl
@@ -0,0 +1,84 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "interface/map.interface.inl"
+
+#define __template template requires hashable_type<_key_type> && valid_allocator_type<_allocator_type, _value_type>
+#define __ia_identifier Map<_key_type, _value_type, _allocator_type, _alignment>
+#define define_member_function(return_type, name, ...) __template return_type __ia_identifier::name(__VA_ARGS__)
+#define define_const_member_function(return_type, name, ...) __template return_type __ia_identifier::name(__VA_ARGS__) CONST
+
+namespace ia
+{
+ define_member_function(, Map, )
+ {
+ m_buckets.resize(BUCKET_COUNT);
+ }
+
+ define_member_function(, ~Map, )
+ {
+ }
+}
+
+namespace ia
+{
+ define_member_function(VOID, set, IN CONST key_type& key, IN value_type&& value)
+ {
+ m_insertedOrder.pushBack(getBucket(key).append({ key, IA_MOVE(value) }));
+ }
+
+ define_const_member_function(CONST _value_type*, get, IN CONST key_type& key)
+ {
+ auto& bucket = getBucket(key);
+ for(auto it = bucket.first(); it; it = bucket.next(it))
+ {
+ if(static_cast(*it).Key == key)
+ return &(*it)->Value;
+ }
+ return nullptr;
+ }
+
+ define_const_member_function(BOOL, contains, IN CONST key_type& key)
+ {
+ auto& bucket = getBucket(key);
+ for(auto it = bucket.first(); it; it = bucket.next(it))
+ {
+ if(static_cast(*it).Key == key)
+ return true;
+ }
+ return false;
+ }
+}
+
+namespace ia
+{
+ define_member_function(List&, getBucket, IN CONST key_type& key)
+ {
+ return m_buckets[key.hash() % BUCKET_COUNT];
+ }
+
+ define_const_member_function(CONST List&, getBucket, IN CONST key_type& key)
+ {
+ return m_buckets[key.hash() % BUCKET_COUNT];
+ }
+}
+
+#undef __template
+#undef __ia_identifier
+#undef define_member_function
+#undef define_const_member_function
\ No newline at end of file
diff --git a/Src/IACore/imp/inl/iacore/memory/allocator/general.inl b/Src/IACore/imp/inl/iacore/memory/allocator/general.inl
new file mode 100644
index 0000000..36371b3
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/memory/allocator/general.inl
@@ -0,0 +1,106 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "iiallocator.inl"
+#include "interface/general.interface.inl"
+
+namespace ia
+{
+ template
+ GeneralAllocator<_value_type>::pointer_type GeneralAllocator<_value_type>::allocate(IN SIZE_T count, IN PCVOID hint)
+ {
+ UNUSED(hint);
+ return reinterpret_cast(_ia_malloc(sizeof(value_type) * count));
+ }
+
+ template
+ GeneralAllocator<_value_type>::result_type GeneralAllocator<_value_type>::allocateAtLeast(IN SIZE_T count, IN PCVOID hint)
+ {
+ UNUSED(hint);
+ return { count, allocate(count, hint) };
+ }
+
+ template
+ VOID GeneralAllocator<_value_type>::deallocate(IN pointer_type ptr)
+ {
+ _ia_free(ptr);
+ }
+
+ template
+ GeneralAllocator<_value_type>::pointer_type GeneralAllocator<_value_type>::allocateAligned(IN SIZE_T count, IN SIZE_T alignment, IN PCVOID hint)
+ {
+ UNUSED(hint);
+ const size_type size = (sizeof(value_type) * count);
+ const auto ptr = reinterpret_cast(_ia_malloc(size + alignment + sizeof(PVOID)));
+ const auto aligned_ptr = reinterpret_cast(ptr + sizeof(PVOID) + alignment - (ptr % alignment));
+ *(reinterpret_cast(aligned_ptr-sizeof(PVOID))) = ptr;
+ return reinterpret_cast(aligned_ptr);
+ }
+
+ template
+ GeneralAllocator<_value_type>::result_type GeneralAllocator<_value_type>::allocateAtLeastAligned(IN SIZE_T count, IN SIZE_T alignment, IN PCVOID hint)
+ {
+ UNUSED(hint);
+ return { count, allocateAligned(count, alignment, hint) };
+ }
+
+ template
+ VOID GeneralAllocator<_value_type>::deallocateAligned(IN pointer_type ptr, IN SIZE_T alignment)
+ {
+ const auto allocated_ptr = *(reinterpret_cast(reinterpret_cast(ptr) - sizeof(PVOID)));
+ _ia_free(reinterpret_cast(allocated_ptr));
+ }
+
+ template
+ VOID GeneralAllocator<_value_type>::construct(IN pointer_type ptr) CONST
+ {
+ new (ptr) value_type();
+ }
+
+ template
+ VOID GeneralAllocator<_value_type>::destruct(IN pointer_type ptr) CONST
+ {
+ ptr->~value_type();
+ }
+
+ template
+ VOID GeneralAllocator<_value_type>::construct(IN pointer_type ptr, IN size_type count) CONST
+ {
+ for(size_type i = 0; i < count; i++)
+ new (&ptr[i]) value_type();
+ }
+
+ template
+ VOID GeneralAllocator<_value_type>::destruct(IN pointer_type ptr, IN size_type count) CONST
+ {
+ for(size_type i = 0; i < count; i++)
+ ptr[i].~value_type();
+ }
+
+ template
+ GeneralAllocator<_value_type>::size_type GeneralAllocator<_value_type>::maxSize() noexcept
+ {
+ return SIZE_MAX;
+ }
+
+ template
+ GeneralAllocator<_value_type>::allocator_type GeneralAllocator<_value_type>::selectOnContainerCopy() CONST
+ {
+ return allocator_type();
+ }
+}
diff --git a/Src/IACore/imp/inl/iacore/memory/allocator/iiallocator.inl b/Src/IACore/imp/inl/iacore/memory/allocator/iiallocator.inl
new file mode 100644
index 0000000..b97c091
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/memory/allocator/iiallocator.inl
@@ -0,0 +1,62 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "interface/iiallocator.interface.inl"
+
+namespace ia
+{
+ template
+ concept valid_allocator_type = std::derived_from>;
+
+ template
+ requires valid_allocator_type
+ allocator_type::pointer_type alloc(IN allocator_type& allocator,
+ IN typename allocator_type::size_type count, IN PCVOID hint = nullptr)
+ {
+ if constexpr(alignment > 1) return allocator.allocateAligned(count, alignment, hint);
+ else return allocator.allocate(count, hint);
+ }
+
+ template
+ requires valid_allocator_type
+ allocator_type::result_type allocAtLeast(IN allocator_type& allocator,
+ IN typename allocator_type::size_type count, IN PCVOID hint = nullptr)
+ {
+ if constexpr(alignment > 1) return allocator.allocateAtLeastAligned(count, alignment, hint);
+ else return allocator.allocateAtLeast(count, hint);
+ }
+
+ template
+ requires valid_allocator_type
+ VOID dealloc(IN allocator_type& allocator, IN typename allocator_type::pointer_type ptr)
+ {
+ if constexpr(alignment > 1) allocator.deallocateAligned(ptr, alignment);
+ else allocator.deallocate(ptr);
+ }
+}
+
+#undef malloc
+#undef free
+
+namespace ia
+{
+ ALWAYS_INLINE PVOID _ia_malloc(IN SIZE_T size) { return std::malloc(size); }
+ ALWAYS_INLINE VOID _ia_free(IN PVOID ptr) { std::free(ptr); }
+ ALWAYS_INLINE PVOID malloc(IN SIZE_T size) { return _ia_malloc(size); }
+ ALWAYS_INLINE VOID free(IN PVOID ptr) { _ia_free(ptr); }
+}
\ No newline at end of file
diff --git a/Src/IACore/imp/inl/iacore/memory/allocator/interface/general.interface.inl b/Src/IACore/imp/inl/iacore/memory/allocator/interface/general.interface.inl
new file mode 100644
index 0000000..6a34eb9
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/memory/allocator/interface/general.interface.inl
@@ -0,0 +1,55 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "iiallocator.interface.inl"
+
+namespace ia
+{
+ template
+ class GeneralAllocator: public IIAllocator, _value_type>
+ {
+ using Base = IIAllocator, _value_type>;
+
+ public:
+ using size_type = Base::size_type;
+ using value_type = Base::value_type;
+ using pointer_type = Base::pointer_type;
+ using reference_type = Base::reference_type;
+ using allocator_type = Base::allocator_type;
+ using result_type = Base::result_type;
+
+ public:
+ INLINE pointer_type allocate(IN SIZE_T count, IN PCVOID hint = nullptr);
+ INLINE pointer_type allocateAligned(IN SIZE_T count, IN SIZE_T alignment, IN PCVOID hint = nullptr);
+
+ INLINE result_type allocateAtLeast(IN SIZE_T count, IN PCVOID hint = nullptr);
+ INLINE result_type allocateAtLeastAligned(IN SIZE_T count, IN SIZE_T alignment, IN PCVOID hint = nullptr);
+
+ INLINE VOID deallocate(IN pointer_type ptr);
+ INLINE VOID deallocateAligned(IN pointer_type ptr, IN SIZE_T alignment);
+
+ INLINE VOID construct(IN pointer_type ptr) CONST;
+ INLINE VOID destruct(IN pointer_type ptr) CONST;
+ INLINE VOID construct(IN pointer_type ptr, IN size_type count) CONST;
+ INLINE VOID destruct(IN pointer_type ptr, IN size_type count) CONST;
+
+ INLINE size_type maxSize() noexcept;
+
+ INLINE allocator_type selectOnContainerCopy() CONST;
+ };
+}
diff --git a/Src/IACore/imp/inl/iacore/memory/allocator/interface/iiallocator.interface.inl b/Src/IACore/imp/inl/iacore/memory/allocator/interface/iiallocator.interface.inl
new file mode 100644
index 0000000..d3f98d8
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/memory/allocator/interface/iiallocator.interface.inl
@@ -0,0 +1,66 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include
+#include
+
+namespace ia
+{
+ template
+ struct AllocationResult
+ {
+ using size_type = SIZE_T;
+ using value_type = _value_type;
+ using pointer_type = _value_type*;
+
+ public:
+ size_type Count { 0 };
+ pointer_type Memory { nullptr };
+ };
+
+ template
+ class IIAllocator
+ {
+ public:
+ using size_type = SIZE_T;
+ using value_type = _value_type;
+ using pointer_type = _value_type*;
+ using reference_type = _value_type&;
+ using allocator_type = _allocator_type;
+ using result_type = AllocationResult<_value_type>;
+
+ public:
+ VIRTUAL pointer_type allocate(IN SIZE_T count, IN PCVOID hint = nullptr) = 0;
+ VIRTUAL pointer_type allocateAligned(IN SIZE_T count, IN SIZE_T alignment, IN PCVOID hint = nullptr) = 0;
+
+ VIRTUAL result_type allocateAtLeast(IN SIZE_T count, IN PCVOID hint = nullptr) = 0;
+ VIRTUAL result_type allocateAtLeastAligned(IN SIZE_T count, IN SIZE_T alignment, IN PCVOID hint = nullptr) = 0;
+
+ VIRTUAL VOID deallocate(IN pointer_type ptr) = 0;
+ VIRTUAL VOID deallocateAligned(IN pointer_type ptr, IN SIZE_T alignment) = 0;
+
+ VIRTUAL VOID construct(IN pointer_type ptr) CONST = 0;
+ VIRTUAL VOID destruct(IN pointer_type ptr) CONST = 0;
+ VIRTUAL VOID construct(IN pointer_type ptr, IN size_type count) CONST = 0;
+ VIRTUAL VOID destruct(IN pointer_type ptr, IN size_type count) CONST = 0;
+
+ VIRTUAL size_type maxSize() noexcept = 0;
+
+ VIRTUAL allocator_type selectOnContainerCopy() CONST = 0;
+ };
+}
diff --git a/Src/IACore/imp/inl/iacore/memory/allocator/interface/orchestrator.interface.inl b/Src/IACore/imp/inl/iacore/memory/allocator/interface/orchestrator.interface.inl
new file mode 100644
index 0000000..04befa3
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/memory/allocator/interface/orchestrator.interface.inl
@@ -0,0 +1,24 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include
+
+namespace ia
+{
+
+}
diff --git a/Src/IACore/imp/inl/iacore/memory/allocator/orchestrator.inl b/Src/IACore/imp/inl/iacore/memory/allocator/orchestrator.inl
new file mode 100644
index 0000000..79f6d9b
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/memory/allocator/orchestrator.inl
@@ -0,0 +1,24 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "interface/orchestrator.interface.inl"
+
+namespace ia
+{
+
+}
diff --git a/Src/IACore/imp/inl/iacore/memory/ptr/interface/refptr.interface.inl b/Src/IACore/imp/inl/iacore/memory/ptr/interface/refptr.interface.inl
new file mode 100644
index 0000000..d3b0ec5
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/memory/ptr/interface/refptr.interface.inl
@@ -0,0 +1,29 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include
+#include
+
+namespace ia
+{
+ template
+ using RefPtr = std::shared_ptr<_value_type>;
+
+ template
+ INLINE RefPtr<_value_type> MakeRefPtr(Args... args) { return std::make_shared<_value_type>(args...); }
+}
diff --git a/Src/IACore/imp/inl/iacore/platform/interface/platform.interface.inl b/Src/IACore/imp/inl/iacore/platform/interface/platform.interface.inl
new file mode 100644
index 0000000..5375b92
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/platform/interface/platform.interface.inl
@@ -0,0 +1,55 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include
+
+namespace ia
+{
+ class Platform
+ {
+ public:
+ enum class CPUFeature
+ {
+ SSE,
+ SSE2,
+ SSE3,
+ SSE4_1,
+ SSE4_2,
+ AVX,
+ AVX2
+ };
+
+ public:
+ INLINE STATIC CONSTEXPR PCCHAR name();
+
+ INLINE STATIC INT32 processorThreadCount();
+ INLINE STATIC SIZE_T totalAvailableMemory();
+
+ INLINE STATIC BOOL isSupported(IN CPUFeature feature);
+
+ public:
+ INLINE STATIC UINT32 random();
+
+ INLINE STATIC UINT64 timestamp();
+
+ INLINE STATIC VOID sleep(UINT64 milliseconds);
+
+ private:
+ Platform() {}
+ };
+}
\ No newline at end of file
diff --git a/Src/IACore/imp/inl/iacore/platform/platform.inl b/Src/IACore/imp/inl/iacore/platform/platform.inl
new file mode 100644
index 0000000..bf08e4a
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/platform/platform.inl
@@ -0,0 +1,135 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "interface/platform.interface.inl"
+
+#include
+#include
+
+// Following platform identification code is based on the template found at https://stackoverflow.com/a/5920028
+#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
+ #ifdef _WIN64
+ #define IA_PLATFORM_WIN64 1
+ #define IA_PLATFORM_WINDOWS 1
+ #else
+ #define IA_PLATFORM_WIN32 1
+ #define IA_PLATFORM_WINDOWS 1
+ #endif
+#elif __APPLE__
+ #include
+ #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR || TARGET_OS_MACCATALYST
+ #define IA_PLATFORM_IOS 1
+ #elif TARGET_OS_MAC
+ #define IA_PLATFORM_MAC 1
+ #endif
+ #define IA_PLATFORM_UNIX 1
+#elif __ANDROID__
+ #define IA_PLATFORM_ANDROID 1
+ #define IA_PLATFORM_LINUX 1
+ #define IA_PLATFORM_UNIX 1
+#elif __linux__
+ #define IA_PLATFORM_LINUX 1
+ #define IA_PLATFORM_UNIX 1
+#elif __unix__
+ #define IA_PLATFORM_UNIX 1
+#endif
+
+#if IA_PLATFORM_WIN32 || IA_PLATFORM_WIN64
+ #include
+#elif IA_PLATFORM_UNIX
+ #include
+#endif
+
+namespace ia
+{
+ CONSTEXPR PCCHAR Platform::name()
+ {
+#if IA_PLATFORM_WIN64
+ return "win64";
+#elif IA_PLATFORM_WIN32
+ return "win32";
+#elif IA_PLATFORM_MAC
+ return "mac";
+#elif IA_PLATFORM_IOS
+ return "ios";
+#elif IA_PLATFORM_ANDROID
+ return "android";
+#elif IA_PLATFORM_LINUX
+ return "linux";
+#else
+ return "unknown";
+#endif
+ }
+
+ INT32 Platform::processorThreadCount()
+ {
+ return static_cast(std::thread::hardware_concurrency());
+ }
+
+ SIZE_T Platform::totalAvailableMemory()
+ {
+ // Based on the code found at https://stackoverflow.com/a/2513561
+#if IA_PLATFORM_WIN32 || IA_PLATFORM_WIN64
+ MEMORYSTATUSEX status;
+ status.dwLength = sizeof(status);
+ GlobalMemoryStatusEx(&status);
+ return status.ullTotalPhys;
+#elif IA_PLATFORM_UNIX
+ return sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGE_SIZE);
+#else
+ return 0;
+#endif
+ }
+
+ BOOL Platform::isSupported(IN CPUFeature feature)
+ {
+ // This implementation is based on the code found at https://gist.github.com/9prady9/a5e1e8bdbc9dc58b3349
+ UINT32 eax, ebx, ecx, edx;
+ if(feature == CPUFeature::AVX2)
+ {
+ ASM("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (7), "c" (0));
+ return ebx & 0x00000020;
+ }
+ ASM("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (1), "c" (0));
+ switch(feature)
+ {
+ case CPUFeature::SSE: return edx & 0x02000000;
+ case CPUFeature::SSE2: return edx & 0x04000000;
+ case CPUFeature::SSE3: return ecx & 0x00000001;
+ case CPUFeature::SSE4_1: return ecx & 0x00080000;
+ case CPUFeature::SSE4_2: return ecx & 0x00100000;
+ case CPUFeature::AVX: return ecx & 0x10000000;
+ default: return false;
+ }
+ }
+
+ UINT32 Platform::random()
+ {
+ return rand();
+ }
+
+ UINT64 Platform::timestamp()
+ {
+ return std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count();
+ }
+
+ VOID Platform::sleep(UINT64 milliseconds)
+ {
+ std::this_thread::sleep_for(std::chrono::milliseconds(milliseconds));
+ }
+}
\ No newline at end of file
diff --git a/Src/IACore/imp/inl/iacore/set/interface/set.interface.inl b/Src/IACore/imp/inl/iacore/set/interface/set.interface.inl
new file mode 100644
index 0000000..e22ac96
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/set/interface/set.interface.inl
@@ -0,0 +1,73 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include
+
+namespace ia
+{
+ template, CONST SIZE_T _alignment = 1>
+ requires valid_allocator_type<_allocator_type, _value_type>
+ class Set: public OrderedVector<_value_type, _allocator_type, _alignment>
+ {
+ using Base = OrderedVector<_value_type, _allocator_type, _alignment>;
+
+ public:
+ using size_type = Base::size_type;
+ using ssize_type = Base::ssize_type;
+ using value_type = Base::value_type;
+ using buffer_type = Base::buffer_type;
+ using pointer_type = Base::pointer_type;
+ using reference_type = Base::reference_type;
+ using allocator_type = Base::allocator_type;
+ using const_pointer_type = Base::const_pointer_type;
+ using const_reference_type = Base::const_reference_type;
+ using iterator = Base::iterator;
+ using const_iterator = Base::const_iterator;
+ using reverse_iterator = Base::reverse_iterator;
+ using reverse_const_iterator = Base::reverse_const_iterator;
+ using comparator_type = Base::comparator_type;
+
+ public:
+ Set(): Base() {}
+ Set(IN Set&& r): Base(r) {}
+ Set(IN CONST Set& r): Base(r) {}
+ Set(IN initializer_list v);
+ ~Set() {}
+
+ VOID operator=(IN CONST Set& r) { Base::copy_from(r); }
+ VOID operator=(IN Set&& r) { Base::take_from(IA_MOVE(r)); }
+
+ public:
+ VOID append(IN value_type&& v);
+ VOID append(IN const_reference_type v);
+ VOID append(IN size_type n, IN const_pointer_type v);
+ VOID append(IN initializer_list v);
+ template requires valid_forward_iterator_type
+ VOID append(IN iterator_type first, IN iterator_type last);
+
+ public:
+ VOID pushBack(IN value_type&& v) { append(v); }
+ VOID pushBack(IN const_reference_type v) { append(v); }
+
+ public:
+ VOID resort() = delete;
+ VOID append(IN size_type n, IN const_reference_type v) = delete;
+ Base slice(IN size_type start, IN size_type count, IN size_type stride = 1) CONST = delete;
+ Base slice(IN const_iterator first, IN const_iterator last, IN size_type stride = 1) CONST = delete;
+ };
+}
diff --git a/Src/IACore/imp/inl/iacore/set/set.inl b/Src/IACore/imp/inl/iacore/set/set.inl
new file mode 100644
index 0000000..0982df1
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/set/set.inl
@@ -0,0 +1,66 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "interface/set.interface.inl"
+
+#define __template_iterator template requires valid_forward_iterator_type
+#define __template template requires valid_allocator_type<_allocator_type, _value_type>
+#define __identifier Set<_value_type, _allocator_type, _alignment>
+#define define_member_function(return_type, name, ...) __template return_type __identifier::name(__VA_ARGS__)
+#define define_const_member_function(return_type, name, ...) __template return_type __identifier::name(__VA_ARGS__) CONST
+
+namespace ia
+{
+ define_member_function(, Set, IN initializer_list v)
+ {
+ for(auto it = v.begin(); it != v.end(); it++) append(*it); // [IATODO]: [OPTIMIZE-P3]
+ }
+
+ define_member_function(VOID, append, IN value_type&& v)
+ {
+ if(Base::contains(v)) return;
+ Base::append(IA_MOVE(v));
+ }
+
+ define_member_function(VOID, append, IN const_reference_type v)
+ {
+ if(Base::contains(v)) return;
+ Base::append(v);
+ }
+
+ define_member_function(VOID, append, IN size_type n, IN const_pointer_type v)
+ {
+ for(size_type i = 0; i < n; i++) append(v[i]); // [IATODO]: [OPTIMIZE-P3]
+ }
+
+ define_member_function(VOID, append, IN initializer_list v)
+ {
+ for(auto it = v.begin(); it != v.end(); it++) append(*it); // [IATODO]: [OPTIMIZE-P3]
+ }
+
+ define_member_function(__template_iterator VOID, append, IN iterator_type first, IN iterator_type last)
+ {
+ for(auto it = first; it != last; it++) append(*it); // [IATODO]: [OPTIMIZE-P3]
+ }
+}
+
+#undef __template_iterator
+#undef __template
+#undef __identifier
+#undef define_member_function
+#undef define_const_member_function
\ No newline at end of file
diff --git a/Src/IACore/imp/inl/iacore/stream/filestream.inl b/Src/IACore/imp/inl/iacore/stream/filestream.inl
new file mode 100644
index 0000000..381a825
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/stream/filestream.inl
@@ -0,0 +1,24 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "interface/filestream.interface.inl"
+
+namespace ia
+{
+
+}
\ No newline at end of file
diff --git a/Src/IACore/imp/inl/iacore/stream/interface/filestream.interface.inl b/Src/IACore/imp/inl/iacore/stream/interface/filestream.interface.inl
new file mode 100644
index 0000000..b687a36
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/stream/interface/filestream.interface.inl
@@ -0,0 +1,55 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "iistream.interface.inl"
+
+#include
+
+namespace ia
+{
+ // NOTE: THIS IS A MOCK IMPLEMENTATION
+ // [IATODO: IMPL] [URGENT] (Mock)
+
+ // [IATODO: IMPL] FileReadStream
+
+ class FileWriteStream: public IIStream
+ {
+ public:
+ FileWriteStream() {}
+ FileWriteStream(IN CONST String& filePath) { open(filePath); }
+ ~FileWriteStream() { if(isOpen()) close(); }
+
+ public:
+ VOID open(IN CONST String& filePath) { m_impl.open(filePath.c_str(), std::ios::out | std::ios::binary); }
+ VOID close() { m_impl.close(); }
+
+ BOOL isOpen() CONST { return m_impl.is_open(); }
+
+ public:
+ template
+ FileWriteStream& operator<<(IN CONST _value_type& v) { m_impl << v; return *this; }
+
+ FileWriteStream& operator<<(IN CONST String& v) { m_impl << v.c_str(); return *this; }
+
+ public:
+ operator BOOL() CONST { return m_impl.is_open(); }
+
+ private:
+ std::ofstream m_impl;
+ };
+}
\ No newline at end of file
diff --git a/Src/IACore/imp/inl/iacore/stream/interface/iistream.interface.inl b/Src/IACore/imp/inl/iacore/stream/interface/iistream.interface.inl
new file mode 100644
index 0000000..aedf7ff
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/stream/interface/iistream.interface.inl
@@ -0,0 +1,28 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "../../string/string.inl"
+
+namespace ia
+{
+ class IIStream
+ {
+ public:
+
+ };
+}
\ No newline at end of file
diff --git a/Src/IACore/imp/inl/iacore/stream/interface/stringstream.interface.inl b/Src/IACore/imp/inl/iacore/stream/interface/stringstream.interface.inl
new file mode 100644
index 0000000..1efbe05
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/stream/interface/stringstream.interface.inl
@@ -0,0 +1,44 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "iistream.interface.inl"
+
+#include
+
+namespace ia
+{
+ // NOTE: THIS IS A MOCK IMPLEMENTATION
+ // [IATODO: IMPL] [URGENT] (Mock)
+ class StringStream: public IIStream
+ {
+ public:
+ StringStream() {}
+
+ public:
+ INLINE String str() CONST;
+
+ public:
+ template
+ StringStream& operator<<(IN CONST _value_type& v) { m_impl << v; return *this; }
+
+ StringStream& operator<<(IN CONST String& v) { m_impl << v.c_str(); return *this; }
+
+ private:
+ std::stringstream m_impl;
+ };
+}
\ No newline at end of file
diff --git a/Src/IACore/imp/inl/iacore/stream/stringstream.inl b/Src/IACore/imp/inl/iacore/stream/stringstream.inl
new file mode 100644
index 0000000..4e038ee
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/stream/stringstream.inl
@@ -0,0 +1,27 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include "interface/stringstream.interface.inl"
+
+namespace ia
+{
+ String StringStream::str() CONST
+ {
+ return m_impl.str().c_str();
+ }
+}
\ No newline at end of file
diff --git a/Src/IACore/imp/inl/iacore/string/interface/string.interface.inl b/Src/IACore/imp/inl/iacore/string/interface/string.interface.inl
new file mode 100644
index 0000000..45f4dff
--- /dev/null
+++ b/Src/IACore/imp/inl/iacore/string/interface/string.interface.inl
@@ -0,0 +1,184 @@
+// IACore-OSS; The Core Library for All IA Open Source Projects
+// Copyright (C) 2024 IAS (ias@iasoft.dev)
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+#pragma once
+
+#include
+
+namespace ia
+{
+ template, CONST SIZE_T _alignment = 1>
+ requires valid_allocator_type<_allocator_type, CHAR>
+ class StringT : public FixedContainer
+ {
+ using Base = FixedContainer