SAP Class Reference

#include <sap.h>

Inheritance diagram for SAP:

Inheritance graph
[legend]
Collaboration diagram for SAP:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SAP ()
virtual ~SAP ()
virtual int command (int argc, const char *const *argv)
virtual void sendUp (Packet *p, double delay)
virtual void sendDown (Packet *p, double delay)
virtual void sendUp (ClMessage *m, double delay)
virtual void sendDown (ClMessage *m, double delay)
virtual void sendSynchronousUp (ClMessage *m)
virtual void sendSynchronousDown (ClMessage *m)
int getModuleUpId ()
int getModuleDownId ()
virtual void handle (Event *e)
int depthUp ()
int depthDown ()

Static Public Member Functions

static void addTracer (Tracer *tr)

Protected Member Functions

void trace (Packet *p)
void trace (ClMessage *m)

Protected Attributes

ModuleupModule_
ModuledownModule_
int depthUp_
int depthDown_

Static Protected Attributes

static PktTracerpktTr_ = 0

Friends

class Tracer

Detailed Description

The SAP class is a ConnectorTrace which is used to connect two modules of adjacent layers. It has tracing functionality, thus it could trace the packets which pass through.

See also:
Module, PktTracer, Tracer

Definition at line 53 of file sap.h.


Constructor & Destructor Documentation

SAP::SAP (  ) 

SAP constructor

Definition at line 65 of file sap.cc.

References DEFAULTDEPTH, depthDown_, and depthUp_.

SAP::~SAP (  )  [virtual]

SAP destructor

Definition at line 73 of file sap.cc.


Member Function Documentation

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

TCL command interpreter. It implements the following OTcl methods:

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:
Module

Reimplemented from ConnectorTrace.

Reimplemented in Bin, and ChSAP.

Definition at line 79 of file sap.cc.

References ConnectorTrace::command(), downModule_, and upModule_.

Referenced by ChSAP::command().

Here is the call graph for this function:

void SAP::sendUp ( Packet *  p,
double  delay 
) [virtual]

Send a packet to the up module adding a delay if it is neccessary. Note: this method sets the direction of the packet to UP

Parameters:
p a pointer to the packet which has to send up
delay the delivery delay (it must be greater or equal 0)

Reimplemented in ChSAP.

Definition at line 121 of file sap.cc.

References ConnectorTrace::debug_, depthUp_, getModuleDownId(), Module::recv(), trace(), UP, and upModule_.

Referenced by Module::sendAsyncClMsgUp(), and Module::sendUp().

Here is the call graph for this function:

void SAP::sendDown ( Packet *  p,
double  delay 
) [virtual]

Send a packet to the down module with the sender module ID and adding a delay if it is neccessary Note: this method sets the direction of the packet to DOWN

Parameters:
p a pointer to the packet which has to send down
delay the delivery delay (it must be greater or equal 0)

Reimplemented in ChSAP.

Definition at line 154 of file sap.cc.

References depthDown_, DOWN, downModule_, getModuleUpId(), Module::recv(), and trace().

Referenced by Module::sendAsyncClMsgDown(), and Module::sendDown().

Here is the call graph for this function:

void SAP::sendUp ( ClMessage m,
double  delay 
) [virtual]

Send a ClMessage to the up module adding a delay if it is neccessary. Note: this method sets the direction of the packet to UP

Parameters:
m a pointer to the ClMessage which has to send up
delay the delivery delay (it must be greater or equal 0)

Definition at line 177 of file sap.cc.

References PlugIn::crLayCommand(), depthUp_, ClMessage::direction(), PlugIn::recvAsyncClMsg(), RUN_DEPRECATED_OR_NEW_VIRTUAL_METHOD, trace(), UP, upModule_, and ClMessage::verbosity().

Here is the call graph for this function:

void SAP::sendDown ( ClMessage m,
double  delay 
) [virtual]

Send a ClMessage to the up module adding a delay if it is neccessary. Note: this method sets the direction of the packet to UP

Parameters:
m a pointer to the ClMessage which has to send down
delay the delivery delay (it must be greater or equal 0)

Definition at line 199 of file sap.cc.

References PlugIn::crLayCommand(), depthDown_, ClMessage::direction(), DOWN, downModule_, PlugIn::recvAsyncClMsg(), RUN_DEPRECATED_OR_NEW_VIRTUAL_METHOD, trace(), and ClMessage::verbosity().

Here is the call graph for this function:

void SAP::sendSynchronousUp ( ClMessage m  )  [virtual]

Send a Synchronous ClMessage to the up module adding a delay if it is neccessary. Note: this method sets the direction of the packet to UP

Parameters:
m a pointer to the ClMessage which has to send up

Definition at line 220 of file sap.cc.

References PlugIn::crLaySynchronousCommand(), depthDown_, depthUp_, ClMessage::direction(), DOWN, PlugIn::recvSyncClMsg(), RUN_DEPRECATED_OR_NEW_VIRTUAL_METHOD, ConnectorTrace::traceSync(), UP, upModule_, and ClMessage::verbosity().

Referenced by Module::sendSyncClMsgUp().

