Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

devPktGen.h

Go to the documentation of this file.
00001 #include "dedevice.h"
00002 #include "devPkt.h"
00003 #include "devAP.h"
00004 #include "derandom_time.h"
00005 #include "probeSG.h"
00006 
00007 #ifndef __DEV_PKTGEN_H__
00008 #define __DEV_PKTGEN_H__
00009 
00010 #define DBG_EV_WIDTH 21
00011 
00012 class SysSAloha;
00013 
00020 
00021 // Packet Generator
00022 
00024 
00029 class DevPktGen : public DEDevice
00030 {
00031 protected:
00032   
00034   int counter;
00035   
00037   SysSAloha *System;
00038   
00040   DevAP* theAP;
00041   
00043   list<DevPkt*> dtList;
00044   
00046   ProbeSG *the_SG_Probe;
00047   
00049   ExponentialDETimeRndGen MsgInterarrTimeGen;
00050   
00051 public:
00052   
00054   static void setup(ParamManager *Param, GlobalProbeManager *Results);
00055   
00057   void Initialize();
00058   
00060   DevPktGen(SysSAloha *_System, DevAP* theAP);
00061 
00063   ~DevPktGen();
00064 
00066   virtual const char *Type() const
00067   {
00068     return "DevPktGen";
00069   };
00070 
00072   void HEv_PktGen_Generation();
00073 
00075   void RemoveTerminal(DevPkt* dt);
00076   
00078   void AddBacklogged();
00079 };
00080 
00081 // *****************************************************************************
00082 // **  Events
00083 
00085 
00089 class Ev_PktGen_Generation : public DEEvent
00090 {
00091 protected:
00092   DevPktGen* target;
00093   
00094 public:
00095     Ev_PktGen_Generation(DevPktGen* _target)
00096     : DEEvent(), target(_target)
00097   {};
00098   
00099   virtual const char *Type() const
00100   {
00101     return "Ev_PktGen_Generation";
00102   };
00103   
00104   void Handler() { target->HEv_PktGen_Generation(); };
00105   
00106   virtual void print(ostream &os) const
00107   {
00108     os << Time << ": " << setw(DBG_EV_WIDTH) << Type();
00109   };
00110 };
00111 
00112 
00113 #endif

Generated on Wed Dec 22 23:26:43 2004 for NePSing Slotted Aloha example by doxygen 1.3.9.1 ---- Hosted by SourceForge.net Logo