14 #ifndef ECL_SIGSLOTS_SIGNAL_HPP_
15 #define ECL_SIGSLOTS_SIGNAL_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) {
163 Signal(
const std::string &topic) : sigslot(NULL) {
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); }
225 void emit() { sigslot->emit(); }