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

View on a fixed part of a SoA between a start index and an end index. More...

#include <SoAView.h>

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

Public Member Functions

 SoAView ()
 Default constructor of SoAView to allow storing it in containers.
 
 SoAView (SoA< SoAArraysType > *soa, size_t startIndex, size_t endIndex)
 Constructs a view on soa that starts at startIndex (inclusive) and ends at endIndex (exclusive).
 
 SoAView (SoA< SoAArraysType > *soa)
 Constructs a SoAView on the whole content of soa.
 
 SoAView (SoA< SoAArraysType > &soa)
 Implicit constructor that converts a SoA to SoAView.
 
template<size_t attribute>
auto begin ()
 Returns a pointer to the given attribute vector.
 
template<size_t attribute>
auto begin () const
 Returns a pointer to the given attribute vector const.
 
size_t size () const
 Returns the number of particles in the view.
 

Detailed Description

template<class SoAArraysType>
class autopas::SoAView< SoAArraysType >

View on a fixed part of a SoA between a start index and an end index.

It is the user`s responsibility to ensure that modifications to the underlying SoA don't let the start index get bigger than the highest index in the SoA, or the end index higher than the number of entries in the SoA.

Template Parameters
SoAArraysTypeThe SoAArrayType of the SoA.

Constructor & Destructor Documentation

◆ SoAView() [1/3]

template<class SoAArraysType >
autopas::SoAView< SoAArraysType >::SoAView ( SoA< SoAArraysType > *  soa,
size_t  startIndex,
size_t  endIndex 
)
inline

Constructs a view on soa that starts at startIndex (inclusive) and ends at endIndex (exclusive).

startIndex and endIndex have to be between 0 (inclusive) and soa->size() (inclusive). endIndex has to be greater or equal to startIndex.

Parameters
soaThe SoA to view.
startIndexThe index of the first entry to view of the SoA.
endIndexThe index of the entry after the last entry to view of the SoA.

◆ SoAView() [2/3]

template<class SoAArraysType >
autopas::SoAView< SoAArraysType >::SoAView ( SoA< SoAArraysType > *  soa)
inlineexplicit

Constructs a SoAView on the whole content of soa.

Parameters
soaThe SoA to view.

◆ SoAView() [3/3]

template<class SoAArraysType >
autopas::SoAView< SoAArraysType >::SoAView ( SoA< SoAArraysType > &  soa)
inline

Implicit constructor that converts a SoA to SoAView.

Parameters
soaThe SoA to view.

Member Function Documentation

◆ begin() [1/2]

template<class SoAArraysType >
template<size_t attribute>
auto autopas::SoAView< SoAArraysType >::begin ( )
inline

Returns a pointer to the given attribute vector.

Template Parameters
attributeID of the desired attribute.
Returns
Pointer to the beginning of the attribute vector

◆ begin() [2/2]

template<class SoAArraysType >
template<size_t attribute>
auto autopas::SoAView< SoAArraysType >::begin ( ) const
inline

Returns a pointer to the given attribute vector const.

Template Parameters
attributeID of the desired attribute.
Returns
Pointer to the beginning of the attribute vector const

◆ size()

template<class SoAArraysType >
size_t autopas::SoAView< SoAArraysType >::size ( ) const
inline

Returns the number of particles in the view.

Returns
Number of particles.

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