Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

PositionHandler Class Reference

#include <mobilenode.h>

Inheritance diagram for PositionHandler:

Inheritance graph
[legend]
Collaboration diagram for PositionHandler:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PositionHandler (MobileNode *n)
void handle (Event *)

Private Attributes

MobileNodenode

Constructor & Destructor Documentation

PositionHandler::PositionHandler MobileNode n  )  [inline]
 

Definition at line 114 of file mobilenode.h.

References node.

00114 : node(n) {}


Member Function Documentation

void PositionHandler::handle Event  )  [virtual]
 

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:


Member Data Documentation

MobileNode* PositionHandler::node [private]
 

Definition at line 117 of file mobilenode.h.

Referenced by handle(), and PositionHandler().


The documentation for this class was generated from the following files:
Generated on Tue Apr 20 13:08:39 2004 for NS2.26SourcesOriginal by doxygen 1.3.3