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

This is a sequence number that increments monotonically. 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. 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. More...
 
bool operator != (const UpdateSeq other)
 
bool operator > (const UpdateSeq other)
 
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)
 
 output (Ostream out)
 

Static Public Member Functions

static UpdateSeq fresh ()
 
static UpdateSeq initial ()
 
static UpdateSeq old ()
 

Public Attributes

AtomicAdjust::Integer seq
 Returns the internal integer value associated with the UpdateSeq. 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

◆ getSeq()

AtomicAdjust::Integer getSeq ( )

Returns the internal integer value associated with the UpdateSeq.

Useful for debugging only.

◆ initial()

static UpdateSeq initial ( )
static

◆ 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

◆ operator !=()

bool operator != ( const UpdateSeq  other)

◆ operator >()

bool operator > ( const UpdateSeq  other)

◆ 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)

◆ output()

output ( Ostream  out)

Member Data Documentation

◆ seq

AtomicAdjust::Integer seq

Returns the internal integer value associated with the UpdateSeq.

Useful for debugging only.