Panda3D
Public Member Functions | Static Public Member Functions

UpdateSeq Class Reference

This is a sequence number that increments monotonically. More...

#include "updateSeq.h"

List of all members.

Public Member Functions

 UpdateSeq ()
 Creates an UpdateSeq in the 'initial' state.
 UpdateSeq (const UpdateSeq &copy)
void clear ()
 Resets the UpdateSeq to the 'initial' state.
bool is_fresh () const
 Returns true if the UpdateSeq is in the 'fresh' 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_special () const
 Returns true if the UpdateSeq is in any special states, i.e.
bool operator!= (const UpdateSeq &other) const
UpdateSeq operator++ (int)
UpdateSeq operator++ ()
bool operator< (const UpdateSeq &other) const
bool operator<= (const UpdateSeq &other) const
UpdateSeqoperator= (const UpdateSeq &copy)
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.
static UpdateSeq initial ()
 Returns an UpdateSeq in the 'initial' state.
static UpdateSeq old ()
 Returns an UpdateSeq in the 'old' state.

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.

Definition at line 43 of file updateSeq.h.


Constructor & Destructor Documentation

UpdateSeq::UpdateSeq ( ) [inline]

Creates an UpdateSeq in the 'initial' state.

Definition at line 22 of file updateSeq.I.

Referenced by initial().


Member Function Documentation

void UpdateSeq::clear ( ) [inline]

Resets the UpdateSeq to the 'initial' state.

Definition at line 87 of file updateSeq.I.

UpdateSeq UpdateSeq::fresh ( ) [inline, static]

Returns an UpdateSeq in the 'fresh' state.

Definition at line 54 of file updateSeq.I.

UpdateSeq UpdateSeq::initial ( ) [inline, static]

Returns an UpdateSeq in the 'initial' state.

Definition at line 32 of file updateSeq.I.

References UpdateSeq().

Referenced by PandaNode::PandaNode().

bool UpdateSeq::is_fresh ( ) const [inline]

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

Definition at line 119 of file updateSeq.I.

bool UpdateSeq::is_initial ( ) const [inline]

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

Definition at line 98 of file updateSeq.I.

bool UpdateSeq::is_old ( ) const [inline]

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

Definition at line 108 of file updateSeq.I.

bool UpdateSeq::is_special ( ) const [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.

UpdateSeq UpdateSeq::old ( ) [inline, static]

The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations