• Main Page
  • Classes
  • Files
  • File List

ExternalEventGenerator.h

00001 /*
00002  * ExternalEventGenerator.h
00003  *
00004  *  Created on: Jul 24, 2012
00005  *      Author: dejan
00006  */
00007 
00008 #ifndef EXTERNALEVENTGENERATOR_H_
00009 #define EXTERNALEVENTGENERATOR_H_
00010 
00011 #include "EvSimObject.h"
00012 #include "EvSimObjectTypeUtils.h"
00013 #include "DirectEventSender.h"
00014 
00015 class ExternalEventGenerator : public EvSimObject, public DirectEventSender {
00016 
00017         EV_SIM_OBJECT( ExternalEventGenerator )
00018 
00019 public:
00020         ExternalEventGenerator(unsigned  num_out_ports) : num_out_ports(num_out_ports) {};
00021         virtual ~ExternalEventGenerator();
00022 
00023         virtual unsigned numOutputPorts() const
00024         {
00025                 return num_out_ports;
00026         };
00027 
00028         virtual PortType getOutputPortType(port_id_t p) const
00029         {
00030                 if (p < num_out_ports)
00031                         return eventPortDirect;
00032                 return portUndefined;
00033         };
00034 
00035         virtual void reset(SimContext &sim_ctxt)
00036         {
00037                 this->sim_ctxt = sim_ctxt;
00038         };
00039 
00040 
00041         virtual void generateEvent(port_id_t out_port, Time time);
00042 
00043         virtual void generateEvent(port_id_t out_port);
00044 
00045 protected:
00046         SimContext sim_ctxt;
00047         unsigned num_out_ports;
00048 };
00049 
00050 #endif /* EXTERNALEVENTGENERATOR_H_ */

Generated on Wed Sep 18 2013 11:25:40 for NEVESIM by  doxygen 1.7.1