Public Member Functions | Public Attributes | Private Attributes | List of all members
rtflann::PooledAllocator Class Reference

#include <allocator.h>

Public Member Functions

template<typename T >
Tallocate (size_t count=1)
 
void * allocateMemory (int size)
 
void free ()
 
 PooledAllocator (int blocksize=BLOCKSIZE)
 
 ~PooledAllocator ()
 

Public Attributes

int usedMemory
 
int wastedMemory
 

Private Attributes

void * base
 
int blocksize
 
void * loc
 
int remaining
 

Detailed Description

Definition at line 103 of file allocator.h.

Constructor & Destructor Documentation

◆ PooledAllocator()

rtflann::PooledAllocator::PooledAllocator ( int  blocksize = BLOCKSIZE)
inline

Default constructor. Initializes a new pool.

Definition at line 124 of file allocator.h.

◆ ~PooledAllocator()

rtflann::PooledAllocator::~PooledAllocator ( )
inline

Destructor. Frees all the memory allocated in this pool.

Definition at line 137 of file allocator.h.

Member Function Documentation

◆ allocate()

template<typename T >
T* rtflann::PooledAllocator::allocate ( size_t  count = 1)
inline

Allocates (using this pool) a generic type T.

Params: count = number of instances to allocate. Returns: pointer (of type T*) to memory buffer

Definition at line 215 of file allocator.h.

◆ allocateMemory()

void* rtflann::PooledAllocator::allocateMemory ( int  size)
inline

Returns a pointer to a piece of new memory of the given size in bytes allocated from the pool.

Definition at line 160 of file allocator.h.

◆ free()

void rtflann::PooledAllocator::free ( )
inline

Definition at line 142 of file allocator.h.

Member Data Documentation

◆ base

void* rtflann::PooledAllocator::base
private

Definition at line 112 of file allocator.h.

◆ blocksize

int rtflann::PooledAllocator::blocksize
private

Definition at line 114 of file allocator.h.

◆ loc

void* rtflann::PooledAllocator::loc
private

Definition at line 113 of file allocator.h.

◆ remaining

int rtflann::PooledAllocator::remaining
private

Definition at line 111 of file allocator.h.

◆ usedMemory

int rtflann::PooledAllocator::usedMemory

Definition at line 118 of file allocator.h.

◆ wastedMemory

int rtflann::PooledAllocator::wastedMemory

Definition at line 119 of file allocator.h.


The documentation for this class was generated from the following file:


rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:29