template<typename T, unsigned int M = DEFAULT_ FILTER_ MASK>
EventReader class
System arguments used to read events of type T
.
Template parameters | |
---|---|
T | Event. |
M | Filter mask. |
Filtering the received events by their mask is also possible via the parameter M
. By default, the reader will read all events sent.
Public types
- class Iterator
- Used to iterate over events received by a reader.
Constructors, destructors, conversion operators
- EventReader(const EventPipe<T>& pipe, std::size_t& index)
- Constructs.
Public functions
Function documentation
template<typename T, unsigned int M>
cubos:: core:: ecs:: EventReader<T, M>:: EventReader(const EventPipe<T>& pipe,
std::size_t& index)
Constructs.
Parameters | |
---|---|
pipe | Event pipe to read events from. |
index | Reference to the reader's index. |
Uses the given index
to know which events it has already read. Increments it whenever it reads an event.
template<typename T, unsigned int M>
const T* cubos:: core:: ecs:: EventReader<T, M>:: read()
Returns a reference to current event, and advances.
Returns | Pointer to current event, or null if there are no more events. |
---|