aboutsummaryrefslogtreecommitdiff
path: root/brep/module
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-04-09 15:44:57 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-04-09 15:44:57 +0200
commit9d346aa8894e567d2871125826488c2ca181d0f5 (patch)
tree870664c4612d246c37d687fba7156de33568bec6 /brep/module
parentcf5c6478240d8e4fe88c4abddf2234ef18b71c4f (diff)
Further interface prototyping
Diffstat (limited to 'brep/module')
-rw-r--r--brep/module43
1 files changed, 43 insertions, 0 deletions
diff --git a/brep/module b/brep/module
new file mode 100644
index 0000000..6687a31
--- /dev/null
+++ b/brep/module
@@ -0,0 +1,43 @@
+// file : brep/module -*- C++ -*-
+// copyright : Copyright (c) 2014-2015 Code Synthesis Tools CC
+// license : MIT; see accompanying LICENSE file
+
+#ifndef BREP_MODULE
+#define BREP_MODULE
+
+namespace brep
+{
+ // This exception is used to signal that the request is invalid
+ // (4XX codes) rather than that it could not be processed (5XX).
+ // By default 422 is returned, which means the request was
+ // semantically invalid.
+ //
+ struct invalid_request
+ {
+ web::status_code status {422};
+ std::string description;
+
+ //@@ Maybe optional "try again" link?
+ //
+ };
+
+ // Adaptation of the web::module to our needs.
+ //
+ class module: public web::module
+ {
+ public:
+ virtual void
+ handle (request&, response&) = 0;
+
+ // Implementation details.
+ //
+ protected:
+ virtual void
+ handle (request&, response&, log&);
+
+ protected:
+ log* log_;
+ };
+}
+
+#endif // BREP_MODULE