Class: TTimeStampState

Declaration: TimeStampState.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

None.

Purpose:

TTimeStampState is a concrete class that provides access to a time stamp. A pointer to a base time stamp is passed in as a constructor argument. Every object that needs a unique time stamp gets one by incrementing this global base time stamp. TTimeStampState increments the base time stamp whenever TTimeStampState::UpdateTimeStamp is invoked. After incrementing the base time stamp, UpdateTimeStamp copies the base time stamp's value to the TTimeStampState's local time stamp. Certain 2-D and 3-D state classes (TMatrixState, TMatrix3DState, and TClipState) use a TTimeStampState object to implement shared time stamps. These classes have a member function called GetSharedTimeStampState that returns a pointer to a communal TTimeStampState object. This TTimeStampState contains the shared time stamp, which is retrieved with GetTimeStamp. Shared time stamps are different from normal time stamps, because the latter are stored separately for each object in a hierarchy of states (such as a hierarchy of matrix states or a hierarchy of clip states). By contrast, a single shared time stamp is used by all the objects in the hierarchy of states. The shared time stamp is updated whenever any object in the hierarchy changes. To determine whether anything in the state hierarchy has changed, you need only query the shared time stamp, instead of having to traverse the hierarchy to see if individual objects' time stamps have changed. This strategy makes rendering more efficient. The shared time stamp should not be confused with the base time stamp. The base time stamp (an instance of TPseudoTimeStamp) is used by many different objects as a global source of unique time stamp values. The shared time stamp (an instance of TPseudoTimeStamp encapsulated in a TTimeStampState object) is used only by a certain set of objects in the same state hierarchy. Thus, an object that does not use this shared time stamp can still increment the base time stamp's value, without incrementing the shared time stamp. The shared time stamp only reflects changes to the base time stamp when the shared time stamp's UpdateTimeStamp function is invoked because this function itself increments the base time stamp and copies its value to the shared time stamp.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

None.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TTimeStampState::TTimeStampState

  1. TTimeStampState (TPseudoTimeStamp * timeStampBase)
  2. TTimeStampState (const TTimeStampState &)

Interface Category:

API.

Purpose:

  1. Constructor that takes a pointer to the global base time stamp used by all objects needing a unique time stamp value.
  2. Copy constructor.

Calling Context:

  1. Call this function directly.
  2. Called to copy an object. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTimeStampState::~TTimeStampState

virtual ~ TTimeStampState ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTimeStampState::GetTimeStamp

virtual TPseudoTimeStamp GetTimeStamp () const

Interface Category:

API.

Purpose:

Returns the unique (local) time stamp value represented by this object. The return value is zero if the UpdateTimeStamp function has never been called.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a TPseudoTimeStamp object that represents the unique time stored by this object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTimeStampState::UpdateTimeStamp

virtual void UpdateTimeStamp ()

Interface Category:

API.

Purpose:

Increments the global base time stamp object and stores the new time stamp as the unique, local time stamp represented by this object.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTimeStampState::operator=

TTimeStampState & operator =(const TTimeStampState &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Call this function by using the operator in an assignment statement.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.