0024530: TKMesh - remove unused package IntPoly
[occt.git] / src / Standard / Standard_ErrorHandlerCallback.cdl
1 -- Created on: 2006-04-13
2 -- Created by: Andrey BETENEV
3 -- Copyright (c) 2006-2014 OPEN CASCADE SAS
4 --
5 -- This file is part of Open CASCADE Technology software library.
6 --
7 -- This library is free software; you can redistribute it and / or modify it
8 -- under the terms of the GNU Lesser General Public version 2.1 as published
9 -- by the Free Software Foundation, with special exception defined in the file
10 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 -- distribution for complete text of the license and disclaimer of any warranty.
12 --
13 -- Alternatively, this file may be used under the terms of Open CASCADE
14 -- commercial license or contractual agreement.
15
16 deferred class ErrorHandlerCallback from Standard
17
18     ---Purpose: Defines a base class for callback objects that can be registered
19     --          in the OCC error handler (the class simulating C++ exceptions)
20     --          so as to be correctly destroyed when error handler is activated.
21     --
22     --          Note that this is needed only when Open CASCADE is compiled with
23     --          NO_CXX_EXCEPTION or OCC_CONVERT_SIGNALS options (i.e. on UNIX/Linux).
24     --          In that case, raising OCC exception and/or signal will not cause 
25     --          C++ stack unwinding and destruction of objects created in the stack.
26     --
27     --          This class is intended to protect critical objects and operations in 
28     --          the try {} catch {} block from being bypassed by OCC signal or exception.
29     --
30     --          Inherit your object from that class, implement DestroyCallback() function,
31     --          and call Register/Unregister in critical points.
32     --
33     --          Note that you must ensure that your object has life span longer than 
34     --          that of the try {} block in which it calls Register().
35
36 is
37
38     Initialize returns ErrorHandlerCallback;
39         ---Purpose: Empty constructor
40         ---C++: inline
41         
42     RegisterCallback (me: in out);
43         ---Purpose: Registers this callback object in the current error handler 
44         --          (if found).
45         ---C++: inline
46         
47     UnregisterCallback (me: in out);
48         ---Purpose: Unregisters this callback object from the error handler.
49         ---C++: inline
50         ---C++: alias "virtual Standard_EXPORT ~Standard_ErrorHandlerCallback ();"
51
52     DestroyCallback (me: in out) is deferred;
53         ---Purpose: The callback function to perform necessary callback action.
54         --          Called by the exception handler when it is being destroyed but 
55         --          still has this callback registered.
56
57 fields
58
59     myHandler:      Address from Standard; -- Pointer to the error handler
60     myPrev, myNext: Address from Standard; -- Pointers to the previous and next callback objects
61     
62 friends
63     class ErrorHandler
64     
65 end ErrorHandlerCallback;