Clustering
C++20 header-only: DBSCAN, HDBSCAN, k-means.
Loading...
Searching...
No Matches
clustering::NewAllocator< T > Class Template Reference

Thin wrapper over new T / delete that satisfies the library's allocator concept. More...

#include <clustering/memory/new_alloc.h>

Public Member Functions

 NewAllocator (std::size_t)
 Constructs the allocator; the count hint is ignored since allocations are individual.
 NewAllocator (const NewAllocator &)=delete
NewAllocatoroperator= (const NewAllocator &)=delete
T * allocate ()
 Allocates one default-constructed T via new.
void deallocate (T *ptr)
 Frees a pointer previously returned by allocate.
void reset ()
 No-op; the allocator holds no bulk state to rewind.
bool isDeallocSupported ()
 Reports that per-element deallocate is supported (true for this allocator).

Detailed Description

template<typename T>
class clustering::NewAllocator< T >

Thin wrapper over new T / delete that satisfies the library's allocator concept.

Definition at line 11 of file new_alloc.h.

Constructor & Destructor Documentation

◆ NewAllocator() [1/2]

template<typename T>
clustering::NewAllocator< T >::NewAllocator ( std::size_t )
inline

Constructs the allocator; the count hint is ignored since allocations are individual.

Definition at line 14 of file new_alloc.h.

◆ NewAllocator() [2/2]

template<typename T>
clustering::NewAllocator< T >::NewAllocator ( const NewAllocator< T > & )
delete

Member Function Documentation

◆ allocate()

template<typename T>
T * clustering::NewAllocator< T >::allocate ( )
inline

Allocates one default-constructed T via new.

Definition at line 20 of file new_alloc.h.

◆ deallocate()

template<typename T>
void clustering::NewAllocator< T >::deallocate ( T * ptr)
inline

Frees a pointer previously returned by allocate.

Definition at line 23 of file new_alloc.h.

◆ isDeallocSupported()

template<typename T>
bool clustering::NewAllocator< T >::isDeallocSupported ( )
inline

Reports that per-element deallocate is supported (true for this allocator).

Definition at line 31 of file new_alloc.h.

◆ operator=()

template<typename T>
NewAllocator & clustering::NewAllocator< T >::operator= ( const NewAllocator< T > & )
delete

◆ reset()

template<typename T>
void clustering::NewAllocator< T >::reset ( )
inline

No-op; the allocator holds no bulk state to rewind.

Definition at line 26 of file new_alloc.h.


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