11template <
class SoAArraysType>
22template <
class SoAArraysType>
28 SoAView() : _soa(nullptr), _startIndex(0), _endIndex(0) {}
40 : _soa(soa), _startIndex(startIndex), _endIndex(endIndex) {
41 if (not(soa->
size() >= endIndex and endIndex >= startIndex)) {
63 template <
size_t attribute>
65 return _soa->template begin<attribute>() + _startIndex;
73 template <
size_t attribute>
74 [[nodiscard]]
auto begin()
const {
75 return _soa->template begin<attribute>() + _startIndex;
83 [[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:23
size_t size() const
Returns the number of particles in the view.
Definition: SoAView.h:83
auto begin()
Returns a pointer to the given attribute vector.
Definition: SoAView.h:64
auto begin() const
Returns a pointer to the given attribute vector const.
Definition: SoAView.h:74
SoAView(SoA< SoAArraysType > *soa)
Constructs a SoAView on the whole content of soa.
Definition: SoAView.h:50
SoAView(SoA< SoAArraysType > &soa)
Implicit constructor that converts a SoA to SoAView.
Definition: SoAView.h:56
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:39
SoAView()
Default constructor of SoAView to allow storing it in containers.
Definition: SoAView.h:28
Structur of the array class.
Definition: SoA.h:28
size_t size() const
Returns the number of particles.
Definition: SoA.h:177
static void exception(const Exception e)
Handle an exception derived by std::exception.
Definition: ExceptionHandler.h:63
This is the main namespace of AutoPas.
Definition: AutoPasDecl.h:32