Open CASCADE Technology 7.8.0
Data Structures | Public Types | Public Member Functions
NCollection_Allocator< ItemType > Class Template Reference

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_typepointer
 
typedef const value_typeconst_pointer
 
typedef value_typereference
 
typedef const value_typeconst_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_Allocatoroperator= (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
 

Detailed Description

template<typename ItemType>
class NCollection_Allocator< ItemType >

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:

std::list<TopoDS_Shape, NCollection_Allocator<TopoDS_Shape>> aList(anSAllocator);
aList.push_back(aSolid);
Describes functions to build parallelepiped boxes. A MakeBox object provides a framework for:
Definition BRepPrimAPI_MakeBox.hxx:52
Definition NCollection_UBTree.hxx:64
Describes a solid shape which.
Definition TopoDS_Solid.hxx:31

Member Typedef Documentation

◆ const_pointer

template<typename ItemType >
typedef const value_type* NCollection_Allocator< ItemType >::const_pointer

◆ const_reference

template<typename ItemType >
typedef const value_type& NCollection_Allocator< ItemType >::const_reference

◆ difference_type

template<typename ItemType >
typedef ptrdiff_t NCollection_Allocator< ItemType >::difference_type

◆ pointer

template<typename ItemType >
typedef value_type* NCollection_Allocator< ItemType >::pointer

◆ reference

template<typename ItemType >
typedef value_type& NCollection_Allocator< ItemType >::reference

◆ size_type

template<typename ItemType >
typedef size_t NCollection_Allocator< ItemType >::size_type

◆ value_type

template<typename ItemType >
typedef ItemType NCollection_Allocator< ItemType >::value_type

Constructor & Destructor Documentation

◆ NCollection_Allocator() [1/3]

template<typename ItemType >
NCollection_Allocator< ItemType >::NCollection_Allocator ( )
inlinenoexcept

Constructor. Creates an object using the default Open CASCADE allocation mechanism, i.e., which uses Standard::Allocate() and Standard::Free() underneath.

◆ NCollection_Allocator() [2/3]

template<typename ItemType >
NCollection_Allocator< ItemType >::NCollection_Allocator ( const Handle< NCollection_BaseAllocator > &  )
inlinenoexcept

Constructor.

◆ NCollection_Allocator() [3/3]

template<typename ItemType >
template<typename OtherType >
NCollection_Allocator< ItemType >::NCollection_Allocator ( const NCollection_Allocator< OtherType > &  )
inlinenoexcept

Constructor. Creates an object using the default Open CASCADE allocation mechanism, i.e., which uses Standard::Allocate() and Standard::Free() underneath.

Member Function Documentation

◆ address() [1/2]

template<typename ItemType >
const_pointer NCollection_Allocator< ItemType >::address ( const_reference  theItem) const
inline

Returns an object address.

◆ address() [2/2]

template<typename ItemType >
pointer NCollection_Allocator< ItemType >::address ( reference  theItem) const
inline

Returns an object address.

◆ allocate()

template<typename ItemType >
pointer NCollection_Allocator< ItemType >::allocate ( const size_type  theSize,
const void *  = 0 
) const
inline

Allocates memory for theSize objects.

◆ construct()

template<typename ItemType >
template<class _Objty , class... _Types>
void NCollection_Allocator< ItemType >::construct ( _Objty _Ptr,
_Types &&...  _Args 
)
inline

Constructs an object. Uses placement new operator and copy constructor to construct an object.

◆ deallocate()

template<typename ItemType >
void NCollection_Allocator< ItemType >::deallocate ( pointer  thePnt,
const size_type   
) const
inline

Frees previously allocated memory.

◆ destroy()

template<typename ItemType >
void NCollection_Allocator< ItemType >::destroy ( pointer  thePnt)
inline

Destroys the object. Uses the object destructor.

◆ operator!=() [1/2]

template<typename ItemType >
bool NCollection_Allocator< ItemType >::operator!= ( const NCollection_Allocator< ItemType > &  ) const
inlinenoexcept

◆ operator!=() [2/2]

template<typename ItemType >
template<class U >
bool NCollection_Allocator< ItemType >::operator!= ( const NCollection_Allocator< U > &  ) const
inlinenoexcept

◆ operator=()

template<typename ItemType >
template<typename OtherType >
NCollection_Allocator & NCollection_Allocator< ItemType >::operator= ( const NCollection_Allocator< OtherType > &  )
inlinenoexcept

Assignment operator.

◆ operator==() [1/2]

template<typename ItemType >
bool NCollection_Allocator< ItemType >::operator== ( const NCollection_Allocator< ItemType > &  ) const
inline

◆ operator==() [2/2]

template<typename ItemType >
template<class U >
bool NCollection_Allocator< ItemType >::operator== ( const NCollection_Allocator< U > &  ) const
inlinenoexcept

◆ reallocate()

template<typename ItemType >
pointer NCollection_Allocator< ItemType >::reallocate ( pointer  thePnt,
const size_type  theSize 
) const
inline

Reallocates memory for theSize objects.


The documentation for this class was generated from the following file: