rodecomp/Source/Utility/Async/NMessageMgr.h
ragnarok-clanker 1dccbfbae5 Maintenance: Annotate globals on their definitions only; drop annotations from header externs
Batch #904 by ragnarok-clanker: no function's compiled code changes; checked with 3 compiled unit(s), including every includer of Source/Contents/MessageTable.h, Source/Contents/Async/AsyncWorkMgr.h, Source/Contents/Emblems/EmblemDataMgr.h, Source/Contents/Hotkeys/UserHotkeyMgr.h, Source/Contents/Messenger/WhisperBlockMgr.h, Source/Contents/Party/AdventurerAgencyMgr.h, Source/Contents/UserData/AccountLinkedUserDataMgr.h, Source/Contents/UserData/CharacterLinkedUserDataMgr.h, Source/Network/TextEncoding.h, Source/Network/Http/CURLMgr.h, Source/Render/Textures/Texture.h, Source/UI/Layout/SnapMgr.h, Source/UI/Party/UIRequestJoinPartyMgr.h, Source/UI/Window/FrameFocus.h, Source/UI/Window/UIWindow.h, Source/Utility/Async/NMessageMgr.h.
2026-10-26 18:25:54 +00:00

38 lines
919 B
C++

#ifndef RAGNAROK_SOURCE_UTILITY_ASYNC_NMESSAGEMGR_H
#define RAGNAROK_SOURCE_UTILITY_ASYNC_NMESSAGEMGR_H
#include <cstdint>
#include <map>
#include <windows.h>
class NInter {
public:
virtual void Receive(std::uint64_t argument, std::uint32_t id) = 0;
virtual ~NInter();
};
class NMessageMgr {
public:
NMessageMgr();
virtual ~NMessageMgr();
static bool Initialize();
static void Shutdown();
bool Register(std::uint32_t objectId, NInter* object);
bool Send(std::uint32_t objectId, std::uint64_t argument, std::uint32_t id);
void Unregister(std::uint32_t objectId, NInter* object);
protected:
/* 0004 */ CRITICAL_SECTION m_criticalSection;
/* 001C */ bool m_enabled;
/* 0020 */ std::map<std::uint32_t, NInter*> m_objects;
};
extern NMessageMgr* g_messageMgr;
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(NInter) == 4);
static_assert(sizeof(NMessageMgr) == 40);
#endif
#endif