OCCT3D OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    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=default
     Constructor. Creates an object using the default Open CASCADE allocation mechanism, i.e., which uses Standard::Allocate() and Standard::Free() underneath.
     NCollection_Allocator (const occ::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.
    template<typename Type = value_type>
    std::enable_if<!std::is_const< Type >::value, pointer >::type address (reference theItem) const noexcept
     Returns an object address.
    const_pointer address (const_reference theItem) const noexcept
     Returns an object address.
    pointer allocate (const size_type theSize, const void *=nullptr) 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) noexcept(std::is_nothrow_destructible< value_type >::value)
     Destroys the object. Uses the object destructor.
    constexpr bool operator== (const NCollection_Allocator &) const noexcept
    template<class U>
    constexpr bool operator== (const NCollection_Allocator< U > &) const noexcept
    constexpr bool operator!= (const NCollection_Allocator &) const noexcept
    template<class U>
    constexpr 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);
    TopoDS_Solid aSolid = BRepPrimAPI_MakeBox(10., 20., 30.);
    aList.push_back(aSolid);
    Describes functions to build parallelepiped boxes. A MakeBox object provides a framework for:
    Definition BRepPrimAPI_MakeBox.hxx:51
    NCollection_Allocator() noexcept=default
    Constructor. Creates an object using the default Open CASCADE allocation mechanism,...
    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 ( )
    defaultnoexcept

    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 occ::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
    inlinenoexcept

    Returns an object address.

    ◆ address() [2/2]

    template<typename ItemType>
    template<typename Type = value_type>
    std::enable_if<!std::is_const< Type >::value, pointer >::type NCollection_Allocator< ItemType >::address ( reference theItem) const
    inlinenoexcept

    Returns an object address.

    ◆ allocate()

    template<typename ItemType>
    pointer NCollection_Allocator< ItemType >::allocate ( const size_type theSize,
    const void * = nullptr ) 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)
    inlinenoexcept

    Destroys the object. Uses the object destructor.

    ◆ operator!=() [1/2]

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

    ◆ operator!=() [2/2]

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

    ◆ 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
    inlineconstexprnoexcept

    ◆ operator==() [2/2]

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

    ◆ 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: