diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-12-21 18:23:07 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-12-21 18:23:07 +0000 |
commit | f450df300c9c057141a4caf79ff6dbfbf58492d9 (patch) | |
tree | 409f9c56056a337cade83d45ccff47ccdb06dd0c /libs/pbd/pbd/event_loop.h | |
parent | 738387f9a417537e768d56d3fc4afcb9dc82d66b (diff) |
fully implement and deploy explicit x-thread signal connection syntax (testing comes next)
git-svn-id: svn://localhost/ardour2/branches/3.0@6379 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/pbd/event_loop.h')
-rw-r--r-- | libs/pbd/pbd/event_loop.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/libs/pbd/pbd/event_loop.h b/libs/pbd/pbd/event_loop.h new file mode 100644 index 0000000000..be98fcd852 --- /dev/null +++ b/libs/pbd/pbd/event_loop.h @@ -0,0 +1,48 @@ +/* + Copyright (C) 2009 Paul Davis + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifndef __pbd_event_loop_h__ +#define __pbd_event_loop_h__ + +#include <boost/function.hpp> +#include <boost/bind.hpp> /* we don't need this here, but anything calling call_slot() probably will, so this is convenient */ +#include <glibmm/thread.h> + +namespace PBD +{ + +class EventLoop +{ + public: + EventLoop() {} + virtual ~EventLoop() {} + + virtual void call_slot (const boost::function<void()>&) = 0; + + static EventLoop* get_event_loop_for_thread(); + static void set_event_loop_for_thread (EventLoop* ui); + + private: + static Glib::StaticPrivate<EventLoop> thread_event_loop; + +}; + +} + +#endif /* __pbd_event_loop_h__ */ |