aboutsummaryrefslogtreecommitdiff
path: root/odb/pragma.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-10-07 10:03:56 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-10-07 10:03:56 +0200
commit4c87055fbbf4b36224cc4003cc9ae38023390400 (patch)
tree03c94a661dd43f1a62a11f2e510f29c67d2a38ea /odb/pragma.cxx
parent7ac7872103a868f4232f4284aeefc1762bd75a89 (diff)
Add support for using object pointers as map keys
Also remove the restriction for map keys and set values to be NOT NULL. Not clear why it was there in the first place and it could be useful if the key or value is an object pointer.
Diffstat (limited to 'odb/pragma.cxx')
-rw-r--r--odb/pragma.cxx26
1 files changed, 25 insertions, 1 deletions
diff --git a/odb/pragma.cxx b/odb/pragma.cxx
index 9bf38c5..0c925ca 100644
--- a/odb/pragma.cxx
+++ b/odb/pragma.cxx
@@ -624,6 +624,8 @@ check_spec_decl_type (declaration const& d,
}
else if (p == "null" ||
p == "not_null" ||
+ p == "key_null" ||
+ p == "key_not_null" ||
p == "value_null" ||
p == "value_not_null")
{
@@ -2252,11 +2254,15 @@ handle_pragma (cxx_lexer& l,
}
else if (p == "null" ||
p == "not_null" ||
+ p == "key_null" ||
+ p == "key_not_null" ||
p == "value_null" ||
p == "value_not_null")
{
// null
// not_null
+ // key_null
+ // key_not_null
// value_null
// value_not_null
//
@@ -2851,7 +2857,9 @@ handle_pragma (cxx_lexer& l,
name == "index-type" ||
name == "key-type" ||
- name == "value-null" ||
+ name == "key-null" ||
+ name == "key-not-null" ||
+ name == "value-null" ||
name == "value-not-null" ||
name == "value-column" ||
@@ -3826,6 +3834,8 @@ handle_pragma_qualifier (cxx_lexer& l, string p)
p == "table" ||
p == "null" ||
p == "not_null" ||
+ p == "key_null" ||
+ p == "key_not_null" ||
p == "value_null" ||
p == "value_not_null" ||
p == "default" ||
@@ -4175,6 +4185,18 @@ handle_pragma_db_value_not_null (cpp_reader* r)
}
extern "C" void
+handle_pragma_db_key_null (cpp_reader* r)
+{
+ handle_pragma_qualifier (r, "key_null");
+}
+
+extern "C" void
+handle_pragma_db_key_not_null (cpp_reader* r)
+{
+ handle_pragma_qualifier (r, "key_not_null");
+}
+
+extern "C" void
handle_pragma_db_default (cpp_reader* r)
{
handle_pragma_qualifier (r, "default");
@@ -4323,6 +4345,8 @@ register_odb_pragmas (void*, void*)
c_register_pragma_with_expansion ("db", "table", handle_pragma_db_table);
c_register_pragma_with_expansion ("db", "null", handle_pragma_db_null);
c_register_pragma_with_expansion ("db", "not_null", handle_pragma_db_not_null);
+ c_register_pragma_with_expansion ("db", "key_null", handle_pragma_db_key_null);
+ c_register_pragma_with_expansion ("db", "key_not_null", handle_pragma_db_key_not_null);
c_register_pragma_with_expansion ("db", "value_null", handle_pragma_db_value_null);
c_register_pragma_with_expansion ("db", "value_not_null", handle_pragma_db_value_not_null);
c_register_pragma_with_expansion ("db", "default", handle_pragma_db_default);