Raven Engine v0.1
A modern 3D Game Engine
Loading...
Searching...
No Matches
Raven::EventQueue Struct Reference

Fixed-size, frame-based event queue. More...

#include <EventQueue.h>

Public Member Functions

template<typename EventT>
requires (DerivedFrom<Event, EventT>)
constexpr bool Push (const EventT &e) noexcept
 Adds a new event to the queue.
constexpr void Clear () noexcept
 Clears all events from the queue.
constexpr u32 Size () const noexcept
 Returns the current number of events in the queue.
constexpr bool Empty () const noexcept
 Checks whether the queue is empty.

Public Attributes

u32 Count = 0
 Current number of valid events in the queue.
std::array< EventSlot, MaxEventsPerFrameEvents {}
 Preallocated storage for events.

Detailed Description

Fixed-size, frame-based event queue.

Stores events in a pre-allocated array of EventSlots, providing fast sequential iteration and zero-cost clearing between frames.

Member Function Documentation

◆ Clear()

void Raven::EventQueue::Clear ( )
inlineconstexprnoexcept

Clears all events from the queue.

◆ Empty()

bool Raven::EventQueue::Empty ( ) const
inlinenodiscardconstexprnoexcept

Checks whether the queue is empty.

◆ Push()

template<typename EventT>
requires (DerivedFrom<Event, EventT>)
bool Raven::EventQueue::Push ( const EventT & e)
inlineconstexprnoexcept

Adds a new event to the queue.

Template Parameters
EventTType of the event.
Parameters
eEvent instance to push.
Returns
True if the event was successfully added, false if the queue is full.

◆ Size()

u32 Raven::EventQueue::Size ( ) const
inlinenodiscardconstexprnoexcept

Returns the current number of events in the queue.

Member Data Documentation

◆ Count

u32 Raven::EventQueue::Count = 0

Current number of valid events in the queue.

◆ Events

std::array<EventSlot, MaxEventsPerFrame> Raven::EventQueue::Events {}

Preallocated storage for events.


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