38 ptm = ::gmtime ( &rawtime );
44 : _state(TIMER_UNSET), _callback(callback), _timeout(timeout * 1000)
57 _state.setState(TIMER_CANCELLED);
64 _timeout = timeout * 1000;
65 _state.setState(TIMER_RESET);
71 _state.setState(TIMER_RESET);
77 _state.setState(TIMER_STOPPED);
82 return _timeout / 1000;
88 _state.setState(TIMER_RUNNING);
90 while (_state.ifState(TIMER_RUNNING) || _state.ifState(TIMER_STOPPED))
93 if(_state.ifState(TIMER_RUNNING))
97 _state.wait(_timeout);
110 if (_state.ifState(TIMER_RESET))
112 _state.setState(TIMER_RUNNING);
114 else if(!_state.ifState(TIMER_STOPPED))
117 _state.setState(TIMER_CANCELLED);
129 _timeout = _callback.
timeout(
this) * 1000;
130 _state.setState(TIMER_RUNNING);
135 _state.setState(TIMER_STOPPED);
143 _state.setState(TIMER_CANCELLED);