Core: publish reloadable module descriptor
This commit is contained in:
3 files changed
+86
-1
No files matched your search
@@ -0,0 +1,61 @@
|
||||
#include <echoion/api/module/Module.hpp>
|
||||
|
||||
#include <memory>
|
||||
#include <string_view>
|
||||
|
||||
namespace Echoion::CoreModule
|
||||
{
|
||||
namespace
|
||||
{
|
||||
class LifecycleModule final : public Void::Plugin::IModule
|
||||
{
|
||||
public:
|
||||
[[nodiscard]] std::string_view name() const noexcept override
|
||||
{
|
||||
return "EchoionCore";
|
||||
}
|
||||
};
|
||||
|
||||
std::unique_ptr<Void::Plugin::IModule> createCoreModule()
|
||||
{
|
||||
return std::make_unique<LifecycleModule>();
|
||||
}
|
||||
} // namespace
|
||||
|
||||
const Void::Plugin::ModuleDescriptor& coreModuleDescriptor()
|
||||
{
|
||||
static const Void::Plugin::ModuleDescriptor descriptor{
|
||||
.module_id = "EchoionCore",
|
||||
.component_version = {
|
||||
.major = ECHOION_COMPONENT_VERSION_MAJOR,
|
||||
.minor = ECHOION_COMPONENT_VERSION_MINOR,
|
||||
.patch = ECHOION_COMPONENT_VERSION_PATCH,
|
||||
.pre_release = {},
|
||||
.build = {},
|
||||
},
|
||||
.abi_hash =
|
||||
"sha256:b421d9e3dc304c5bc31c8fd2d2fc52f62f9055aa90eef8d072c9c99e3b461a20",
|
||||
.abi_contract = Void::Json::object({
|
||||
{"schemaVersion", 1},
|
||||
{"contractId", "echoion.module.core"},
|
||||
{"descriptor", "Void::Plugin::ModuleDescriptor"},
|
||||
}),
|
||||
.dependencies = {
|
||||
{
|
||||
.module_id = "EchoionApi",
|
||||
.version_range = "^2.0.0",
|
||||
.abi_hash = "sha256:336492a52097dd12f222bb6d9acab19e8eb6a502eab45bb78127bce6d733fbd3",
|
||||
},
|
||||
},
|
||||
.activation_policy = Void::Plugin::ActivationPolicy::Reloadable,
|
||||
.create = createCoreModule,
|
||||
};
|
||||
return descriptor;
|
||||
}
|
||||
} // namespace Echoion::CoreModule
|
||||
|
||||
extern "C" ECHOION_MODULE_EXPORT const Void::Plugin::ModuleDescriptor*
|
||||
echoion_module_query()
|
||||
{
|
||||
return &Echoion::CoreModule::coreModuleDescriptor();
|
||||
}
|
||||
Reference in new issue
Block a user