summaryrefslogtreecommitdiff
path: root/odb/relational/context.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-03-10 08:44:28 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-03-21 15:39:59 +0200
commit7ae497743c7b042904fe1f6b4153ab3f4763ff2b (patch)
tree08ba3f742f20d16d893856ccceb070094bd69225 /odb/relational/context.ixx
parent2436f20262a41bd1cafa5107ab6d6799c03e0964 (diff)
Split MySQL code generator into common and db-specific parts
The common part (in relational/) still has some MySQL-specific parts. Also, add the notion of the current context which is used to avoid explicitly passing the context object to every generator's c-tor.
Diffstat (limited to 'odb/relational/context.ixx')
-rw-r--r--odb/relational/context.ixx31
1 files changed, 31 insertions, 0 deletions
diff --git a/odb/relational/context.ixx b/odb/relational/context.ixx
new file mode 100644
index 0000000..da24d39
--- /dev/null
+++ b/odb/relational/context.ixx
@@ -0,0 +1,31 @@
+// file : odb/relational/context.ixx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
+// license : GNU GPL v3; see accompanying LICENSE file
+
+namespace relational
+{
+ inline bool context::
+ grow (semantics::class_& c)
+ {
+ return current ().grow_impl (c);
+ }
+
+ inline bool context::
+ grow (semantics::data_member& m)
+ {
+ return current ().grow_impl (m);
+ }
+
+ inline bool context::
+ grow (semantics::data_member& m, semantics::type& t, string const& kp)
+ {
+ return current ().grow_impl (m, t, kp);
+ }
+
+ inline context::string context::
+ quote_id (string const& id) const
+ {
+ return current ().quote_id_impl (id);
+ }
+}