|
AGX Dynamics
2.37.3.2
|
The StackAllocator class is designed to be used with the STL vector class. More...
#include <StackAllocator.h>
Public Types | |
| typedef const T * | const_pointer |
| typedef const T & | const_reference |
| typedef std::ptrdiff_t | difference_type |
| typedef T * | pointer |
| typedef T & | reference |
| typedef std::size_t | size_type |
| typedef T | value_type |
Public Member Functions | |
| StackAllocator () throw () | |
| ~StackAllocator () throw () | |
| pointer | address (reference value) const |
| const_pointer | address (const_reference value) const |
| pointer | allocate (size_type num, const void *=0) |
| void | construct (pointer p, const T &value) |
| void | deallocate (pointer p, size_type num) |
| void | destroy (pointer p) |
| size_type | max_size () const throw () |
The StackAllocator class is designed to be used with the STL vector class.
It allocates the required amount of space directly on the stack where an STL container is declared. Because the STL template for the allocator must have a single argument, this template must be specialized to the desired value of the template argument N before being used in an STL container declaration. The source code for the present class is adapted from the standard definition of the allocator class in STL, as in the book "The C++ Standard Library: A Tutorial and Reference" by Nicolai M. Josuttis, Addison Wesley,
The explicit assumption made here is that the STL container requires only space for N objects and that any other overhead for begin, end, and capacity pointers are allocated in the stack of the STL class itself. In particular, this allocator cannot work with std::list at this time.
In addition, the rebind utility is not provided and neither is the copy constructor.
Definition at line 54 of file StackAllocator.h.
| typedef const T* agx::StackAllocator< T, N >::const_pointer |
Definition at line 61 of file StackAllocator.h.
| typedef const T& agx::StackAllocator< T, N >::const_reference |
Definition at line 63 of file StackAllocator.h.
| typedef std::ptrdiff_t agx::StackAllocator< T, N >::difference_type |
Definition at line 65 of file StackAllocator.h.
| typedef T* agx::StackAllocator< T, N >::pointer |
Definition at line 60 of file StackAllocator.h.
| typedef T& agx::StackAllocator< T, N >::reference |
Definition at line 62 of file StackAllocator.h.
| typedef std::size_t agx::StackAllocator< T, N >::size_type |
Definition at line 64 of file StackAllocator.h.
| typedef T agx::StackAllocator< T, N >::value_type |
Definition at line 59 of file StackAllocator.h.
|
inline | |||||||||||||
Definition at line 78 of file StackAllocator.h.
|
inline | |||||||||||||
Definition at line 81 of file StackAllocator.h.
|
inline |
Definition at line 68 of file StackAllocator.h.
|
inline |
Definition at line 71 of file StackAllocator.h.
|
inline |
Definition at line 90 of file StackAllocator.h.
|
inline |
Definition at line 95 of file StackAllocator.h.
|
inline |
Definition at line 107 of file StackAllocator.h.
|
inline |
Definition at line 101 of file StackAllocator.h.
|
inline | |||||||||||||
Definition at line 85 of file StackAllocator.h.