Alex Bikfalvi
SimStream Documentation
StreamMessageBootPushSelectResponse.cpp
00001 #include "Headers.h" 00002 #include "StreamMessageBootPushSelectResponse.h" 00003 00004 CStreamMessageBootPushSelectResponse::CStreamMessageBootPushSelectResponse( 00005 __uint32 stream, 00006 __uint32 layers, 00007 CAddress* hosts 00008 ) : CStreamMessage(CStreamMessage::STREAM_MESSAGE_BOOT_PUSH_SELECT_RESPONSE, 40 + layers * 32, stream) 00009 { 00010 assert(layers <= MAX_LAYERS); 00011 00012 this->type = STREAM; 00013 this->layers = layers; 00014 for(__uint32 index = 0; index < this->layers; index++) 00015 this->hosts[layer] = hosts[layer]; 00016 } 00017 00018 CStreamMessageBootPushSelectResponse::CStreamMessageBootPushSelectResponse( 00019 __uint32 stream, 00020 __uint32 layer, 00021 CAddress address 00022 ) : CStreamMessage(CStreamMessage::STREAM_MESSAGE_BOOT_PUSH_SELECT_RESPONSE, 72, stream) 00023 { 00024 assert(layer < MAX_LAYERS); 00025 00026 this->type = LAYER; 00027 this->layer = layer; 00028 this->layers = 1; 00029 this->hosts[this->layer] = address; 00030 } 00031 00032 CPacket* CStreamMessageBootPushSelectResponse::Copy() 00033 { 00034 CStreamMessageBootPushSelectResponse* packet; 00035 00036 switch(this->type) 00037 { 00038 case STREAM: 00039 packet = new CStreamMessageBootPushSelectResponse( 00040 this->stream, 00041 this->layers, 00042 this->hosts 00043 ); 00044 break; 00045 case LAYER: 00046 packet = new CStreamMessageBootPushSelectResponse( 00047 this->stream, 00048 this->layer, 00049 this->hosts[this->layer] 00050 ); 00051 break; 00052 } 00053 00054 return packet; 00055 }
Last updated: February 8, 2011