|
Open CASCADE Technology
6.9.0
|
Implements allocator requirements as defined in ISO C++ Standard 2003, section 20.1.5. More...
#include <NCollection_StdAllocator.hxx>
Data Structures | |
| struct | rebind |
Public Types | |
| typedef T | value_type |
| typedef value_type * | pointer |
| typedef const value_type * | const_pointer |
| typedef value_type & | reference |
| typedef const value_type & | const_reference |
| typedef size_t | size_type |
| typedef ptrdiff_t | difference_type |
Public Member Functions | |
| NCollection_StdAllocator () throw () | |
| Constructor. More... | |
| NCollection_StdAllocator (const Handle< NCollection_BaseAllocator > &theAlloc) throw () | |
| Constructor. More... | |
| NCollection_StdAllocator (const NCollection_StdAllocator &X) throw () | |
| Constructor. More... | |
| ~NCollection_StdAllocator () throw () | |
| Destructor. More... | |
| template<typename U > | |
| NCollection_StdAllocator (const NCollection_StdAllocator< U > &Y) throw () | |
| Constructor. More... | |
| pointer | address (reference x) const |
| Returns an object address. More... | |
| const_pointer | address (const_reference x) const |
| Returns an object address. More... | |
| pointer | allocate (size_type n, const void *=0) |
| Allocates memory for n objects. More... | |
| void | deallocate (pointer p, size_type) |
| Frees previously allocated memory. More... | |
| size_type | max_size () const throw () |
| Returns the largest value for which method allocate might succeed. More... | |
| void | construct (pointer p, const_reference val) |
| Constructs an object. More... | |
| void | destroy (pointer p) |
| Destroys the object. More... | |
| const Handle < NCollection_BaseAllocator > & | Allocator () const |
| Returns an underlying NCollection_BaseAllocator instance. More... | |
Protected Attributes | |
| Handle< NCollection_BaseAllocator > | myAlloc |
Implements allocator requirements as defined in ISO C++ Standard 2003, section 20.1.5.
The allocator uses instance of the NCollection_BaseAllocator (sub)class for memory allocation/deallocation. The allocator can be used with standard containers (std::vector, std::map, etc) to take advantage of NCollection_IncAllocator which implements memory region concept, and hence to increase performance in specific cases.
The underlying NCollection_BaseAllocator instance can be received using the Allocator() method.
Example of use:
| typedef const value_type* NCollection_StdAllocator< T >::const_pointer |
| typedef const value_type& NCollection_StdAllocator< T >::const_reference |
| typedef ptrdiff_t NCollection_StdAllocator< T >::difference_type |
| typedef value_type* NCollection_StdAllocator< T >::pointer |
| typedef value_type& NCollection_StdAllocator< T >::reference |
| typedef size_t NCollection_StdAllocator< T >::size_type |
| typedef T NCollection_StdAllocator< T >::value_type |
|
inline | |||||||||||||
Constructor.
Creates an object using default Open CASCADE allocation mechanism, i.e. which uses Standard::Allocate() and Standard::Free() underneath.
|
inline | ||||||||||||||
Constructor.
Saves theAlloc as an underlying allocator instance.
|
inline | ||||||||||||||
Constructor.
Copies Allocator() from X.
|
inline | |||||||||||||
Destructor.
Empty implementation.
|
inline | ||||||||||||||
Constructor.
Copies Allocator() from Y.
|
inline |
Returns an object address.
Returns &x.
|
inline |
Returns an object address.
Returns &x.
|
inline |
Allocates memory for n objects.
Uses underlying allocator to allocate memory.
|
inline |
Returns an underlying NCollection_BaseAllocator instance.
Returns an object specified in the constructor.
|
inline |
Constructs an object.
Uses placement new operator and copy constructor to construct an object.
|
inline |
Frees previously allocated memory.
Uses underlying allocator to deallocate memory.
|
inline |
Destroys the object.
Uses object destructor.
|
inline | |||||||||||||
Returns the largest value for which method allocate might succeed.
|
protected |
1.8.5