Fawkes API Fawkes Development Version

fawkes::Watch Class Reference

This is a stop-watch. More...

#include <>>

List of all members.

Public Member Functions

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

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 31 of file watch.h.


Constructor & Destructor Documentation

fawkes::Watch::Watch ( Clock clock)

Constructor.

Parameters:
clockclock instance to use for measurement.

Definition at line 40 of file watch.cpp.

fawkes::Watch::~Watch ( ) [virtual]

Destructor.

Definition at line 51 of file watch.cpp.


Member Function Documentation

Time fawkes::Watch::clock_time ( )

Returns the current clock time.

Returns:
the current clock time

Definition at line 183 of file watch.cpp.

References fawkes::Clock::get_time().

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 123 of file watch.cpp.

References fawkes::Clock::get_time(), and fawkes::Time::set_time().

void fawkes::Watch::reset ( void  )

Reset time.

Definition at line 141 of file watch.cpp.

References fawkes::Clock::get_time(), and fawkes::Time::set_time().

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::Clock::get_time(), and fawkes::Time::set_time().

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 97 of file watch.cpp.

References fawkes::Clock::get_time(), and fawkes::Time::set_time().

Time fawkes::Watch::watch_time ( )

Returns the current watch time.

Returns:
the current watch time

Definition at line 153 of file watch.cpp.

References fawkes::Clock::get_time().


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends