Plasma Engine  2.0
Loading...
Searching...
No Matches
ProcessingStreamIterator.h
1
2#pragma once
3
4#include <Foundation/DataProcessing/Stream/ProcessingStream.h>
5#include <Foundation/Memory/MemoryUtils.h>
6
8template <typename Type>
10{
11public:
13 plProcessingStreamIterator(const plProcessingStream* pStream, plUInt64 uiNumElements, plUInt64 uiStartIndex);
14
16 Type& Current() const;
17
19 bool HasReachedEnd() const;
20
22 void Advance();
23
25 void Advance(plUInt32 uiNumElements);
26
27 // TODO: Add iterator interface? Only makes really sense for element spawners and processors which work on a single stream
28
29protected:
30 void* m_pCurrentPtr = nullptr;
31 void* m_pEndPtr = nullptr;
32
33 plUInt64 m_uiElementStride = 0;
34};
35
36#include <Foundation/DataProcessing/Stream/Implementation/ProcessingStreamIterator_inl.h>
A single stream in a stream group holding contiguous data of a given type.
Definition ProcessingStream.h:8
Helper template class to iterate over stream elements.
Definition ProcessingStreamIterator.h:10
plProcessingStreamIterator(const plProcessingStream *pStream, plUInt64 uiNumElements, plUInt64 uiStartIndex)
Constructor.
Definition ProcessingStreamIterator_inl.h:3
void Advance()
Advances the current pointer to the next element in the stream.
Definition ProcessingStreamIterator_inl.h:28
bool HasReachedEnd() const
Returns true of the iterator has reached the end of the stream or the number of elements it should it...
Definition ProcessingStreamIterator_inl.h:22
Type & Current() const
Returns a reference to the current element. Note that the behavior is undefined if HasReachedEnd() is...
Definition ProcessingStreamIterator_inl.h:16