#include <mobilenode.h>
Inheritance diagram for PositionHandler:


Public Member Functions | |
| PositionHandler (MobileNode *n) | |
| void | handle (Event *) |
Private Attributes | |
| MobileNode * | node |
|
|
Definition at line 114 of file mobilenode.h. References node.
00114 : node(n) {} |
|
|
Implements Handler. Definition at line 87 of file mobilenode.cc. References __PRETTY_FUNCTION__, Node::address(), Node::address_, Scheduler::clock(), Scheduler::instance(), node, MobileNode::pos_handle_, MobileNode::pos_intr_, MobileNode::position_update_interval_, MobileNode::random_destination(), Scheduler::schedule(), and MobileNode::update_position().
00088 {
00089 Scheduler& s = Scheduler::instance();
00090
00091 #if 0
00092 fprintf(stderr, "*** POSITION HANDLER for node %d (time: %f) ***\n",
00093 node->address(), s.clock());
00094 #endif
00095 /*
00096 * Update current location
00097 */
00098 node->update_position();
00099
00100 /*
00101 * Choose a new random speed and direction
00102 */
00103 #ifdef DEBUG
00104 fprintf(stderr, "%d - %s: calling random_destination()\n",
00105 node->address_, __PRETTY_FUNCTION__);
00106 #endif
00107 node->random_destination();
00108
00109 s.schedule(&node->pos_handle_, &node->pos_intr_,
00110 node->position_update_interval_);
00111 }
|
Here is the call graph for this function:

|
|
Definition at line 117 of file mobilenode.h. Referenced by handle(), and PositionHandler(). |
1.3.3