movesim.hh

来自「COPE the first practical network coding 」· HH 代码 · 共 68 行

HH
68
字号
#ifndef MOVESIM_HH#define MOVESIM_HH/* * =c * MovementSimulator(T NODE-EL V-LAT V-LON, ...) * =s Grid * =io * None * =d *  * Generate programmed movement in Click-embedded Grid network * simulations.  Each argument tuple specifies a new velocity for the * GridLocationInfo element NODE-EL at time T milliseconds, with new * latitude velocity of V-LAT degree per second, and new longitude * velocity of V-LON degrees per second. * * =a * GridLocationInfo */#include <click/element.hh>#include "grid.hh"#include <click/timer.hh>#include <click/vector.hh>#include "elements/grid/gridlocationinfo.hh"CLICK_DECLSclass MovementSimulator : public Element {  public:  MovementSimulator();  ~MovementSimulator();  const char *class_name() const { return "MovementSimulator"; }  int configure(Vector<String> &, ErrorHandler *);  int initialize(ErrorHandler *);  void add_handlers();  int read_args(const Vector<String> &conf, ErrorHandler *errh);private:  Timer _event_timer;  struct node_event {    GridLocationInfo *loc_el;    double v_lat;    double v_lon;    node_event() : loc_el(0) { }    node_event(GridLocationInfo *el, double vlat, double vlon) :       loc_el(el), v_lat(vlat), v_lon(vlon) { }  };  struct event_entry {    unsigned long t; // relative time in msecs    Vector<node_event> nodes;    event_entry *next;  };  event_entry *_events; // sentinel for events list  static void event_hook(Timer *, void *);  bool find_entry(unsigned int t, event_entry **retval);};CLICK_ENDDECLS#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?