CAST II Game Engine

   MAIN       FEATURES       SCREENSHOTS       FORUMS       MANUAL       DOWNLOADS       CONTACTS   
Units
Class Hierarchy
Classes, Interfaces and Objects
Types
Enumerations
Variables
Constants
Functions and Procedures
Identifiers

Unit Timer

Description

Timer unit

(C) 2006-2007 George "Mirage" Bakhtadze. www.casteng.com
The source code may be used under either MPL 1.1 or LGPL 2.1 license. See included license.txt file
Created: May 16, 2007
Unit contains base timer-related types and classes

Classes, Interfaces and Objects

NameDescription
Class TTimerTimer service class

Types

Overview

TEventID = Integer;
TInternalTimeUnit = Int64;
TRecurringEvent = record Delay, Time: TInternalTimeUnit; Delegate: TTimerDelegate; case Boolean of False: (MessageClass: CMessage); True: (EventID: Integer) end;
TSecond = TTimeUnit;
TTimeMark = record Signature: TFileSignature; ID: Integer; Stamp: TInternalTimeUnit; end;
TTimerDelegate = procedure(EventID: Integer; const ErrorDelta: TTimeUnit) of object;
TTimerEvent = record Time: TInternalTimeUnit; Delegate: TTimerDelegate; case Boolean of False: (MessageClass: CMessage); True: (EventID: Integer) end;
TTimerQueryFunc = function: TInternalTimeUnit of object;

Description

TEventID = Integer;

Type of recurring event identifiers

TInternalTimeUnit = Int64;

Type for timer internal time processing. Currently one tenth of millisecond.

TRecurringEvent = record Delay, Time: TInternalTimeUnit; Delegate: TTimerDelegate; case Boolean of False: (MessageClass: CMessage); True: (EventID: Integer) end;

Timer recurring event data structure.
Delay - delay between occurences of the event in TInternalTimeUnit units
Time - time of next occurence in TInternalTimeUnit units
Delegate - a function of TTimerDelegate which will be called when the event occurs. Nil for no call
MessageClass - class of message generated when the event occurs. Nil for no message
EventID - Some identification number to supply delegate with

TSecond = TTimeUnit;

Type for time measured in seconds

TTimeMark = record Signature: TFileSignature; ID: Integer; Stamp: TInternalTimeUnit; end;

Data structure containing the information necessary for correct measure of intervals

TTimerDelegate = procedure(EventID: Integer; const ErrorDelta: TTimeUnit) of object;

Methods of this type can be bound to timer events. EventID - identifies event (specified in SetEvent() call). ErrorDelta - delta time between time the event actually occured and scheduled event time.

TTimerEvent = record Time: TInternalTimeUnit; Delegate: TTimerDelegate; case Boolean of False: (MessageClass: CMessage); True: (EventID: Integer) end;

Timer event data structure.
Time - time of the event in TInternalTimeUnit units
Delegate - a function of TTimerDelegate which will be called when the event occurs. Nil for no call
MessageClass - class of message generated when the event occurs. Nil for no message
EventID - Some identification number to supply delegate with

TTimerQueryFunc = function: TInternalTimeUnit of object;

Timer query function type. Methods of this type can be used to query a custom implementation of timer. Should return time in TInternalTimeUnit units.

Constants

Overview

eIDNone = -1;
InternalUnitsInMillisecond = 10;

Description

eIDNone = -1;

Event ID corresponding to no event

InternalUnitsInMillisecond = 10;

Number of internal time units per millisecond

Last modified: Jan 6, 2010
Copyright (C) 2006-2010, casteng.com