Files
VoidLoaderApi/include/Mod/Registration.hpp
T
2025-10-20 00:43:10 +03:00

20 lines
704 B
C++

#pragma once
#include <Mod/Context.hpp>
#include <Mod/Base.hpp>
#include <memory>
namespace vl::mod {
// Registration record stored in the module's custom section.
// Core will scan this in the loaded .so to find available mods.
struct Registration {
const void* magic;
std::unique_ptr<Base> (*factory)(const Context&);
const char* typeName; // e.g., typeid(T).name()
const char* name; // COMPILE-TIME mod name (from T::Name())
const char* version; // COMPILE-TIME mod version (from T::Version())
};
inline constexpr std::uintptr_t kModRegMagicRaw = 0xBADC0FFEEULL;
inline const void* kModRegMagic = reinterpret_cast<const void*>(kModRegMagicRaw);
} // namespace vl::log