Alex Bikfalvi
SimStream Documentation
Host.cpp
00001 #include "Headers.h" 00002 #include "Host.h" 00003 #include "RouteHost.h" 00004 #include "Console.h" 00005 00006 CHost::CHost( 00007 __uint32 id, 00008 CSimHandler* sim, 00009 CAddress address, 00010 CInfo* info, 00011 CData* data 00012 ) : CNode(id, sim, address, 1, &CRouteHost::route, info) 00013 { 00014 assert(data); 00015 00016 // Data 00017 this->data = data; 00018 00019 // Initialize layers 00020 this->layerIgmp = new CLayerIgmp(this->sim, this->address, this->info->NumGroups()); 00021 00022 // Create layer connections 00023 // IP layer <-> IGMP layer 00024 (*this->layerIp->EventRecv()) += this->layerIgmp->DelegateRecv(); 00025 (*this->layerIgmp->EventSend()) += this->layerIp->DelegateSend(); 00026 // IGMP layer <-> IP multicast layer 00027 (*this->layerIgmp->EventJoin()) += this->layerIpMcast->DelegateJoin(); 00028 (*this->layerIgmp->EventLeave()) += this->layerIpMcast->DelegateLeave(); 00029 (*this->layerIgmp->EventLocalJoin()) += this->layerIpMcast->DelegateLocalJoin(); 00030 (*this->layerIgmp->EventLocalLeave()) += this->layerIpMcast->DelegateLocalLeave(); 00031 } 00032 00033 CHost::~CHost() 00034 { 00035 // Delete layers 00036 delete this->layerIgmp; 00037 } 00038 00039 void CHost::Finalize() 00040 { 00041 // Call the base class finalizer 00042 CNode::Finalize(); 00043 00044 // Call the finalizer for the layers 00045 this->layerIgmp->Finalize(); 00046 }
Last updated: February 8, 2011