Public Member Functions | |
CRecursionProtector () | |
Constructor. | |
virtual | ~CRecursionProtector () |
Virtual destructor. | |
virtual void | Enter () |
Increments an internal counter. | |
virtual void | Leave () |
Decrements an internal counter. | |
Classes | |
struct | CRecursionException |
Exception is raised when recursion is detected. More... |
Each object of CRecursionProtector class contains a counter, which is incremented by Enter() call and it is decremented by Leave() call. Initially, the counter value is equal to 0. As soon as the counter value exceeds 1, CrecursionException() is raised. This class is designed for work in one thread. If it is necessary to detect a recursion in a multi-threaded application, CThreadRecursionProtector class should be applied.
void Enter | ( | ) | [virtual] |
Increments an internal counter.
The function increments the recursion counter by 1. If the counter value becomes more than 1, the function will throws CRecursionException.
Reimplemented in CThreadRecursionProtector.
void Leave | ( | ) | [virtual] |
Decrements an internal counter.
The function decrements the recursion counter by 1. If the counter value becomes less than 0, CRecursionException() exception is thrown
Reimplemented in CThreadRecursionProtector.
Copyright Dapfor 2007-2009 | Generated on Wed Jul 7 03:24:43 2010 for MFCGrid by 1.5.5 |