4 files changed
+101
No files matched your search
@@ -0,0 +1,22 @@
|
||||
#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
|
||||
Reference in new issue
Block a user