HydraHook
Direct3D and Core Audio hooking library for Windows
Loading...
Searching...
No Matches
ResettableOnce Class Reference

Once-per-hook announcement guard that can be re-armed. More...

#include <Engine.h>

Public Member Functions

template<typename Fn>
void call (Fn &&fn)
 Runs fn once until reset() is called; concurrent callers wait for the first.
void reset ()
 Re-arms the guard.

Detailed Description

Once-per-hook announcement guard that can be re-armed.

Replaces function-local std::once_flag so a hook, unhook, rehook cycle announces each hook again. Zero-cost fast path is one acquire load.

Definition at line 56 of file Engine.h.

Member Function Documentation

◆ call()

template<typename Fn>
void ResettableOnce::call ( Fn && fn)
inline

Runs fn once until reset() is called; concurrent callers wait for the first.

Definition at line 61 of file Engine.h.

Referenced by HydraHookMainThread().

◆ reset()

void ResettableOnce::reset ( )
inline

Re-arms the guard.

Definition at line 75 of file Engine.h.

Referenced by HookAnnouncements::reset_all().


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