GEOSX
|
This class provides a view into a SortedArray. More...
#include <SortedArrayView.hpp>
Public Types | |
using | ValueType = T |
The type of the values contained in the SortedArrayView. | |
using | IndexType = INDEX_TYPE |
The integer type used for indexing. | |
using | value_type = T |
The type of the values contained in the SortedArrayView, here for stl compatability. | |
using | size_type = INDEX_TYPE |
The integer type used for indexing, here for stl compatability. | |
Public Member Functions | |
Constructors, destructor and assignment operators. | |
SortedArrayView (SortedArrayView const &src)=default | |
Default copy constructor. Performs a shallow copy and calls the chai::ManagedArray copy constructor. More... | |
constexpr | SortedArrayView (SortedArrayView &&src) |
Default move constructor, performs a shallow copy. More... | |
constexpr | SortedArrayView (INDEX_TYPE const size, BUFFER_TYPE< T > const &buffer) |
Construct a new SortedArrayView from the given buffer. More... | |
SortedArrayView & | operator= (SortedArrayView const &src)=default |
Default copy assignment operator, this does a shallow copy. More... | |
constexpr SortedArrayView & | operator= (SortedArrayView &&src) |
Default move assignment operator, this does a shallow copy. More... | |
SortedArrayView and ArraySlice creation methods | |
constexpr SortedArrayView< T const, INDEX_TYPE, BUFFER_TYPE > | toView () const |
constexpr SortedArrayView< T const, INDEX_TYPE, BUFFER_TYPE > | toViewConst () const |
constexpr ArraySlice< T const, 1, 0, INDEX_TYPE > | toSlice () const & |
constexpr ArraySlice< T const, 1, 0, INDEX_TYPE > | toSlice () const &&=delete |
Overload for rvalues that is deleted. More... | |
Attribute querying methods | |
constexpr bool | empty () const |
constexpr INDEX_TYPE | size () const |
bool | contains (T const &value) const |
bool | count (T const &value) const |
Methods that provide access to the data. | |
constexpr T const & | operator[] (INDEX_TYPE const i) const |
constexpr T const & | operator() (INDEX_TYPE const i) const |
constexpr T const * | data () const |
constexpr T const * | begin () const |
constexpr T const * | end () const |
Methods dealing with memory spaces | |
void | move (MemorySpace const space, bool touch=true) const |
Moves the SortedArrayView to the given execution space. More... | |
Protected Member Functions | |
SortedArrayView () | |
Default constructor. More... | |
Protected Attributes | |
BUFFER_TYPE< T > | m_values |
Holds the array of values. | |
INDEX_TYPE | m_size = 0 |
The number of values. | |
This class provides a view into a SortedArray.
T | type of data that is contained by the array. |
INDEX_TYPE | the integer to use for indexing. |
When using a SortedArrayView directly the template parameter T should be const since the View has no way of modifying the values. This also prevents unnecessary memory movement.
Definition at line 58 of file SortedArrayView.hpp.
|
default |
Default copy constructor. Performs a shallow copy and calls the chai::ManagedArray copy constructor.
src | the SortedArray to copy. |
|
inline |
Default move constructor, performs a shallow copy.
src | The SortedArray to be moved from. |
Definition at line 91 of file SortedArrayView.hpp.
|
inline |
Construct a new SortedArrayView from the given buffer.
size | The number of entries. |
buffer | The values buffer, of size size . |
Definition at line 104 of file SortedArrayView.hpp.
|
inlineprotected |
Default constructor.
Definition at line 290 of file SortedArrayView.hpp.
|
inline |
Definition at line 248 of file SortedArrayView.hpp.
|
inline |
value
is in the array. value | the value to search for. |
Definition at line 196 of file SortedArrayView.hpp.
|
inline |
value | the value to search for. |
Definition at line 205 of file SortedArrayView.hpp.
|
inline |
Definition at line 241 of file SortedArrayView.hpp.
|
inline |
Definition at line 181 of file SortedArrayView.hpp.
|
inline |
Definition at line 255 of file SortedArrayView.hpp.
|
inline |
Moves the SortedArrayView to the given execution space.
space | the space to move to. |
touch | If the values will be modified in the new space. |
touch
is set to false. Definition at line 273 of file SortedArrayView.hpp.
|
inline |
i
. i | the index of the value to access. |
Definition at line 231 of file SortedArrayView.hpp.
|
default |
Default copy assignment operator, this does a shallow copy.
src | The SortedArray to copy. |
|
inline |
Default move assignment operator, this does a shallow copy.
src | the SortedArray to be moved from. |
Definition at line 122 of file SortedArrayView.hpp.
|
inline |
i
. i | the index of the value to access. |
Definition at line 220 of file SortedArrayView.hpp.
|
inline |
Definition at line 188 of file SortedArrayView.hpp.
|
inline |
Definition at line 157 of file SortedArrayView.hpp.
|
inlinedelete |
Overload for rvalues that is deleted.
ArraySlice
would contain pointers to the size of the current SortedArrayView
that is about to be destroyed. This overload prevents that from happening.
|
inline |
Definition at line 142 of file SortedArrayView.hpp.
|
inline |
Definition at line 150 of file SortedArrayView.hpp.