OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm::perf::GatedTimer Struct Reference

#include <PerfTimers.hpp>

Collaboration diagram for openswmm::perf::GatedTimer:

Public Member Functions

 GatedTimer (double &a) noexcept
 Start a profiling-gated self-time interval on the current thread.
 
 ~GatedTimer () noexcept
 Add elapsed wall time excluding nested GatedTimer intervals.
 
 GatedTimer (const GatedTimer &)=delete
 Prevent copying an active GatedTimer scope.
 
GatedTimer & operator= (const GatedTimer &)=delete
 Prevent replacing an active GatedTimer scope by copy assignment.
 

Public Attributes

double * acc = nullptr
 
double outer = 0.0
 enclosing timer's tally, restored on close
 
std::chrono::steady_clock::time_point t0
 

Constructor & Destructor Documentation

◆ GatedTimer() [1/2]

openswmm::perf::GatedTimer::GatedTimer ( double & a)
inlineexplicitnoexcept

Start a profiling-gated self-time interval on the current thread.

When disabled, stores no accumulator and reads no clock. When enabled, saves the thread-local enclosing tally and starts a new one. Timers must nest lexically and be destroyed on the same thread.

Parameters
[in,out]aBorrowed seconds accumulator; must outlive this timer and be externally serialized if shared.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~GatedTimer()

openswmm::perf::GatedTimer::~GatedTimer ( )
inlinenoexcept

Add elapsed wall time excluding nested GatedTimer intervals.

No-op when disabled at construction. Restores parent thread-local tally including this full interval. Accumulator write is not atomic; overlapping timers on distinct threads need separate accumulators or synchronization.

◆ GatedTimer() [2/2]

openswmm::perf::GatedTimer::GatedTimer ( const GatedTimer & )
delete

Prevent copying an active GatedTimer scope.

A copied scope would duplicate ownership of timing/counter cleanup and is forbidden at compile time.

Here is the call graph for this function:

Member Function Documentation

◆ operator=()

GatedTimer & openswmm::perf::GatedTimer::operator= ( const GatedTimer & )
delete

Prevent replacing an active GatedTimer scope by copy assignment.

Scope state must be completed by its original object on the thread that created it.

Here is the call graph for this function:

Member Data Documentation

◆ acc

double* openswmm::perf::GatedTimer::acc = nullptr

◆ outer

double openswmm::perf::GatedTimer::outer = 0.0

enclosing timer's tally, restored on close

◆ t0

std::chrono::steady_clock::time_point openswmm::perf::GatedTimer::t0

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