Elaztek Developer Hub
Blamite Game Engine - Strings  00386.06.16.23.0646.blamite
A library containing general purpose utilities and classes for use in multiple projects.
events.cpp File Reference
#include "events.h"
#include <algorithm>
#include <signal.h>
#include <Strings/components/utils/converters/converters.h>
#include <mutex>
#include "components/logger/logger.h"
+ Include dependency graph for events.cpp:

Functions

void notify_listener (BlamEvent *event, BlamEventListener *listener)
 Notifies the specified listener about an event. More...
 
bool compare_listener_priority (BlamEventListener *first, BlamEventListener *second)
 Compares listener priority. More...
 

Variables

std::vector< BlamEventListener * > listeners
 List of registered event listeners. More...
 
std::recursive_mutex listener_list_lock
 Lock to ensure that the listener list cannot be modified concurrently. More...
 

Function Documentation

◆ compare_listener_priority()

bool compare_listener_priority ( BlamEventListener first,
BlamEventListener second 
)

Compares listener priority.

Used to sort the list after priority modifications.

Parameters
first- The first listener to check.
second- The second listener to check.
Returns
Whether or not the priority of the first listener is less than the priority of the second listener.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ notify_listener()

void notify_listener ( BlamEvent event,
BlamEventListener listener 
)

Notifies the specified listener about an event.

Each event type must be added to this in order for the appropriate function(s) to be called.

Parameters
event- Pointer to the event.
listener- Pointer to the listener.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ listener_list_lock

std::recursive_mutex listener_list_lock

Lock to ensure that the listener list cannot be modified concurrently.

◆ listeners

std::vector<BlamEventListener*> listeners

List of registered event listeners.