Low-Level Abstraction of Memory Access
llama::View< TMapping, TBlobType, TAccessor > Struct Template Reference

#include <View.hpp>

+ Inheritance diagram for llama::View< TMapping, TBlobType, TAccessor >:
+ Collaboration diagram for llama::View< TMapping, TBlobType, TAccessor >:

Public Types

using Mapping = TMapping
 
using BlobType = TBlobType
 
using ArrayExtents = typename Mapping::ArrayExtents
 
using ArrayIndex = typename ArrayExtents::Index
 
using RecordDim = typename Mapping::RecordDim
 
using Accessor = TAccessor
 
using iterator = Iterator< View >
 
using const_iterator = Iterator< const View >
 

Public Member Functions

 View ()=default
 Performs default initialization of the blob array. More...
 
 View (Mapping mapping, Array< BlobType, Mapping::blobCount > blobs={}, Accessor accessor={})
 
auto mapping () -> Mapping &
 
auto mapping () const -> const Mapping &
 
auto accessor () -> Accessor &
 
auto accessor () const -> const Accessor &
 
auto extents () const -> ArrayExtents
 
template<typename V >
auto operator() (llama::ArrayIndex< V, ArrayIndex::rank >) const
 
auto operator() (ArrayIndex ai) const -> decltype(auto)
 Retrieves the RecordRef at the given ArrayIndex index. More...
 
auto operator() (ArrayIndex ai) -> decltype(auto)
 
template<typename... Indices, std::enable_if_t< std::conjunction_v< std::is_convertible< Indices, size_type >... >, int > = 0>
auto operator() (Indices... indices) const -> decltype(auto)
 
template<typename... Indices, std::enable_if_t< std::conjunction_v< std::is_convertible< Indices, size_type >... >, int > = 0>
auto operator() (Indices... indices) -> decltype(auto)
 
auto operator[] (ArrayIndex ai) const -> decltype(auto)
 
auto operator[] (ArrayIndex ai) -> decltype(auto)
 
template<typename V >
auto operator[] (llama::ArrayIndex< V, ArrayIndex::rank >) const
 
auto operator[] (size_type index) const -> decltype(auto)
 Retrieves the RecordRef at the 1D ArrayIndex index constructed from the passed index. More...
 
auto operator[] (size_type index) -> decltype(auto)
 
auto begin () -> iterator
 
auto begin () const -> const_iterator
 
auto end () -> iterator
 
auto end () const -> const_iterator
 
auto blobs () -> Array< BlobType, Mapping::blobCount > &
 
auto blobs () const -> const Array< BlobType, Mapping::blobCount > &
 

Friends

template<typename TView , typename TBoundRecordCoord , bool OwnView>
struct RecordRef
 

Detailed Description

template<typename TMapping, typename TBlobType, typename TAccessor = accessor::Default>
struct llama::View< TMapping, TBlobType, TAccessor >

Central LLAMA class holding memory for storage and giving access to values stored there defined by a mapping. A view should be created using allocView.

Template Parameters
TMappingThe mapping used by the view to map accesses into memory.
TBlobTypeThe storage type used by the view holding memory.
TAccessorThe accessor to use when an access is made through this view.

Definition at line 388 of file View.hpp.

Member Typedef Documentation

◆ Accessor

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
using llama::View< TMapping, TBlobType, TAccessor >::Accessor = TAccessor

Definition at line 401 of file View.hpp.

◆ ArrayExtents

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
using llama::View< TMapping, TBlobType, TAccessor >::ArrayExtents = typename Mapping::ArrayExtents

Definition at line 398 of file View.hpp.

◆ ArrayIndex

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
using llama::View< TMapping, TBlobType, TAccessor >::ArrayIndex = typename ArrayExtents::Index

Definition at line 399 of file View.hpp.

◆ BlobType

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
using llama::View< TMapping, TBlobType, TAccessor >::BlobType = TBlobType

Definition at line 397 of file View.hpp.

◆ const_iterator

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
using llama::View< TMapping, TBlobType, TAccessor >::const_iterator = Iterator<const View>

Definition at line 403 of file View.hpp.

◆ iterator

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
using llama::View< TMapping, TBlobType, TAccessor >::iterator = Iterator<View>

Definition at line 402 of file View.hpp.

◆ Mapping

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
using llama::View< TMapping, TBlobType, TAccessor >::Mapping = TMapping

Definition at line 396 of file View.hpp.

◆ RecordDim

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
using llama::View< TMapping, TBlobType, TAccessor >::RecordDim = typename Mapping::RecordDim

Definition at line 400 of file View.hpp.

Constructor & Destructor Documentation

◆ View() [1/2]

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
llama::View< TMapping, TBlobType, TAccessor >::View ( )
default

Performs default initialization of the blob array.

◆ View() [2/2]

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
llama::View< TMapping, TBlobType, TAccessor >::View ( Mapping  mapping,
Array< BlobType, Mapping::blobCount >  blobs = {},
Accessor  accessor = {} 
)
inlineexplicit

Creates a LLAMA View manually. Prefer the allocations functions allocView and allocViewUninitialized if possible.

Parameters
mappingThe mapping used by the view to map accesses into memory.
blobsAn array of blobs providing storage space for the mapped data.
accessorThe accessor to use when an access is made through this view.

