spot 2.16
Loading...
Searching...
No Matches
Public Member Functions | Protected Types | Protected Attributes | List of all members
spot::timer_map Class Reference

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

#include <spot/misc/timer.hh>

Collaboration diagram for spot::timer_map:

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.
 
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.
 
void reset_all ()
 Remove information about all timers.
 

Protected Types

typedef std::pair< spot::timer, int > item_type
 Timer + count pair.
 
typedef std::map< std::string, item_typetm_type
 Timer map type.
 

Protected Attributes

tm_type tm
 The map of named timers.
 

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

◆ item_type

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

Timer + count pair.

◆ tm_type

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

Timer map type.

Member Function Documentation

◆ cancel()

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.

References tm.

◆ empty()

bool spot::timer_map::empty ( ) const
inline

Whether there is no timer in the map.

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

References tm.

◆ print()

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

Format information about all timers in a table.

◆ reset_all()

void spot::timer_map::reset_all ( )
inline

Remove information about all timers.

References tm.

◆ start()

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.

References tm.

Referenced by spot::swarmed_bloemen< State, SuccIterator, StateHash, StateEqual >::setup(), and spot::swarmed_bloemen_ec< State, SuccIterator, StateHash, StateEqual >::setup().

◆ stop()

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

◆ timer()

const spot::timer & spot::timer_map::timer ( const std::string &  name) const
inline

Member Data Documentation

◆ tm

tm_type spot::timer_map::tm
protected

The map of named timers.

Referenced by cancel(), empty(), reset_all(), start(), stop(), and timer().


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

Please direct any question, comment, or bug report to the Spot mailing list at spot@lrde.epita.fr.
Generated on Fri Feb 27 2015 10:00:07 for spot by doxygen 1.9.8