rodecomp/Source/Utility/Async/NMessageMgr.h
ragnarok-clanker 6ae40abb62 Confirm fn_07577 (NAsyncWorkThread::~NAsyncWorkThread)
Batch #13594 by eAthena: 1 byte-identical, 0 confirmed by peer review.

- fn_07577 NAsyncWorkThread::~NAsyncWorkThread: byte-identical (already on main)

Merged automatically: every function is byte-identical to the original.
2026-11-06 20:47:29 +00:00

39 lines
996 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::uint32_t argumentLow, std::uint32_t argumentHigh, std::uint32_t id) = 0;
// INLINED
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::uint32_t argumentLow, std::uint32_t argumentHigh, 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