Files
VoidLoaderApi/include/Mod/Registration.hpp
T
faumaray e84b2691cf Mod Base
Signed-off-by: Faumaray <faumaray@gmail.com>
2025-10-20 00:32:43 +03:00

23 lines
709 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 {
// magic helps Core validate the record
const void* magic;
// factory that constructs a ModBase-derived object with Context
std::unique_ptr<Base> (*factory)(const Context&);
// an optional RTTI-ish string (e.g., typeid(T).name())
const char* typeName;
};
inline constexpr std::uintptr_t kModRegMagicValue = 0xBADC0FFEEULL;
inline const void* kModRegMagic = reinterpret_cast<const void*>(kModRegMagicValue);
} // namespace vl::log