Low-Level Abstraction of Memory Access
llama::Vector< Mapping > Struct Template Reference

#include <Vector.hpp>

Public Types

using ViewType = decltype(allocViewUninitialized< Mapping >())
 
using RecordDim = typename Mapping::RecordDim
 
using iterator = decltype(std::declval< ViewType >().begin())
 
using value_type = typename iterator::value_type
 
using size_type = typename Mapping::ArrayExtents::value_type
 

Public Member Functions

 Vector ()=default
 
template<typename RecordRef = One<RecordDim>>
 Vector (size_type count, const RecordRef &value={})
 
template<typename Iterator >
 Vector (Iterator first, Iterator last)
 
 Vector (const Vector &other)=default
 
 Vector (Vector &&other) noexcept
 
auto operator= (const Vector &other) -> Vector &=default
 
auto operator= (Vector &&other) noexcept -> Vector &
 
 ~Vector ()=default
 
auto at (size_type i) -> decltype(auto)
 
auto at (size_type i) const -> decltype(auto)
 
auto operator[] (size_type i) -> decltype(auto)
 
auto operator[] (size_type i) const -> decltype(auto)
 
auto front () -> decltype(auto)
 
auto front () const -> decltype(auto)
 
auto back () -> decltype(auto)
 
auto back () const -> decltype(auto)
 
auto begin () -> decltype(auto)
 
auto begin () const -> decltype(auto)
 
auto cbegin () -> decltype(auto)
 
auto cbegin () const -> decltype(auto)
 
auto end () -> decltype(auto)
 
auto end () const -> decltype(auto)
 
auto cend () -> decltype(auto)
 
auto cend () const -> decltype(auto)
 
auto empty () const -> bool
 
auto size () const -> size_type
 
void reserve (size_type cap)
 
auto capacity () const -> size_type
 
void shrink_to_fit ()
 
void clear ()
 
template<typename T >
auto insert (iterator pos, T &&t) -> iterator
 
auto erase (iterator pos) -> iterator
 
template<typename T >
void push_back (T &&t)
 
void pop_back ()
 
template<typename RecordRef = One<RecordDim>>
void resize (size_type count, const RecordRef &value={})
 

Friends

auto operator== (const Vector &a, const Vector &b) -> bool
 
auto operator!= (const Vector &a, const Vector &b) -> bool
 
auto operator< (const Vector &a, const Vector &b) -> bool
 
auto operator<= (const Vector &a, const Vector &b) -> bool
 
auto operator> (const Vector &a, const Vector &b) -> bool
 
auto operator>= (const Vector &a, const Vector &b) -> bool
 
void swap (Vector &a, Vector &b) noexcept
 

Detailed Description

template<typename Mapping>
struct llama::Vector< Mapping >

An equivalent of std::vector<T> backed by a View. Elements are never value initialized though. No strong exception guarantee. WARNING: This class is experimental.

Template Parameters
MappingThe mapping to be used for the underlying view. Needs to have 1 array dimension.

Definition at line 22 of file Vector.hpp.

Member Typedef Documentation

◆ iterator

template<typename Mapping >
using llama::Vector< Mapping >::iterator = decltype(std::declval<ViewType>().begin())

Definition at line 29 of file Vector.hpp.

◆ RecordDim

template<typename Mapping >
using llama::Vector< Mapping >::RecordDim = typename Mapping::RecordDim

Definition at line 27 of file Vector.hpp.

◆ size_type

template<typename Mapping >
using llama::Vector< Mapping >::size_type = typename Mapping::ArrayExtents::value_type

Definition at line 31 of file Vector.hpp.

◆ value_type

template<typename Mapping >
using llama::Vector< Mapping >::value_type = typename iterator::value_type

Definition at line 30 of file Vector.hpp.

◆ ViewType

template<typename Mapping >
using llama::Vector< Mapping >::ViewType = decltype(allocViewUninitialized<Mapping>())

Definition at line 26 of file Vector.hpp.

Constructor & Destructor Documentation

◆ Vector() [1/5]

