Class: TSystemClock

Declaration: LowLevelClock.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TClock

Inherited By:

None.

Purpose:

Provides the TClock interface for system timing services. TSystemClock provides fast performance for real-time based on the local system. It counts time from the boot of the system. It also provides functions for converting between TTime and the system-dependent TSystemTicks (GetTicksPerSecond, ConvertTicksToTime, and ConvertTimeToTicks). These conversion functions are needed for conversions between interrupt level code, which uses TSystemTicks, and task level code, which uses TTime.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

None.

Concurrency:

Multithread safe.

Resource Use:

No special requirements.

Member Function: TSystemClock::TSystemClock

  1. TSystemClock ()
  2. TSystemClock (const TSystemClock & theClock)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.

Calling Context:

  1. Called to instantiate an object.
  2. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

TSystemClock should always be very light weight and quick to instantiate.

Member Function: TSystemClock::~TSystemClock

virtual ~ TSystemClock ()

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:

Multithread safe.

Other Considerations:

None.

Member Function: TSystemClock::Now

virtual void Now (TTime & theTime) const

Interface Category:

API.

Purpose:

Gets the current time.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TSystemClock::DelayUntil

virtual void DelayUntil (const TTime & pointInTime)

Interface Category:

API.

Purpose:

Delays the calling thread until the pointInTime is current or in the past.

Calling Context:

Called directly by the thread that wants to delay.

Parameters:

Return Value:

None.

Exceptions:

The delay functions on TSystemClock unblock on any message received from the Interrupt Manager task. These delays will be fixed as soon as CommonPoint has ports. Until then, it throws TClockException::kUnsafeDelay if it receives a message other than its own. Do not use in the UI thread. Throws TClockException::kTTimeIsNaN if the pointInTime is a NaN.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TSystemClock::operator=

TSystemClock & operator =(const TSystemClock & aClock)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

Return Value:

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

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TSystemClock::GetClockSurrogate

virtual void GetClockSurrogate (TSyncableClockSurrogate & sur) const

Interface Category:

API.

Purpose:

Gets a clock surrogate for the SystemTimeSource: this acts the same as a TSystemClock.

Calling Context:

Called to get a clock surrogate to sync to for a TSyncableClock.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

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.