0024512: clang++ compiler complains about extra semicolon
[occt.git] / src / Standard / Standard_ErrorHandler.cdl
1 -- Created on: 1992-09-28
2 -- Created by: Ramin BARRETO
3 -- Copyright (c) 1992-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
8 -- This library is free software; you can redistribute it and / or modify it
9 -- under the terms of the GNU Lesser General Public version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
17 class ErrorHandler from Standard
18
19 uses 
20     Failure from Standard,
21     Boolean from Standard,
22     Address from Standard,
23     PErrorHandler from Standard,
24     Type from Standard
25 is
26     Create returns ErrorHandler;
27         --- Purpose: Create a ErrorHandler (to be used with try{}catch(){}).
28         --           It uses the "setjmp" and "longjmp" routines. 
29         ---Level: Advanced
30     
31     Destroy(me: in out);
32         ---Purpose: Unlinks and checks if there is a raised exception.
33         ---C++: alias ~
34         ---Level: Advanced
35         
36     Unlink(me: in out);
37         ---Purpose: Removes handler from the handlers list
38         ---Level: Advanced
39     
40     Catches(me: in out; aType: Type) returns Boolean;
41         ---Purpose: Returns "True" if the caught exception has the same type 
42         --          or inherits from "aType"
43         ---Level: Advanced
44     
45     Label(me: in out) returns JmpBuf from Standard;
46         ---Purpose: Returns label for jump
47         ---C++: inline
48         ---C++: return &
49         ---Level: Advanced
50
51     Abort(myclass; theError : Failure) is private;
52     ---Purpose: A exception is raised but it is not yet caught.
53     --          So Abort the current function and transmit the exception
54     --          to "calling routines".
55     -- Warning: If no catch is prepared for this exception, it displays the
56     --          exception name and calls "exit(1)".
57     ---Level: Internal
58
59     Error(me) returns Failure;
60         ---Purpose: Returns the current Error.
61
62     LastCaughtError(myclass) returns Failure;
63         ---Purpose: Returns the caught exception.
64         --    
65         ---Level: Advanced
66     
67     Error(myclass; aError: Failure) is private;
68         ---Purpose: Set the Error which will be transmitted to "calling routines".
69         ---Level: Advanced
70     
71     IsInTryBlock(myclass) returns Boolean from  Standard;
72         ---Purpose: Test if the code is currently running in a try block
73         ---Level: Internal
74         
75     FindHandler(myclass; theStatus: HandlerStatus from Standard;
76                          theUnlink: Boolean       from Standard) 
77     returns PErrorHandler from Standard is private;
78         ---Purpose: Returns the current handler (Top in former implemntations)
79     
80 fields
81
82     myPrevious    : PErrorHandler from Standard;
83     myCaughtError : Failure from Standard;
84     myLabel       : JmpBuf from Standard;
85     myStatus      : HandlerStatus from Standard;
86     myThread      : ThreadId from Standard; 
87     myCallbackPtr : Address from Standard;
88
89 friends
90     class Failure,
91     class ErrorHandlerCallback
92     
93 end ErrorHandler from Standard;