1 #ifndef SIGNALS_DETAIL_CONNECTION_IMPL_HPP
2 #define SIGNALS_DETAIL_CONNECTION_IMPL_HPP
7 #include "../connection.hpp"
9 #include "connection_impl_base.hpp"
14 template <
typename Signature>
20 template <
typename R,
typename... Args>
29 : slot_{std::move(s)}, connected_{
true}
40 auto const lock = std::lock_guard{mtx_};
43 slot_.slot_function() = [c, es](Args&&... args) {
44 return es.slot_function()(c, std::forward<Args>(args)...);
46 for (std::weak_ptr<void>
const& wp : es.get_tracked_container()) {
52 void disconnect()
override
54 auto const lock = std::lock_guard{mtx_};
58 auto connected()
const ->
bool override
60 auto const lock = std::lock_guard{mtx_};
64 auto get_slot() ->
Slot<R(Args...)>& {
return slot_; }
66 auto get_slot()
const ->
Slot<R(Args...)>
const& {
return slot_; }
69 Slot<R(Args...)> slot_;
74 #endif // SIGNALS_DETAIL_CONNECTION_IMPL_HPP