Units
Class Hierarchy
Classes, Interfaces and Objects
Types
Enumerations
Variables
Constants
Functions and Procedures
Identifiers

Class TkdInterruptPipe

Unit

kdinterrupt

Declaration

type TkdInterruptPipe = class(TThread)

Description

Complementary class TkdInterruptPipe models the inter-spatial interrupt-bearing pipe between the GDD and the user-defined interrupt event handler. The class is constructively a CLX-based system thread initially fallen asleep and awakened by the GDD whenever a new hardware interrupt or a small group of frequent interrupts is generated. This is the time at that OnHwInterrupt event of the paternal instance of TkdInterrupt class is fired and the user-defined interrupt event handler established is run. Various interrupt-related data is also moves up to the user space to become accessible straight in a Kylix application via several statistical members of the paternal instance of TkdInterrupt class, such: as InterruptsGenerated, InterruptsDirected, InterruptLastTime, InterruptPreviousTime properties. The functional core of this class is accommodated in its Execute method overridden.

Methods

Overview

Publicconstructor Create (TkdInterruptInstance: TkdInterrupt);
Publicdestructor Destroy; override;
Protectedprocedure Execute; override;

Description

Publicconstructor Create (TkdInterruptInstance: TkdInterrupt);

TkdInterruptPipe redefines Create so that it requires the pointer to the paternal instance of TkdInterrupt class the pipe is modelled for. This is in order to bind these objects to each other to perform various callbacks needed to maintain the whole functionality up.

Publicdestructor Destroy; override;

TkdInterruptPipe redefines Destroy so that it signals about the pipe is about to be destroyed. This is in order for the paternal instance of TkdInterrupt class to determine the time at that it is safe to unregister itself. The signalling forces PreUnregisterResource method of the paternal instance to finish.

Protectedprocedure Execute; override;

Execute method implements the main functional code of the pipe in the user space. After creation the pipe enters the GDD to get the information about newly generated interrups. Till the next interrupt(s) is(are) generated, the pipe is staying fallen asleep. As soon as a new interrupt is generated, (or a small group of frequent interrupts are generated) the pipe is awakened by the GDD. The pipe then reads all the interrupt information especially prepared and throw it out to the user space. On the user level the pipe synchronously binds this information to the corresponding members of the paternal instance of TkdInterrupt class to make it available for an end-user application. Finally, the user-defined interrupt event handler currently established is run.