GEOSX
|
Contains template functions for performing common operations on buffers. More...
Classes | |
class | VoidBuffer |
This class implements the default behavior for the Buffer methods related to execution space. This class is not intended to be used directly, instead derive from it if you would like to inherit the default behavior. More... | |
Functions | |
HAS_MEMBER_FUNCTION_NO_RTYPE (move, MemorySpace::CPU, true) | |
Defines a static constexpr bool HasMemberFunction_move< CLASS > that is true iff the class has a method move(MemorySpace, bool). More... | |
template<typename BUFFER > | |
constexpr void | check (BUFFER const &buf, std::ptrdiff_t const size) |
Check that given Buffer and size are valid. More... | |
template<typename BUFFER > | |
void | checkInsert (BUFFER const &buf, std::ptrdiff_t const size, std::ptrdiff_t const pos) |
Check that given Buffer, size, and insertion position, are valid. More... | |
template<typename BUFFER > | |
void | free (BUFFER &buf, std::ptrdiff_t const size) |
Destroy the values in the buffer and free it's memory. More... | |
template<typename BUFFER > | |
void | setCapacity (BUFFER &buf, std::ptrdiff_t const size, std::ptrdiff_t const newCapacity) |
Set the capacity of the buffer. More... | |
template<typename BUFFER > | |
void | reserve (BUFFER &buf, std::ptrdiff_t const size, std::ptrdiff_t const newCapacity) |
Reserve space in the buffer for at least the given capacity. More... | |
template<typename BUFFER > | |
void | dynamicReserve (BUFFER &buf, std::ptrdiff_t const size, std::ptrdiff_t const newCapacity) |
If the buffer's capacity is greater than newCapacity this is a no-op. Otherwise the buffer's capacity is increased to at least 2 * newCapacity. More... | |
template<typename BUFFER , typename ... ARGS> | |
void | resize (BUFFER &buf, std::ptrdiff_t const size, std::ptrdiff_t const newSize, ARGS &&... args) |
Resize the buffer to the given size. More... | |
template<typename BUFFER , typename ... ARGS> | |
void | emplaceBack (BUFFER &buf, std::ptrdiff_t const size, ARGS &&... args) |
Construct a new value at the end of the buffer. More... | |
template<typename BUFFER , typename ... ARGS> | |
void | emplace (BUFFER &buf, std::ptrdiff_t const size, std::ptrdiff_t const pos, ARGS &&... args) |
Construct a new value at position pos . More... | |
template<typename BUFFER , typename ITER > | |
std::ptrdiff_t | insert (BUFFER &buf, std::ptrdiff_t const size, std::ptrdiff_t const pos, ITER const first, ITER const last) |
Insert multiple values into the buffer. More... | |
template<typename BUFFER > | |
void | popBack (BUFFER &buf, std::ptrdiff_t const size) |
Remove a value from the end of the buffer. More... | |
template<typename BUFFER > | |
void | erase (BUFFER &buf, std::ptrdiff_t const size, std::ptrdiff_t const pos) |
Erase a value from the buffer. More... | |
template<typename DST_BUFFER , typename SRC_BUFFER > | |
void | copyInto (DST_BUFFER &dst, std::ptrdiff_t const dstSize, SRC_BUFFER const &src, std::ptrdiff_t const srcSize) |
Copy values from the source buffer into the destination buffer. More... | |
Contains template functions for performing common operations on buffers.
Each function accepts a buffer and a size as the first two arguments.
|
inline |
Check that given Buffer and size are valid.
BUFFER | the buffer type. |
buf | The buffer to check. |
size | The size of the buffer. |
Definition at line 138 of file bufferManipulation.hpp.
|
inline |
Check that given Buffer, size, and insertion position, are valid.
BUFFER | the buffer type. |
buf | The buffer to check. |
size | The size of the buffer. |
pos | The insertion position. |
Definition at line 160 of file bufferManipulation.hpp.
void LvArray::bufferManipulation::copyInto | ( | DST_BUFFER & | dst, |
std::ptrdiff_t const | dstSize, | ||
SRC_BUFFER const & | src, | ||
std::ptrdiff_t const | srcSize | ||
) |
Copy values from the source buffer into the destination buffer.
DST_BUFFER | the destination buffer type. |
SRC_BUFFER | the source buffer type. |
dst | The destination buffer. |
dstSize | The size of the destination buffer. |
src | The source buffer. |
srcSize | The size of the source buffer. |
Definition at line 387 of file bufferManipulation.hpp.
void LvArray::bufferManipulation::dynamicReserve | ( | BUFFER & | buf, |
std::ptrdiff_t const | size, | ||
std::ptrdiff_t const | newCapacity | ||
) |
If the buffer's capacity is greater than newCapacity this is a no-op. Otherwise the buffer's capacity is increased to at least 2 * newCapacity.
BUFFER | the buffer type. |
buf | The buffer to reserve space in. |
size | The size of the buffer. |
newCapacity | The new minimum capacity of the buffer. |
Definition at line 243 of file bufferManipulation.hpp.
void LvArray::bufferManipulation::emplace | ( | BUFFER & | buf, |
std::ptrdiff_t const | size, | ||
std::ptrdiff_t const | pos, | ||
ARGS &&... | args | ||
) |
Construct a new value at position pos
.
BUFFER | The buffer type. |
ARGS | A variadic pack of argument types. |
buf | The buffer to insert into. |
size | The current size of the buffer. |
pos | The position to construct the values at. |
args | A variadic pack of parameters to construct the new value with. |
Definition at line 309 of file bufferManipulation.hpp.
void LvArray::bufferManipulation::emplaceBack | ( | BUFFER & | buf, |
std::ptrdiff_t const | size, | ||
ARGS &&... | args | ||
) |
Construct a new value at the end of the buffer.
BUFFER | The buffer type. |
ARGS | A variadic pack of argument types. |
buf | The buffer to insert into. |
size | The current size of the buffer. |
args | A variadic pack of parameters to construct the new value with. |
Definition at line 291 of file bufferManipulation.hpp.
void LvArray::bufferManipulation::erase | ( | BUFFER & | buf, |
std::ptrdiff_t const | size, | ||
std::ptrdiff_t const | pos | ||
) |
Erase a value from the buffer.
BUFFER | the buffer type. |
buf | The buffer to erase from. |
size | The current size of the buffer. |
pos | The position to erase. |
Definition at line 367 of file bufferManipulation.hpp.
void LvArray::bufferManipulation::free | ( | BUFFER & | buf, |
std::ptrdiff_t const | size | ||
) |
Destroy the values in the buffer and free it's memory.
BUFFER | the buffer type. |
buf | The buffer to free. |
size | The size of the buffer. |
Definition at line 182 of file bufferManipulation.hpp.
LvArray::bufferManipulation::HAS_MEMBER_FUNCTION_NO_RTYPE | ( | move | , |
MemorySpace::CPU | , | ||
true | |||
) |
Defines a static constexpr bool HasMemberFunction_move< CLASS
> that is true iff the class has a method move(MemorySpace, bool).
CLASS | The type to test. |
std::ptrdiff_t LvArray::bufferManipulation::insert | ( | BUFFER & | buf, |
std::ptrdiff_t const | size, | ||
std::ptrdiff_t const | pos, | ||
ITER const | first, | ||
ITER const | last | ||
) |
Insert multiple values into the buffer.
BUFFER | The buffer type. |
ITER | An iterator type. |
buf | The buffer to insert into. |
size | The current size of the buffer. |
pos | The position to insert the values at. |
first | An iterator to the first value to insert. |
last | An iterator to the end of the values to insert. |
Definition at line 332 of file bufferManipulation.hpp.
void LvArray::bufferManipulation::popBack | ( | BUFFER & | buf, |
std::ptrdiff_t const | size | ||
) |
Remove a value from the end of the buffer.
BUFFER | the buffer type. |
buf | The buffer to remove from. |
size | The current size of the buffer. |
Definition at line 353 of file bufferManipulation.hpp.
void LvArray::bufferManipulation::reserve | ( | BUFFER & | buf, |
std::ptrdiff_t const | size, | ||
std::ptrdiff_t const | newCapacity | ||
) |
Reserve space in the buffer for at least the given capacity.
BUFFER | the buffer type. |
buf | The buffer to reserve space in. |
size | The size of the buffer. |
newCapacity | The new minimum capacity of the buffer. |
Definition at line 222 of file bufferManipulation.hpp.
void LvArray::bufferManipulation::resize | ( | BUFFER & | buf, |
std::ptrdiff_t const | size, | ||
std::ptrdiff_t const | newSize, | ||
ARGS &&... | args | ||
) |
Resize the buffer to the given size.
BUFFER | the buffer type. |
ARGS | The types of the arguments to initialize the new values with. |
buf | The buffer to resize. |
size | The current size of the buffer. |
newSize | The new size of the buffer. |
args | The arguments to initialize the new values with. |
Definition at line 266 of file bufferManipulation.hpp.
void LvArray::bufferManipulation::setCapacity | ( | BUFFER & | buf, |
std::ptrdiff_t const | size, | ||
std::ptrdiff_t const | newCapacity | ||
) |
Set the capacity of the buffer.
BUFFER | the buffer type. |
buf | The buffer to set the capacity of. |
size | The size of the buffer. |
newCapacity | The new capacity of the buffer. |
Definition at line 207 of file bufferManipulation.hpp.