summaryrefslogtreecommitdiffhomepage
path: root/src/RTree.h
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-03-19 18:20:49 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-03-19 18:28:21 +0100
commitbfbbfc325f081d9523f56accc267167c82ffa495 (patch)
treef03202dde3c3eb771878cc4b56cb2a57f02981c1 /src/RTree.h
parent00c86f570f2081e51d7bed617a33a4269f00eb4c (diff)
src/rtree: add simple object pool impl
Diffstat (limited to 'src/RTree.h')
-rw-r--r--src/RTree.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/RTree.h b/src/RTree.h
index 9ef66f34..1a30a735 100644
--- a/src/RTree.h
+++ b/src/RTree.h
@@ -17,15 +17,16 @@
// RTree.h
//
-#define RTREE_DONT_USE_MEMPOOLS // This version does not contain a fixed memory allocator, fill in lines with EXAMPLE to implement one.
+//#define RTREE_DONT_USE_MEMPOOLS // This version does not contain a fixed memory allocator, fill in lines with EXAMPLE to implement one.
#define RTREE_USE_SPHERICAL_VOLUME // Better split classification, may be slower on some systems
+namespace floormat::detail { template<typename T> struct rtree_pool; }
+
#ifdef RTREE_STDIO
// Fwd decl
class RTFileStream; // File I/O helper class, look below for implementation and notes.
#endif
-
/// \class RTree
/// Implementation of RTree, a multidimensional bounding rectangle tree.
/// Example usage: For a 3-dimensional tree use RTree<Object*, float, 3> myTree;
@@ -47,11 +48,10 @@ template<class DATATYPE, class ELEMTYPE, int NUMDIMS,
class RTree
{
-protected:
+public:
struct Node; // Fwd decl. Used by other internal structs and iterator
-
-public:
+ struct ListNode;
// These constant must be declared after Branch and before Node struct
// Stuck up here for MSVC 6 compiler. NSVC .NET 2003 is much happier.
@@ -184,8 +184,6 @@ public:
ELEMTYPE m_max[NUMDIMS]; ///< Max dimensions of bounding box
};
-protected:
-
/// May be data or may be another subtree
/// The parents level determines this.
/// If the parents level is 0, then this is data
@@ -214,6 +212,7 @@ protected:
Node* m_node; ///< Node
};
+protected:
/// Variables for finding a split partition
struct PartitionVars
{