From d4900d85f7a5d791f89821713d02d3dd19361044 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 22 Feb 2024 11:17:25 +0300 Subject: Add support for tenant-associated service notifications --- mod/mod-ci.hxx | 49 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) (limited to 'mod/mod-ci.hxx') diff --git a/mod/mod-ci.hxx b/mod/mod-ci.hxx index 431f53b..3b1e1be 100644 --- a/mod/mod-ci.hxx +++ b/mod/mod-ci.hxx @@ -9,14 +9,39 @@ #include #include +#include +#include // tenant_service + #include #include +#include + +#ifdef BREP_CI_TENANT_SERVICE +# include +#endif + namespace brep { - class ci: public handler + class ci: public handler, + private ci_start +#ifdef BREP_CI_TENANT_SERVICE + , public tenant_service_build_queued, + public tenant_service_build_building, + public tenant_service_build_built +#endif { public: + +#ifdef BREP_CI_TENANT_SERVICE + explicit + ci (tenant_service_map&); + + // Create a shallow copy (handling instance) if initialized and a deep + // copy (context exemplar) otherwise. + // + ci (const ci&, tenant_service_map&); +#else ci () = default; // Create a shallow copy (handling instance) if initialized and a deep @@ -24,12 +49,26 @@ namespace brep // explicit ci (const ci&); +#endif virtual bool - handle (request&, response&); + handle (request&, response&) override; virtual const cli::options& - cli_options () const {return options::ci::description ();} + cli_options () const override {return options::ci::description ();} + +#ifdef BREP_CI_TENANT_SERVICE + virtual function (const tenant_service&)> + build_queued (const tenant_service&, + const vector&, + optional initial_state) const override; + + virtual function (const tenant_service&)> + build_building (const tenant_service&, const build&) const override; + + virtual function (const tenant_service&)> + build_built (const tenant_service&, const build&) const override; +#endif private: virtual void @@ -38,6 +77,10 @@ namespace brep private: shared_ptr options_; shared_ptr form_; + +#ifdef BREP_CI_TENANT_SERVICE + tenant_service_map& tenant_service_map_; +#endif }; } -- cgit v1.1