24 #include "InvalidStateException.h"
27 namespace basic_types {
Timer(unsigned int timeout=0)
Generates a new Timer with the given timeout.
Definition: Timer.cpp:26
void setTimeout(unsigned int timeout)
Sets the timeout for this Timer.
Definition: Timer.cpp:34
Provides a timer, which can be started and used to measure elapsed time.
Definition: Timer.h:34
unsigned int timeout
Stores the timeout for "out of time"-checks.
Definition: Timer.h:106
bool running
Stores whether this timer was started at least once.
Definition: Timer.h:116
bool isRunning() const
Returns true iff the Timers start-method was called.
Definition: Timer.cpp:72
time_t startTime
Stores the starting time of this Timer.
Definition: Timer.h:111
double getElapsedTime() const
Returns the time elapsed since the Timer was started (in seconds).
Definition: Timer.cpp:50
bool isTimeoutSet() const
Returns true iff the timeout has a positive value.
Definition: Timer.cpp:38
virtual ~Timer()
Destroys this instance of a Timer.
Definition: Timer.cpp:28
time_t getStartTime() const
Returns the time when this Timer was started.
Definition: Timer.cpp:42
unsigned int getTimeout() const
Returns the timeout stored in this Timer.
Definition: Timer.cpp:30
shared_ptr< Timer > Timer_sp
Alias for a shared pointer to a Timer.
Definition: Timer.h:122
bool outOfTime() const
Returns true, iff the elapsed time is larger than the set timeout.
Definition: Timer.cpp:65
void start()
Starts the timer.
Definition: Timer.cpp:60