AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::detail::ArrayOpsBase< T, false > Struct Template Reference

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/core/ArrayBase.hpp>

Public Types

using DefaultCtorTag = std::is_default_constructible< T >
 

Static Public Member Functions

static void init_impl (T *data, IndexType begin, IndexType nelems, std::true_type)
 Helper for default-initializing the "new" segment of an array. More...
 
static void init_impl (T *, IndexType, IndexType, std::false_type)
 
static void init (T *data, IndexType begin, IndexType nelems)
 Default-initializes the "new" segment of an array. More...
 
static void fill (T *array, IndexType begin, IndexType nelems, const T &value)
 Fills an uninitialized array with objects of type T. More...
 
static void fill_range (T *array, IndexType begin, IndexType nelems, const T *values, MemorySpace space)
 Fills an uninitialized array with a range of objects of type T. More...
 
template<typename... Args>
static void emplace (T *array, IndexType i, Args &&... args)
 Constructs a new element in uninitialized memory. More...
 
static void destroy (T *array, IndexType begin, IndexType nelems)
 Calls the destructor on a range of typed elements in the array. More...
 
static void move (T *array, IndexType src_begin, IndexType src_end, IndexType dst)
 Moves a range of data in the array. More...
 
static void realloc_move (T *array, IndexType nelems, T *values)
 Moves a range of elements to a new allocation. More...
 

Member Typedef Documentation

◆ DefaultCtorTag

template<typename T >
using axom::detail::ArrayOpsBase< T, false >::DefaultCtorTag = std::is_default_constructible<T>

Member Function Documentation

◆ init_impl() [1/2]

template<typename T >
static void axom::detail::ArrayOpsBase< T, false >::init_impl ( T *  data,
IndexType  begin,
IndexType  nelems,
std::true_type   
)
inlinestatic

Helper for default-initializing the "new" segment of an array.

Parameters
[in,out]dataThe data to initialize
[in]beginThe beginning of the subset of data that should be initialized
[in]nelemsthe number of elements to initialize
Note
Specialization for when T is default-constructible.

References axom::utilities::annotations::begin().

◆ init_impl() [2/2]

template<typename T >
static void axom::detail::ArrayOpsBase< T, false >::init_impl ( T *  ,
IndexType  ,
IndexType  ,
std::false_type   
)
inlinestatic

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Note
Specialization for when T is not default-constructible.

◆ init()

template<typename T >
static void axom::detail::ArrayOpsBase< T, false >::init ( T *  data,
IndexType  begin,
IndexType  nelems 
)
inlinestatic

Default-initializes the "new" segment of an array.

Parameters
[in,out]dataThe data to initialize
[in]beginThe beginning of the subset of data that should be initialized
[in]nelemsthe number of elements to initialize
Note
Specialization for when T is default-constructible.

References axom::utilities::annotations::begin().

◆ fill()

template<typename T >
static void axom::detail::ArrayOpsBase< T, false >::fill ( T *  array,
IndexType  begin,
IndexType  nelems,
const T &  value 
)
inlinestatic

Fills an uninitialized array with objects of type T.

Parameters
[in,out]arraythe array to fill
[in]beginthe index in the array to begin filling elements at
[in]nelemsthe number of elements to fill the array with
[in]valuethe value to set each array element to

References axom::utilities::annotations::begin().

◆ fill_range()

template<typename T >
static void axom::detail::ArrayOpsBase< T, false >::fill_range ( T *  array,
IndexType  begin,
IndexType  nelems,
const T *  values,
MemorySpace  space 
)
inlinestatic

Fills an uninitialized array with a range of objects of type T.

Parameters
[in,out]arraythe array to fill
[in]beginthe index at which to begin placing elements
[in]nelemsthe number of elements in the range to fill the array with
[in]valuesthe values to set each array element to
[in]spacethe memory space in which values resides

References AXOM_UNUSED_VAR, axom::utilities::annotations::begin(), and axom::copy().

◆ emplace()

template<typename T >
template<typename... Args>
static void axom::detail::ArrayOpsBase< T, false >::emplace ( T *  array,
IndexType  i,
Args &&...  args 
)
inlinestatic

Constructs a new element in uninitialized memory.

Parameters
[in,out]arraythe array to construct in
[in]ithe array index in which to construct the new object
[in]argsthe arguments to forward to constructor of the element.

◆ destroy()

template<typename T >
static void axom::detail::ArrayOpsBase< T, false >::destroy ( T *  array,
IndexType  begin,
IndexType  nelems 
)
inlinestatic

Calls the destructor on a range of typed elements in the array.

Parameters
[in,out]arraythe array with elements to destroy
[in]beginthe start index of the range of elements to destroy
[in]valueone past the end index of the range of elements to destroy

References axom::utilities::annotations::begin().

◆ move()

template<typename T >
static void axom::detail::ArrayOpsBase< T, false >::move ( T *  array,
IndexType  src_begin,
IndexType  src_end,
IndexType  dst 
)
inlinestatic

Moves a range of data in the array.

Parameters
[in,out]arraythe array with elements to move
[in]src_beginthe start index of the source range
[in]src_endthe end index of the source range, exclusive
[in]dstthe destination index of the range of elements

◆ realloc_move()

template<typename T >
static void axom::detail::ArrayOpsBase< T, false >::realloc_move ( T *  array,
IndexType  nelems,
T *  values 
)
inlinestatic

Moves a range of elements to a new allocation.

Parameters
[in,out]arraythe array to move the elements to.
[in]nelemsthe number of elements to move.
[in]valuesthe destination index of the range of elements

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