ircproxy The Ultimate Cyborg |
#include <Counter.h>
Use this class like:
Counter counter;
if (counter == 0)
To increment the counter, create an Increment object in a scope:
Increment increment(counter);
When increment is destructed, the counter will automatically be decremented again.
Definition at line 38 of file Counter.h.
Public Member Functions | |
Counter (void) | |
Constructor. | |
~Counter () | |
Destructor. | |
operator int () const | |
Automatic conversion to int. | |
Private Attributes | |
int | M_counter |
Non-zero when locked. | |
Friends | |
class | Increment |
Has direct access to M_counter. |
Counter::Counter | ( | void | ) | [inline] |
Counter::~Counter | ( | ) | [inline] |
Counter::operator int | ( | ) | const [inline] |
friend class Increment [friend] |
int Counter::M_counter [private] |
Non-zero when locked.
Definition at line 41 of file Counter.h.
Referenced by Increment::Increment(), operator int(), ~Counter(), and Increment::~Increment().
Copyright © 2005-2007 Carlo Wood. All rights reserved. |
---|