SheafSystem
0.0.0.0
|
A reallocatable pool of objects of type T. Objects in the pool are either "allocated" or linked together via pointers into a "free" list. Intended to support efficient allocation and deallocation of nodes in a graph or other dynamic data structure. There is an implicit constraint on T: it must have a next() feature. More...
#include <ptr_linked_pool.h>
Public Member Functions | |
size_t | capacity () const |
The number of objects, either free or allocated, currently in the pool. More... | |
size_t | free_size () const |
The size of free list. More... | |
size_t | allocated_size () const |
The size of allocated list. More... | |
void | reserve (size_t xcapacity) |
Makes capacity at least xcapacity. More... | |
void | clear () |
Deletes all the objects in the pool. More... | |
T * | allocate () |
Allocate next available object from the free list. More... | |
void | deallocate (T *xobject) |
Deallocate xobject. More... | |
void | print () const |
Prints the data members of this on cout. Intended for use debugging. More... | |
void | print (std::ostream &xos) const |
Prints the data members of this on output stream xos. Intended for use debugging. More... | |
ptr_linked_pool (size_t xcapacity=1024) | |
Creates an instance with capacity xcapacity. More... | |
~ptr_linked_pool () | |
Destructor. More... | |
A reallocatable pool of objects of type T. Objects in the pool are either "allocated" or linked together via pointers into a "free" list. Intended to support efficient allocation and deallocation of nodes in a graph or other dynamic data structure. There is an implicit constraint on T: it must have a next() feature.
Definition at line 42 of file d_tree_point_locator_node.h.
sheaf::ptr_linked_pool< T >::ptr_linked_pool | ( | size_t | xcapacity = 1024 | ) |
Creates an instance with capacity xcapacity.
Definition at line 195 of file ptr_linked_pool.impl.h.
Referenced by sheaf::ptr_linked_pool< geometry::d_tree_point_locator_node< DC, DB > >::print().
sheaf::ptr_linked_pool< T >::~ptr_linked_pool | ( | ) |
Destructor.
Definition at line 220 of file ptr_linked_pool.impl.h.
Referenced by sheaf::ptr_linked_pool< geometry::d_tree_point_locator_node< DC, DB > >::ptr_linked_pool().
T * sheaf::ptr_linked_pool< T >::allocate | ( | ) |
Allocate next available object from the free list.
Definition at line 78 of file ptr_linked_pool.impl.h.
Referenced by sheaf::ptr_linked_pool< geometry::d_tree_point_locator_node< DC, DB > >::free_size(), and geometry::d_tree_point_locator_node< DC, DB >::insert_box().
size_t sheaf::ptr_linked_pool< T >::allocated_size | ( | ) | const |
The size of allocated list.
Definition at line 60 of file ptr_linked_pool.impl.h.
Referenced by sheaf::ptr_linked_pool< geometry::d_tree_point_locator_node< DC, DB > >::capacity().
size_t sheaf::ptr_linked_pool< T >::capacity | ( | ) | const |
The number of objects, either free or allocated, currently in the pool.
Definition at line 50 of file ptr_linked_pool.impl.h.
void sheaf::ptr_linked_pool< T >::clear | ( | ) |
Deletes all the objects in the pool.
Definition at line 309 of file ptr_linked_pool.impl.h.
Referenced by sheaf::ptr_linked_pool< geometry::d_tree_point_locator_node< DC, DB > >::reserve().
void sheaf::ptr_linked_pool< T >::deallocate | ( | T * | xobject | ) |
Deallocate xobject.
Definition at line 118 of file ptr_linked_pool.impl.h.
Referenced by sheaf::ptr_linked_pool< geometry::d_tree_point_locator_node< DC, DB > >::allocate().
size_t sheaf::ptr_linked_pool< T >::free_size | ( | ) | const |
The size of free list.
Definition at line 69 of file ptr_linked_pool.impl.h.
Referenced by sheaf::ptr_linked_pool< geometry::d_tree_point_locator_node< DC, DB > >::allocated_size().
void sheaf::ptr_linked_pool< T >::print | ( | ) | const |
Prints the data members of this on cout. Intended for use debugging.
Definition at line 146 of file ptr_linked_pool.impl.h.
Referenced by sheaf::ptr_linked_pool< geometry::d_tree_point_locator_node< DC, DB > >::deallocate(), and sheaf::ptr_linked_pool< geometry::d_tree_point_locator_node< DC, DB > >::print().
void sheaf::ptr_linked_pool< T >::print | ( | std::ostream & | xos | ) | const |
Prints the data members of this on output stream xos. Intended for use debugging.
Definition at line 155 of file ptr_linked_pool.impl.h.
void sheaf::ptr_linked_pool< T >::reserve | ( | size_t | xcapacity | ) |
Makes capacity at least xcapacity.
Definition at line 228 of file ptr_linked_pool.impl.h.
Referenced by sheaf::ptr_linked_pool< geometry::d_tree_point_locator_node< DC, DB > >::~ptr_linked_pool().