ost::AtomicCounter(3)
π ost::AtomicCounter π
okay so bestie, welcome to ost::AtomicCounter β it lives in the Library Functions Manual section 3, and it's genuinely one of the most iconic little classes in GNU CommonC++.
β¨ NAME β¨
ost::AtomicCounter β the AtomicCounter class offers thread-safe manipulation of an integer counter. that's it, that's the whole vibe π
πΈ SYNOPSIS πΈ
#include <thread.h>
π¦ Public Member Functions π¦
AtomicCounter ()β Initialize an atomic counter to0.AtomicCounter (int value)β Initialize an atomic counter to a known value.~AtomicCounter ()β the destructor, she's just there, doing her thing πint operator++ (void)int operator-- (void)int operator+= (int change)int operator-= (int change)int operator+ (int change)int operator- (int change)int operator= (int value)bool operator! (void)operator int ()
π Detailed Description π
The AtomicCounter class offers thread-safe manipulation of an integer counter. no cap, that's the entire assignment and she ate π₯
These are commonly used for building thread-safe 'reference' counters for C++ classes. The AtomicCounter depends on the platform's support for 'atomic' integer operations, and can alternately substitute a 'mutex' if no atomic support exists. iykyk β she adapts to whatever the platform's giving her. π§
Author
Sean Cavanaugh sean@dimensionalrift.com
atomic counter operation. β
π Constructor & Destructor Documentation π
ost::AtomicCounter::AtomicCounter ()
Initialize an atomic counter to 0. starting from zero, main character energy from the jump π
ost::AtomicCounter::AtomicCounter (int value)
Initialize an atomic counter to a known value.
Parameters
valueβ initial value.
ost::AtomicCounter::~AtomicCounter ()
she's gone, she's resting, no notes π
π Member Function Documentation π
ost::AtomicCounter::operator int ()
bool ost::AtomicCounter::operator! (void)
int ost::AtomicCounter::operator+ (int change)
int ost::AtomicCounter::operator++ (void)
int ost::AtomicCounter::operator+= (int change)
int ost::AtomicCounter::operator- (int change)
int ost::AtomicCounter::operator-- (void)
int ost::AtomicCounter::operator-= (int change)
int ost::AtomicCounter::operator= (int value)
bestie these ones come with no extra description in the source, so there's literally nothing more to tell you β the signatures are the whole story, and we're keeping them exactly as they are. β¨
π Author π
Generated automatically by Doxygen for GNU CommonC++ from the source code. not a human typing this out at 3am, a robot, and honestly? slay π€π
and that's the whole page, bestie!! this little gem came to you from GNU CommonC++, dated Sun Dec 27 2020 β so she's a vintage queen, iconic behavior, periodt. π¦πΈπβ¨π
π¦ where this page comes from
- ubuntu jammy: libcommoncpp2-doc 1.8.1-10
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms