OLT_WDMSplitter Class Reference

#include <OLT_WDMSplitter.h>

Inheritance diagram for OLT_WDMSplitter:

cSimpleModule cModule cComponent cDefaultList cNoncopyableOwnedObject cOwnedObject noncopyable cNamedObject cObject

List of all members.

Protected Member Functions

virtual void initialize ()
virtual void handleMessage (cMessage *msg)

Protected Attributes

double received_messages


Detailed Description

Definition at line 21 of file OLT_WDMSplitter.h.


Member Function Documentation

void OLT_WDMSplitter::handleMessage ( cMessage msg  )  [protected, virtual]

Reimplemented from cSimpleModule.

Definition at line 38 of file OLT_WDMSplitter.cc.

00039 {
00040         // VARIABLES
00041         int type = msg->getKind(); // VARIABLE TYPE PARA IDENTIFICAR LOS MENSAJES DE LA RED
00042         int p= gateSize("wdmnet"); // TAMANYO DE LA PUERTA wdmnet DEL MODULO OLT_WDMSPLITTER
00043 
00044         // ESTRUCTURA CONDICIONAL SWITCH QUE NOS DIFERENCIA LOS MENSAJES QUE LLEGUEN A ESTE MODULO
00045         switch(type)
00046         {
00047                 case 0:
00048                         // LLEGA UN PAQUETE GATE CON IDENTIFICADOR = 0
00049                         if(msg->getKind()==0)
00050                         {
00051                                 GATEmsg *gatemsg=check_and_cast<GATEmsg*>(msg); // CHEQUEAMOS EL PAQUETE GATE
00052 
00053                                 // ENVIAMOS EL PAQUETE GATE HACIA EL SPLITTER POR LA LONGITUD DE ONDA QUE NOS INDICA EL PARAMETRO gatemsg->getLambdagate()
00054                                 send(gatemsg, "wdmnet$o", gatemsg->getLambdagate());
00055                         }
00056                         break;
00057 
00058                 case 1:
00059                         // LLEGA UN PAQUETE ETHERNET CON IDENTIFICADOR = 1
00060                         if(msg->getKind()==1)
00061                         {
00062                                 ETHERNETmsg *ethernetmsg=check_and_cast<ETHERNETmsg*>(msg);
00063                                 // DEFINIMOS EL PARAMETRO ingate QUE NOS INDICA EL PUNTERO DE LA PUERTA POR LA CUAL ENTRA EL MENSAJE QUE LLEGA
00064                                 cGate *ingate = ethernetmsg->getArrivalGate();
00065 
00066                                 // COMPARAMOS EL NOMBRE DE LA PUERTA POR LA QUE ENTRA EL MENSAJE CON LA PUERTA wdmnet$i
00067                                 if(ingate->getName() == gate("wdmnet$i",intuniform(0,p-1))->getName())
00068                                 {
00069 
00070                                         if(ethernetmsg->getIsWireless()==1)
00071                                         {
00072                                                 //ev<<" Envio de paquete Ethernet de origen inalambrico al modulo 'OLT_Rx'."<<endl;
00073                                         }
00074                                         else
00075                                         {
00076                                                 received_messages++;
00077                                                 //ev<<" Envio mensaje Ethernet (Id. " << ethernetmsg->getId() << ") al modulo 'OLT_Rx'."<< endl;
00078                                                 //ev<<" Total paquetes Ethernet recibidos de las fuentes opticas: " << received_messages << endl;
00079                                         }
00080                                         send(ethernetmsg, "wdmrxOut"); // ENVIAMOS EL PAQUETE ETHERNET HACIA EL RECEPTOR
00081                                 }
00082                                 else
00083                                 {
00084                                         // ENVIAMOS EL PAQUETE ETHERNET HACIA EL SPLITTER POR LA LONGITUD DE ONDA QUE NOS INDICA EL PARAMETRO ethernetmsg->getLambdaethernet()
00085                                         send(ethernetmsg, "wdmnet$o", ethernetmsg->getLambdaethernet());
00086                                 }
00087                         }
00088                         break;
00089 
00090                 case 2:
00091                         // LLEGA UN PAQUETE REPORT CON IDENTIFICADOR = 2
00092                         if(msg->getKind()==2)
00093                         {
00094                                 REPORTmsg *reportmsg = check_and_cast<REPORTmsg*>(msg); // CHEQUEAMOS EL PAQUETE REPORT
00095                                 send(reportmsg, "wdmrxOut"); // ENVIAMOS EL PAQUETE REPORT HACIA EL RECEPTOR DEL OLT
00096                         }
00097                         break;
00098 
00099                 default:
00100                         delete msg;
00101                         break;
00102         }
00103 }

void OLT_WDMSplitter::initialize (  )  [protected, virtual]

Reimplemented from cComponent.

Definition at line 27 of file OLT_WDMSplitter.cc.

00028 {
00029 }


Member Data Documentation

Definition at line 24 of file OLT_WDMSplitter.h.


The documentation for this class was generated from the following files:

Generated on Thu Nov 28 14:47:24 2013 for red_wireless by  doxygen 1.5.7.1