aboutsummaryrefslogtreecommitdiff
path: root/mod/mod-ci.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2024-05-26 13:46:55 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2024-05-28 13:58:46 +0300
commita7ae434c48c14bfde46a871455a3aa2ac0b81376 (patch)
tree2d4f66a2e153842e166becfcbb2a820036faffcb /mod/mod-ci.hxx
parent5e631e5f63fdc8528d5d178d6a66dfb32a2c0f8b (diff)
Add CI cancel handler
Diffstat (limited to 'mod/mod-ci.hxx')
-rw-r--r--mod/mod-ci.hxx31
1 files changed, 27 insertions, 4 deletions
diff --git a/mod/mod-ci.hxx b/mod/mod-ci.hxx
index a83b9d3..bd91e99 100644
--- a/mod/mod-ci.hxx
+++ b/mod/mod-ci.hxx
@@ -16,6 +16,7 @@
#include <mod/module-options.hxx>
#include <mod/ci-common.hxx>
+#include <mod/database-module.hxx>
#if defined(BREP_CI_TENANT_SERVICE_UNLOADED) && !defined(BREP_CI_TENANT_SERVICE)
# error BREP_CI_TENANT_SERVICE must be defined if BREP_CI_TENANT_SERVICE_UNLOADED is defined
@@ -23,10 +24,6 @@
#ifdef BREP_CI_TENANT_SERVICE
# include <mod/tenant-service.hxx>
-
-#ifdef BREP_CI_TENANT_SERVICE_UNLOADED
-# include <mod/database-module.hxx>
-#endif
#endif
namespace brep
@@ -110,6 +107,32 @@ namespace brep
tenant_service_map& tenant_service_map_;
#endif
};
+
+ class ci_cancel: public database_module,
+ private ci_start
+ {
+ public:
+ ci_cancel () = default;
+
+ // Create a shallow copy (handling instance) if initialized and a deep
+ // copy (context exemplar) otherwise.
+ //
+ explicit
+ ci_cancel (const ci_cancel&);
+
+ virtual bool
+ handle (request&, response&) override;
+
+ virtual const cli::options&
+ cli_options () const override {return options::ci_cancel::description ();}
+
+ private:
+ virtual void
+ init (cli::scanner&) override;
+
+ private:
+ shared_ptr<options::ci_cancel> options_;
+ };
}
#endif // MOD_MOD_CI_HXX