diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2009-06-04 22:32:56 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2009-06-04 22:32:56 +0200 |
commit | d3a7b7c10b0ef7a3d8c8ea7f1aef2468702dd8f4 (patch) | |
tree | 5bc2a48eb2a03ae03e321d7d576658eeabad688d /src/Net/Signals/Signal1.h | |
parent | 0b27c37fe95c6aced613d51a3624f8930a96ad3f (diff) | |
download | mad-d3a7b7c10b0ef7a3d8c8ea7f1aef2468702dd8f4.tar mad-d3a7b7c10b0ef7a3d8c8ea7f1aef2468702dd8f4.zip |
Alte Signal-Implementierung entfernt
Diffstat (limited to 'src/Net/Signals/Signal1.h')
-rw-r--r-- | src/Net/Signals/Signal1.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Net/Signals/Signal1.h b/src/Net/Signals/Signal1.h index b9649be..331c5cb 100644 --- a/src/Net/Signals/Signal1.h +++ b/src/Net/Signals/Signal1.h @@ -20,19 +20,23 @@ #ifndef MAD_NET_SIGNALS_SIGNAL1_H_ #define MAD_NET_SIGNALS_SIGNAL1_H_ -#include "SignalBase.h" +#include "GenericSignal.h" +#include <Net/ThreadManager.h> + +#include <boost/function.hpp> namespace Mad { namespace Net { namespace Signals { template <typename T1> -class Signal1 : public SignalBase<boost::signal1<void, T1>, boost::function1<void, T1> > { +class Signal1 : public GenericSignal<boost::function1<void, T1> > { public: void emit(T1 arg1) { - boost::lock_guard<boost::mutex> lock(SignalBase<boost::signal1<void, T1>, boost::function1<void, T1> >::mutex); + boost::lock_guard<boost::mutex> lock(this->mutex); - SignalBase<boost::signal1<void, T1>, boost::function1<void, T1> >::signal(arg1); + for(typename std::map<Connection, typename GenericSignal<boost::function1<void, T1> >::slot_type>::iterator handler = this->handlers.begin(); handler != this->handlers.end(); ++handler) + Net::ThreadManager::get()->pushWork(boost::bind(handler->second, arg1)); } }; |