From 5e212cb6603516da14e6b374cd3f78a146cd5b5e Mon Sep 17 00:00:00 2001
From: Gabriel Studer <gabriel.studer@unibas.ch>
Date: Wed, 24 Mar 2021 12:13:28 +0100
Subject: [PATCH] move PagedArray datastructure to base module

makes it easier to re-use elsewhere
---
 modules/base/src/CMakeLists.txt         | 1 +
 modules/{db => base}/src/paged_array.hh | 7 +++++--
 modules/db/src/CMakeLists.txt           | 1 -
 modules/db/src/binary_container.hh      | 2 +-
 4 files changed, 7 insertions(+), 4 deletions(-)
 rename modules/{db => base}/src/paged_array.hh (96%)

diff --git a/modules/base/src/CMakeLists.txt b/modules/base/src/CMakeLists.txt
index 796052d61..2ad8088a2 100644
--- a/modules/base/src/CMakeLists.txt
+++ b/modules/base/src/CMakeLists.txt
@@ -32,6 +32,7 @@ pod_vector.hh
 fixed_string.hh
 tri_matrix.hh
 boost_filesystem_helper.hh
+paged_array.hh
 )
 
 set(OST_EXPORT_HELPERS
diff --git a/modules/db/src/paged_array.hh b/modules/base/src/paged_array.hh
similarity index 96%
rename from modules/db/src/paged_array.hh
rename to modules/base/src/paged_array.hh
index 3ce76378b..7bfae89ad 100644
--- a/modules/db/src/paged_array.hh
+++ b/modules/base/src/paged_array.hh
@@ -18,8 +18,8 @@
 //------------------------------------------------------------------------------
 
 
-#ifndef OST_DB_PAGED_ARRAY_HH
-#define OST_DB_PAGED_ARRAY_HH
+#ifndef OST_PAGED_ARRAY_HH
+#define OST_PAGED_ARRAY_HH
 
 /*
   Author: Marco Biasini, Gabriel Studer
@@ -32,6 +32,9 @@
 
 namespace ost{ namespace db{
 
+
+/// \brief Vector style container that splits content in pages, suited for large 
+///        amounts of data. Comes with serialization functionality.
 template <typename T, uint64_t P>
 class PagedArray  {
 private:
diff --git a/modules/db/src/CMakeLists.txt b/modules/db/src/CMakeLists.txt
index 8b59de092..8d40b089c 100644
--- a/modules/db/src/CMakeLists.txt
+++ b/modules/db/src/CMakeLists.txt
@@ -3,7 +3,6 @@ sqlite_wrap.hh
 sqlite_conv.hh
 module_config.hh
 linear_indexer.hh
-paged_array.hh
 binary_container.hh
 extract_data_helper.hh
 )
diff --git a/modules/db/src/binary_container.hh b/modules/db/src/binary_container.hh
index 6477e7452..9b012d566 100644
--- a/modules/db/src/binary_container.hh
+++ b/modules/db/src/binary_container.hh
@@ -26,7 +26,7 @@
 #include <ost/base.hh>
 #include <ost/stdint.hh>
 #include <ost/geom/vec3.hh>
-#include <ost/db/paged_array.hh>
+#include <ost/paged_array.hh>
 
 
 namespace ost { namespace db {
-- 
GitLab