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 247 of file profile.h.

Constructor & Destructor Documentation

◆ PROF_COUNTER() [1/2]

PROF_COUNTER::PROF_COUNTER ( )
inline

Definition at line 250 of file profile.h.

◆ PROF_COUNTER() [2/2]

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

Definition at line 256 of file profile.h.

Member Function Documentation

◆ Count()

unsigned long long PROF_COUNTER::Count ( ) const
inline

Definition at line 262 of file profile.h.

References m_count.

◆ operator++()

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

Definition at line 272 of file profile.h.

References m_count.

◆ Reset()

void PROF_COUNTER::Reset ( )
inline

Definition at line 267 of file profile.h.

References m_count.

◆ Show()

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

Definition at line 277 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 288 of file profile.h.

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

◆ m_name

std::string PROF_COUNTER::m_name
private

Definition at line 287 of file profile.h.

Referenced by Show().


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