- template<class T1, class T2> void apply (T1& obj, void (T1::*method)(LocationList&, T2& arg), T2& arg) {
- Glib::Threads::Mutex::Lock lm (lock);
- (obj.*method)(locations, arg);
+ PBD::Signal1<void,Location*> added;
+ PBD::Signal1<void,Location*> removed;
+ PBD::Signal0<void> changed; /* emitted when any action that could have added/removed more than 1 location actually removed 1 or more */
+
+ template<class T> void apply (T& obj, void (T::*method)(const LocationList&)) const {
+ /* We don't want to hold the lock while the given method runs, so take a copy
+ of the list and pass that instead.
+ */
+ Locations::LocationList copy;
+ {
+ Glib::Threads::Mutex::Lock lm (lock);
+ copy = locations;
+ }
+ (obj.*method)(copy);