#include <store.hpp>
This avoids the overhead of memory allocation for objects that are frequently created and destroyed. The objects managed by this store must have default (zero parameter) constructors.
Definition at line 15 of file store.hpp.
Public Member Functions | |
Store () | |
Constructor. | |
~Store () | |
Destructor. | |
T * | newItem () |
Retrieves a fresh item from the store. | |
void | deleteItem (T *item) |
Returns a used item to the store. | |
Protected Attributes | |
std::stack< T * > | items |
A stack of the items in the store. |
|
Constructor.
|
|
Destructor.
|
|
Returns a used item to the store.
|
|
Retrieves a fresh item from the store.
|
|
A stack of the items in the store.
|