PortMap Class Reference

#include <port-map.h>

Inheritance diagram for PortMap:

Inheritance graph
[legend]
Collaboration diagram for PortMap:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PortMap ()
virtual ~PortMap ()
virtual void recv (Packet *p)
virtual void recv (Packet *p, int idSrc)
virtual int assignPort (Module *m)
virtual int command (int argc, const char *const *argv)

Protected Attributes

int portcounter
map< int, int > port_map
map< int, int > id_map
int debug_

Detailed Description

Reimplementation of Port-Mux using stl::map instead of custom-made memory allocation (Port-Mux implementation results quite buggy and I don't feel like debugging it - Nicola)

Definition at line 47 of file port-map.h.


Member Function Documentation

void PortMap::recv ( Packet *  p  )  [virtual]

Abstract method which has to be filled with the ad-hoc operations that the module has to do to the packet received

Parameters:
p pointer to the packet will be received
See also:
SAP, ChSAP

Implements Module.

Definition at line 78 of file port-map.cc.

void PortMap::recv ( Packet *  p,
int  idSrc 
) [virtual]

Call the recv method with only the Packet parameter, by extending it it is possible to use the information stored in idSrc to understand with module has sent this packet

Parameters:
p pointer to the packet will be received
idSrc unique id of the module that has sent the packet
See also:
SAP, ChSAP

Reimplemented from Module.

Definition at line 87 of file port-map.cc.

References debug_, Module::drop(), id_map, port_map, portcounter, Module::sendDown(), Module::sendUp(), and UP.

Here is the call graph for this function:

int PortMap::command ( int  argc,
const char *const *  argv 
) [virtual]

TCL command interpreter. It implements the following OTcl methods:

Moreover it inherits all the OTcl method of PlugIn

Parameters:
argc number of arguments in argv
argv array of strings which are the comand parameters (Note that argv[0] is the name of the object)
Returns:
TCL_OK or TCL_ERROR whether the command has been dispatched succesfully or no
See also:
PlugIn

Reimplemented from Module.

Definition at line 53 of file port-map.cc.

References assignPort(), and Module::command().

Here is the call graph for this function:


Member Data Documentation

map<int, int> PortMap::id_map [protected]

value = port; key = id

Definition at line 61 of file port-map.h.

Referenced by assignPort(), and recv().

int PortMap::debug_ [protected]

value = id; key = port

Definition at line 63 of file port-map.h.

Referenced by assignPort(), PortMap(), and recv().


The documentation for this class was generated from the following files:
Generated on Wed Nov 26 15:52:10 2008 for NS-MIRACLE library by  doxygen 1.5.2