14 #ifndef ECL_SIGSLOTS_SLOT_HPP_ 15 #define ECL_SIGSLOTS_SLOT_HPP_ 47 template <
typename Data=Vo
id>
58 Slot(
void (*f)(Data)) : sigslot(NULL) {
72 Slot(
void (*f)(Data),
const std::string &topic) : sigslot(NULL) {
87 Slot(
void (C::*f)(Data), C &c) : sigslot(NULL) {
102 template <
typename C>
103 Slot(
void (C::*f)(Data), C &c,
const std::string& topic) : sigslot(NULL) {
121 sigslot->incrHandles();
132 sigslot->decrHandles();
133 if ( sigslot->handles() == 0 ) {
143 const std::set<std::string>&
connections() {
return sigslot->subscribedTopics(); }
152 void connect(
const std::string& topic) { sigslot->connectSlot(topic); }
212 template <
typename C>
213 Slot(
void (C::*f)(
void), C &c) : sigslot(NULL) {
226 template <
typename C>
227 Slot(
void (C::*f)(
void), C &c,
const std::string &topic) : sigslot(NULL) {
244 sigslot->incrHandles();
254 sigslot->decrHandles();
255 if ( sigslot->handles() == 0 ) {
267 void connect(
const std::string& topic) { sigslot->connectSlot(topic); }
void connect(const std::string &topic)
Make a connection to the specified topic.
Slot(VoidFunction f)
Load with a global/static function.
Slot(VoidFunction f, const std::string &topic)
Load with a global/static function and connect.
Slot(const Slot &slot)
Copy constructor.
Slot(void(C::*f)(void), C &c, const std::string &topic)
Load with a member function and connect.
Slot(const Slot &slot)
Copy constructor.
~Slot()
Default destructor.
Slot(void(C::*f)(Data), C &c, const std::string &topic)
Load with a member function and connect.
~Slot()
Default destructor.
SigSlot< Void > * sigslot
Slot(void(*f)(Data))
Load with a global/static function.
Slot(void(*f)(Data), const std::string &topic)
Load with a global/static function and connect.
void connect(const std::string &topic)
Make a connection to the specified topic.
void disconnect()
Disconnect the slot from all topics.
const std::set< std::string > & connections()
Lists the topics this slot is connected to.
Slot(void(C::*f)(Data), C &c)
Load with a member function.
Not for direct use, provides the power behind both void signals and slots.
void disconnect()
Disconnect the slot from all topics.
Slot(void(C::*f)(void), C &c)
Load with a member function.
Not for direct use, provides the power behind both signals and slots.
SigSlot< Data > * sigslot
Function loading component of a callback system.