agpl_1.0.0_b5da3320/src/agpl-exceptions.ads

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--  Exceptions of general use across Agpl.
--  And type for storage of exceptions.

with Ada.Exceptions;

package Agpl.Exceptions is

   pragma Preelaborate;

   Unimplemented : exception;

   protected type Protected_Occurrence is

      --  Maybe a more general type with a queue of exceptions could be useful?

      procedure Check_And_Clear;
      --  Will raise any stored exception or null otherwise

      function Is_Set return Boolean;

      procedure Clear;
      --  Clear any stored exception without raising it

      procedure Store (E : Ada.Exceptions.Exception_Occurrence);

   private

      Occurrence : Ada.Exceptions.Exception_Occurrence;

   end Protected_Occurrence;

end Agpl.Exceptions;