Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

spot::timer_map Class Reference
[Miscellaneous helper algorithms]

A map of timer, where each timer has a name. More...

#include <misc/timer.hh>

List of all members.

Public Member Functions

void start (const std::string &name)
 Start a timer with name name.
void stop (const std::string &name)
 Stop timer name.
void cancel (const std::string &name)
 Cancel timer name.
const spot::timertimer (const std::string &name) const
 Return the timer name.
spot::timertimer (const std::string &name)
 Return the timer name.
bool empty () const
 Whether there is no timer in the map.
std::ostream & print (std::ostream &os) const
 Format information about all timers in a table.

Protected Types

typedef std::pair< spot::timer,
int > 
item_type
typedef std::map< std::string,
item_type
tm_type

Protected Attributes

tm_type tm


Detailed Description

A map of timer, where each timer has a name.

Timer_map also keeps track of the number of measures each timer has performed.


Member Typedef Documentation

typedef std::pair<spot::timer, int> spot::timer_map::item_type [protected]
 

typedef std::map<std::string, item_type> spot::timer_map::tm_type [protected]
 


Member Function Documentation

void spot::timer_map::cancel const std::string &  name  )  [inline]
 

Cancel timer name.

The timer must have been previously started with start().

This cancel only the current measure. (Previous measures recorded by the timer are preserved.) When a timer that has not done any measure is canceled, it is removed from the map.

bool spot::timer_map::empty  )  const [inline]
 

Whether there is no timer in the map.

If empty() return true, then either no timer where ever started, or all started timers were canceled without completing any measure.

std::ostream& spot::timer_map::print std::ostream &  os  )  const
 

Format information about all timers in a table.

void spot::timer_map::start const std::string &  name  )  [inline]
 

Start a timer with name name.

The timer is created if it did not exist already. Once started, a timer should be either stop()ed or cancel()ed.

void spot::timer_map::stop const std::string &  name  )  [inline]
 

Stop timer name.

The timer must have been previously started with start().

spot::timer& spot::timer_map::timer const std::string &  name  )  [inline]
 

Return the timer name.

const spot::timer& spot::timer_map::timer const std::string &  name  )  const [inline]
 

Return the timer name.


Member Data Documentation

tm_type spot::timer_map::tm [protected]
 


The documentation for this class was generated from the following file:
Please comment this page and report errors about it on the RefDocComments page.
Generated on Mon Jan 31 12:55:28 2005 for spot by doxygen 1.4.0