Panda3D
|
This is a sequence number that increments monotonically. More...
#include "updateSeq.h"
Public Member Functions | |
UpdateSeq () | |
Creates an UpdateSeq in the 'initial' state. More... | |
UpdateSeq (const UpdateSeq ©) | |
void | clear () |
Resets the UpdateSeq to the 'initial' state. More... | |
AtomicAdjust::Integer | get_seq () const |
Returns the internal integer value associated with the UpdateSeq. More... | |
bool | is_fresh () const |
Returns true if the UpdateSeq is in the 'fresh' state. More... | |
bool | is_initial () const |
Returns true if the UpdateSeq is in the 'initial' state. More... | |
bool | is_old () const |
Returns true if the UpdateSeq is in the 'old' state. More... | |
bool | is_special () const |
Returns true if the UpdateSeq is in any special states, i.e. More... | |
bool | operator!= (const UpdateSeq &other) const |
UpdateSeq | operator++ () |
UpdateSeq | operator++ (int) |
bool | operator< (const UpdateSeq &other) const |
bool | operator<= (const UpdateSeq &other) const |
UpdateSeq & | operator= (const UpdateSeq ©) |
bool | operator== (const UpdateSeq &other) const |
bool | operator> (const UpdateSeq &other) const |
bool | operator>= (const UpdateSeq &other) const |
void | output (ostream &out) const |
Static Public Member Functions | |
static UpdateSeq | fresh () |
Returns an UpdateSeq in the 'fresh' state. More... | |
static UpdateSeq | initial () |
Returns an UpdateSeq in the 'initial' state. More... | |
static UpdateSeq | old () |
Returns an UpdateSeq in the 'old' state. More... | |
This is a sequence number that increments monotonically.
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 43 of file updateSeq.h.
|
inline |
|
inline |
Resets the UpdateSeq to the 'initial' state.
Definition at line 87 of file updateSeq.I.
References is_initial(), and AtomicAdjustDummyImpl::set().
Referenced by fresh().
|
inlinestatic |
Returns an UpdateSeq in the 'fresh' state.
Definition at line 54 of file updateSeq.I.
References clear(), AtomicAdjustDummyImpl::get(), AtomicAdjustDummyImpl::set(), and UpdateSeq().
Referenced by old().
|
inline |
Returns the internal integer value associated with the UpdateSeq.
Useful for debugging only.
Definition at line 274 of file updateSeq.I.
References AtomicAdjustDummyImpl::get().
Referenced by is_special().
|
inlinestatic |
Returns an UpdateSeq in the 'initial' state.
Definition at line 32 of file updateSeq.I.
References old(), and UpdateSeq().
Referenced by UpdateSeq().
|
inline |
Returns true if the UpdateSeq is in the 'fresh' state.
Definition at line 119 of file updateSeq.I.
References AtomicAdjustDummyImpl::get(), and is_special().
Referenced by is_old().
|
inline |
Returns true if the UpdateSeq is in the 'initial' state.
Definition at line 98 of file updateSeq.I.
References AtomicAdjustDummyImpl::get(), and is_old().
Referenced by clear().
|
inline |
Returns true if the UpdateSeq is in the 'old' state.
Definition at line 108 of file updateSeq.I.
References AtomicAdjustDummyImpl::get(), and is_fresh().
Referenced by is_initial().
|
inline |
Returns true if the UpdateSeq is in any special states, i.e.
'initial', 'old', or 'fresh'.
Definition at line 130 of file updateSeq.I.
References AtomicAdjustDummyImpl::compare_and_exchange(), AtomicAdjustDummyImpl::get(), and get_seq().
Referenced by is_fresh().
|
inlinestatic |
Returns an UpdateSeq in the 'old' state.
Definition at line 42 of file updateSeq.I.
References fresh().
Referenced by TextureAttrib::complete_pointers(), TextureAttrib::find_on_stage(), initial(), LODNode::is_any_shown(), TextureContext::mark_needs_reload(), IndexBufferContext::mark_unloaded(), VertexBufferContext::mark_unloaded(), and TextureContext::mark_unloaded().