1 #ifndef SAFE_ROLLER_CLASS
2 #define SAFE_ROLLER_CLASS
67 void safe_add(
int &to_change,
int addition);
Implements a thread-safe roller object.
int next_id()
returns a unique (per instance of this type) id.
void set_current(int new_current)
allows the current id to be manipulated.
safe_roller(int start_of_range=0, int end_of_range=MAXINT32)
Provides numbers between the start and end in a thread-safe way.
int current() const
returns the current id to be used; be careful!
A roller that's based on integers. This is the most common type so far.
#define MAXINT32
Maximum 32-bit integer value.
void safe_add(int &to_change, int addition)
thread-safe integer addition.