nw::kernel::EventSystem

struct EventSystem : public nw::kernel::Service

Public Types

template<typename T>
using storage = std::priority_queue<T, Vector<T>, std::greater<T>>

Public Functions

EventSystem(MemoryResource *scope)
void add(EventType type, ObjectBase *object, void *data = nullptr)
int process()
virtual nlohmann::json stats() const override

Log service stats, if the service wants.

MemoryResource *allocator() const noexcept

Gets the memory allocator for the servce.

inline virtual void initialize(ServiceInitTime)

Initializes a service

Note

Every service will be called with as many values as exist in ServiceInitTime. it’s up to the service itself to filter/ignore what’s not relevant to them.

Public Members

storage<EventHandle> queue_

Public Static Attributes

static const std::type_index type_index = {typeid(EventSystem)}