13template <
class SoAArraysType>
24template <
class SoAArraysType>
30 SoAView() : _soa(nullptr), _startIndex(0), _endIndex(0) {}
42 : _soa(soa), _startIndex(startIndex), _endIndex(endIndex) {
43 if (not(soa->
size() >= endIndex and endIndex >= startIndex)) {
65 template <
size_t attribute>
67 return _soa->template begin<attribute>() + _startIndex;
75 template <
size_t attribute>
76 [[nodiscard]]
auto begin()
const {
77 return _soa->template begin<attribute>() + _startIndex;
85 [[nodiscard]]
size_t size()
const {
return _endIndex - _startIndex; }
View on a fixed part of a SoA between a start index and an end index.
Definition: SoAView.h:25
size_t size() const
Returns the number of particles in the view.
Definition: SoAView.h:85
auto begin()
Returns a pointer to the given attribute vector.
Definition: SoAView.h:66
auto begin() const
Returns a pointer to the given attribute vector const.
Definition: SoAView.h:76
SoAView(SoA< SoAArraysType > *soa)
Constructs a SoAView on the whole content of soa.
Definition: SoAView.h:52
SoAView(SoA< SoAArraysType > &soa)
Implicit constructor that converts a SoA to SoAView.
Definition: SoAView.h:58
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).
Definition: SoAView.h:41
SoAView()
Default constructor of SoAView to allow storing it in containers.
Definition: SoAView.h:30
Structur of the array class.
Definition: SoA.h:28
size_t size() const
Returns the number of particles.
Definition: SoA.h:187
static void exception(const Exception e)
Handle an exception derived by std::exception.
Definition: ExceptionHandler.h:64
This is the main namespace of AutoPas.
Definition: AutoPasDecl.h:34