KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PROF_COUNTER Class Reference

A thread-safe event counter. More...

#include <profile.h>

Public Member Functions

 PROF_COUNTER ()
 
 PROF_COUNTER (const std::string &aName)
 
unsigned long long Count () const
 
void Reset ()
 
unsigned long long operator++ (int)
 
void Show (std::ostream &aStream=std::cerr)
 

Private Attributes

std::string m_name
 
std::atomic_ullong m_count
 

Detailed Description

A thread-safe event counter.

Definition at line 236 of file profile.h.

Constructor & Destructor Documentation

◆ PROF_COUNTER() [1/2]

PROF_COUNTER::PROF_COUNTER ( )
inline

Definition at line 239 of file profile.h.

◆ PROF_COUNTER() [2/2]

PROF_COUNTER::PROF_COUNTER ( const std::string &  aName)
inline

Definition at line 245 of file profile.h.

Member Function Documentation

◆ Count()

unsigned long long PROF_COUNTER::Count ( ) const
inline

Definition at line 251 of file profile.h.

References m_count.

◆ operator++()

unsigned long long PROF_COUNTER::operator++ ( int  )
inline

Definition at line 261 of file profile.h.

References m_count.

◆ Reset()

void PROF_COUNTER::Reset ( )
inline

Definition at line 256 of file profile.h.

References m_count.

◆ Show()

void PROF_COUNTER::Show ( std::ostream &  aStream = std::cerr)
inline

Definition at line 266 of file profile.h.

References m_count, and m_name.

Member Data Documentation

◆ m_count

std::atomic_ullong PROF_COUNTER::m_count
private

Definition at line 277 of file profile.h.

Referenced by Count(), operator++(), Reset(), and Show().

◆ m_name

std::string PROF_COUNTER::m_name
private

Definition at line 276 of file profile.h.

Referenced by Show().


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