1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
9 #ifndef anna_timex_Clock_hpp
10 #define anna_timex_Clock_hpp
12 #include <anna/timex/TimeEvent.hpp>
19 Clase base para los relojes. Se activa de forma periodica cada #getTimeout milisegundos.
23 class Clock : public TimeEvent {
28 @param name Nombre logico de este reloj.
29 @param timeout Periodo de activacion indicado en milisegundos.
31 Clock(const char* name, const Millisecond & timeout);
34 Devuelve una cadena con la informacion referente a este reloj.
35 \return Una cadena con la informacion referenta a este reloj.
37 std::string asString() const
39 std::string msg("Clock { ");
40 msg += TimeEvent::asString();
47 Metodo a reimplementar para establecer las acciones que se ejecutaran cada vez
48 que expire el tiempo asociado al reloj.
50 \return \em true si el reloj desea continuar recibiendo los pulsos periodicamente o
51 \em false en otro caso.
53 virtual bool tick() throw(RuntimeException) = 0;
58 void expire(Engine* timeController) throw(RuntimeException);