Thrill  0.1
ScopedMultiTimerSwitch Class Reference

Detailed Description

RAII Scoped MultiTimer switcher: switches the timer of a MultiTimer on construction and back to old one on destruction.

Definition at line 107 of file multi_timer.hpp.

+ Collaboration diagram for ScopedMultiTimerSwitch:

#include <multi_timer.hpp>

Public Member Functions

 ScopedMultiTimerSwitch (MultiTimer &timer, const char *new_timer)
 construct and timer to switch to More...
 
 ~ScopedMultiTimerSwitch ()
 change back timer to previous timer. More...
 

Protected Attributes

const char * previous_
 previous timer, used to switch back to on destruction More...
 
MultiTimertimer_
 reference to MultiTimer More...
 

Constructor & Destructor Documentation

◆ ScopedMultiTimerSwitch()

ScopedMultiTimerSwitch ( MultiTimer timer,
const char *  new_timer 
)

construct and timer to switch to

Definition at line 147 of file multi_timer.cpp.

References MultiTimer::start(), and ScopedMultiTimerSwitch::timer_.

◆ ~ScopedMultiTimerSwitch()

change back timer to previous timer.

Definition at line 153 of file multi_timer.cpp.

References ScopedMultiTimerSwitch::previous_, MultiTimer::start(), and ScopedMultiTimerSwitch::timer_.

Member Data Documentation

◆ previous_

const char* previous_
protected

previous timer, used to switch back to on destruction

Definition at line 121 of file multi_timer.hpp.

Referenced by ScopedMultiTimerSwitch::~ScopedMultiTimerSwitch().

◆ timer_


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