Open CASCADE Technology 7.8.0
|
Implements allocator requirements as defined in ISO C++ Standard 2003, section 20.1.5. More...
#include <NCollection_Allocator.hxx>
Data Structures | |
struct | rebind |
Public Types | |
typedef ItemType | 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_Allocator () noexcept | |
Constructor. Creates an object using the default Open CASCADE allocation mechanism, i.e., which uses Standard::Allocate() and Standard::Free() underneath. | |
NCollection_Allocator (const Handle< NCollection_BaseAllocator > &) noexcept | |
Constructor. | |
template<typename OtherType > | |
NCollection_Allocator & | operator= (const NCollection_Allocator< OtherType > &) noexcept |
Assignment operator. | |
template<typename OtherType > | |
NCollection_Allocator (const NCollection_Allocator< OtherType > &) noexcept | |
Constructor. Creates an object using the default Open CASCADE allocation mechanism, i.e., which uses Standard::Allocate() and Standard::Free() underneath. | |
pointer | address (reference theItem) const |
Returns an object address. | |
const_pointer | address (const_reference theItem) const |
Returns an object address. | |
pointer | allocate (const size_type theSize, const void *=0) const |
Allocates memory for theSize objects. | |
void | deallocate (pointer thePnt, const size_type) const |
Frees previously allocated memory. | |
pointer | reallocate (pointer thePnt, const size_type theSize) const |
Reallocates memory for theSize objects. | |
template<class _Objty , class... _Types> | |
void | construct (_Objty *_Ptr, _Types &&... _Args) |
Constructs an object. Uses placement new operator and copy constructor to construct an object. | |
void | destroy (pointer thePnt) |
Destroys the object. Uses the object destructor. | |
bool | operator== (const NCollection_Allocator &) const |
template<class U > | |
bool | operator== (const NCollection_Allocator< U > &) const noexcept |
bool | operator!= (const NCollection_Allocator &) const noexcept |
template<class U > | |
bool | operator!= (const NCollection_Allocator< U > &) const noexcept |
Implements allocator requirements as defined in ISO C++ Standard 2003, section 20.1.5.
The allocator uses a standard OCCT mechanism for memory allocation and deallocation. It can be used with standard containers (std::vector, std::map, etc.) to take advantage of OCCT memory optimizations.
Example of use:
typedef const value_type* NCollection_Allocator< ItemType >::const_pointer |
typedef const value_type& NCollection_Allocator< ItemType >::const_reference |
typedef ptrdiff_t NCollection_Allocator< ItemType >::difference_type |
typedef value_type* NCollection_Allocator< ItemType >::pointer |
typedef value_type& NCollection_Allocator< ItemType >::reference |
typedef size_t NCollection_Allocator< ItemType >::size_type |
typedef ItemType NCollection_Allocator< ItemType >::value_type |
|
inlinenoexcept |
Constructor. Creates an object using the default Open CASCADE allocation mechanism, i.e., which uses Standard::Allocate() and Standard::Free() underneath.
|
inlinenoexcept |
Constructor.
|
inlinenoexcept |
Constructor. Creates an object using the default Open CASCADE allocation mechanism, i.e., which uses Standard::Allocate() and Standard::Free() underneath.
|
inline |
Returns an object address.
|
inline |
Returns an object address.
|
inline |
Allocates memory for theSize objects.
|
inline |
Constructs an object. Uses placement new operator and copy constructor to construct an object.
|
inline |
Frees previously allocated memory.
|
inline |
Destroys the object. Uses the object destructor.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Assignment operator.
|
inline |
|
inlinenoexcept |
|
inline |
Reallocates memory for theSize objects.