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