Rename to HookableEvent. Because naming conflict

This commit is contained in:
Scott Mansell
2023-02-03 13:37:42 +13:00
parent 60f2b5af7b
commit 8c8bd0e7ac
5 changed files with 12 additions and 12 deletions

View File

@ -46,7 +46,6 @@ add_library(common
EnumFormatter.h
EnumMap.h
Event.h
EventHook.h
FatFsUtil.cpp
FatFsUtil.h
FileSearch.cpp
@ -63,6 +62,7 @@ add_library(common
GekkoDisassembler.h
Hash.cpp
Hash.h
HookableEvent.h
HttpRequest.cpp
HttpRequest.h
Image.cpp

View File

@ -19,7 +19,7 @@ namespace Common
// Define Events in a header as:
//
// using MyLoveyEvent = Event<"My lovely event", std::string>;
// using MyLoveyEvent = HookableEvent<"My lovely event", std::string>;
//
// Register listeners anywhere you need them as:
// EventHook myHook = MyLoveyEvent::Register([](std::string foo) {
@ -40,7 +40,7 @@ struct HookBase
using EventHook = std::unique_ptr<HookBase>;
template <StringLiteral EventName, typename... CallbackArgs>
class Event
class HookableEvent
{
public:
using CallbackType = std::function<void(CallbackArgs...)>;
@ -48,7 +48,7 @@ public:
private:
struct HookImpl final : public HookBase
{
~HookImpl() override { Event::Remove(this); }
~HookImpl() override { HookableEvent::Remove(this); }
HookImpl(CallbackType callback, std::string name)
: m_fn(std::move(callback)), m_name(std::move(name))
{