• Main Page
  • Classes
  • Files
  • File List

EvSimRegularClock.h

00001 #ifndef EVSIMRegularCLOCK_H_
00002 #define EVSIMRegularCLOCK_H_
00003 
00004 #include "EvSimObject.h"
00005 #include "DirectEventSender.h"
00006 #include "SimContext.h"
00007 #include "EvSimObjectTypeUtils.h"
00008 
00009 class EvSimRegularClock : public EvSimObject, public DirectEventSender {
00010 
00011         EV_SIM_OBJECT( EvSimRegularClock )
00012 
00013 public:
00014 
00015         EvSimRegularClock(Time tic_interval = 1e-3,
00016                                   bool isActive = true,
00017                                   Time start_time = 0,
00018                                   Time end_time = MAX_TIME);
00019 
00020         virtual ~EvSimRegularClock();
00021 
00022         bool isActive;
00023 
00024         Time end_time;
00025 
00026         virtual void reset(SimContext &sim_ctxt);
00027 
00028         virtual void eventHit(SimContext &sim_ctxt, Time time, port_id_t port);
00029 
00030         virtual unsigned numOutputPorts() const
00031         {
00032                 return 2;
00033         }
00034 
00035         virtual EvSimObject::PortType outputPortType(port_id_t p) const
00036         {
00037                 if (p == 0 || p == 1)
00038                         return EvSimObject::eventPortDirect;
00039                 return EvSimObject::portUndefined;
00040         }
00041 
00042         void setTickInterval(Time tic_interval)
00043         {
00044                 this->tic_interval = tic_interval;
00045         }
00046 
00047         virtual void postAddedInNetwork(EvSimNetwork &net, EvSimObject::ID self);
00048 
00049 protected:
00050         Time tic_interval;
00051         Time start_time;
00052 };
00053 
00054 
00055 #endif /* EVSIMRegularCLOCK_H_ */

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