#pragma once #include #include // Shared interface for the stateful hot-reload test plugins. The host // holds an IPlugin*; because every stateful plugin's concrete type derives // from IStateful through a single-inheritance chain, the host recovers the // richer interface with static_cast (dynamic_cast is unreliable across // RTLD_LOCAL boundaries). The vtable layout is identical on both sides as // long as this header is shared — which it is. namespace VoidTest { class IStateful : public Void::Plugin::IPlugin { public: [[nodiscard]] virtual int counter() const = 0; virtual void bump() = 0; [[nodiscard]] virtual int schema_version() const = 0; }; [[nodiscard]] inline IStateful* as_stateful(Void::Plugin::IPlugin* p) { return static_cast(p); } } // namespace VoidTest