VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
VoltMod::EventLifecycle Struct Reference

Starting and stopping an Event source, driven by whether anything is listening. More...

#include <Event.hpp>

Public Attributes

std::function< bool()> OnFirst
 
std::function< void()> OnLast
 

Detailed Description

Starting and stopping an Event source, driven by whether anything is listening.

OnFirst runs before the first handler is stored; false refuses the subscription, and the owner is expected to have said why. OnLast runs after the last handler is removed. Both run on the game thread, and OnLast may run from inside Event::Raise when the last handler drops itself.

Definition at line 21 of file Event.hpp.

Member Data Documentation

◆ OnFirst

std::function<bool()> VoltMod::EventLifecycle::OnFirst

Definition at line 23 of file Event.hpp.

Referenced by VoltMod::LazyHook::ForEvent(), and VoltMod::Event< Args >::operator+=().

◆ OnLast

std::function<void()> VoltMod::EventLifecycle::OnLast

Definition at line 24 of file Event.hpp.

Referenced by VoltMod::Event< Args >::operator+=().


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