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: 2967 $ $Date: 2012-05-12 10:21:56 +0400 (Sat, 12 May 2012) $
43------------------------------------------------------------------------------
44with AMF.Internals.UML_Multiplicity_Elements;
45with AMF.Internals.UML_Named_Elements;
46with AMF.UML.Actions;
47with AMF.UML.Activities;
48with AMF.UML.Connectable_Element_Template_Parameters;
49with AMF.UML.Connector_Ends.Collections;
50with AMF.UML.Dependencies.Collections;
51with AMF.UML.Multiplicity_Elements;
52with AMF.UML.Named_Elements;
53with AMF.UML.Namespaces;
54with AMF.UML.Packages.Collections;
55with AMF.UML.Parameterable_Elements;
56with AMF.UML.String_Expressions;
57with AMF.UML.Structured_Activity_Nodes;
58with AMF.UML.Template_Parameters;
59with AMF.UML.Types;
60with AMF.UML.Variables;
61with AMF.Visitors;
62
63package AMF.Internals.UML_Variables is
64
65   package UML_Multiplicity_Elements is
66     new AMF.Internals.UML_Multiplicity_Elements
67          (AMF.Internals.UML_Named_Elements.UML_Named_Element_Proxy);
68
69   type UML_Variable_Proxy is
70     limited new UML_Multiplicity_Elements.UML_Multiplicity_Element_Proxy
71       and AMF.UML.Variables.UML_Variable with null record;
72
73   overriding function Get_Activity_Scope
74    (Self : not null access constant UML_Variable_Proxy)
75       return AMF.UML.Activities.UML_Activity_Access;
76   --  Getter of Variable::activityScope.
77   --
78   --  An activity that owns the variable.
79
80   overriding procedure Set_Activity_Scope
81    (Self : not null access UML_Variable_Proxy;
82     To   : AMF.UML.Activities.UML_Activity_Access);
83   --  Setter of Variable::activityScope.
84   --
85   --  An activity that owns the variable.
86
87   overriding function Get_Scope
88    (Self : not null access constant UML_Variable_Proxy)
89       return AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access;
90   --  Getter of Variable::scope.
91   --
92   --  A structured activity node that owns the variable.
93
94   overriding procedure Set_Scope
95    (Self : not null access UML_Variable_Proxy;
96     To   : AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access);
97   --  Setter of Variable::scope.
98   --
99   --  A structured activity node that owns the variable.
100
101   overriding function Get_End
102    (Self : not null access constant UML_Variable_Proxy)
103       return AMF.UML.Connector_Ends.Collections.Ordered_Set_Of_UML_Connector_End;
104   --  Getter of ConnectableElement::end.
105   --
106   --  Denotes a set of connector ends that attaches to this connectable
107   --  element.
108
109   overriding function Get_Template_Parameter
110    (Self : not null access constant UML_Variable_Proxy)
111       return AMF.UML.Connectable_Element_Template_Parameters.UML_Connectable_Element_Template_Parameter_Access;
112   --  Getter of ConnectableElement::templateParameter.
113   --
114   --  The ConnectableElementTemplateParameter for this ConnectableElement
115   --  parameter.
116
117   overriding procedure Set_Template_Parameter
118    (Self : not null access UML_Variable_Proxy;
119     To   : AMF.UML.Connectable_Element_Template_Parameters.UML_Connectable_Element_Template_Parameter_Access);
120   --  Setter of ConnectableElement::templateParameter.
121   --
122   --  The ConnectableElementTemplateParameter for this ConnectableElement
123   --  parameter.
124
125   overriding function Get_Type
126    (Self : not null access constant UML_Variable_Proxy)
127       return AMF.UML.Types.UML_Type_Access;
128   --  Getter of TypedElement::type.
129   --
130   --  The type of the TypedElement.
131   --  This information is derived from the return result for this Operation.
132
133   overriding procedure Set_Type
134    (Self : not null access UML_Variable_Proxy;
135     To   : AMF.UML.Types.UML_Type_Access);
136   --  Setter of TypedElement::type.
137   --
138   --  The type of the TypedElement.
139   --  This information is derived from the return result for this Operation.
140
141   overriding function Get_Client_Dependency
142    (Self : not null access constant UML_Variable_Proxy)
143       return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency;
144   --  Getter of NamedElement::clientDependency.
145   --
146   --  Indicates the dependencies that reference the client.
147
148   overriding function Get_Name_Expression
149    (Self : not null access constant UML_Variable_Proxy)
150       return AMF.UML.String_Expressions.UML_String_Expression_Access;
151   --  Getter of NamedElement::nameExpression.
152   --
153   --  The string expression used to define the name of this named element.
154
155   overriding procedure Set_Name_Expression
156    (Self : not null access UML_Variable_Proxy;
157     To   : AMF.UML.String_Expressions.UML_String_Expression_Access);
158   --  Setter of NamedElement::nameExpression.
159   --
160   --  The string expression used to define the name of this named element.
161
162   overriding function Get_Namespace
163    (Self : not null access constant UML_Variable_Proxy)
164       return AMF.UML.Namespaces.UML_Namespace_Access;
165   --  Getter of NamedElement::namespace.
166   --
167   --  Specifies the namespace that owns the NamedElement.
168
169   overriding function Get_Qualified_Name
170    (Self : not null access constant UML_Variable_Proxy)
171       return AMF.Optional_String;
172   --  Getter of NamedElement::qualifiedName.
173   --
174   --  A name which allows the NamedElement to be identified within a
175   --  hierarchy of nested Namespaces. It is constructed from the names of the
176   --  containing namespaces starting at the root of the hierarchy and ending
177   --  with the name of the NamedElement itself.
178
179   overriding function Get_Owning_Template_Parameter
180    (Self : not null access constant UML_Variable_Proxy)
181       return AMF.UML.Template_Parameters.UML_Template_Parameter_Access;
182   --  Getter of ParameterableElement::owningTemplateParameter.
183   --
184   --  The formal template parameter that owns this element.
185
186   overriding procedure Set_Owning_Template_Parameter
187    (Self : not null access UML_Variable_Proxy;
188     To   : AMF.UML.Template_Parameters.UML_Template_Parameter_Access);
189   --  Setter of ParameterableElement::owningTemplateParameter.
190   --
191   --  The formal template parameter that owns this element.
192
193   overriding function Get_Template_Parameter
194    (Self : not null access constant UML_Variable_Proxy)
195       return AMF.UML.Template_Parameters.UML_Template_Parameter_Access;
196   --  Getter of ParameterableElement::templateParameter.
197   --
198   --  The template parameter that exposes this element as a formal parameter.
199
200   overriding procedure Set_Template_Parameter
201    (Self : not null access UML_Variable_Proxy;
202     To   : AMF.UML.Template_Parameters.UML_Template_Parameter_Access);
203   --  Setter of ParameterableElement::templateParameter.
204   --
205   --  The template parameter that exposes this element as a formal parameter.
206
207   overriding function Is_Accessible_By
208    (Self : not null access constant UML_Variable_Proxy;
209     A : AMF.UML.Actions.UML_Action_Access)
210       return Boolean;
211   --  Operation Variable::isAccessibleBy.
212   --
213   --  The isAccessibleBy() operation is not defined in standard UML.
214   --  Implementations should define it to specify which actions can access a
215   --  variable.
216
217   overriding function Ends
218    (Self : not null access constant UML_Variable_Proxy)
219       return AMF.UML.Connector_Ends.Collections.Set_Of_UML_Connector_End;
220   --  Operation ConnectableElement::end.
221   --
222   --  Missing derivation for ConnectableElement::/end : ConnectorEnd
223
224   overriding function All_Owning_Packages
225    (Self : not null access constant UML_Variable_Proxy)
226       return AMF.UML.Packages.Collections.Set_Of_UML_Package;
227   --  Operation NamedElement::allOwningPackages.
228   --
229   --  The query allOwningPackages() returns all the directly or indirectly
230   --  owning packages.
231
232   overriding function Is_Distinguishable_From
233    (Self : not null access constant UML_Variable_Proxy;
234     N : AMF.UML.Named_Elements.UML_Named_Element_Access;
235     Ns : AMF.UML.Namespaces.UML_Namespace_Access)
236       return Boolean;
237   --  Operation NamedElement::isDistinguishableFrom.
238   --
239   --  The query isDistinguishableFrom() determines whether two NamedElements
240   --  may logically co-exist within a Namespace. By default, two named
241   --  elements are distinguishable if (a) they have unrelated types or (b)
242   --  they have related types but different names.
243
244   overriding function Namespace
245    (Self : not null access constant UML_Variable_Proxy)
246       return AMF.UML.Namespaces.UML_Namespace_Access;
247   --  Operation NamedElement::namespace.
248   --
249   --  Missing derivation for NamedElement::/namespace : Namespace
250
251   overriding function Is_Compatible_With
252    (Self : not null access constant UML_Variable_Proxy;
253     P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access)
254       return Boolean;
255   --  Operation ParameterableElement::isCompatibleWith.
256   --
257   --  The query isCompatibleWith() determines if this parameterable element
258   --  is compatible with the specified parameterable element. By default
259   --  parameterable element P is compatible with parameterable element Q if
260   --  the kind of P is the same or a subtype as the kind of Q. Subclasses
261   --  should override this operation to specify different compatibility
262   --  constraints.
263
264   overriding function Is_Template_Parameter
265    (Self : not null access constant UML_Variable_Proxy)
266       return Boolean;
267   --  Operation ParameterableElement::isTemplateParameter.
268   --
269   --  The query isTemplateParameter() determines if this parameterable
270   --  element is exposed as a formal template parameter.
271
272   overriding function Compatible_With
273    (Self : not null access constant UML_Variable_Proxy;
274     Other : AMF.UML.Multiplicity_Elements.UML_Multiplicity_Element_Access)
275       return Boolean;
276   --  Operation MultiplicityElement::compatibleWith.
277   --
278   --  The operation compatibleWith takes another multiplicity as input. It
279   --  checks if one multiplicity is compatible with another.
280
281   overriding function Includes_Cardinality
282    (Self : not null access constant UML_Variable_Proxy;
283     C : Integer)
284       return Boolean;
285   --  Operation MultiplicityElement::includesCardinality.
286   --
287   --  The query includesCardinality() checks whether the specified
288   --  cardinality is valid for this multiplicity.
289
290   overriding function Includes_Multiplicity
291    (Self : not null access constant UML_Variable_Proxy;
292     M : AMF.UML.Multiplicity_Elements.UML_Multiplicity_Element_Access)
293       return Boolean;
294   --  Operation MultiplicityElement::includesMultiplicity.
295   --
296   --  The query includesMultiplicity() checks whether this multiplicity
297   --  includes all the cardinalities allowed by the specified multiplicity.
298
299   overriding function Iss
300    (Self : not null access constant UML_Variable_Proxy;
301     Lowerbound : Integer;
302     Upperbound : Integer)
303       return Boolean;
304   --  Operation MultiplicityElement::is.
305   --
306   --  The operation is determines if the upper and lower bound of the ranges
307   --  are the ones given.
308
309   overriding procedure Enter_Element
310    (Self    : not null access constant UML_Variable_Proxy;
311     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
312     Control : in out AMF.Visitors.Traverse_Control);
313   --  Dispatch call to corresponding subprogram of visitor interface.
314
315   overriding procedure Leave_Element
316    (Self    : not null access constant UML_Variable_Proxy;
317     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
318     Control : in out AMF.Visitors.Traverse_Control);
319   --  Dispatch call to corresponding subprogram of visitor interface.
320
321   overriding procedure Visit_Element
322    (Self     : not null access constant UML_Variable_Proxy;
323     Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
324     Visitor  : in out AMF.Visitors.Abstract_Visitor'Class;
325     Control  : in out AMF.Visitors.Traverse_Control);
326   --  Dispatch call to corresponding subprogram of iterator interface.
327
328end AMF.Internals.UML_Variables;
329