Public Member Functions

NicEntryDirect Class Reference
[connectionManager - channel and connection related classes]

NicEntry is used by ConnectionManager to store the necessary information for each nic. More...

#include <NicEntryDirect.h>

Inherits NicEntry.

Collaboration diagram for NicEntryDirect:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 NicEntryDirect (bool debug)
 Constructor, initializes all members.
virtual ~NicEntryDirect ()
 Destructor -- needs to be there...
virtual void connectTo (NicEntry *)
 Connect two nics.
virtual void disconnectFrom (NicEntry *)
 Disconnect two nics.

Detailed Description

NicEntry is used by ConnectionManager to store the necessary information for each nic.

Author:
Daniel Willkomm
See also:
ConnectionManager, NicEntry

Definition at line 36 of file NicEntryDirect.h.


Member Function Documentation

void NicEntryDirect::connectTo ( NicEntry other  )  [virtual]

Connect two nics.

Establish unidirectional connection with other nic

Parameters:
other reference to remote nic (other NicEntry)

This function acquires an in gate at the remote nic and an out gate at this nic, connects the two and updates the freeInGate, freeOutGate and outConns data sets.

Implements NicEntry.

Definition at line 32 of file NicEntryDirect.cc.

References NicEntry::nicId, NicEntry::nicPtr, and NicEntry::outConns.

{
    cModule* otherPtr = other->nicPtr;

    nicEV <<"connecting nic #"<<nicId<< " and #"<<other->nicId<<endl;

    cGate *radioGate=NULL;
    if( (radioGate = otherPtr->gate("radioIn")) == NULL )
    throw cRuntimeError("Nic has no radioIn gate!");

    outConns[other] = radioGate->getPathStartGate();
}

void NicEntryDirect::disconnectFrom ( NicEntry other  )  [virtual]

Disconnect two nics.

Release unidirectional connection with other nic

Parameters:
other reference to remote nic (other NicEntry)

Implements NicEntry.

Definition at line 46 of file NicEntryDirect.cc.

References NicEntry::nicId, and NicEntry::outConns.

{
    nicEV <<"disconnecting nic #"<<nicId<< " and #"<<other->nicId<<endl;
    outConns.erase(other);
}


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