Repo-Init
 
Loading...
Searching...
No Matches
TrackPerformance Class Reference

#include <Performance.hpp>

Collaboration diagram for TrackPerformance:

Public Member Functions

 TrackPerformance (PerformanceTracker &tracker)
 
 ~TrackPerformance ()
 
 TrackPerformance (const TrackPerformance &)=delete
 
 TrackPerformance (TrackPerformance &&)=delete
 
TrackPerformanceoperator= (const TrackPerformance &)=delete
 
TrackPerformanceoperator= (TrackPerformance &&)=delete
 

Private Attributes

PerformanceTracker_tracker
 Reference to the PerformanceTracker object.
 

Detailed Description

RAII style wrapper for PerformanceTracker.

The TrackPerformance class is a RAII (Resource Acquisition Is Initialization) style wrapper for the PerformanceTracker class. It automatically starts the timer when constructed and stops the timer when destructed. This ensures that the timer is always stopped, even in case of exceptions or early returns. The class is non-copyable and non-movable to prevent unintended behavior.

Definition at line 51 of file Performance.hpp.

Constructor & Destructor Documentation

◆ TrackPerformance() [1/3]

TrackPerformance::TrackPerformance ( PerformanceTracker & tracker)
inlineexplicit

Constructs a new TrackPerformance object.

Parameters
[in]trackerThe PerformanceTracker object to track.

Definition at line 60 of file Performance.hpp.

60: _tracker(tracker) { _tracker.startTimer(); }
PerformanceTracker & _tracker
Reference to the PerformanceTracker object.
Here is the call graph for this function:

◆ ~TrackPerformance()

TrackPerformance::~TrackPerformance ( )
inline

Destructs the TrackPerformance object and stops the timer.

Definition at line 65 of file Performance.hpp.

Here is the call graph for this function:

◆ TrackPerformance() [2/3]

TrackPerformance::TrackPerformance ( const TrackPerformance & )
delete

◆ TrackPerformance() [3/3]

TrackPerformance::TrackPerformance ( TrackPerformance && )
delete

Member Function Documentation

◆ operator=() [1/2]

TrackPerformance & TrackPerformance::operator= ( const TrackPerformance & )
delete

◆ operator=() [2/2]

TrackPerformance & TrackPerformance::operator= ( TrackPerformance && )
delete

Member Data Documentation

◆ _tracker

PerformanceTracker& TrackPerformance::_tracker
private

Reference to the PerformanceTracker object.

Definition at line 53 of file Performance.hpp.


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