AutoPas  3.0.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
autopas::utils::SoAStorage< SoAArraysType > Class Template Reference

SoAStorage is a helper to access the stored SoA's. More...

#include <SoAStorage.h>

Inheritance diagram for autopas::utils::SoAStorage< SoAArraysType >:
Inheritance graph
[legend]

Public Member Functions

template<typename FunctorT >
void apply (FunctorT func)
 Apply the specific function to all vectors.
 
template<size_t soaAttribute>
constexpr auto & get ()
 Get the vector at the specific entry of the storage.
 
template<size_t soaAttribute>
constexpr const auto & get () const
 Get the vector at the specific entry of the storage.
 
constexpr const auto & getTuple () const
 Getter for the internal tuple.
 

Detailed Description

template<class SoAArraysType>
class autopas::utils::SoAStorage< SoAArraysType >

SoAStorage is a helper to access the stored SoA's.

Template Parameters
SoAArraysTypethe type of the storage arrays. should be a tuple of aligned vectors

Member Function Documentation

◆ apply()

template<class SoAArraysType >
template<typename FunctorT >
void autopas::utils::SoAStorage< SoAArraysType >::apply ( FunctorT  func)
inline

Apply the specific function to all vectors.

This can e.g. be resize operations, ... The functor func should not require input parameters. The returns of the functor are ignored.

Template Parameters
FunctorTthe type of the functor
Parameters
funca functor, that should be applied on all vectors (e.g. lambda functions, should take auto& list as an argument)
Todo:
c++20: replace with expansion statement: for... (auto& elem : tup) {}

◆ get() [1/2]

template<class SoAArraysType >
template<size_t soaAttribute>
constexpr auto & autopas::utils::SoAStorage< SoAArraysType >::get ( )
inlineconstexpr

Get the vector at the specific entry of the storage.

Template Parameters
soaAttributethe attribute for which the vector should be returned
Returns
a reference to the vector for the specific attribute

◆ get() [2/2]

template<class SoAArraysType >
template<size_t soaAttribute>
constexpr const auto & autopas::utils::SoAStorage< SoAArraysType >::get ( ) const
inlineconstexpr

Get the vector at the specific entry of the storage.

Template Parameters
soaAttributethe attribute for which the vector should be returned
Returns
a reference to the vector for the specific attribute
Note
const variant

◆ getTuple()

template<class SoAArraysType >
constexpr const auto & autopas::utils::SoAStorage< SoAArraysType >::getTuple ( ) const
inlineconstexpr

Getter for the internal tuple.

Returns

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