dReal4
TimerGuard Class Reference

Pauses the passed timer object when the guard object is destructed (e.g. More...

#include </home/soonhokong/work/dreal4/dreal/util/timer.h>

Public Member Functions

 TimerGuard (Timer *timer, bool enabled, bool start_timer=true)
 Constructs the timer guard object with timer. More...
 
 TimerGuard (const TimerGuard &)=delete
 
 TimerGuard (TimerGuard &&)=delete
 
TimerGuardoperator= (const TimerGuard &)=delete
 
TimerGuardoperator= (TimerGuard &&)=delete
 
 ~TimerGuard ()
 Destructs the timer guard object. It pauses the embedded timer object.
 
void pause ()
 Pauses the embedded timer object.
 
void resume ()
 Resumes the embedded timer object.
 

Detailed Description

Pauses the passed timer object when the guard object is destructed (e.g.

going out of scope).

Constructor & Destructor Documentation

◆ TimerGuard()

TimerGuard ( Timer timer,
bool  enabled,
bool  start_timer = true 
)

Constructs the timer guard object with timer.

If enabled is false, this class does not do anything. If start_timer is true, starts the timer in the constructor. Otherwise, it does not start it and a user has to call resume() to start it.


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