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.
- TSystemClock ()
- TSystemClock (const TSystemClock & theClock)
Interface Category:
API.
Purpose:
- Default constructor.
- Copy constructor.
Calling Context:
- Called to instantiate an object.
- Called to copy an object.
Parameters:
- Takes no parameters.
- const TSystemClock & theClock -The system clock to be copied.
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.
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.
virtual void Now (TTime & theTime) const
Interface Category:
API.
Purpose:
Gets the current time.
Calling Context:
Call this function directly.
Parameters:
- TTime & theTime -theTime is set to the current time.
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:
- const TTime & pointInTime -The point in time that the calling thread delays until it is current or past.
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:
- const TSystemClock & aClock -The clock to be assigned to this.
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.