9#ifndef SE_MEMORY_POOL_HPP
10#define SE_MEMORY_POOL_HPP
13#include <boost/pool/object_pool.hpp>
27template<
typename NodeT,
typename BlockT>
35 return new (node_buffer_.malloc())
NodeT(coord, size,
typename NodeT::DataType());
43 const typename NodeT::DataType&
init_data)
53 const typename BlockT::DataType&
init_data)
71 boost::object_pool<NodeT> node_buffer_;
72 boost::object_pool<BlockT> block_buffer_;
Manages memory for se::Octree nodes and blocks in an efficient manner.
Definition memory_pool.hpp:28
NodeT * allocateNode(NodeT *const parent_ptr, const int child_idx, const typename NodeT::DataType &init_data)
Return a pointer to a newly allocated node that is the child with index child_idx of parent_ptr and i...
Definition memory_pool.hpp:41
void deleteBlock(BlockT *const block_ptr)
Destruct and deallocate the block pointed to by block_ptr.
Definition memory_pool.hpp:65
BlockT * allocateBlock(NodeT *const parent_ptr, const int child_idx, const typename BlockT::DataType &init_data)
Return a pointer to a newly allocated block that is the child with index child_idx of parent_ptr and ...
Definition memory_pool.hpp:51
void deleteNode(NodeT *const node_ptr)
Destruct and deallocate the node pointed to by node_ptr.
Definition memory_pool.hpp:59
NodeT * allocateRoot(const Eigen::Vector3i &coord, const int size)
Allocate the root node with coordinates in voxels coord and edge length in voxels size.
Definition memory_pool.hpp:33
Helper wrapper to allocate and de-allocate octants in the octree.
Definition bounded_vector.hpp:14