27 using slot =
typename Signal::slot;
28 using slot_type = slot;
29 using slot_list_iterator =
typename Signal::slot_list::iterator;
30 using slot_storage =
typename Signal::slot_list;
31 using slot_id =
typename slot::slot_id;
32 using signal_holder =
typename Signal::signal_holder;
33 connection(std::weak_ptr<signal_holder> slots,
const slot_type& slot) :
connection(std::move(slots), slot.m_slot_id) {};
34 connection(std::weak_ptr<signal_holder> slots,
const slot_id slot_id) : m_slots(std::move(slots)), m_slot_id(slot_id) {};
37 connection(
const connection& other) : m_slots(other.m_slots), m_slot_id(other.m_slot_id) {};
38 connection(connection&& other) : m_slots(std::move(other.m_slots)), m_slot_id(other.m_slot_id) {};
45 m_slot_id = rhs.m_slot_id;
46 m_slots = rhs.m_slots;
50 void swap(connection& other) {
52 swap(m_slots, other.m_slots);
53 swap(m_slot_id, other.m_slot_id);
56 explicit operator bool()
const {
return connected(); };
58 const auto slots = m_slots.lock();
59 if (slots && slots->signal !=
nullptr) {
60 return slots->signal->connected(m_slot_id);
68 std::shared_ptr<signal_holder> slots = m_slots.lock();
69 if (slots !=
nullptr && slots->signal !=
nullptr) {
70 slots->signal->disconnect(m_slot_id);
75 template <
class ThreadPolicy,
class Allocator,
class F>
77 template <
class T,
class IDGenerator,
class FlagType,
class Allocator>
82 std::weak_ptr<signal_holder> m_slots;