GEOSX
Namespaces | Macros | Functions
arrayManipulation.hpp File Reference

Contains functions for manipulating a contiguous array of values. More...

#include "Macros.hpp"

Go to the source code of this file.

Namespaces

 LvArray
 The top level namespace.
 
 LvArray::arrayManipulation
 Contains functions for operating on a contiguous array of values.
 

Macros

#define ARRAYMANIPULATION_CHECK_BOUNDS(index)
 Check that index is a valid into into the array. More...
 
#define ARRAYMANIPULATION_CHECK_INSERT_BOUNDS(index)
 Check that index is a valid insertion position in the array. More...
 

Functions

template<typename INDEX_TYPE >
constexpr std::enable_if< std::is_signed< INDEX_TYPE >::value, bool >::type LvArray::arrayManipulation::isPositive (INDEX_TYPE const i)
 
template<typename INDEX_TYPE >
constexpr std::enable_if< !std::is_signed< INDEX_TYPE >::value, bool >::type LvArray::arrayManipulation::isPositive (INDEX_TYPE)
 
template<typename ITER >
constexpr std::iterator_traits< ITER >::difference_type LvArray::arrayManipulation::iterDistance (ITER first, ITER const last, std::input_iterator_tag)
 
template<typename RandomAccessIterator >
constexpr std::iterator_traits< RandomAccessIterator >::difference_type LvArray::arrayManipulation::iterDistance (RandomAccessIterator first, RandomAccessIterator last, std::random_access_iterator_tag)
 
template<typename ITER >
constexpr std::iterator_traits< ITER >::difference_type LvArray::arrayManipulation::iterDistance (ITER const first, ITER const last)
 
template<typename T >
void LvArray::arrayManipulation::destroy (T *const LVARRAY_RESTRICT ptr, std::ptrdiff_t const size)
 Destory the values in the array. More...
 
template<typename ITER , typename T >
void LvArray::arrayManipulation::uninitializedCopy (ITER first, ITER const &last, T *LVARRAY_RESTRICT dst)
 Copy construct values from the source to the destination. More...
 
template<typename T >
void LvArray::arrayManipulation::uninitializedMove (T *const LVARRAY_RESTRICT dst, std::ptrdiff_t const size, T *const LVARRAY_RESTRICT src)
 Move construct values from the source to the destination. More...
 
template<typename T >
void LvArray::arrayManipulation::uninitializedShiftDown (T *const LVARRAY_RESTRICT ptr, std::ptrdiff_t const size, std::ptrdiff_t const amount)
 Shift values down into uninitialized memory. More...
 
template<typename T >
void LvArray::arrayManipulation::uninitializedShiftUp (T *const LVARRAY_RESTRICT ptr, std::ptrdiff_t const size, std::ptrdiff_t const amount)
 Shift values up into uninitialized memory. More...
 
template<typename T , typename ... ARGS>
void LvArray::arrayManipulation::resize (T *const LVARRAY_RESTRICT ptr, std::ptrdiff_t const size, std::ptrdiff_t const newSize, ARGS &&... args)
 Resize the give array. More...
 
template<typename T >
void LvArray::arrayManipulation::shiftUp (T *const LVARRAY_RESTRICT ptr, std::ptrdiff_t const size, std::ptrdiff_t const index, std::ptrdiff_t const n)
 Shift the values in the array at or above the given position up by the given amount. New uninitialized values take their place. More...
 
template<typename T >
void LvArray::arrayManipulation::shiftDown (T *const LVARRAY_RESTRICT ptr, std::ptrdiff_t const size, std::ptrdiff_t const index, std::ptrdiff_t const n)
 Shift the values in the array at or above the given position down by the given amount overwriting the existing values. The n entries at the end of the array are not destroyed. More...
 
template<typename T >
void LvArray::arrayManipulation::erase (T *const LVARRAY_RESTRICT ptr, std::ptrdiff_t const size, std::ptrdiff_t const index, std::ptrdiff_t const n=1)
 Shift the values in the array at or above the given position down by the given amount overwriting the existing values. The n entries at the end of the array are then destroyed. More...
 
template<typename T , typename ... ARGS>
void LvArray::arrayManipulation::emplaceBack (T *const LVARRAY_RESTRICT ptr, std::ptrdiff_t const size, ARGS &&... args)
 Append the to the array constructing the new value in place. More...
 
template<typename T , typename ITER >
std::ptrdiff_t LvArray::arrayManipulation::append (T *const LVARRAY_RESTRICT ptr, std::ptrdiff_t const size, ITER first, ITER const last)
 Append the given values to the array. More...
 
template<typename T , typename ... ARGS>
void LvArray::arrayManipulation::emplace (T *const LVARRAY_RESTRICT ptr, std::ptrdiff_t const size, std::ptrdiff_t const index, ARGS &&... args)
 Insert into the array constructing the new value in place. More...
 
template<typename T , typename ITERATOR >
void LvArray::arrayManipulation::insert (T *const LVARRAY_RESTRICT ptr, std::ptrdiff_t const size, std::ptrdiff_t const index, ITERATOR first, std::ptrdiff_t const n)
 Insert the given values into the array at the given position. More...
 
template<typename T >
void LvArray::arrayManipulation::popBack (T *const LVARRAY_RESTRICT ptr, std::ptrdiff_t const size)
 Destroy the value at the end of the array. More...
 

Detailed Description

Contains functions for manipulating a contiguous array of values.

Definition in file arrayManipulation.hpp.

Macro Definition Documentation

◆ ARRAYMANIPULATION_CHECK_BOUNDS

#define ARRAYMANIPULATION_CHECK_BOUNDS (   index)

Check that index is a valid into into the array.

Parameters
indexThe index to check.
Note
This is only active when LVARRAY_BOUNDS_CHECK is defined.

Definition at line 44 of file arrayManipulation.hpp.

◆ ARRAYMANIPULATION_CHECK_INSERT_BOUNDS

#define ARRAYMANIPULATION_CHECK_INSERT_BOUNDS (   index)

Check that index is a valid insertion position in the array.

Parameters
indexThe index to check.
Note
This is only active when LVARRAY_BOUNDS_CHECK is defined.

Definition at line 51 of file arrayManipulation.hpp.