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.
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.
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:
- TTime & theTime -Set to the current time.
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.
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:
- TTime & nextTime -Set to the next time that work needs to be done.
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:
- const TTime & newTime -The new time, to be compared to, to see if any wakeups are due.
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
- void Initialize (const TLocalObjectInstance & instance, const TTimeSourceSurrogate & surrogate)
- void Initialize (const TLocalObjectInstance & instance)
Interface Category:
API.
Purpose:
- Initializes object with surrogate and name the time source.
- Initializes object and name the time source.
Calling Context:
- Called by derived class' constructors.
- Called by derived class' constructors.
Parameters:
- const TLocalObjectInstance & instance -Name of the time source.
- const TTimeSourceSurrogate & surrogate -Surrogate to use for faster Now.
- const TLocalObjectInstance & instance -Name of the time source.
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.