1------------------------------------------------------------------------------ 2-- -- 3-- GNAT RUN-TIME COMPONENTS -- 4-- -- 5-- A D A . R E A L _ T I M E . T I M I N G _ E V E N T S -- 6-- -- 7-- S p e c -- 8-- -- 9-- Copyright (C) 2005-2019, Free Software Foundation, Inc. -- 10-- -- 11-- This specification is derived from the Ada Reference Manual for use with -- 12-- GNAT. The copyright notice above, and the license provisions that follow -- 13-- apply solely to the contents of the part following the private keyword. -- 14-- -- 15-- GNAT is free software; you can redistribute it and/or modify it under -- 16-- terms of the GNU General Public License as published by the Free Soft- -- 17-- ware Foundation; either version 3, or (at your option) any later ver- -- 18-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- 19-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- 20-- or FITNESS FOR A PARTICULAR PURPOSE. -- 21-- -- 22-- As a special exception under Section 7 of GPL version 3, you are granted -- 23-- additional permissions described in the GCC Runtime Library Exception, -- 24-- version 3.1, as published by the Free Software Foundation. -- 25-- -- 26-- You should have received a copy of the GNU General Public License and -- 27-- a copy of the GCC Runtime Library Exception along with this program; -- 28-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- 29-- <http://www.gnu.org/licenses/>. -- 30-- -- 31-- GNAT was originally developed by the GNAT team at New York University. -- 32-- Extensive contributions were provided by Ada Core Technologies Inc. -- 33-- -- 34------------------------------------------------------------------------------ 35 36with Ada.Finalization; 37 38package Ada.Real_Time.Timing_Events is 39 40 type Timing_Event is tagged limited private; 41 42 type Timing_Event_Handler 43 is access protected procedure (Event : in out Timing_Event); 44 45 procedure Set_Handler 46 (Event : in out Timing_Event; 47 At_Time : Time; 48 Handler : Timing_Event_Handler); 49 50 procedure Set_Handler 51 (Event : in out Timing_Event; 52 In_Time : Time_Span; 53 Handler : Timing_Event_Handler); 54 55 function Current_Handler 56 (Event : Timing_Event) return Timing_Event_Handler; 57 58 procedure Cancel_Handler 59 (Event : in out Timing_Event; 60 Cancelled : out Boolean); 61 62 function Time_Of_Event (Event : Timing_Event) return Time; 63 64private 65 66 type Timing_Event is new Ada.Finalization.Limited_Controlled with record 67 Timeout : Time := Time_First; 68 -- The time at which the user's handler should be invoked when the 69 -- event is "set" (i.e., when Handler is not null). 70 71 Handler : Timing_Event_Handler; 72 -- An access value designating the protected procedure to be invoked 73 -- at the Timeout time in the future. When this value is null the event 74 -- is said to be "cleared" and no timeout is processed. 75 end record; 76 77 overriding procedure Finalize (This : in out Timing_Event); 78 -- Finalization procedure is required to satisfy (RM D.15 (19/2)), which 79 -- says that the object must be cleared on finalization. 80 81end Ada.Real_Time.Timing_Events; 82