Documentation


animal::Chrono Class Reference

#include <chrono.h>

List of all members.


Detailed Description

A Chronometers class.

This is useful to calculate the frame rate of an animation.

Definition at line 32 of file chrono.h.

Public Member Functions

 Chrono ()
 constructor

double reset ()
 stop and reset the chronometer

double stop ()
 stop chronometer

double go ()
 Start chronometer.

double get_time () const
 Give the time value of the chronometer (in seconds).

std::ostream & write (std::ostream &os) const
 Text output.


Static Public Member Functions

double get_system_time ()
 Give the system time (in seconds).

long get_system_second ()
 Give seconds of the system time (in seconds).

long get_system_microsecond ()
 Give milliseconds of the system time.


Private Attributes

double last_action_val
bool etat

Friends

std::ostream & operator<< (std::ostream &os, const Chrono &obj)
 Text output (operator <<).


Constructor & Destructor Documentation

animal::Chrono::Chrono  )  [inline]
 

constructor

Definition at line 55 of file chrono.h.

References etat, and last_action_val.


Member Function Documentation

long animal::Chrono::get_system_microsecond  )  [inline, static]
 

Give milliseconds of the system time.

Returns:
microseconds of the system time

Definition at line 144 of file chrono.h.

long animal::Chrono::get_system_second  )  [inline, static]
 

Give seconds of the system time (in seconds).

Returns:
seconds of the system time

Definition at line 133 of file chrono.h.

double animal::Chrono::get_system_time  )  [inline, static]
 

Give the system time (in seconds).

Returns:
system time (converted to double)

Definition at line 120 of file chrono.h.

Referenced by get_time(), and go().

double animal::Chrono::get_time  )  const [inline]
 

Give the time value of the chronometer (in seconds).

Returns:
Time value (converted to double)

Definition at line 104 of file chrono.h.

References etat, get_system_time(), and last_action_val.

Referenced by go(), reset(), stop(), and write().

double animal::Chrono::go  )  [inline]
 

Start chronometer.

Returns:
Time value of the chronometer just before it starts.

Definition at line 88 of file chrono.h.

References etat, get_system_time(), get_time(), and last_action_val.

double animal::Chrono::reset  )  [inline]
 

stop and reset the chronometer

Returns:
Time value of chronometer just before the reset.

Definition at line 61 of file chrono.h.

References etat, get_time(), and last_action_val.

double animal::Chrono::stop  )  [inline]
 

stop chronometer

Returns:
Time value of chronometer just after it stops.

Definition at line 73 of file chrono.h.

References etat, get_time(), and last_action_val.

std::ostream& animal::Chrono::write std::ostream &  os  )  const [inline]
 

Text output.

Definition at line 152 of file chrono.h.

References get_time().


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &  os,
const Chrono obj
[friend]
 

Text output (operator <<).

Definition at line 159 of file chrono.h.


Member Data Documentation

bool animal::Chrono::etat [private]
 

If etat==true, the chronometer is running and last_action_val is the system time value of the last "go".
If etat==false, the chronometer is stopped and last_action_val is the actual chronometre time value.

Definition at line 44 of file chrono.h.

Referenced by Chrono(), get_time(), go(), reset(), and stop().

double animal::Chrono::last_action_val [private]
 

last useful value (the meaning depends on the value of etat).

Definition at line 40 of file chrono.h.

Referenced by Chrono(), get_time(), go(), reset(), and stop().


The documentation for this class was generated from the following file:
Generated on Thu Dec 23 13:52:29 2004 by doxygen 1.3.6