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 |
Definition at line 39 of file positiondb.h.
double PositionDB::getDistance | ( | nsaddr_t | srcid, | |
nsaddr_t | dstid | |||
) |
distance of two items (in the original intention, nodes indexed by MAC addresses)
srcid | index of src | |
dstid | index of dst |
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
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) |
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.
m | an instance of ClMessage that represent the message received and used for the answer |
Reimplemented from PlugIn.
Definition at line 95 of file positiondb.cc.
References getDistance(), and ClMessage::type().
Here is the call graph for this function: