Panda3D
Public Member Functions | Static Public Member Functions | List of all members
UpdateSeq Class Reference

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. More...

Public Member Functions

 __init__ ()
 Creates an UpdateSeq in the 'initial' state. More...
 
 __init__ (const UpdateSeq copy)
 
 clear ()
 Resets the UpdateSeq to the 'initial' state. More...
 
AtomicAdjust::Integer getSeq ()
 Returns the internal integer value associated with the UpdateSeq. Useful for debugging only. More...
 
bool isFresh ()
 Returns true if the UpdateSeq is in the 'fresh' state. More...
 
bool isInitial ()
 Returns true if the UpdateSeq is in the 'initial' state. More...
 
bool isOld ()
 Returns true if the UpdateSeq is in the 'old' state. More...
 
bool isSpecial ()
 Returns true if the UpdateSeq is in any special states, i.e. 'initial', 'old', or 'fresh'. More...
 
bool operator!= (const UpdateSeq other)
 
UpdateSeq operator++ ()
 
UpdateSeq operator++ (int)
 
bool operator< (const UpdateSeq other)
 
bool operator<= (const UpdateSeq other)
 
UpdateSeq operator= (const UpdateSeq copy)
 
bool operator== (const UpdateSeq other)
 
bool operator> (const UpdateSeq other)
 
bool operator>= (const UpdateSeq other)
 
 output (Ostream out)
 

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...
 

Detailed Description

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.

Member Function Documentation

◆ __init__() [1/2]

__init__ ( )

Creates an UpdateSeq in the 'initial' state.

◆ __init__() [2/2]

__init__ ( const UpdateSeq  copy)

◆ clear()

clear ( )

Resets the UpdateSeq to the 'initial' state.

◆ fresh()

static UpdateSeq fresh ( )
static

Returns an UpdateSeq in the 'fresh' state.

◆ getSeq()

AtomicAdjust::Integer getSeq ( )

Returns the internal integer value associated with the UpdateSeq. Useful for debugging only.

◆ initial()

static UpdateSeq initial ( )
static

Returns an UpdateSeq in the 'initial' state.

◆ isFresh()

bool isFresh ( )

Returns true if the UpdateSeq is in the 'fresh' state.

◆ isInitial()

bool isInitial ( )

Returns true if the UpdateSeq is in the 'initial' state.

◆ isOld()

bool isOld ( )

Returns true if the UpdateSeq is in the 'old' state.

◆ isSpecial()

bool isSpecial ( )

Returns true if the UpdateSeq is in any special states, i.e. 'initial', 'old', or 'fresh'.

◆ old()

static UpdateSeq old ( )
static

Returns an UpdateSeq in the 'old' state.

◆ operator!=()

bool operator!= ( const UpdateSeq  other)

◆ operator++() [1/2]

UpdateSeq operator++ ( )

◆ operator++() [2/2]

UpdateSeq operator++ ( int  )

◆ operator<()

bool operator< ( const UpdateSeq  other)

◆ operator<=()

bool operator<= ( const UpdateSeq  other)

◆ operator=()

UpdateSeq operator= ( const UpdateSeq  copy)

◆ operator==()

bool operator== ( const UpdateSeq  other)

◆ operator>()

bool operator> ( const UpdateSeq  other)

◆ operator>=()

bool operator>= ( const UpdateSeq  other)

◆ output()

output ( Ostream  out)