template<typename Mapping >
llama::Vector< Mapping >::Vector ( )
default

◆ Vector() [2/5]

template<typename Mapping >
template<typename RecordRef = One<RecordDim>>
llama::Vector< Mapping >::Vector ( size_type  count,
const RecordRef value = {} 
)
inlineexplicit

Definition at line 36 of file Vector.hpp.

◆ Vector() [3/5]

template<typename Mapping >
template<typename Iterator >
llama::Vector< Mapping >::Vector ( Iterator  first,
Iterator  last 
)
inline

Definition at line 44 of file Vector.hpp.

◆ Vector() [4/5]

template<typename Mapping >
llama::Vector< Mapping >::Vector ( const Vector< Mapping > &  other)
default

◆ Vector() [5/5]

template<typename Mapping >
llama::Vector< Mapping >::Vector ( Vector< Mapping > &&  other)
inlinenoexcept

Definition at line 56 of file Vector.hpp.

◆ ~Vector()

template<typename Mapping >
llama::Vector< Mapping >::~Vector ( )
default

Member Function Documentation

◆ at() [1/2]

template<typename Mapping >
auto llama::Vector< Mapping >::at ( size_type  i) -> decltype(auto)
inline

Definition at line 84 of file Vector.hpp.

◆ at() [2/2]

template<typename Mapping >
auto llama::Vector< Mapping >::at ( size_type  i) const -> decltype(auto)
inline

Definition at line 91 of file Vector.hpp.

◆ back() [1/2]

template<typename Mapping >
auto llama::Vector< Mapping >::back ( ) -> decltype(auto)
inline

Definition at line 118 of file Vector.hpp.

◆ back() [2/2]

template<typename Mapping >
auto llama::Vector< Mapping >::back ( ) const -> decltype(auto)
inline

Definition at line 123 of file Vector.hpp.

◆ begin() [1/2]

template<typename Mapping >
auto llama::Vector< Mapping >::begin ( ) -> decltype(auto)
inline

Definition at line 128 of file Vector.hpp.

◆ begin() [2/2]

template<typename Mapping >
auto llama::Vector< Mapping >::begin ( ) const -> decltype(auto)
inline

Definition at line 133 of file Vector.hpp.

◆ capacity()

template<typename Mapping >
auto llama::Vector< Mapping >::capacity ( ) const -> size_type
inline

Definition at line 184 of file Vector.hpp.

◆ cbegin() [1/2]

template<typename Mapping >
auto llama::Vector< Mapping >::cbegin ( ) -> decltype(auto)
inline

Definition at line 138 of file Vector.hpp.

◆ cbegin() [2/2]

template<typename Mapping >
auto llama::Vector< Mapping >::cbegin ( ) const -> decltype(auto)
inline

Definition at line 143 of file Vector.hpp.

◆ cend() [1/2]

template<typename Mapping >
auto llama::Vector< Mapping >::cend ( ) -> decltype(auto)
inline

Definition at line 158 of file Vector.hpp.

◆ cend() [2/2]

template<typename Mapping >
auto llama::Vector< Mapping >::cend ( ) const -> decltype(auto)
inline

Definition at line 163 of file Vector.hpp.

◆ clear()

template<typename Mapping >
void llama::Vector< Mapping >::clear ( )
inline

Definition at line 195 of file Vector.hpp.

◆ empty()

template<typename Mapping >
auto llama::Vector< Mapping >::empty ( ) const -> bool
inline

Definition at line 168 of file Vector.hpp.

◆ end() [1/2]

template<typename Mapping >
auto llama::Vector< Mapping >::end ( ) -> decltype(auto)
inline

Definition at line 148 of file Vector.hpp.

◆ end() [2/2]

template<typename Mapping >
auto llama::Vector< Mapping >::end ( ) const -> decltype(auto)
inline

Definition at line 153 of file Vector.hpp.

◆ erase()

template<typename Mapping >
auto llama::Vector< Mapping >::erase ( iterator  pos) -> iterator
inline

