mirror of
https://github.com/hyblocker/OpenVR-SpaceCalibrator.git
synced 2026-10-13 09:00:37 +02:00
28 lines
394 B
C++
28 lines
394 B
C++
#include "Hooking.h"
|
|
|
|
std::map<std::string, IHook *> IHook::hooks;
|
|
|
|
bool IHook::Exists(const std::string &name)
|
|
{
|
|
return hooks.find(name) != hooks.end();
|
|
}
|
|
|
|
void IHook::Register(IHook *hook)
|
|
{
|
|
hooks[hook->name] = hook;
|
|
}
|
|
|
|
void IHook::Unregister(IHook *hook)
|
|
{
|
|
hooks.erase(hook->name);
|
|
}
|
|
|
|
void IHook::DestroyAll()
|
|
{
|
|
for (auto &hook : hooks)
|
|
{
|
|
hook.second->Destroy();
|
|
}
|
|
hooks.clear();
|
|
}
|