0022749: Segfault in HashCode() of Standard_Transient
[occt.git] / src / Standard / Standard_Failure.cdl
1 -- File:        Standard_Failure.cdl
2 -- Created:     Thu Sep  5 17:21:09 1991
3 -- Author:      Philippe COICADAN
4 --              <phc@topsn1>
5 -- Revised      J.P. TIRAULT
6 --              New organization of standard Package (August 1992)
7 --                              
8 ---Copyright:    Matra Datavision 1991, 1992
9
10
11 class Failure from Standard inherits Transient from Standard 
12
13     ---Purpose: 
14     --   Forms the root of the entire exception hierarchy.
15
16 uses
17     CString from Standard,
18     OStream from Standard,
19     SStream from Standard
20
21 raises
22     NoSuchObject from Standard
23     
24 is
25
26     Create returns mutable Failure;
27         ---Purpose: 
28         --   Creates a status object of type "Failure".
29         ---Level: Advanced
30         ---C++: alias "Standard_EXPORT Standard_Failure (const Standard_Failure& f);"
31
32     Create (aString: CString) returns mutable Failure;
33         ---Purpose: 
34         --   Creates a status object of type "Failure".
35         ---Level: Advanced
36         ---C++: alias "Standard_EXPORT Standard_Failure& operator= (const Standard_Failure& f);"
37
38     Destroy(me:mutable);
39         ---Level: Advanced
40         ---C++: alias ~
41
42     Print (me; s: in out OStream);
43         ---Purpose: 
44         --   Prints on the stream <s> the exception name followed by 
45         --   the error message.
46         --  Level: Advanced
47         --  Warning:
48         --   The operator "OStream& operator<< (Standard_OStream&,
49         --                                      Handle(Standard_Failure)&)"
50         --   is implemented. (This operator uses the method Print)
51         --   
52         ---C++: alias operator<< 
53
54     GetMessageString (me) returns CString from Standard;
55         ---Purpose: Returns error message
56         ---C++: inline
57     
58     SetMessageString (me: mutable; aMessage: CString);
59         ---Purpose: Sets error message
60
61     Reraise (me: mutable);
62     Reraise (me: mutable; aMessage: CString);
63     Reraise (me: mutable; aReason: SStream);
64         ---Purpose: Reraises a caught exception and changes its error message.
65         ---Level: Advanced
66     
67     Raise (myclass; aMessage: CString  = "") ;
68         ---Purpose: Raises an exception of type "Failure" and associates
69         --          an error message to it. The message can be printed 
70         --          in an exception handler.
71         ---Level: Advanced
72         
73         
74     Raise (myclass; aReason: SStream) ;
75         ---Purpose: Raises an exception of type "Failure" and associates
76         --          an error message to it. The message can be constructed
77         --          at run-time.
78         ---Level: Advanced
79     
80     NewInstance(myclass; aMessage: CString) returns mutable Failure;
81         ---Purpose: Used to construct an instance of the exception object
82         --          as a handle. Shall be used to protect against possible
83         --          construction of exception object in C stack -- that is 
84         --          dangerous since some of methods require that object
85         --          was allocated dynamically.
86         
87     Jump (me);
88         ---Purpose: Used to throw CASCADE exception from C signal handler.
89         --          On platforms that do not allow throwing C++ exceptions 
90         --          from this handler (e.g. Linux), uses longjump to get to 
91         --          the current active signal handler, and only then is 
92         --          converted to C++ exception.
93         ---Level: Advanced, not for regular use
94     
95     Caught (myclass) returns mutable Failure raises NoSuchObject;
96         ---Purpose: Returns the last caught exception. 
97         --          Needed when exceptions are emulated by C longjumps,
98         --          in other cases is also provided for compatibility.
99
100     Throw (me) is virtual protected;
101         ---Purpose: Used only if standard C++ exceptions are used.
102         --          Throws exception of the same type as this by C++ throw,
103         --          and stores current object as last thrown exception,
104         --          to be accessible by method Caught()
105
106 fields
107     
108     myMessage: CString;
109     
110 end Failure from Standard;
111