26#ifndef Pt_Connection_h
27#define Pt_Connection_h
31#include <Pt/NonCopyable.h>
42 ConnectionData(Connectable& sender, Slot* slot)
47 , _callable(slot->callable())
71 const Connectable* sender()
const
77 const Slot* slot()
const
80 const Callback* callable()
const
88 const Callback* _callable;
112 {
return _data && _data->isValid(); }
116 {
return _data ? _data->sender() : 0; }
120 {
return _data ? _data->
slot() : 0; }
125 {
return _data ? _data->callable() : 0; }
129 {
return this->
isValid() ==
false; }
138 bool operator==(
const Connection& connection)
const
139 {
return _data == connection._data; }
142 ConnectionData* _data;
Connection Management for Signal and Slot Objects.
Definition Connectable.h:50
const Callback * callable() const
Returns the slot's Callback, cached at connection time.
Definition Connection.h:124
Connection()
Default Constructor.
Connection & operator=(const Connection &connection)
Assignment operator.
void close()
Closes the connection.
bool isValid() const
Returns true if not closed.
Definition Connection.h:111
const Slot * slot() const
Returns the slot.
Definition Connection.h:119
bool operator!() const
Returns true if closed.
Definition Connection.h:128
const Connectable * sender() const
Returns the sender.
Definition Connection.h:115
Connection(const Connection &connection)
Copy Constructor.
Connection(Connectable &sender, Slot *slot)
Construct with sender and slot.
Endpoint of a signal/slot connection.
Definition Slot.h:55
ConstMethodSlot< R, ClassT, As... > slot(ClassT &object, R(BaseT::*method)(As...) const)
Returns a slot object for the given object/member pair.
Definition ConstMethod.h:172
Core module.
Definition Allocator.h:33