ChSAP Class Reference

#include <chsap.h>

Inheritance diagram for ChSAP:

Inheritance graph
[legend]
Collaboration diagram for ChSAP:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ChSAP ()
virtual ~ChSAP ()
virtual int command (int argc, const char *const *argv)
void sendDown (Packet *p, double delay)
virtual void sendUp (Packet *p, double delay)
void handle (Event *e)
PositiongetPosition ()

Protected Attributes

NodeCorenodeCorePtr_
ChannelModulechannel_

Detailed Description

The ChSAP class is a SAP which is used to connect a modules to a channel-module. It has tracing functionality, thus it could trace the packets which pass through.

See also:
ChannelModule, Module, NodeCore, Position

Definition at line 52 of file chsap.h.


Constructor & Destructor Documentation

ChSAP::ChSAP (  ) 

ChSAP constructor

Definition at line 45 of file chsap.cc.

ChSAP::~ChSAP (  )  [virtual]

ChSAP destructor

Definition at line 49 of file chsap.cc.


Member Function Documentation

int ChSAP::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 SAP

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

Reimplemented from SAP.

Definition at line 54 of file chsap.cc.

References channel_, SAP::command(), SAP::downModule_, nodeCorePtr_, and SAP::upModule_.

Here is the call graph for this function:

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

Overload of the SAP method: send a packet to the channel adding a delay if it is neccessary (it does not send the module id of the sender) 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 from SAP.

Definition at line 97 of file chsap.cc.

References channel_, ConnectorTrace::debug_, ConnectorTrace::depth_, SAP::depthDown_, DOWN, ChannelModule::recv(), and SAP::trace().

Here is the call graph for this function:

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

Overload of the SAP method: 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 from SAP.

Definition at line 121 of file chsap.cc.

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

Referenced by LinkChannelModule::recv().

Here is the call graph for this function:

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

Overload of the SAP method: This method is called when the ChSAP 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 SAP.

Definition at line 154 of file chsap.cc.

References channel_, ConnectorTrace::debug_, SAP::depthDown_, SAP::depthUp_, DOWN, Module::recv(), ChannelModule::recv(), SAP::trace(), and SAP::upModule_.

Here is the call graph for this function:

Position * ChSAP::getPosition (  ) 

Returns the Position of the node

Returns:
the Position of the node
See also:
NodeCore, Position

Definition at line 176 of file chsap.cc.

References NodeCore::getPosition(), and nodeCorePtr_.

Referenced by WirelessChModule::sendUpPhy(), DumbWirelessChModule::sendUpPhy(), and UmtsWirelessChModule::sendUpPhy().

Here is the call graph for this function:


Member Data Documentation

NodeCore* ChSAP::nodeCorePtr_ [protected]

Instance of the node core this ChSAP belongs to

Definition at line 121 of file chsap.h.

Referenced by command(), and getPosition().


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