gloox  1.0.28
Public Member Functions | List of all members
AtomicRefCount Class Reference

#include <atomicrefcount.h>

Public Member Functions

 AtomicRefCount ()
 
int increment ()
 
int decrement ()
 
void reset ()
 

Detailed Description

A simple implementation of a thread safe 32-bit reference count. Native functions are used where possible. When not available, a mutex is used for locking and unlocking.

Author
Daniel Bowen
Jakob Schröter js@ca.nosp@m.maya.nosp@m..net
Since
1.0.1

Definition at line 34 of file atomicrefcount.h.

Constructor & Destructor Documentation

◆ AtomicRefCount()

Contructs a new atomic reference count.

Definition at line 37 of file atomicrefcount.cpp.

Member Function Documentation

◆ decrement()

int decrement ( )

Decrements the reference count, and returns the new value.

Returns
The new value.

Definition at line 58 of file atomicrefcount.cpp.

◆ increment()

int increment ( )

Increments the reference count, and returns the new value.

Returns
The new value.

Definition at line 42 of file atomicrefcount.cpp.

◆ reset()

void reset ( )

Resets the reference count to zero.

Since
1.0.4

Definition at line 74 of file atomicrefcount.cpp.


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