netxsimdg
Loading...
Searching...
No Matches
Nextsim::ScopedTimer Class Reference

A class providing a timer aware of the calling context. More...

#include <ScopedTimer.hpp>

Collaboration diagram for Nextsim::ScopedTimer:
Collaboration graph

Public Member Functions

 ScopedTimer (const std::string &name)
 Creates a scoped timer with a name.
 
void substitute (const std::string &newName)
 

Static Public Member Functions

static void setTimerAddress (Timer *timer)
 
static Timertimer ()
 Returns a reference to the underlying Timer.
 

Detailed Description

A class providing a timer aware of the calling context.

Definition at line 20 of file ScopedTimer.hpp.

Constructor & Destructor Documentation

◆ ScopedTimer() [1/2]

Nextsim::ScopedTimer::ScopedTimer ( )

Definition at line 13 of file ScopedTimer.cpp.

◆ ScopedTimer() [2/2]

Nextsim::ScopedTimer::ScopedTimer ( const std::string & name)

Creates a scoped timer with a name.

Definition at line 18 of file ScopedTimer.cpp.

◆ ~ScopedTimer()

Nextsim::ScopedTimer::~ScopedTimer ( )

Definition at line 20 of file ScopedTimer.cpp.

Member Function Documentation

◆ setTimerAddress()

void Nextsim::ScopedTimer::setTimerAddress ( Timer * timer)
static

Sets the address of the timer which provides the timing functions

Parameters
timerA pointer to an instance of the Timer class.

Definition at line 28 of file ScopedTimer.cpp.

◆ substitute()

void Nextsim::ScopedTimer::substitute ( const std::string & newName)

Substitutes the currently running timer with a new one with a different name.

Parameters
newNamethe name of the new timer

Definition at line 22 of file ScopedTimer.cpp.

◆ timer()

Timer & Nextsim::ScopedTimer::timer ( )
static

Returns a reference to the underlying Timer.

Definition at line 30 of file ScopedTimer.cpp.


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