Flow123d  DF_patch_fe_data_tables-b828b90
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
ArenaResource< Resource > Class Template Reference

#include <arena_resource.hh>

Inheritance diagram for ArenaResource< Resource >:
Inheritance graph
[legend]
Collaboration diagram for ArenaResource< Resource >:
Collaboration graph
[legend]

Public Member Functions

 ArenaResource (size_t buffer_size, size_t simd_alignment)
 
 ~ArenaResource ()=default
 
Resource & resource ()
 Getter for resource. More...
 
template<class T >
T * allocate_8 (size_t n_items)
 Allocate and return data pointer of n_item array of type T (alignment to length 8 bytes) More...
 
template<class T >
T * allocate_simd (size_t n_items)
 Allocate and return data pointer of n_item array of type T (alignment to length given by simd_alignment constructor argument) More...
 
void reset ()
 

Protected Member Functions

void * do_allocate (size_t bytes, size_t alignment) override
 Override do_allocate to handle allocation logic. More...
 
void do_deallocate (void *p, size_t bytes, size_t alignment) override
 Override do_deallocate (no-op for monotonic buffer) More...
 
bool do_is_equal (const std::pmr::memory_resource &other) const noexcept override
 Override do_is_equal for memory resource comparison. More...
 

Private Attributes

std::unique_ptr< char[]> buffer
 
size_t buffer_size
 
Resource resource_
 
size_t simd_alignment_
 

Detailed Description

template<class Resource>
class ArenaResource< Resource >

Definition at line 56 of file arena_resource.hh.

Constructor & Destructor Documentation

◆ ArenaResource()

template<class Resource >
ArenaResource< Resource >::ArenaResource ( size_t  buffer_size,
size_t  simd_alignment 
)
inlineexplicit

Definition at line 58 of file arena_resource.hh.

◆ ~ArenaResource()

template<class Resource >
ArenaResource< Resource >::~ArenaResource ( )
default

Member Function Documentation

◆ allocate_8()

template<class Resource >
template<class T >
T* ArenaResource< Resource >::allocate_8 ( size_t  n_items)
inline

Allocate and return data pointer of n_item array of type T (alignment to length 8 bytes)

Definition at line 79 of file arena_resource.hh.

◆ allocate_simd()

template<class Resource >
template<class T >
T* ArenaResource< Resource >::allocate_simd ( size_t  n_items)
inline

Allocate and return data pointer of n_item array of type T (alignment to length given by simd_alignment constructor argument)

Definition at line 87 of file arena_resource.hh.

◆ do_allocate()

template<class Resource >
void* ArenaResource< Resource >::do_allocate ( size_t  bytes,
size_t  alignment 
)
inlineoverrideprotected

Override do_allocate to handle allocation logic.

Definition at line 100 of file arena_resource.hh.

◆ do_deallocate()

template<class Resource >
void ArenaResource< Resource >::do_deallocate ( void *  p,
size_t  bytes,
size_t  alignment 
)
inlineoverrideprotected

Override do_deallocate (no-op for monotonic buffer)

Definition at line 106 of file arena_resource.hh.

◆ do_is_equal()

template<class Resource >
bool ArenaResource< Resource >::do_is_equal ( const std::pmr::memory_resource &  other) const
inlineoverrideprotectednoexcept

Override do_is_equal for memory resource comparison.

Definition at line 111 of file arena_resource.hh.

◆ reset()

template<class Resource >
void ArenaResource< Resource >::reset ( )
inline

Definition at line 94 of file arena_resource.hh.

◆ resource()

template<class Resource >
Resource& ArenaResource< Resource >::resource ( )
inline

Getter for resource.

Definition at line 73 of file arena_resource.hh.

Member Data Documentation

◆ buffer

template<class Resource >
std::unique_ptr<char[]> ArenaResource< Resource >::buffer
private

Definition at line 116 of file arena_resource.hh.

◆ buffer_size

template<class Resource >
size_t ArenaResource< Resource >::buffer_size
private

Definition at line 117 of file arena_resource.hh.

◆ resource_

template<class Resource >
Resource ArenaResource< Resource >::resource_
private

Definition at line 118 of file arena_resource.hh.

◆ simd_alignment_

template<class Resource >
size_t ArenaResource< Resource >::simd_alignment_
private

Definition at line 119 of file arena_resource.hh.


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