type TkdInterruptPipe = class(TThread)
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.![]() | constructor Create (TkdInterruptInstance: TkdInterrupt); |
![]() | destructor Destroy; override; |
![]() | procedure Execute; override; |
![]() | constructor 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.
![]() | destructor 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.
![]() | procedure 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.