summaryrefslogtreecommitdiff
path: root/libs/pbd/pbd/sequence_property.h
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-03-31 22:17:01 +0000
committerCarl Hetherington <carl@carlh.net>2010-03-31 22:17:01 +0000
commit7f8b337d309fe62a442ef8c3086b7eb97c7e57e9 (patch)
treecc842e1a34520822a8cb9a1b887aac093775640a /libs/pbd/pbd/sequence_property.h
parentcc227eb75e8c920424313286417d325e58efaa94 (diff)
A few small cleanups to the property code.
git-svn-id: svn://localhost/ardour2/branches/3.0@6816 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/pbd/sequence_property.h')
-rw-r--r--libs/pbd/pbd/sequence_property.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/libs/pbd/pbd/sequence_property.h b/libs/pbd/pbd/sequence_property.h
index c2ad939b7c..8bbc7c77d2 100644
--- a/libs/pbd/pbd/sequence_property.h
+++ b/libs/pbd/pbd/sequence_property.h
@@ -113,9 +113,12 @@ class SequenceProperty : public PropertyBase
owner_state_node.add_child_nocopy ((*i)->get_state ());
}
}
+
+ bool changed () const {
+ return !_change.added.empty() || !_change.removed.empty();
+ }
void clear_history () {
- PropertyBase::clear_history();
_change.added.clear ();
_change.removed.clear ();
}
@@ -145,21 +148,18 @@ class SequenceProperty : public PropertyBase
typename Container::const_reverse_iterator rend() const { return _val.rend(); }
typename Container::iterator insert (typename Container::iterator i, const typename Container::value_type& v) {
- _have_old = true;
_change.added.insert (v);
return _val.insert (i, v);
}
typename Container::iterator erase (typename Container::iterator i) {
if (i != _val.end()) {
- _have_old = true;
_change.removed.insert (*i);
}
return _val.erase (i);
}
typename Container::iterator erase (typename Container::iterator f, typename Container::iterator l) {
- _have_old = true;
for (typename Container::const_iterator i = f; i != l; ++i) {
_change.removed.insert(*i);
}
@@ -167,20 +167,17 @@ class SequenceProperty : public PropertyBase
}
void push_back (const typename Container::value_type& v) {
- _have_old = true;
_change.added.insert (v);
_val.push_back (v);
}
void push_front (const typename Container::value_type& v) {
- _have_old = true;
_change.added.insert (v);
_val.push_front (v);
}
void pop_front () {
if (!_val.empty()) {
- _have_old = true;
_change.removed.insert (front());
}
_val.pop_front ();
@@ -188,14 +185,12 @@ class SequenceProperty : public PropertyBase
void pop_back () {
if (!_val.empty()) {
- _have_old = true;
_change.removed.insert (front());
}
_val.pop_back ();
}
void clear () {
- _have_old = true;
_change.removed.insert (_val.begin(), _val.end());
_val.clear ();
}
@@ -209,7 +204,6 @@ class SequenceProperty : public PropertyBase
}
Container& operator= (const Container& other) {
- _have_old = true;
_change.removed.insert (_val.begin(), _val.end());
_change.added.insert (other.begin(), other.end());
return _val = other;