Definition at line 216 of file Vector.hpp.

◆ front() [1/2]

template<typename Mapping >
auto llama::Vector< Mapping >::front ( ) -> decltype(auto)
inline

Definition at line 108 of file Vector.hpp.

◆ front() [2/2]

template<typename Mapping >
auto llama::Vector< Mapping >::front ( ) const -> decltype(auto)
inline

Definition at line 113 of file Vector.hpp.

◆ insert()

template<typename Mapping >
template<typename T >
auto llama::Vector< Mapping >::insert ( iterator  pos,
T &&  t 
) -> iterator
inline

Definition at line 201 of file Vector.hpp.

◆ operator=() [1/2]

template<typename Mapping >
auto llama::Vector< Mapping >::operator= ( const Vector< Mapping > &  other) -> Vector &=default
default

◆ operator=() [2/2]

template<typename Mapping >
auto llama::Vector< Mapping >::operator= ( Vector< Mapping > &&  other) -> Vector&
inlinenoexcept

Definition at line 63 of file Vector.hpp.

◆ operator[]() [1/2]

template<typename Mapping >
auto llama::Vector< Mapping >::operator[] ( size_type  i) -> decltype(auto)
inline

Definition at line 98 of file Vector.hpp.

◆ operator[]() [2/2]

template<typename Mapping >
auto llama::Vector< Mapping >::operator[] ( size_type  i) const -> decltype(auto)
inline

Definition at line 103 of file Vector.hpp.

◆ pop_back()

template<typename Mapping >
void llama::Vector< Mapping >::pop_back ( )
inline

Definition at line 240 of file Vector.hpp.

◆ push_back()

template<typename Mapping >
template<typename T >
void llama::Vector< Mapping >::push_back ( T &&  t)
inline

Definition at line 229 of file Vector.hpp.

◆ reserve()

template<typename Mapping >
void llama::Vector< Mapping >::reserve ( size_type  cap)
inline

Definition at line 178 of file Vector.hpp.

◆ resize()

template<typename Mapping >
template<typename RecordRef = One<RecordDim>>
void llama::Vector< Mapping >::resize ( size_type  count,
const RecordRef value = {} 
)
inline

Definition at line 246 of file Vector.hpp.

◆ shrink_to_fit()

template<typename Mapping >
void llama::Vector< Mapping >::shrink_to_fit ( )
inline

Definition at line 190 of file Vector.hpp.

◆ size()

template<typename Mapping >
auto llama::Vector< Mapping >::size ( ) const -> size_type
inline

Definition at line 173 of file Vector.hpp.

Friends And Related Function Documentation

◆ operator!=

template<typename Mapping >
auto operator!= ( const Vector< Mapping > &  a,
const Vector< Mapping > &  b 
) -> bool
friend

Definition at line 261 of file Vector.hpp.

◆ operator<

template<typename Mapping >
auto operator< ( const Vector< Mapping > &  a,
const Vector< Mapping > &  b 
) -> bool
friend

Definition at line 266 of file Vector.hpp.

◆ operator<=

template<typename Mapping >
auto operator<= ( const Vector< Mapping > &  a,
const Vector< Mapping > &  b 
) -> bool
friend

Definition at line 271 of file Vector.hpp.

◆ operator==

template<typename Mapping >
auto operator== ( const Vector< Mapping > &  a,
const Vector< Mapping > &  b 
) -> bool
friend

Definition at line 254 of file Vector.hpp.

◆ operator>

template<typename Mapping >
auto operator> ( const Vector< Mapping > &  a,
const Vector< Mapping > &  b 
) -> bool
friend

Definition at line 276 of file Vector.hpp.

◆ operator>=

template<typename Mapping >
auto operator>= ( const Vector< Mapping > &  a,
const Vector< Mapping > &  b 
) -> bool
friend

Definition at line 281 of file Vector.hpp.

◆ swap

template<typename Mapping >
void swap ( Vector< Mapping > &  a,
Vector< Mapping > &  b 
)
friend

Definition at line 286 of file Vector.hpp.


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