rodecomp/Source/Utility/Async/NMessageMgr.h
ragnarok-clanker a47d20f8be Reconstruct readable C++ and organize cohesive source subsystems
Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.

Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
2026-10-25 07:42:41 +00:00

40 lines
961 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;
};
// STATIC: 0x0138D3EC
// GLOBAL: gl_24361
extern NMessageMgr* g_messageMgr;
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(NInter) == 4);
static_assert(sizeof(NMessageMgr) == 40);
#endif
#endif