Open CASCADE Technology 7.8.2.dev
|
Implements allocator requirements as defined in ISO C++ Standard 2003, section 20.1.5. More...
#include <NCollection_OccAllocator.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 |
typedef std::false_type | propagate_on_container_move_assignment |
Public Member Functions | |
NCollection_OccAllocator () | |
Constructor. Creates an object using the default Open CASCADE allocation mechanism, i.e., which uses Standard::Allocate() and Standard::Free() underneath. | |
NCollection_OccAllocator (const Handle< NCollection_BaseAllocator > &theAlloc) | |
Constructor. | |
NCollection_OccAllocator (Handle< NCollection_BaseAllocator > &&theAlloc) | |
Constructor. | |
NCollection_OccAllocator (const NCollection_OccAllocator &theOther) | |
Constructor. | |
NCollection_OccAllocator (NCollection_OccAllocator &&theOther) noexcept | |
Constructor. | |
NCollection_OccAllocator & | operator= (const NCollection_OccAllocator &theOther) |
Assignment operator. | |
NCollection_OccAllocator & | operator= (NCollection_OccAllocator &&theOther) noexcept |
Assignment operator. | |
template<typename OtherType > | |
NCollection_OccAllocator & | operator= (const NCollection_OccAllocator< OtherType > &theOther) |
Assignment operator. | |
template<typename OtherType > | |
NCollection_OccAllocator (const NCollection_OccAllocator< OtherType > &theOther) | |
Constructor. Creates an object using the default Open CASCADE allocation mechanism, i.e., which uses Standard::Allocate() and Standard::Free() underneath. | |
void | SetAllocator (const Handle< NCollection_BaseAllocator > &theAlloc) |
const Handle< NCollection_BaseAllocator > & | Allocator () const |
pointer | allocate (size_type theSize, const void *=0) |
Allocates memory for theSize objects. | |
template<typename T > | |
void | deallocate (T *thePnt, size_type) |
Template version of function Free(), nullifies the argument pointer. | |
void | deallocate (pointer thePnt, size_type) |
Frees previously allocated memory. | |
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. | |
pointer | address (reference theItem) const |
Returns an object address. | |
const_pointer | address (const_reference theItem) const |
Returns an object address. | |
template<class _Uty > | |
void | destroy (_Uty *_Ptr) |
Destroys the object. Uses the object destructor. | |
size_t | max_size () const noexcept |
Estimate maximum array size. | |
bool | operator== (const NCollection_OccAllocator &theOther) const |
template<class U > | |
bool | operator== (const NCollection_OccAllocator< U > &theOther) const |
bool | operator!= (const NCollection_OccAllocator &theOther) const |
template<class U > | |
bool | operator!= (const NCollection_OccAllocator< U > &theOther) const |
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:
const value_type* NCollection_OccAllocator< ItemType >::const_pointer |
const value_type& NCollection_OccAllocator< ItemType >::const_reference |
ptrdiff_t NCollection_OccAllocator< ItemType >::difference_type |
value_type* NCollection_OccAllocator< ItemType >::pointer |
std::false_type NCollection_OccAllocator< ItemType >::propagate_on_container_move_assignment |
value_type& NCollection_OccAllocator< ItemType >::reference |
size_t NCollection_OccAllocator< ItemType >::size_type |
ItemType NCollection_OccAllocator< ItemType >::value_type |
|
inline |
Constructor. Creates an object using the default Open CASCADE allocation mechanism, i.e., which uses Standard::Allocate() and Standard::Free() underneath.
|
inline |
Constructor.
|
inline |
Constructor.
|
inline |
Constructor.
|
inlinenoexcept |
Constructor.
|
inline |
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 |
|
inline |
Constructs an object. Uses placement new operator and copy constructor to construct an object.
|
inline |
Frees previously allocated memory.
|
inline |
Template version of function Free(), nullifies the argument pointer.
thePtr | - previously allocated memory block to be freed |
|
inline |
Destroys the object. Uses the object destructor.
|
inlinenoexcept |
Estimate maximum array size.
|
inline |
|
inline |
|
inline |
Assignment operator.
|
inline |
Assignment operator.
|
inlinenoexcept |
Assignment operator.
|
inline |
|
inline |
|
inline |