14 #ifndef ECL_SIGSLOTS_SIGNAL_HPP_ 15 #define ECL_SIGSLOTS_SIGNAL_HPP_ 22 #include <ecl/utilities/void.hpp> 23 #include <ecl/config/macros.hpp> 46 template <
typename Data=Vo
id>
55 Signal() : sigslot(NULL) {
56 sigslot =
new SigSlot<Data>();
61 Signal(
const std::string &topic) : sigslot(NULL) {
62 sigslot =
new SigSlot<Data>();
77 Signal(
const Signal& signal) {
79 sigslot->incrHandles();
90 sigslot->decrHandles();
91 if ( sigslot->handles() == 0 ) {
104 void connect(
const std::string& topic) { sigslot->connectSignal(topic); }
113 void connectAsSlot(
const std::string& topic) { sigslot->connectSlot(topic); }
119 void disconnect() { sigslot->disconnect(); }
128 void emit(Data data) { sigslot->emit(data); }
131 SigSlot<Data>* sigslot;
157 Signal() : sigslot(NULL) {
158 sigslot =
new SigSlot<Void>();
163 Signal(
const std::string &topic) : sigslot(NULL) {
164 sigslot =
new SigSlot<Void>();
178 Signal(
const Signal& signal) {
180 sigslot->incrHandles();
190 sigslot->decrHandles();
191 if ( sigslot->handles() == 0 ) {
203 void connect(
const std::string& topic) { sigslot->connectSignal(topic); }
212 void connectAsSlot(
const std::string& topic) { sigslot->connectSlot(topic); }
218 void disconnect() { sigslot->disconnect(); }
225 void emit() { sigslot->emit(); }
228 SigSlot<Void>* sigslot;