astrotypes  0.0
Public Types | Public Member Functions | List of all members
pss::astrotypes::PointerAllocator< LocalType > Class Template Reference

Dummy allocator that stores a pointer to a previously allocated area of memory. More...

#include <src/cpp/pss/astrotypes/multiarray/PointerAllocator.h>

Inheritance diagram for pss::astrotypes::PointerAllocator< LocalType >:
Inheritance graph

Public Types

using value_type = LocalType
 
- Public Types inherited from pss::astrotypes::StandardAllocator< LocalType >
using value_type = LocalType
 

Public Member Functions

 PointerAllocator (value_type *pointer) noexcept
 Construct the allocator from a pointer to previously allocated memory. More...
 
value_typeallocate (std::size_t)
 Returns a pointer to the previously allocated memory. More...
 
void deallocate (value_type *, std::size_t) noexcept
 Empty deallocator. More...
 
- Public Member Functions inherited from pss::astrotypes::StandardAllocator< LocalType >
 StandardAllocator () noexcept=default
 
template<typename OtherType >
 StandardAllocator (StandardAllocator< OtherType > const &) noexcept
 
value_typeallocate (std::size_t size)
 Allocate an area of contiguos memory. More...
 
void deallocate (value_type *pointer, std::size_t) noexcept
 Free a previously allocated memory area. More...
 

Detailed Description

template<typename LocalType>
class pss::astrotypes::PointerAllocator< LocalType >

Dummy allocator that stores a pointer to a previously allocated area of memory.

<LocalType>

Definition at line 38 of file PointerAllocator.h.

Member Typedef Documentation

template<typename LocalType>
using pss::astrotypes::PointerAllocator< LocalType >::value_type = LocalType

Definition at line 41 of file PointerAllocator.h.

Constructor & Destructor Documentation

template<typename LocalType>
pss::astrotypes::PointerAllocator< LocalType >::PointerAllocator ( value_type pointer)
inlineexplicitnoexcept

Construct the allocator from a pointer to previously allocated memory.

Parameters
pointerPointer to previously allocated memory

Definition at line 47 of file PointerAllocator.h.

Member Function Documentation

template<typename LocalType>
value_type* pss::astrotypes::PointerAllocator< LocalType >::allocate ( std::size_t  )
inline

Returns a pointer to the previously allocated memory.

Parameters
sizeIgnored parameter, here for compatibility with allocate interface
Returns
Pointer to the previously allocated memory area

Definition at line 57 of file PointerAllocator.h.

template<typename LocalType>
void pss::astrotypes::PointerAllocator< LocalType >::deallocate ( value_type ,
std::size_t   
)
inlinenoexcept

Empty deallocator.

Parameters
pointerIgnored parameter, here for compatibility with allocate interface
sizeIgnored parameter, here for compatibility with allocate interface

Definition at line 67 of file PointerAllocator.h.