aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-10-15 11:33:40 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-10-21 19:02:01 +0200
commitcc569c1834e191eda45a328cfe34d15181d2d396 (patch)
tree7e1763897b2a008ca92de268eaabd4967de8b690
parent07259554b3cfab91a455dcc23cc637b299605a9e (diff)
Add support for readonly members
New pragma: readonly. New test: readonly.
-rw-r--r--odb/database.txx10
1 files changed, 10 insertions, 0 deletions
diff --git a/odb/database.txx b/odb/database.txx
index 82afd64..c70697d 100644
--- a/odb/database.txx
+++ b/odb/database.txx
@@ -138,7 +138,12 @@ namespace odb
throw not_in_transaction ();
object_traits::callback (*this, obj,callback_event::pre_update);
+
+ // Compiler error pointing here? Perhaps the object is readonly and
+ // therefore does not provide the update() function?
+ //
object_traits::update (*this, obj);
+
object_traits::callback (*this, obj, callback_event::post_update);
}
@@ -160,7 +165,12 @@ namespace odb
T& obj (pointer_traits::get_ref (pobj));
object_traits::callback (*this, obj, callback_event::pre_update);
+
+ // Compiler error pointing here? Perhaps the object is readonly and
+ // therefore does not provide the update() function?
+ //
object_traits::update (*this, obj);
+
object_traits::callback (*this, obj, callback_event::post_update);
}