+ template <class T>
+ void
+ maybe_set (T& member, T new_value, int property) const
+ {
+ ContentChangeSignaller cc (_parent, property);
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ if (member == new_value) {
+ cc.abort ();
+ return;
+ }
+ member = new_value;
+ }
+ }
+
+ template <class T>
+ void
+ maybe_set (boost::optional<T>& member, T new_value, int property) const
+ {
+ ContentChangeSignaller cc (_parent, property);
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ if (member && member.get() == new_value) {
+ cc.abort ();
+ return;
+ }
+ member = new_value;
+ }
+ }
+