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: 2937 $ $Date: 2012-05-01 21:07:27 +0400 (Tue, 01 May 2012) $
43------------------------------------------------------------------------------
44with AMF.Internals.UML_Packageable_Elements;
45with AMF.UML.Classifiers;
46with AMF.UML.Dependencies.Collections;
47with AMF.UML.Elements.Collections;
48with AMF.UML.Named_Elements.Collections;
49with AMF.UML.Namespaces;
50with AMF.UML.Opaque_Expressions;
51with AMF.UML.Packages.Collections;
52with AMF.UML.Parameterable_Elements;
53with AMF.UML.String_Expressions;
54with AMF.UML.Substitutions;
55with AMF.UML.Template_Parameters;
56with AMF.Visitors;
57
58package AMF.Internals.UML_Substitutions is
59
60   type UML_Substitution_Proxy is
61     limited new AMF.Internals.UML_Packageable_Elements.UML_Packageable_Element_Proxy
62       and AMF.UML.Substitutions.UML_Substitution with null record;
63
64   overriding function Get_Contract
65    (Self : not null access constant UML_Substitution_Proxy)
66       return AMF.UML.Classifiers.UML_Classifier_Access;
67   --  Getter of Substitution::contract.
68   --
69   --  The contract with which the substituting classifier complies.
70
71   overriding procedure Set_Contract
72    (Self : not null access UML_Substitution_Proxy;
73     To   : AMF.UML.Classifiers.UML_Classifier_Access);
74   --  Setter of Substitution::contract.
75   --
76   --  The contract with which the substituting classifier complies.
77
78   overriding function Get_Substituting_Classifier
79    (Self : not null access constant UML_Substitution_Proxy)
80       return AMF.UML.Classifiers.UML_Classifier_Access;
81   --  Getter of Substitution::substitutingClassifier.
82   --
83   --  Instances of the substituting classifier are runtime substitutable
84   --  where instances of the contract classifier are expected.
85
86   overriding procedure Set_Substituting_Classifier
87    (Self : not null access UML_Substitution_Proxy;
88     To   : AMF.UML.Classifiers.UML_Classifier_Access);
89   --  Setter of Substitution::substitutingClassifier.
90   --
91   --  Instances of the substituting classifier are runtime substitutable
92   --  where instances of the contract classifier are expected.
93
94   overriding function Get_Mapping
95    (Self : not null access constant UML_Substitution_Proxy)
96       return AMF.UML.Opaque_Expressions.UML_Opaque_Expression_Access;
97   --  Getter of Abstraction::mapping.
98   --
99   --  An composition of an Expression that states the abstraction
100   --  relationship between the supplier and the client. In some cases, such
101   --  as Derivation, it is usually formal and unidirectional; in other cases,
102   --  such as Trace, it is usually informal and bidirectional. The mapping
103   --  expression is optional and may be omitted if the precise relationship
104   --  between the elements is not specified.
105
106   overriding procedure Set_Mapping
107    (Self : not null access UML_Substitution_Proxy;
108     To   : AMF.UML.Opaque_Expressions.UML_Opaque_Expression_Access);
109   --  Setter of Abstraction::mapping.
110   --
111   --  An composition of an Expression that states the abstraction
112   --  relationship between the supplier and the client. In some cases, such
113   --  as Derivation, it is usually formal and unidirectional; in other cases,
114   --  such as Trace, it is usually informal and bidirectional. The mapping
115   --  expression is optional and may be omitted if the precise relationship
116   --  between the elements is not specified.
117
118   overriding function Get_Client
119    (Self : not null access constant UML_Substitution_Proxy)
120       return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element;
121   --  Getter of Dependency::client.
122   --
123   --  The element(s) dependent on the supplier element(s). In some cases
124   --  (such as a Trace Abstraction) the assignment of direction (that is, the
125   --  designation of the client element) is at the discretion of the modeler,
126   --  and is a stipulation.
127
128   overriding function Get_Supplier
129    (Self : not null access constant UML_Substitution_Proxy)
130       return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element;
131   --  Getter of Dependency::supplier.
132   --
133   --  The element(s) independent of the client element(s), in the same
134   --  respect and the same dependency relationship. In some directed
135   --  dependency relationships (such as Refinement Abstractions), a common
136   --  convention in the domain of class-based OO software is to put the more
137   --  abstract element in this role. Despite this convention, users of UML
138   --  may stipulate a sense of dependency suitable for their domain, which
139   --  makes a more abstract element dependent on that which is more specific.
140
141   overriding function Get_Source
142    (Self : not null access constant UML_Substitution_Proxy)
143       return AMF.UML.Elements.Collections.Set_Of_UML_Element;
144   --  Getter of DirectedRelationship::source.
145   --
146   --  Specifies the sources of the DirectedRelationship.
147
148   overriding function Get_Target
149    (Self : not null access constant UML_Substitution_Proxy)
150       return AMF.UML.Elements.Collections.Set_Of_UML_Element;
151   --  Getter of DirectedRelationship::target.
152   --
153   --  Specifies the targets of the DirectedRelationship.
154
155   overriding function Get_Related_Element
156    (Self : not null access constant UML_Substitution_Proxy)
157       return AMF.UML.Elements.Collections.Set_Of_UML_Element;
158   --  Getter of Relationship::relatedElement.
159   --
160   --  Specifies the elements related by the Relationship.
161
162   overriding function Get_Client_Dependency
163    (Self : not null access constant UML_Substitution_Proxy)
164       return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency;
165   --  Getter of NamedElement::clientDependency.
166   --
167   --  Indicates the dependencies that reference the client.
168
169   overriding function Get_Name_Expression
170    (Self : not null access constant UML_Substitution_Proxy)
171       return AMF.UML.String_Expressions.UML_String_Expression_Access;
172   --  Getter of NamedElement::nameExpression.
173   --
174   --  The string expression used to define the name of this named element.
175
176   overriding procedure Set_Name_Expression
177    (Self : not null access UML_Substitution_Proxy;
178     To   : AMF.UML.String_Expressions.UML_String_Expression_Access);
179   --  Setter of NamedElement::nameExpression.
180   --
181   --  The string expression used to define the name of this named element.
182
183   overriding function Get_Namespace
184    (Self : not null access constant UML_Substitution_Proxy)
185       return AMF.UML.Namespaces.UML_Namespace_Access;
186   --  Getter of NamedElement::namespace.
187   --
188   --  Specifies the namespace that owns the NamedElement.
189
190   overriding function Get_Qualified_Name
191    (Self : not null access constant UML_Substitution_Proxy)
192       return AMF.Optional_String;
193   --  Getter of NamedElement::qualifiedName.
194   --
195   --  A name which allows the NamedElement to be identified within a
196   --  hierarchy of nested Namespaces. It is constructed from the names of the
197   --  containing namespaces starting at the root of the hierarchy and ending
198   --  with the name of the NamedElement itself.
199
200   overriding function Get_Owning_Template_Parameter
201    (Self : not null access constant UML_Substitution_Proxy)
202       return AMF.UML.Template_Parameters.UML_Template_Parameter_Access;
203   --  Getter of ParameterableElement::owningTemplateParameter.
204   --
205   --  The formal template parameter that owns this element.
206
207   overriding procedure Set_Owning_Template_Parameter
208    (Self : not null access UML_Substitution_Proxy;
209     To   : AMF.UML.Template_Parameters.UML_Template_Parameter_Access);
210   --  Setter of ParameterableElement::owningTemplateParameter.
211   --
212   --  The formal template parameter that owns this element.
213
214   overriding function Get_Template_Parameter
215    (Self : not null access constant UML_Substitution_Proxy)
216       return AMF.UML.Template_Parameters.UML_Template_Parameter_Access;
217   --  Getter of ParameterableElement::templateParameter.
218   --
219   --  The template parameter that exposes this element as a formal parameter.
220
221   overriding procedure Set_Template_Parameter
222    (Self : not null access UML_Substitution_Proxy;
223     To   : AMF.UML.Template_Parameters.UML_Template_Parameter_Access);
224   --  Setter of ParameterableElement::templateParameter.
225   --
226   --  The template parameter that exposes this element as a formal parameter.
227
228   overriding function All_Owning_Packages
229    (Self : not null access constant UML_Substitution_Proxy)
230       return AMF.UML.Packages.Collections.Set_Of_UML_Package;
231   --  Operation NamedElement::allOwningPackages.
232   --
233   --  The query allOwningPackages() returns all the directly or indirectly
234   --  owning packages.
235
236   overriding function Is_Distinguishable_From
237    (Self : not null access constant UML_Substitution_Proxy;
238     N : AMF.UML.Named_Elements.UML_Named_Element_Access;
239     Ns : AMF.UML.Namespaces.UML_Namespace_Access)
240       return Boolean;
241   --  Operation NamedElement::isDistinguishableFrom.
242   --
243   --  The query isDistinguishableFrom() determines whether two NamedElements
244   --  may logically co-exist within a Namespace. By default, two named
245   --  elements are distinguishable if (a) they have unrelated types or (b)
246   --  they have related types but different names.
247
248   overriding function Namespace
249    (Self : not null access constant UML_Substitution_Proxy)
250       return AMF.UML.Namespaces.UML_Namespace_Access;
251   --  Operation NamedElement::namespace.
252   --
253   --  Missing derivation for NamedElement::/namespace : Namespace
254
255   overriding function Is_Compatible_With
256    (Self : not null access constant UML_Substitution_Proxy;
257     P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access)
258       return Boolean;
259   --  Operation ParameterableElement::isCompatibleWith.
260   --
261   --  The query isCompatibleWith() determines if this parameterable element
262   --  is compatible with the specified parameterable element. By default
263   --  parameterable element P is compatible with parameterable element Q if
264   --  the kind of P is the same or a subtype as the kind of Q. Subclasses
265   --  should override this operation to specify different compatibility
266   --  constraints.
267
268   overriding function Is_Template_Parameter
269    (Self : not null access constant UML_Substitution_Proxy)
270       return Boolean;
271   --  Operation ParameterableElement::isTemplateParameter.
272   --
273   --  The query isTemplateParameter() determines if this parameterable
274   --  element is exposed as a formal template parameter.
275
276   overriding procedure Enter_Element
277    (Self    : not null access constant UML_Substitution_Proxy;
278     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
279     Control : in out AMF.Visitors.Traverse_Control);
280   --  Dispatch call to corresponding subprogram of visitor interface.
281
282   overriding procedure Leave_Element
283    (Self    : not null access constant UML_Substitution_Proxy;
284     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
285     Control : in out AMF.Visitors.Traverse_Control);
286   --  Dispatch call to corresponding subprogram of visitor interface.
287
288   overriding procedure Visit_Element
289    (Self     : not null access constant UML_Substitution_Proxy;
290     Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
291     Visitor  : in out AMF.Visitors.Abstract_Visitor'Class;
292     Control  : in out AMF.Visitors.Traverse_Control);
293   --  Dispatch call to corresponding subprogram of iterator interface.
294
295end AMF.Internals.UML_Substitutions;
296