#include <reallocator.h>
Public Types | |
typedef std::allocator < __ValueType > | __Allocator |
typedef __Allocator::size_type | size_type |
typedef __Allocator::value_type | value_type |
typedef __Allocator::pointer | pointer |
typedef __Allocator::const_pointer | const_pointer |
typedef __Allocator::difference_type | difference_type |
typedef __ReferenceType & | reference |
typedef const __ReferenceType & | const_reference |
Public Member Functions | |
pointer | address (reference ref) |
const_pointer | address (const_reference ref) |
pointer | allocate (size_type size, std::allocator< void >::const_pointer hint=0L) |
void | deallocate (pointer ptr, size_type size) |
void | construct (pointer ptr, const_reference oth) |
size_type | max_size () const |
Classes | |
struct | rebind |
Internally the handled element spaces are treated as char arrays.
Definition at line 58 of file reallocator.h.
typedef std::allocator<__ValueType> mbo::allocator< __ValueType, __ReferenceType >::__Allocator |
allocator type
Definition at line 62 of file reallocator.h.
typedef __Allocator::size_type mbo::allocator< __ValueType, __ReferenceType >::size_type |
type used for size and indexing
Definition at line 63 of file reallocator.h.
typedef __Allocator::value_type mbo::allocator< __ValueType, __ReferenceType >::value_type |
value type
Definition at line 64 of file reallocator.h.
typedef __Allocator::pointer mbo::allocator< __ValueType, __ReferenceType >::pointer |
pointer to value type
Definition at line 65 of file reallocator.h.
typedef __Allocator::const_pointer mbo::allocator< __ValueType, __ReferenceType >::const_pointer |
const
pointer to value type
Definition at line 66 of file reallocator.h.
typedef __Allocator::difference_type mbo::allocator< __ValueType, __ReferenceType >::difference_type |
type used to calculate element position distances
Definition at line 67 of file reallocator.h.
typedef __ReferenceType& mbo::allocator< __ValueType, __ReferenceType >::reference |
type used with element referencing (read/write)
Definition at line 69 of file reallocator.h.
typedef const __ReferenceType& mbo::allocator< __ValueType, __ReferenceType >::const_reference |
type used with const element referencing (read only)
Definition at line 70 of file reallocator.h.
pointer mbo::allocator< __ValueType, __ReferenceType >::address | ( | reference | ref | ) | [inline] |
const_pointer mbo::allocator< __ValueType, __ReferenceType >::address | ( | const_reference | ref | ) | [inline] |
pointer mbo::allocator< __ValueType, __ReferenceType >::allocate | ( | size_type | size, | |
std::allocator< void >::const_pointer | hint = 0L | |||
) | [inline] |
Allocate element space
size | number of elements required | |
hint | ignored |
Definition at line 94 of file reallocator.h.
00095 { 00096 return size ? reinterpret_cast<pointer>(new char [size * sizeof(value_type)]) : 0L; 00097 }
void mbo::allocator< __ValueType, __ReferenceType >::deallocate | ( | pointer | ptr, | |
size_type | size | |||
) | [inline] |
Deallocate an element space.
ptr | element space to deallocate | |
size | number of elements in element space |
Definition at line 106 of file reallocator.h.
void mbo::allocator< __ValueType, __ReferenceType >::construct | ( | pointer | ptr, | |
const_reference | oth | |||
) | [inline] |
Construct an element as a copy of another one
ptr | pointer to element position in element space | |
oth | other element to copy from |
Definition at line 118 of file reallocator.h.
00119 { 00120 #if _MSC_VER >= 1300 00121 # pragma push_macro("new") 00122 # undef new 00123 #endif 00124 new (ptr) value_type(oth); 00125 #if _MSC_VER >= 1300 00126 # pragma pop_macro("new") 00127 #endif 00128 }
size_type mbo::allocator< __ValueType, __ReferenceType >::max_size | ( | ) | const [inline] |
Definition at line 133 of file reallocator.h.
00134 { 00135 return static_cast<size_type>(~0) / sizeof(value_type); 00136 }
Hosted on code.google.com | © Marcus Börger | Generated on Fri Jan 18 21:21:13 2008 for MBO-lib by ![]() |