#pragma once #include namespace Void::Service { /// Base for services resolved through a ServiceRegistry by interface /// type. Consumers depend only on an interface (which may but need not /// derive IService); implementing IService additionally opts the /// service into registry-driven lifecycle (start_all/stop_all). class IService { public: virtual ~IService() = default; [[nodiscard]] virtual std::string_view service_name() const = 0; /// Called by ServiceRegistry::start_all(), in registration /// order. virtual void on_start() {} /// Called by ServiceRegistry::stop_all(), in reverse order. virtual void on_stop() {} }; } // namespace Void::Service