UMPIRE
Umpire: resource management and provision
umpire::TypedAllocator< T > Class Template Reference

Allocator for objects of type T. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/umpire/checkouts/develop/src/umpire/TypedAllocator.hpp>

Public Types

typedef T value_type
 

Public Member Functions

 TypedAllocator (Allocator allocator)
 Construct a new TypedAllocator that will use allocator to allocate data. More...
 
template<typename U >
 TypedAllocator (const TypedAllocator< U > &other)
 
T * allocate (std::size_t size)
 
void deallocate (T *ptr, std::size_t size)
 Deallocate ptr, the passed size is ignored. More...
 

Friends

template<typename U >
class TypedAllocator
 
template<typename U , typename V >
bool operator== (const TypedAllocator< U > &, const TypedAllocator< V > &)
 
template<typename U , typename V >
bool operator!= (const TypedAllocator< U > &, const TypedAllocator< V > &)
 

Detailed Description

template<typename T>
class umpire::TypedAllocator< T >

Allocator for objects of type T.

This class is an adaptor that allows using an Allocator to allocate objects of type T. You can use this class as an allocator for STL containers like std::vector.

Member Typedef Documentation

◆ value_type

template<typename T >
typedef T umpire::TypedAllocator< T >::value_type

Constructor & Destructor Documentation

◆ TypedAllocator() [1/2]

template<typename T >
umpire::TypedAllocator< T >::TypedAllocator ( Allocator  allocator)
explicit

Construct a new TypedAllocator that will use allocator to allocate data.

Parameters
allocatorAllocator to use for allocating memory.

◆ TypedAllocator() [2/2]

template<typename T >
template<typename U >
umpire::TypedAllocator< T >::TypedAllocator ( const TypedAllocator< U > &  other)

Member Function Documentation

◆ allocate()

template<typename T >
T * umpire::TypedAllocator< T >::allocate ( std::size_t  size)

◆ deallocate()

template<typename T >
void umpire::TypedAllocator< T >::deallocate ( T *  ptr,
std::size_t  size 
)

Deallocate ptr, the passed size is ignored.

Parameters
ptrPointer to deallocate
sizeSize of allocation (ignored).

Friends And Related Function Documentation

◆ TypedAllocator

template<typename T >
template<typename U >
friend class TypedAllocator
friend

◆ operator==

template<typename T >
template<typename U , typename V >
bool operator== ( const TypedAllocator< U > &  lhs,
const TypedAllocator< V > &  rhs 
)
friend

◆ operator!=

template<typename T >
template<typename U , typename V >
bool operator!= ( const TypedAllocator< U > &  lhs,
const TypedAllocator< V > &  rhs 
)
friend