AutoTimer< Name, Scope > Class Template Reference

CPP API: mio::timing::AutoTimer< Name, Scope > Class Template Reference
mio::timing::AutoTimer< Name, Scope > Class Template Reference

Timer that automatically starts when it is created, and stops when it is destroyed. More...

#include <auto_timer.h>

Collaboration diagram for mio::timing::AutoTimer< Name, Scope >:

Public Member Functions

 AutoTimer ()
 Run the NamedTimer given by the template parameter(s) Name (and Scope). More...
 
 AutoTimer (AutoTimer &&)=delete
 
 AutoTimer (AutoTimer &)=delete
 
 AutoTimer (BasicTimer &timer)
 Run the given BasicTimer. Does not take ownership, so mind the timer's lifetime! More...
 
 ~AutoTimer ()
 

Private Attributes

BasicTimerm_timer
 Reference to the timer so it can be stopped in AutoTimer's destructor. More...
 

Detailed Description

template<StringLiteral Name, StringLiteral Scope = "">
class mio::timing::AutoTimer< Name, Scope >

Timer that automatically starts when it is created, and stops when it is destroyed.

Template Parameters
Name,ScopeThe name and scope of a NamedTimer. Do not set these if you want to use a BasicTimer.

Constructor & Destructor Documentation

◆ AutoTimer() [1/4]

template<StringLiteral Name, StringLiteral Scope = "">
mio::timing::AutoTimer< Name, Scope >::AutoTimer ( )
inline

Run the NamedTimer given by the template parameter(s) Name (and Scope).

◆ AutoTimer() [2/4]

template<StringLiteral Name, StringLiteral Scope = "">
mio::timing::AutoTimer< Name, Scope >::AutoTimer ( BasicTimer timer)
inline

Run the given BasicTimer. Does not take ownership, so mind the timer's lifetime!

◆ AutoTimer() [3/4]

template<StringLiteral Name, StringLiteral Scope = "">
mio::timing::AutoTimer< Name, Scope >::AutoTimer ( AutoTimer< Name, Scope > &  )
delete

◆ AutoTimer() [4/4]

template<StringLiteral Name, StringLiteral Scope = "">
mio::timing::AutoTimer< Name, Scope >::AutoTimer ( AutoTimer< Name, Scope > &&  )
delete

◆ ~AutoTimer()

template<StringLiteral Name, StringLiteral Scope = "">
mio::timing::AutoTimer< Name, Scope >::~AutoTimer ( )
inline

Member Data Documentation

◆ m_timer

template<StringLiteral Name, StringLiteral Scope = "">
BasicTimer& mio::timing::AutoTimer< Name, Scope >::m_timer
private

Reference to the timer so it can be stopped in AutoTimer's destructor.