Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
EventQueue Class Reference

#include <EventQueue.h>

Public Member Functions

 EventQueue ()
 
 ~EventQueue ()=default
 
void Push (const Message &msg)
 
void BeginFrame ()
 
const std::vector< Message > & GetEvents () const
 
const std::vector< size_t > & GetDomainIndices (EventDomain domain) const
 
template<typename Func >
void ForEachDomainEvent (EventDomain domain, Func &&callback) const
 

Static Public Member Functions

static EventQueueGetInstance ()
 
static EventQueueGet ()
 

Private Attributes

std::vector< Messagem_readEvents
 
std::vector< Messagem_writeEvents
 
std::array< std::vector< size_t >, static_cast< int >(EventDomain::All)+1 > m_readDomainIdx
 
std::array< std::vector< size_t >, static_cast< int >(EventDomain::All)+1 > m_writeDomainIdx
 
std::mutex m_writeMutex
 

Detailed Description

Definition at line 11 of file EventQueue.h.

Constructor & Destructor Documentation

◆ EventQueue()

EventQueue::EventQueue ( )
inline

Definition at line 14 of file EventQueue.h.

References All, GetComponentTypeID_Static(), m_readDomainIdx, m_readEvents, m_writeDomainIdx, and m_writeEvents.

+ Here is the call graph for this function:

◆ ~EventQueue()

EventQueue::~EventQueue ( )
default

Member Function Documentation

◆ BeginFrame()

void EventQueue::BeginFrame ( )
inline
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 56 of file EventQueue.h.

References All, GetComponentTypeID_Static(), m_readDomainIdx, m_readEvents, m_writeDomainIdx, m_writeEvents, and m_writeMutex.

Referenced by World::Process().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ForEachDomainEvent()

template<typename Func >
void EventQueue::ForEachDomainEvent ( EventDomain  domain,
Func &&  callback 
) const
inline

Definition at line 93 of file EventQueue.h.

References GetComponentTypeID_Static(), GetDomainIndices(), and m_readEvents.

+ Here is the call graph for this function:

◆ Get()

static EventQueue & EventQueue::Get ( )
inlinestatic

◆ GetDomainIndices()

const std::vector< size_t > & EventQueue::GetDomainIndices ( EventDomain  domain) const
inline

Definition at line 80 of file EventQueue.h.

References All, GetComponentTypeID_Static(), and m_readDomainIdx.

Referenced by ForEachDomainEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetEvents()

const std::vector< Message > & EventQueue::GetEvents ( ) const
inline

Definition at line 73 of file EventQueue.h.

References m_readEvents.

◆ GetInstance()

static EventQueue & EventQueue::GetInstance ( )
inlinestatic

Definition at line 29 of file EventQueue.h.

References GetComponentTypeID_Static().

Referenced by Get().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Push()

void EventQueue::Push ( const Message msg)
inline

Member Data Documentation

◆ m_readDomainIdx

std::array<std::vector<size_t>, static_cast<int>(EventDomain::All) + 1> EventQueue::m_readDomainIdx
private

Definition at line 113 of file EventQueue.h.

Referenced by BeginFrame(), EventQueue(), and GetDomainIndices().

◆ m_readEvents

std::vector<Message> EventQueue::m_readEvents
private

Definition at line 108 of file EventQueue.h.

Referenced by BeginFrame(), EventQueue(), ForEachDomainEvent(), and GetEvents().

◆ m_writeDomainIdx

std::array<std::vector<size_t>, static_cast<int>(EventDomain::All) + 1> EventQueue::m_writeDomainIdx
private

Definition at line 114 of file EventQueue.h.

Referenced by BeginFrame(), EventQueue(), and Push().

◆ m_writeEvents

std::vector<Message> EventQueue::m_writeEvents
private

Definition at line 109 of file EventQueue.h.

Referenced by BeginFrame(), EventQueue(), and Push().

◆ m_writeMutex

std::mutex EventQueue::m_writeMutex
private

Definition at line 116 of file EventQueue.h.

Referenced by BeginFrame(), and Push().


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