#include <updateSeq.h>
Public Member Functions | |
UpdateSeq () | |
Creates an UpdateSeq in the 'initial' state. | |
UpdateSeq (const UpdateSeq ©) | |
UpdateSeq & | operator= (const UpdateSeq ©) |
void | clear () |
Resets the UpdateSeq to the 'initial' state. | |
bool | is_initial () const |
Returns true if the UpdateSeq is in the 'initial' state. | |
bool | is_old () const |
Returns true if the UpdateSeq is in the 'old' state. | |
bool | is_fresh () const |
Returns true if the UpdateSeq is in the 'fresh' state. | |
bool | is_special () const |
Returns true if the UpdateSeq is in any special states, i.e. | |
bool | operator== (const UpdateSeq &other) const |
bool | operator!= (const UpdateSeq &other) const |
bool | operator< (const UpdateSeq &other) const |
bool | operator<= (const UpdateSeq &other) const |
UpdateSeq | operator++ () |
UpdateSeq | operator++ (int) |
void | output (ostream &out) const |
Static Public Member Functions | |
UpdateSeq | initial () |
Returns an UpdateSeq in the 'initial' state. | |
UpdateSeq | old () |
Returns an UpdateSeq in the 'old' state. | |
UpdateSeq | fresh () |
Returns an UpdateSeq in the 'fresh' state. | |
Private Types | |
enum | SpecialCases { SC_initial = 0, SC_old = 1, SC_fresh = ~0 } |
Private Attributes | |
unsigned int | _seq |
It can be used to track cache updates, or serve as a kind of timestamp for any changing properties.
A special class is used instead of simply an int, so we can elegantly handle such things as wraparound and special cases. There are two special cases. Firstly, a sequence number is 'initial' when it is first created. This sequence is older than any other sequence number. Secondly, a sequence number may be explicitly set to 'old'. This is older than any other sequence number except 'initial'. Finally, we have the explicit number 'fresh', which is newer than any other sequence number. All other sequences are numeric and are monotonically increasing.
Definition at line 64 of file updateSeq.h.
|
Definition at line 92 of file updateSeq.h. |
|
Creates an UpdateSeq in the 'initial' state.
Definition at line 32 of file updateSeq.I. References INLINE. |
|
Definition at line 87 of file updateSeq.I. References _seq, INLINE, and SC_initial. |
|
Resets the UpdateSeq to the 'initial' state.
Definition at line 113 of file updateSeq.I. |
|
Returns an UpdateSeq in the 'fresh' state.
Definition at line 73 of file updateSeq.I. |
|
Returns an UpdateSeq in the 'initial' state.
Definition at line 45 of file updateSeq.I. |
|
Returns true if the UpdateSeq is in the 'fresh' state.
Definition at line 156 of file updateSeq.I. |
|
Returns true if the UpdateSeq is in the 'initial' state.
Definition at line 128 of file updateSeq.I. References INLINE, SC_fresh, SC_initial, and SC_old. |
|
Returns true if the UpdateSeq is in the 'old' state.
Definition at line 141 of file updateSeq.I. |
|
Returns true if the UpdateSeq is in any special states, i.e. 'initial', 'old', or 'fresh'. Definition at line 171 of file updateSeq.I. |
|
Returns an UpdateSeq in the 'old' state.
Definition at line 58 of file updateSeq.I. |
|
Definition at line 203 of file updateSeq.I. |
|
Definition at line 265 of file updateSeq.I. |
|
Definition at line 246 of file updateSeq.I. References INLINE, and output(). Referenced by operator<(). |
|
Definition at line 215 of file updateSeq.I. References INLINE, and operator++(). |
|
Definition at line 234 of file updateSeq.I. |
|
Definition at line 99 of file updateSeq.I. References _seq, INLINE, and SC_initial. |
|
Definition at line 191 of file updateSeq.I. |
|
Definition at line 279 of file updateSeq.I. Referenced by operator++(). |
|
Definition at line 98 of file updateSeq.h. Referenced by clear(), fresh(), initial(), is_fresh(), is_special(), old(), operator!=(), operator<=(), operator=(), and UpdateSeq(). |