aboutsummaryrefslogtreecommitdiff
path: root/odb/option-types.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/option-types.hxx')
-rw-r--r--odb/option-types.hxx50
1 files changed, 50 insertions, 0 deletions
diff --git a/odb/option-types.hxx b/odb/option-types.hxx
index 66e2f28..732cd5a 100644
--- a/odb/option-types.hxx
+++ b/odb/option-types.hxx
@@ -5,7 +5,9 @@
#ifndef ODB_OPTION_TYPES_HXX
#define ODB_OPTION_TYPES_HXX
+#include <map>
#include <iosfwd>
+#include <cassert>
#include <odb/semantics/relational/name.hxx>
@@ -40,6 +42,7 @@ struct database
{
// Keep in alphabetic order.
//
+ common,
mssql,
mysql,
oracle,
@@ -65,6 +68,53 @@ operator<< (std::ostream&, database);
//
//
+template <typename V>
+struct database_map: std::map<database, V>
+{
+ typedef std::map<database, V> base_type;
+
+ using base_type::operator[];
+
+ V const&
+ operator[] (database const& k) const
+ {
+ typename base_type::const_iterator i (this->find (k));
+ assert (i != this->end ());
+ return i->second;
+ }
+};
+
+//
+//
+struct multi_database
+{
+ enum value
+ {
+ // Keep in alphabetic order.
+ //
+ dynamic,
+ static_,
+ disabled // Special value.
+ };
+
+ multi_database (value v = disabled) : v_ (v) {}
+ operator value () const {return v_;}
+
+ const char*
+ string () const;
+
+private:
+ value v_;
+};
+
+std::istream&
+operator>> (std::istream&, multi_database&);
+
+std::ostream&
+operator<< (std::ostream&, multi_database);
+
+//
+//
struct schema_format
{
enum value