1------------------------------------------------------------------------------
2--                                                                          --
3--                            Matreshka Project                             --
4--                                                                          --
5--                          Ada Modeling Framework                          --
6--                                                                          --
7--                        Runtime Library Component                         --
8--                                                                          --
9------------------------------------------------------------------------------
10--                                                                          --
11-- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com>                --
12-- All rights reserved.                                                     --
13--                                                                          --
14-- Redistribution and use in source and binary forms, with or without       --
15-- modification, are permitted provided that the following conditions       --
16-- are met:                                                                 --
17--                                                                          --
18--  * Redistributions of source code must retain the above copyright        --
19--    notice, this list of conditions and the following disclaimer.         --
20--                                                                          --
21--  * Redistributions in binary form must reproduce the above copyright     --
22--    notice, this list of conditions and the following disclaimer in the   --
23--    documentation and/or other materials provided with the distribution.  --
24--                                                                          --
25--  * Neither the name of the Vadim Godunko, IE nor the names of its        --
26--    contributors may be used to endorse or promote products derived from  --
27--    this software without specific prior written permission.              --
28--                                                                          --
29-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS      --
30-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT        --
31-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR    --
32-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT     --
33-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,   --
34-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
35-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR   --
36-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF   --
37-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING     --
38-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS       --
39-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.             --
40--                                                                          --
41------------------------------------------------------------------------------
42--  $Revision: 2864 $ $Date: 2012-04-13 14:08:07 +0400 (Fri, 13 Apr 2012) $
43------------------------------------------------------------------------------
44with AMF.Internals.UML_Elements;
45with AMF.UML.Classifiers.Collections;
46with AMF.UML.Exception_Handlers;
47with AMF.UML.Executable_Nodes;
48with AMF.UML.Object_Nodes;
49with AMF.Visitors;
50
51package AMF.Internals.UML_Exception_Handlers is
52
53   type UML_Exception_Handler_Proxy is
54     limited new AMF.Internals.UML_Elements.UML_Element_Proxy
55       and AMF.UML.Exception_Handlers.UML_Exception_Handler with null record;
56
57   overriding function Get_Exception_Input
58    (Self : not null access constant UML_Exception_Handler_Proxy)
59       return AMF.UML.Object_Nodes.UML_Object_Node_Access;
60   --  Getter of ExceptionHandler::exceptionInput.
61   --
62   --  An object node within the handler body. When the handler catches an
63   --  exception, the exception token is placed in this node, causing the body
64   --  to execute.
65
66   overriding procedure Set_Exception_Input
67    (Self : not null access UML_Exception_Handler_Proxy;
68     To   : AMF.UML.Object_Nodes.UML_Object_Node_Access);
69   --  Setter of ExceptionHandler::exceptionInput.
70   --
71   --  An object node within the handler body. When the handler catches an
72   --  exception, the exception token is placed in this node, causing the body
73   --  to execute.
74
75   overriding function Get_Exception_Type
76    (Self : not null access constant UML_Exception_Handler_Proxy)
77       return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier;
78   --  Getter of ExceptionHandler::exceptionType.
79   --
80   --  The kind of instances that the handler catches. If an exception occurs
81   --  whose type is any of the classifiers in the set, the handler catches
82   --  the exception and executes its body.
83
84   overriding function Get_Handler_Body
85    (Self : not null access constant UML_Exception_Handler_Proxy)
86       return AMF.UML.Executable_Nodes.UML_Executable_Node_Access;
87   --  Getter of ExceptionHandler::handlerBody.
88   --
89   --  A node that is executed if the handler satisfies an uncaught exception.
90
91   overriding procedure Set_Handler_Body
92    (Self : not null access UML_Exception_Handler_Proxy;
93     To   : AMF.UML.Executable_Nodes.UML_Executable_Node_Access);
94   --  Setter of ExceptionHandler::handlerBody.
95   --
96   --  A node that is executed if the handler satisfies an uncaught exception.
97
98   overriding function Get_Protected_Node
99    (Self : not null access constant UML_Exception_Handler_Proxy)
100       return AMF.UML.Executable_Nodes.UML_Executable_Node_Access;
101   --  Getter of ExceptionHandler::protectedNode.
102   --
103   --  The node protected by the handler. The handler is examined if an
104   --  exception propagates to the outside of the node.
105
106   overriding procedure Set_Protected_Node
107    (Self : not null access UML_Exception_Handler_Proxy;
108     To   : AMF.UML.Executable_Nodes.UML_Executable_Node_Access);
109   --  Setter of ExceptionHandler::protectedNode.
110   --
111   --  The node protected by the handler. The handler is examined if an
112   --  exception propagates to the outside of the node.
113
114   overriding procedure Enter_Element
115    (Self    : not null access constant UML_Exception_Handler_Proxy;
116     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
117     Control : in out AMF.Visitors.Traverse_Control);
118   --  Dispatch call to corresponding subprogram of visitor interface.
119
120   overriding procedure Leave_Element
121    (Self    : not null access constant UML_Exception_Handler_Proxy;
122     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
123     Control : in out AMF.Visitors.Traverse_Control);
124   --  Dispatch call to corresponding subprogram of visitor interface.
125
126   overriding procedure Visit_Element
127    (Self     : not null access constant UML_Exception_Handler_Proxy;
128     Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
129     Visitor  : in out AMF.Visitors.Abstract_Visitor'Class;
130     Control  : in out AMF.Visitors.Traverse_Control);
131   --  Dispatch call to corresponding subprogram of iterator interface.
132
133end AMF.Internals.UML_Exception_Handlers;
134