diff options
author | Carl Hetherington <carl@carlh.net> | 2011-01-09 15:10:26 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-01-09 15:10:26 +0000 |
commit | ddb1a76e5b1b0645d28a83f4735f2070b204fc38 (patch) | |
tree | 3ef75c743d83588e3acd293dde3c946f1d837c13 /libs/ardour/ardour/route_group.h | |
parent | e137f663032a3798a861ec0612874ffdb824e3fa (diff) |
Replace RouteGroup's collection of apply() methods with a single one.
git-svn-id: svn://localhost/ardour2/branches/3.0@8485 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/route_group.h')
-rw-r--r-- | libs/ardour/ardour/route_group.h | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/libs/ardour/ardour/route_group.h b/libs/ardour/ardour/route_group.h index d5e4b274e1..215f9f6bd7 100644 --- a/libs/ardour/ardour/route_group.h +++ b/libs/ardour/ardour/route_group.h @@ -92,33 +92,10 @@ class RouteGroup : public SessionObject int add (boost::shared_ptr<Route>); int remove (boost::shared_ptr<Route>); - void apply (void (Route::*func)(void *), void *src) { + template<typename Function> + void foreach_route (Function f) { for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) { - ((*i).get()->*func)(src); - } - } - - void apply (void (Route::*func)()) { - for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) { - ((*i).get()->*func)(); - } - } - - template<class T> void apply (void (Route::*func)(T, void *), T val, void *src) { - for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) { - ((*i).get()->*func)(val, src); - } - } - - template<class T> void apply (void (Route::*func)(T), T val) { - for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) { - ((*i).get()->*func)(val); - } - } - - template<class T> void foreach_route (T *obj, void (T::*func)(Route&)) { - for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) { - (obj->*func)(**i); + f (i->get()); } } |