Definition at line 429 of file View.hpp.

Member Function Documentation

◆ accessor() [1/2]

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
auto llama::View< TMapping, TBlobType, TAccessor >::accessor ( ) -> Accessor&
inline

Definition at line 446 of file View.hpp.

◆ accessor() [2/2]

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
auto llama::View< TMapping, TBlobType, TAccessor >::accessor ( ) const -> const Accessor&
inline

Definition at line 451 of file View.hpp.

◆ begin() [1/2]

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
auto llama::View< TMapping, TBlobType, TAccessor >::begin ( ) -> iterator
inline

Definition at line 542 of file View.hpp.

◆ begin() [2/2]

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
auto llama::View< TMapping, TBlobType, TAccessor >::begin ( ) const -> const_iterator
inline

Definition at line 548 of file View.hpp.

◆ blobs() [1/2]

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
auto llama::View< TMapping, TBlobType, TAccessor >::blobs ( ) -> Array<BlobType, Mapping::blobCount>&
inline

Definition at line 565 of file View.hpp.

◆ blobs() [2/2]

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
auto llama::View< TMapping, TBlobType, TAccessor >::blobs ( ) const -> const Array<BlobType, Mapping::blobCount>&
inline

Definition at line 570 of file View.hpp.

◆ end() [1/2]

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
auto llama::View< TMapping, TBlobType, TAccessor >::end ( ) -> iterator
inline

Definition at line 554 of file View.hpp.

◆ end() [2/2]

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
auto llama::View< TMapping, TBlobType, TAccessor >::end ( ) const -> const_iterator
inline

Definition at line 560 of file View.hpp.

◆ extents()

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
auto llama::View< TMapping, TBlobType, TAccessor >::extents ( ) const -> ArrayExtents
inline

Definition at line 456 of file View.hpp.

◆ mapping() [1/2]

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
auto llama::View< TMapping, TBlobType, TAccessor >::mapping ( ) -> Mapping&
inline

Definition at line 436 of file View.hpp.

◆ mapping() [2/2]

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
auto llama::View< TMapping, TBlobType, TAccessor >::mapping ( ) const -> const Mapping&
inline

Definition at line 441 of file View.hpp.

◆ operator()() [1/5]

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
auto llama::View< TMapping, TBlobType, TAccessor >::operator() ( ArrayIndex  ai) -> decltype(auto)
inline

Definition at line 478 of file View.hpp.

◆ operator()() [2/5]

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
auto llama::View< TMapping, TBlobType, TAccessor >::operator() ( ArrayIndex  ai) const -> decltype(auto)
inline

Retrieves the RecordRef at the given ArrayIndex index.

Definition at line 470 of file View.hpp.

◆ operator()() [3/5]

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
template<typename... Indices, std::enable_if_t< std::conjunction_v< std::is_convertible< Indices, size_type >... >, int > = 0>
auto llama::View< TMapping, TBlobType, TAccessor >::operator() ( Indices...  indices) -> decltype(auto)
inline

Definition at line 502 of file View.hpp.

◆ operator()() [4/5]

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
template<typename... Indices, std::enable_if_t< std::conjunction_v< std::is_convertible< Indices, size_type >... >, int > = 0>
auto llama::View< TMapping, TBlobType, TAccessor >::operator() ( Indices...  indices) const -> decltype(auto)
inline

Retrieves the RecordRef at the ArrayIndex index constructed from the passed component indices.

Definition at line 491 of file View.hpp.

◆ operator()() [5/5]

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
template<typename V >
auto llama::View< TMapping, TBlobType, TAccessor >::operator() ( llama::ArrayIndex< V, ArrayIndex::rank ) const
inline

Definition at line 463 of file View.hpp.

◆ operator[]() [1/5]

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
auto llama::View< TMapping, TBlobType, TAccessor >::operator[] ( ArrayIndex  ai) -> decltype(auto)
inline

Definition at line 517 of file View.hpp.

◆ operator[]() [2/5]

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
auto llama::View< TMapping, TBlobType, TAccessor >::operator[] ( ArrayIndex  ai) const -> decltype(auto)
inline

Retrieves the RecordRef at the ArrayIndex index constructed from the passed component indices.

Definition at line 512 of file View.hpp.

◆ operator[]() [3/5]

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
template<typename V >
auto llama::View< TMapping, TBlobType, TAccessor >::operator[] ( llama::ArrayIndex< V, ArrayIndex::rank ) const
inline

Definition at line 524 of file View.hpp.

◆ operator[]() [4/5]

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
auto llama::View< TMapping, TBlobType, TAccessor >::operator[] ( size_type  index) -> decltype(auto)
inline

Definition at line 536 of file View.hpp.

◆ operator[]() [5/5]

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
auto llama::View< TMapping, TBlobType, TAccessor >::operator[] ( size_type  index) const -> decltype(auto)
inline

Retrieves the RecordRef at the 1D ArrayIndex index constructed from the passed index.

Definition at line 531 of file View.hpp.

Friends And Related Function Documentation

◆ RecordRef

template<typename TMapping , typename TBlobType , typename TAccessor = accessor::Default>
template<typename TView , typename TBoundRecordCoord , bool OwnView>
friend struct RecordRef
friend

Definition at line 577 of file View.hpp.


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