3 * Author: Lukas Krejci <krejci.l@centrum.cz>, (C) 2008
4 * Copyright: See COPYING file that comes with this distribution
7 #include <beacon/trackable.hpp>
8 #include <beacon/detail/quick_wait.hpp>
13 void disconnect(intrusive_ptr
<detail::connection_impl_base
> & con
) {
17 trackable::~trackable() {
18 detail::wait(_cons_guard
);
19 std::for_each(_connections
.begin(), _connections
.end(), &disconnect
);
20 detail::notify(_cons_guard
);
23 trackable
& trackable::operator=(trackable
const & rhs
) {
25 detail::wait(_cons_guard
);
26 std::for_each(_connections
.begin(), _connections
.end(), &disconnect
);
28 detail::notify(_cons_guard
);
30 _evq
= rhs
.current_event_queue();
34 void trackable::add_connection(intrusive_ptr
<detail::connection_impl_base
> con
) {
35 detail::wait(_cons_guard
);
36 _connections
.push_back(con
);
37 detail::notify(_cons_guard
);