feat: Add Python packaging infrastructure and comprehensive bindings for math and vector types.

This commit is contained in:
AndreaRigoni
2026-03-05 11:39:27 +00:00
parent e69b29a259
commit 647d0caa1c
10 changed files with 372 additions and 60 deletions

View File

@@ -1,7 +1,36 @@
set(HEADERS Archives.h Array.h Collection.h DataAllocator.h Debug.h Export.h Function.h Macros.h Mpl.h Object.h Options.h Serializable.h Signal.h Singleton.h SmartPointer.h StaticInterface.h StringReader.h Types.h Uuid.h Vector.h)
set(HEADERS
Archives.h
Array.h
Collection.h
DataAllocator.h
Debug.h
Export.h
Function.h
Macros.h
Mpl.h
Object.h
Options.h
Serializable.h
Signal.h
Singleton.h
SmartPointer.h
StaticInterface.h
StringReader.h
Types.h
Uuid.h
Vector.h
)
set(SOURCES Archives.cpp Debug.cpp Object.cpp Options.cpp Serializable.cpp Signal.cpp Uuid.cpp)
set(SOURCES
Archives.cpp
Debug.cpp
Object.cpp
Options.cpp
Serializable.cpp
Signal.cpp
Uuid.cpp
)
set(LIBRARIES Boost::program_options Boost::serialization)

View File

@@ -274,6 +274,11 @@ public:
this->MoveToRAM();
return BaseClass::insert(pos, std::move(x));
}
template <typename InputIt>
iterator insert(const_iterator pos, InputIt first, InputIt last) {
this->MoveToRAM();
return BaseClass::insert(pos, first, last);
}
iterator erase(const_iterator pos) {
this->MoveToRAM();
return BaseClass::erase(pos);

View File

@@ -1,31 +0,0 @@
#include <Core/Vector.h>
#include <iostream>
int main() {
uLib::Vector<int> v;
v.push_back(1);
v.push_back(2);
v.push_back(3);
std::cout << "RAM Vector elements: ";
for (int i = 0; i < v.size(); ++i) {
std::cout << v[i] << " ";
}
std::cout << std::endl;
#ifdef USE_CUDA
std::cout << "Moving to VRAM..." << std::endl;
v.MoveToVRAM();
int *vram_ptr = v.GetVRAMData();
if (vram_ptr) {
std::cout << "Successfully got VRAM pointer!" << std::endl;
} else {
std::cout << "Failed to get VRAM pointer!" << std::endl;
}
std::cout << "Moving back to RAM..." << std::endl;
v.MoveToRAM();
#endif
return 0;
}