#include #include #include // A minimal plugin used by the Plugin integration test. // Supports state transfer: carries an int counter across hot-reloads. namespace { class TestPlugin final : public Void::Plugin::IPlugin { public: [[nodiscard]] std::string_view name() const noexcept override { return "TestPlugin"; } void on_load() override { loaded = true; } void on_unload() override { loaded = false; } bool loaded{false}; int counter{0}; }; } // namespace extern "C" { void* void_plugin_create() { return new TestPlugin; } void void_plugin_destroy(void* p) { delete static_cast(p); } Void::Plugin::PluginInfo void_plugin_info() { return { .abi_version = Void::Plugin::ABI_VERSION, .name = "TestPlugin", .plugin_version = "1.0.0", .description = "Integration test plugin", }; } void void_plugin_transfer_state(void* old_ptr, void* new_ptr) { const auto* old_p = static_cast(old_ptr); auto* new_p = static_cast(new_ptr); new_p->counter = old_p->counter + 1; // increment to prove transfer ran } } // extern "C"