libhatchet
Loading...
Searching...
No Matches
hxallocator< T, fixed_capacity_ > Class Template Reference

#include <hxallocator.hpp>

Public Types

using value_t = T

Public Member Functions

 hxallocator (void)
hxsize_t capacity (void) const
const T * data (void) const
T * data (void)
void reserve_storage (hxsize_t size_, hxsystem_allocator_t allocator_=hxsystem_allocator_current, hxalignment_t alignment_=hxalignment)

Detailed Description

template<typename T, hxsize_t fixed_capacity_>
class hxallocator< T, fixed_capacity_ >

hxallocator<1+> - Provides static allocation when capacity is greater than zero.

Member Typedef Documentation

◆ value_t

template<typename T, hxsize_t fixed_capacity_>
using hxallocator< T, fixed_capacity_ >::value_t = T

value_t - Publishes the value type.

Constructor & Destructor Documentation

◆ hxallocator()

template<typename T, hxsize_t fixed_capacity_>
hxallocator< T, fixed_capacity_ >::hxallocator ( void )
inline

Initializes memory to 0xab when HX_HARDENING_MODE == HX_HARDENING_MODE_DEBUG.

Member Function Documentation

◆ capacity()

template<typename T, hxsize_t fixed_capacity_>
hxsize_t hxallocator< T, fixed_capacity_ >::capacity ( void ) const
inline

Returns the number of elements of T allocated.

◆ data() [1/2]

template<typename T, hxsize_t fixed_capacity_>
T * hxallocator< T, fixed_capacity_ >::data ( void )
inline

Returns a pointer to a potentially uninitialized array of T.

◆ data() [2/2]

template<typename T, hxsize_t fixed_capacity_>
const T * hxallocator< T, fixed_capacity_ >::data ( void ) const
inline

Returns a pointer to a const and potentially uninitialized array of T.

◆ reserve_storage()

template<typename T, hxsize_t fixed_capacity_>
void hxallocator< T, fixed_capacity_ >::reserve_storage ( hxsize_t size_,
hxsystem_allocator_t allocator_ = hxsystem_allocator_current,
hxalignment_t alignment_ = hxalignment )
inline

Ensures capacity.

Will not reallocate. Provided for interface compatibility with the dynamic allocator.

  • size : The number of elements of type T to ensure are available.
  • allocator : Ignored.
  • alignment : Ignored.

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