Class: TTimeSource

Declaration: Clock.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

TDrivenTimeSource

Purpose:

An abstract base class that provides a source of time for the TSyncableClock framework.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Derived classes should try to provide a surrogate for their object and call the Initialize function in the derived class' constructor, to provide a better interface.

Concurrency:

Multithread safe.

Resource Use:

No special requirements.

Member Function: TTimeSource::~TTimeSource

virtual ~ TTimeSource ()

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: TTimeSource::Now

virtual void Now (TTime & theTime) const

Interface Category:

API.

Purpose:

Gets the current time for the time source.

Calling Context:

Called to determine the current time.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

This function must be consistent with the surrogate's Now function.

Member Function: TTimeSource::GetClockSurrogate

void GetClockSurrogate (TSyncableClockSurrogate & sur) const

Interface Category:

API.

Purpose:

Gets a TSyncableClockSurrogate that can be used to sync a TSyncableClock directly to a time source.

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: TTimeSource::TTimeSource

TTimeSource ()

Interface Category:

API.

Purpose:

Default constructor.

Calling Context:

Called by the stream-in operators and derived classes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TTimeSource::GetNextTime

virtual void GetNextTime (TTime & nextTime)

Interface Category:

API.

Purpose:

Gets next time that the time source must do work (fire a wakeup).

Calling Context:

Called by TSyncableClock framework.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

Should be overridden to determine when the next time work is needed to be done.

Member Function: TTimeSource::TickleWakeUps

virtual void TickleWakeUps (const TTime & newTime)

Interface Category:

API.

Purpose:

Called to fire any wakeups that are due.

Calling Context:

Called by a derived class.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

Should be called at extreme points when direct is changed too.

Member Function: TTimeSource::GetSharedHeap

TSharedMemoryHeap * GetSharedHeap () const

Interface Category:

API.

Purpose:

Gets the shared heap that the shared memory for the Syncable Clock framework uses.

Calling Context:

Called internally by the Clock framework, by some time source surrogates, and by time source derived classes.

Parameters:

Return Value:

The shared memory heap.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TTimeSource::Initialize

  1. void Initialize (const TLocalObjectInstance & instance, const TTimeSourceSurrogate & surrogate)
  2. void Initialize (const TLocalObjectInstance & instance)

Interface Category:

API.

Purpose:

  1. Initializes object with surrogate and name the time source.
  2. Initializes object and name the time source.

Calling Context:

  1. Called by derived class' constructors.
  2. Called by derived class' constructors.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

Must be called before time source is usable, and before any other functions.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.