Here is the call graph for this function:

void SAP::sendSynchronousDown ( ClMessage m  )  [virtual]

Send a Synchronous ClMessage to the up module adding a delay if it is neccessary. Note: this method sets the direction of the packet to UP

Parameters:
m a pointer to the ClMessage which has to send down
delay the delivery delay (it must be greater or equal 0)

Definition at line 237 of file sap.cc.

References PlugIn::crLaySynchronousCommand(), depthDown_, depthUp_, ClMessage::direction(), DOWN, downModule_, PlugIn::recvSyncClMsg(), RUN_DEPRECATED_OR_NEW_VIRTUAL_METHOD, ConnectorTrace::traceSync(), UP, and ClMessage::verbosity().

Referenced by Module::sendSyncClMsgDown().

Here is the call graph for this function:

void SAP::addTracer ( Tracer tr  )  [static]

Adds a new tracer to the packet tracer list (pktTr_)

Parameters:
tr a pointer to the tracer instance which has to insert in the tracer list
See also:
PktTracer, Tracer

Definition at line 53 of file sap.cc.

References PktTracer::addTracer(), and pktTr_.

Here is the call graph for this function:

int SAP::getModuleUpId (  ) 

Returns the ID of the up module

Returns:
the up module ID

Definition at line 255 of file sap.cc.

References PlugIn::getId(), and upModule_.

Referenced by UmtsWirelessChModule::command(), MrclRouting::getConfiguration(), handle(), sendDown(), and Module::sendUp().

Here is the call graph for this function:

int SAP::getModuleDownId (  ) 

Returns the ID of the down module

Returns:
the down module ID

Definition at line 261 of file sap.cc.

References downModule_, and PlugIn::getId().

Referenced by MrclRouting::getConfiguration(), handle(), Module::sendDown(), sendUp(), and Module::sendUp().

Here is the call graph for this function:

void SAP::handle ( Event *  e  )  [virtual]

This method is called when the SAP has been scheduled in order to give a delay to a packet

Parameters:
e pointer to the event which has this SAP for handler. It is a Packet

Reimplemented from ConnectorTrace.

Reimplemented in Bin, and ChSAP.

Definition at line 295 of file sap.cc.

References ConnectorTrace::debug_, depthDown_, depthUp_, DOWN, downModule_, getModuleDownId(), getModuleUpId(), Module::recv(), trace(), and upModule_.

Here is the call graph for this function:

int SAP::depthUp (  ) 

Return the value of depthUp_

Returns:
The value of depthUp_

Definition at line 111 of file sap.cc.

References depthUp_.

int SAP::depthDown (  ) 

Return the value of depthDown_

Returns:
The value of depthDown_

Definition at line 116 of file sap.cc.

References depthDown_.

void SAP::trace ( Packet *  p  )  [protected]

Write a line in the system trace file which contains the trace information of a packet

Parameters:
p pointer to the packet which has to be traced

Definition at line 274 of file sap.cc.

References ConnectorTrace::debug_, ConnectorTrace::dirDown_, ConnectorTrace::dirUp_, DOWN, ConnectorTrace::dump(), pktTr_, ConnectorTrace::preambleDown_, ConnectorTrace::preambleUp_, PktTracer::trace(), and ConnectorTrace::writeTrace().

Referenced by handle(), ChSAP::handle(), sendDown(), ChSAP::sendDown(), sendUp(), and ChSAP::sendUp().

Here is the call graph for this function:

void SAP::trace ( ClMessage m  )  [protected]

Write a line in the system trace file which contains the trace information of a ClMessage

Parameters:
m pointer to the ClMessage which has to be traced

Reimplemented from ConnectorTrace.

Definition at line 290 of file sap.cc.

References ConnectorTrace::trace().

Here is the call graph for this function:


Member Data Documentation

PktTracer * SAP::pktTr_ = 0 [static, protected]

The packet tracer list

Definition at line 198 of file sap.h.

Referenced by addTracer(), Bin::drop(), and trace().

Module* SAP::upModule_ [protected]

Pointer to the up module

Definition at line 200 of file sap.h.

Referenced by command(), ChSAP::command(), getModuleUpId(), handle(), ChSAP::handle(), sendSynchronousUp(), sendUp(), and ChSAP::sendUp().

Module* SAP::downModule_ [protected]

Pointer to the down module

Definition at line 202 of file sap.h.

Referenced by command(), ChSAP::command(), getModuleDownId(), handle(), sendDown(), and sendSynchronousDown().

int SAP::depthUp_ [protected]

Define the level of tracing for packet with up direction

Definition at line 220 of file sap.h.

Referenced by depthUp(), handle(), ChSAP::handle(), SAP(), sendSynchronousDown(), sendSynchronousUp(), sendUp(), and ChSAP::sendUp().

int SAP::depthDown_ [protected]

Define the level of tracing for packet with down direction

Definition at line 222 of file sap.h.

Referenced by depthDown(), handle(), ChSAP::handle(), SAP(), sendDown(), ChSAP::sendDown(), sendSynchronousDown(), and sendSynchronousUp().


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