Alex Bikfalvi
SimStream Documentation
StreamServerPushSelect.h
00001 #pragma once 00002 00003 #include "StreamServer.h" 00004 00005 #include "Address.h" 00006 #include "Timer.h" 00007 #include "Shuffle.h" 00008 #include "InfoPushSelect.h" 00009 00010 #include "PacketStream.h" 00011 #include "StreamEncoderFrame.h" 00012 00013 #include "StreamMessage.h" 00014 #include "StreamMessagePushSelectJoin.h" 00015 #include "StreamMessagePushSelectLeave.h" 00016 #include "StreamMessageBootPushSelectRequest.h" 00017 #include "StreamMessageBootPushSelectResponse.h" 00018 #include "StreamMessageBootPushSelectRegister.h" 00019 #include "StreamMessageBootPushSelectDeregister.h" 00020 00021 class CStreamServerPushSelect : public CStreamServer 00022 { 00023 private: 00024 // Stream 00025 CStreamSource* source; 00026 set<CAddress>* receivers; 00027 CTimer<CStreamServerPushSelect>* timer; 00028 CInfoPushSelect* info; 00029 00030 // Delegates 00031 IDelegate2<void, CAddress, CPacketStream*>* 00032 delegateSendStream; 00033 IDelegate2<void, CAddress, CStreamMessage*>* 00034 delegateSendMessage; 00035 00036 // Global 00037 __uint32 layers; 00038 00039 __byte gopLength; 00040 00041 __time scheduleTime; 00042 __uint32 scheduleFrame; 00043 __uint32 scheduleRate; 00044 __uint32 deltaFrame; 00045 00046 // Encoder 00047 CStreamEncoderFrame* encoder; 00048 00049 public: 00050 CStreamServerPushSelect( 00051 CSimHandler* sim, 00052 CInfoPushSelect* info, 00053 CStreamSource* source, 00054 IDelegate2<void, CAddress, CPacketStream*>* delegateSendStream, 00055 IDelegate2<void, CAddress, CStreamMessage*>* delegateSendMessage 00056 ); 00057 virtual ~CStreamServerPushSelect(); 00058 00059 // Control 00060 void Start(); 00061 void Stop(); 00062 00063 // Receive 00064 void Recv(CAddress src, CStreamMessage* message); 00065 00066 // Finalizer 00067 virtual void Finalize(); 00068 00069 private: 00070 void Timer(CTimerInfo* info); 00071 00072 void RecvMessageQuery(CAddress src, CStreamMessageBootPushSelectRequest* message); 00073 void RecvMessageQueryStream(CAddress src, CStreamMessageBootPushSelectRequest* message); 00074 void RecvMessageQueryLayer(CAddress src, CStreamMessageBootPushSelectRequest* message); 00075 00076 void RecvMessageRegister(CAddress src, CStreamMessageBootPushSelectRegister* message); 00077 void RecvMessageDeregister(CAddress src, CStreamMessageBootPushSelectDeregister* message); 00078 00079 void RecvMessageJoin(CAddress src, CStreamMessagePushSelectJoin* message); 00080 void RecvMessageLeave(CAddress src, CStreamMessagePushSelectLeave* message); 00081 };
Last updated: February 8, 2011