PositionDB Class Reference

Inheritance diagram for PositionDB:

Inheritance graph
[legend]
Collaboration diagram for PositionDB:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PositionDB ()
double getDistance (nsaddr_t srcid, nsaddr_t dstid)
virtual int command (int argc, const char *const *argv)
virtual int recvSyncClMsg (ClMessage *m)

Protected Attributes

int debug_

Static Protected Attributes

static std::map< nsaddr_t,
Position * > 
posmap

Detailed Description

Definition at line 39 of file positiondb.h.


Member Function Documentation

double PositionDB::getDistance ( nsaddr_t  srcid,
nsaddr_t  dstid 
)

distance of two items (in the original intention, nodes indexed by MAC addresses)

Parameters:
srcid index of src
dstid index of dst
Returns:
the distance as per Position::getDist()

Definition at line 76 of file positiondb.cc.

References posmap.

Referenced by recvSyncClMsg().

int PositionDB::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 NsObject

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, ClSAP, Bin

Reimplemented from PlugIn.

Definition at line 54 of file positiondb.cc.

References PlugIn::command(), PlugIn::getPosition(), and posmap.

Here is the call graph for this function:

int PositionDB::recvSyncClMsg ( ClMessage m  )  [virtual]

Cross-Layer messages synchronous interpreter. It has to be properly extended in order to interpret custom cross-layer messages used by this particular plug-in. This type of communication need to be directly answered in the message exchanged in order to be synchronous with the source.

Parameters:
m an instance of ClMessage that represent the message received and used for the answer
Returns:
zero if successful
See also:
NodeCore, ClMessage, ClSAP, ClTracer

Reimplemented from PlugIn.

Definition at line 95 of file positiondb.cc.

References getDistance(), and ClMessage::type().

Here is the call graph for this function:


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