TrafficLightTimer.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /**
  2. * Copyright (c) 2012 committers of YAKINDU and others.
  3. * All rights reserved. This program and the accompanying materials
  4. * are made available under the terms of the Eclipse Public License v1.0
  5. * which accompanies this distribution, and is available at
  6. * http://www.eclipse.org/legal/epl-v10.html
  7. * Contributors:
  8. * m.muehlbrandt - initial API and implementation
  9. *
  10. */
  11. #ifndef TRAFFICLIGHTTIMER_H_
  12. #define TRAFFICLIGHTTIMER_H_
  13. #include <QObject>
  14. #include <QMap>
  15. #include "TimeEvent.h"
  16. #include "src-gen/sc_types.h"
  17. #include "src-gen/TrafficLightWaitingRequired.h"
  18. #include "src-gen/TrafficLightWaiting.h"
  19. class TrafficLightTimer: public QObject {
  20. Q_OBJECT
  21. public:
  22. TrafficLightTimer(TrafficLightWaiting *sc_handle);
  23. virtual ~TrafficLightTimer();
  24. void setTimer(const sc_eventid evid, const sc_integer time_ms,
  25. const sc_boolean periodic);
  26. void unsetTimer(const sc_eventid evid);
  27. public slots:
  28. void raiseTimeEvent(sc_eventid evid);
  29. private:
  30. QMap<sc_eventid, TimeEvent*> timerMap;
  31. TrafficLightWaiting *sc_handle;
  32. };
  33. #endif /* TRAFFICLIGHTTIMER_H_ */