#include <pool.h>
Inherited by ace::RandomSizedMemoryPool< _Type >, and ace::RandomSizedMemoryPool< char >.
Public Member Functions | |
| MemoryPool (size_t block_size) throw () | |
| Constructor accepts and stores block size, doesn't allocate any memory yet. | |
| virtual | ~MemoryPool (void) throw () |
| Destructor does nothing useful, just is. | |
| size_t | block_size (void) const throw () |
| virtual void | clear (void)=0 throw () |
| Method used to clear the pool - should deallocate all dynamically allocated memory. | |
| virtual _Type * | get_memory (size_t mem_size)=0 |
| Returns pointer to free memory of size `mem_size` or throws std::bad_alloc in case there is not enough free memory. | |
Protected Member Functions | |
| virtual _Block< _Type > * | create_new_block (void)=0 |
| Function for allocation of new memory blocks. | |
Private Attributes | |
| size_t | _block_size |
| Block size. | |
Doesn't do much, just define some basic behavior.
| _Type | Stored unit type. | |
| _Block | Pool memory block template class. |
| ace::MemoryPool< _Type, _Block >::MemoryPool | ( | size_t | block_size | ) | throw () [inline] |
Constructor accepts and stores block size, doesn't allocate any memory yet.
| block_size | Size of memory blocks within the pool. |
| virtual ace::MemoryPool< _Type, _Block >::~MemoryPool | ( | void | ) | throw () [inline, virtual] |
Destructor does nothing useful, just is.
| virtual _Block<_Type>* ace::MemoryPool< _Type, _Block >::create_new_block | ( | void | ) | [protected, pure virtual] |
Function for allocation of new memory blocks.
Implemented in ace::RandomSizedMemoryPool< _Type >, and ace::RandomSizedMemoryPool< char >.
| size_t ace::MemoryPool< _Type, _Block >::block_size | ( | void | ) | const throw () [inline] |
| virtual void ace::MemoryPool< _Type, _Block >::clear | ( | void | ) | throw () [pure virtual] |
Method used to clear the pool - should deallocate all dynamically allocated memory.
Implemented in ace::RandomSizedMemoryPool< _Type >, and ace::RandomSizedMemoryPool< char >.
| virtual _Type* ace::MemoryPool< _Type, _Block >::get_memory | ( | size_t | mem_size | ) | [pure virtual] |
Returns pointer to free memory of size `mem_size` or throws std::bad_alloc in case there is not enough free memory.
| mem_size | The size of demanded memory. |
| std::bad_alloc | When there is no more memory available. |
Implemented in ace::RandomSizedMemoryPool< _Type >, and ace::RandomSizedMemoryPool< char >.
size_t ace::MemoryPool< _Type, _Block >::_block_size [private] |
Block size.
1.5.6