Fawkes API  Fawkes Development Version
fawkes::Watch Class Reference

#include <>>

Public Member Functions

 Watch (Clock *clock)
 Constructor. More...
 
virtual ~Watch ()
 Destructor. More...
 
void start (Time *t=0)
 Starts the watch. More...
 
void stop (Time *t=0)
 Stops the watch. More...
 
void pause (Time *t=0)
 Pauses the watch. More...
 
void reset ()
 Reset time. More...
 
Time watch_time ()
 Returns the current watch time. More...
 
Time clock_time ()
 Returns the current clock time. More...
 

Detailed Description

This is a stop-watch. Also, one can request the current time from the clock. Every watch counts time w.r.t. a certain time source.

Author
Daniel Beck

Definition at line 35 of file watch.h.

Constructor & Destructor Documentation

◆ Watch()

fawkes::Watch::Watch ( Clock clock)

Constructor.

Parameters
clockclock instance to use for measurement.

Definition at line 43 of file watch.cpp.

◆ ~Watch()

fawkes::Watch::~Watch ( )
virtual

Destructor.

Definition at line 52 of file watch.cpp.

References fawkes::Clock::get_time().

Member Function Documentation

◆ clock_time()

Time fawkes::Watch::clock_time ( )

Returns the current clock time.

Returns
the current clock time

Definition at line 169 of file watch.cpp.

◆ pause()

void fawkes::Watch::pause ( Time t = 0)

Pauses the watch.

Puts the watch into pause mode

Parameters
tthe time at which the watch is started is written to this time object

Definition at line 116 of file watch.cpp.

References fawkes::Time::set_time().

◆ reset()

void fawkes::Watch::reset ( void  )

Reset time.

Definition at line 134 of file watch.cpp.

◆ start()

void fawkes::Watch::start ( Time t = 0)

Starts the watch.

This starts the watch. In case it is paused, currently, the watch is restarted

Parameters
tthe time at which the watch is started is written to this time object

Definition at line 62 of file watch.cpp.

References fawkes::Time::set_time().

◆ stop()

void fawkes::Watch::stop ( Time t = 0)

Stops the watch.

This stops the watch also when it is paused, currently

Parameters
tthe time at which the watch is started is written to this time object

Definition at line 92 of file watch.cpp.

References fawkes::Time::set_time().

◆ watch_time()

Time fawkes::Watch::watch_time ( )

Returns the current watch time.

Returns
the current watch time

Definition at line 145 of file watch.cpp.


The documentation for this class was generated from the following files: