ost::AtomicCounter(3)

πŸ“¦ version 1.8.1, in ubuntu jammy

πŸ’– 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 to 0.
  • 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