00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __SIGNALV0IMPLSERIOUS__
00023 #define __SIGNALV0IMPLSERIOUS__
00024
00025 #ifndef __SIGNALV0__
00026 #error "This is an internal implementation header. You are not allowed to include it directly!"
00027 #endif
00028
00029 #include "ConnectionHandler.hxx"
00030
00031 namespace SigSlot
00032 {
00033
00034 class Signalv0
00035 : public Signal
00036 {
00037 public:
00038 typedef CBL::Functor0 tCallbackType;
00039 public:
00040 virtual ~Signalv0()
00041 {
00042 mSuper.DestroyConnections();
00043 }
00044
00045 void Connect( Slotv0& slot )
00046 {
00047 Connection c ( AssignConnection(), this );
00048
00049 mSuper.AddCallback( c.GetID(), &slot, slot.GetMethod() );
00050
00051 slot.Bind(c);
00052 }
00053
00054 void Emit()
00055 {
00056 if ( mSuper.HasNoCallbacks() )
00057 return;
00058
00059 tSuperType::tCallList calls = mSuper.GetCalls();
00060 tSuperType::tCallIterator i = calls.begin();
00061 tSuperType::tCallIterator end = calls.end();
00062
00063 while( i != end )
00064 {
00065 (*(*i))();
00066 i++;
00067 }
00068 }
00069
00070 void FreeConnection( Connection* pConnection )
00071 {
00072 mSuper.RemoveCall( pConnection->GetID() );
00073 FreeConnectionId( pConnection->GetID() );
00074 }
00075
00076 private:
00077 typedef Signalv0 tSignalType;
00078 typedef ConnectionHandler<tSignalType > tSuperType;
00079
00080 tSuperType mSuper;
00081 };
00082
00083 }
00084
00085 #endif // Signalv0ImplSerious.hxx
00086