Add Lua bindings for RegionMap and region list
[ardour.git] / libs / pbd / pbd / sequence_property.h
index e105e82e47c01ba7c61529ff024f892a82661e0d..4069340e429bb6f6ac7432d825600c1ae83771f4 100644 (file)
@@ -91,7 +91,7 @@ class /*LIBPBD_API*/ SequenceProperty : public PropertyBase
 
                 XMLNode* child = new XMLNode (PBD::capitalize (property_name()));
                 history_node->add_child_nocopy (*child);
-                
+
                /* record the change described in our change member */
 
                if (!_changes.added.empty()) {
@@ -126,13 +126,13 @@ class /*LIBPBD_API*/ SequenceProperty : public PropertyBase
        void get_value (XMLNode & node) const {
                 for (typename Container::const_iterator i = _val.begin(); i != _val.end(); ++i) {
                         node.add_child_nocopy ((*i)->get_state ());
-                } 
+                }
        }
 
        bool changed () const {
                return !_changes.added.empty() || !_changes.removed.empty();
        }
-       
+
        void clear_changes () {
                _changes.added.clear ();
                _changes.removed.clear ();
@@ -144,7 +144,7 @@ class /*LIBPBD_API*/ SequenceProperty : public PropertyBase
        }
 
        /** Given a record of changes to this property, pass it to a callback that will
-        *  update the property in some appropriate way. 
+        *  update the property in some appropriate way.
         *
         *  This exists because simply using std::sequence methods to add/remove items
         *  from the property is far too simplistic - the semantics of add/remove may
@@ -158,19 +158,19 @@ class /*LIBPBD_API*/ SequenceProperty : public PropertyBase
                if (!changed ()) {
                        return;
                }
-               
+
                /* Create a property with just the changes and not the actual values */
                SequenceProperty<Container>* a = create ();
                a->_changes = _changes;
                changes.add (a);
-               
+
                if (cmd) {
                        /* whenever one of the items emits DropReferences, make sure
                           that the Destructible we've been told to notify hears about
                           it. the Destructible is likely to be the Command being built
                           with this diff().
                        */
-                        
+
                        for (typename ChangeContainer::const_iterator i = a->changes().added.begin(); i != a->changes().added.end(); ++i) {
                                (*i)->DropReferences.connect_same_thread (*cmd, boost::bind (&Destructible::drop_references, cmd));
                        }
@@ -182,7 +182,7 @@ class /*LIBPBD_API*/ SequenceProperty : public PropertyBase
                XMLNodeList const children = node.children ();
 
                /* find the node for this property name */
-               
+
                std::string const c = capitalize (property_name ());
                XMLNodeList::const_iterator i = children.begin();
                while (i != children.end() && (*i)->name() != c) {
@@ -194,7 +194,7 @@ class /*LIBPBD_API*/ SequenceProperty : public PropertyBase
                }
 
                /* create a property with the changes */
-               
+
                SequenceProperty<Container>* p = create ();
 
                XMLNodeList const & grandchildren = (*i)->children ();
@@ -301,12 +301,12 @@ class /*LIBPBD_API*/ SequenceProperty : public PropertyBase
                }
                _val.clear ();
        }
-       
-       typename Container::size_type size() const { 
+
+       typename Container::size_type size() const {
                return _val.size();
        }
 
-       bool empty() const { 
+       bool empty() const {
                return _val.empty();
        }
 
@@ -320,30 +320,30 @@ class /*LIBPBD_API*/ SequenceProperty : public PropertyBase
                return _val = other;
        }
 
-       typename Container::reference front() { 
+       typename Container::reference front() {
                return _val.front ();
        }
 
-       typename Container::const_reference front() const { 
+       typename Container::const_reference front() const {
                return _val.front ();
        }
 
-       typename Container::reference back() { 
+       typename Container::reference back() {
                return _val.back ();
        }
 
-       typename Container::const_reference back() const { 
+       typename Container::const_reference back() const {
                return _val.back ();
        }
 
-       void sort() { 
+       void sort() {
                _val.sort ();
        }
 
        template<class BinaryPredicate> void sort(BinaryPredicate comp) {
                _val.sort (comp);
        }
-        
+
         const ChangeRecord& changes () const { return _changes; }
 
 protected:
@@ -355,12 +355,12 @@ protected:
                , _changes (p._changes)
                , _update_callback (p._update_callback)
        {}
-       
+
        Container _val; ///< our actual container of things
        ChangeRecord _changes; ///< changes to the container (adds/removes) that have happened since clear_changes() was last called
        boost::function<void(const ChangeRecord&)> _update_callback;
 
-private:       
+private:
        virtual SequenceProperty<Container>* create () const = 0;
 };