VLink  2.0.0
A high-performance communication middleware
vlink::CpuProfilerGuard Class Referencefinal

Scope guard that opens and closes a CpuProfiler active interval. More...

#include <cpu_profiler_guard.h>

Collaboration diagram for vlink::CpuProfilerGuard:

Public Member Functions

 CpuProfilerGuard (class CpuProfiler *profiler) noexcept
 Constructs the guard and opens the active interval on profiler. More...
 
 ~CpuProfilerGuard () noexcept
 Destructor; closes the active interval on the bound profiler. More...
 

Detailed Description

Scope guard that opens and closes a CpuProfiler active interval.

Calls CpuProfiler::begin in its constructor and CpuProfiler::end in its destructor. A null profiler pointer is accepted; both ends become no-ops in that case.

Constructor & Destructor Documentation

◆ CpuProfilerGuard()

vlink::CpuProfilerGuard::CpuProfilerGuard ( class CpuProfiler profiler)
explicitnoexcept

Constructs the guard and opens the active interval on profiler.

Parameters
profilerTarget profiler; nullptr disables both ends.

◆ ~CpuProfilerGuard()

vlink::CpuProfilerGuard::~CpuProfilerGuard ( )
noexcept

Destructor; closes the active interval on the bound profiler.


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