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_Named_Elements;
45with AMF.String_Collections;
46with AMF.UML.Behaviors.Collections;
47with AMF.UML.Classifiers.Collections;
48with AMF.UML.Constraints.Collections;
49with AMF.UML.Dependencies.Collections;
50with AMF.UML.Element_Imports.Collections;
51with AMF.UML.Named_Elements.Collections;
52with AMF.UML.Namespaces;
53with AMF.UML.Package_Imports.Collections;
54with AMF.UML.Packageable_Elements.Collections;
55with AMF.UML.Packages.Collections;
56with AMF.UML.Parameter_Sets.Collections;
57with AMF.UML.Parameters.Collections;
58with AMF.UML.Receptions;
59with AMF.UML.Redefinable_Elements.Collections;
60with AMF.UML.Signals;
61with AMF.UML.String_Expressions;
62with AMF.UML.Types.Collections;
63with AMF.Visitors;
64
65package AMF.Internals.UML_Receptions is
66
67   type UML_Reception_Proxy is
68     limited new AMF.Internals.UML_Named_Elements.UML_Named_Element_Proxy
69       and AMF.UML.Receptions.UML_Reception with null record;
70
71   overriding function Get_Signal
72    (Self : not null access constant UML_Reception_Proxy)
73       return AMF.UML.Signals.UML_Signal_Access;
74   --  Getter of Reception::signal.
75   --
76   --  The signal that this reception handles.
77
78   overriding procedure Set_Signal
79    (Self : not null access UML_Reception_Proxy;
80     To   : AMF.UML.Signals.UML_Signal_Access);
81   --  Setter of Reception::signal.
82   --
83   --  The signal that this reception handles.
84
85   overriding function Get_Concurrency
86    (Self : not null access constant UML_Reception_Proxy)
87       return AMF.UML.UML_Call_Concurrency_Kind;
88   --  Getter of BehavioralFeature::concurrency.
89   --
90   --  Specifies the semantics of concurrent calls to the same passive
91   --  instance (i.e., an instance originating from a class with isActive
92   --  being false). Active instances control access to their own behavioral
93   --  features.
94
95   overriding procedure Set_Concurrency
96    (Self : not null access UML_Reception_Proxy;
97     To   : AMF.UML.UML_Call_Concurrency_Kind);
98   --  Setter of BehavioralFeature::concurrency.
99   --
100   --  Specifies the semantics of concurrent calls to the same passive
101   --  instance (i.e., an instance originating from a class with isActive
102   --  being false). Active instances control access to their own behavioral
103   --  features.
104
105   overriding function Get_Is_Abstract
106    (Self : not null access constant UML_Reception_Proxy)
107       return Boolean;
108   --  Getter of BehavioralFeature::isAbstract.
109   --
110   --  If true, then the behavioral feature does not have an implementation,
111   --  and one must be supplied by a more specific element. If false, the
112   --  behavioral feature must have an implementation in the classifier or one
113   --  must be inherited from a more general element.
114
115   overriding procedure Set_Is_Abstract
116    (Self : not null access UML_Reception_Proxy;
117     To   : Boolean);
118   --  Setter of BehavioralFeature::isAbstract.
119   --
120   --  If true, then the behavioral feature does not have an implementation,
121   --  and one must be supplied by a more specific element. If false, the
122   --  behavioral feature must have an implementation in the classifier or one
123   --  must be inherited from a more general element.
124
125   overriding function Get_Method
126    (Self : not null access constant UML_Reception_Proxy)
127       return AMF.UML.Behaviors.Collections.Set_Of_UML_Behavior;
128   --  Getter of BehavioralFeature::method.
129   --
130   --  A behavioral description that implements the behavioral feature. There
131   --  may be at most one behavior for a particular pairing of a classifier
132   --  (as owner of the behavior) and a behavioral feature (as specification
133   --  of the behavior).
134
135   overriding function Get_Owned_Parameter
136    (Self : not null access constant UML_Reception_Proxy)
137       return AMF.UML.Parameters.Collections.Ordered_Set_Of_UML_Parameter;
138   --  Getter of BehavioralFeature::ownedParameter.
139   --
140   --  Specifies the ordered set of formal parameters of this
141   --  BehavioralFeature.
142
143   overriding function Get_Owned_Parameter_Set
144    (Self : not null access constant UML_Reception_Proxy)
145       return AMF.UML.Parameter_Sets.Collections.Set_Of_UML_Parameter_Set;
146   --  Getter of BehavioralFeature::ownedParameterSet.
147   --
148   --  The ParameterSets owned by this BehavioralFeature.
149
150   overriding function Get_Raised_Exception
151    (Self : not null access constant UML_Reception_Proxy)
152       return AMF.UML.Types.Collections.Set_Of_UML_Type;
153   --  Getter of BehavioralFeature::raisedException.
154   --
155   --  References the Types representing exceptions that may be raised during
156   --  an invocation of this feature.
157
158   overriding function Get_Featuring_Classifier
159    (Self : not null access constant UML_Reception_Proxy)
160       return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier;
161   --  Getter of Feature::featuringClassifier.
162   --
163   --  The Classifiers that have this Feature as a feature.
164
165   overriding function Get_Is_Static
166    (Self : not null access constant UML_Reception_Proxy)
167       return Boolean;
168   --  Getter of Feature::isStatic.
169   --
170   --  Specifies whether this feature characterizes individual instances
171   --  classified by the classifier (false) or the classifier itself (true).
172
173   overriding procedure Set_Is_Static
174    (Self : not null access UML_Reception_Proxy;
175     To   : Boolean);
176   --  Setter of Feature::isStatic.
177   --
178   --  Specifies whether this feature characterizes individual instances
179   --  classified by the classifier (false) or the classifier itself (true).
180
181   overriding function Get_Is_Leaf
182    (Self : not null access constant UML_Reception_Proxy)
183       return Boolean;
184   --  Getter of RedefinableElement::isLeaf.
185   --
186   --  Indicates whether it is possible to further redefine a
187   --  RedefinableElement. If the value is true, then it is not possible to
188   --  further redefine the RedefinableElement. Note that this property is
189   --  preserved through package merge operations; that is, the capability to
190   --  redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in
191   --  the resulting RedefinableElement of a package merge operation where a
192   --  RedefinableElement with isLeaf=false is merged with a matching
193   --  RedefinableElement with isLeaf=true: the resulting RedefinableElement
194   --  will have isLeaf=false. Default value is false.
195
196   overriding procedure Set_Is_Leaf
197    (Self : not null access UML_Reception_Proxy;
198     To   : Boolean);
199   --  Setter of RedefinableElement::isLeaf.
200   --
201   --  Indicates whether it is possible to further redefine a
202   --  RedefinableElement. If the value is true, then it is not possible to
203   --  further redefine the RedefinableElement. Note that this property is
204   --  preserved through package merge operations; that is, the capability to
205   --  redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in
206   --  the resulting RedefinableElement of a package merge operation where a
207   --  RedefinableElement with isLeaf=false is merged with a matching
208   --  RedefinableElement with isLeaf=true: the resulting RedefinableElement
209   --  will have isLeaf=false. Default value is false.
210
211   overriding function Get_Redefined_Element
212    (Self : not null access constant UML_Reception_Proxy)
213       return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element;
214   --  Getter of RedefinableElement::redefinedElement.
215   --
216   --  The redefinable element that is being redefined by this element.
217
218   overriding function Get_Redefinition_Context
219    (Self : not null access constant UML_Reception_Proxy)
220       return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier;
221   --  Getter of RedefinableElement::redefinitionContext.
222   --
223   --  References the contexts that this element may be redefined from.
224
225   overriding function Get_Client_Dependency
226    (Self : not null access constant UML_Reception_Proxy)
227       return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency;
228   --  Getter of NamedElement::clientDependency.
229   --
230   --  Indicates the dependencies that reference the client.
231
232   overriding function Get_Name_Expression
233    (Self : not null access constant UML_Reception_Proxy)
234       return AMF.UML.String_Expressions.UML_String_Expression_Access;
235   --  Getter of NamedElement::nameExpression.
236   --
237   --  The string expression used to define the name of this named element.
238
239   overriding procedure Set_Name_Expression
240    (Self : not null access UML_Reception_Proxy;
241     To   : AMF.UML.String_Expressions.UML_String_Expression_Access);
242   --  Setter of NamedElement::nameExpression.
243   --
244   --  The string expression used to define the name of this named element.
245
246   overriding function Get_Namespace
247    (Self : not null access constant UML_Reception_Proxy)
248       return AMF.UML.Namespaces.UML_Namespace_Access;
249   --  Getter of NamedElement::namespace.
250   --
251   --  Specifies the namespace that owns the NamedElement.
252
253   overriding function Get_Qualified_Name
254    (Self : not null access constant UML_Reception_Proxy)
255       return AMF.Optional_String;
256   --  Getter of NamedElement::qualifiedName.
257   --
258   --  A name which allows the NamedElement to be identified within a
259   --  hierarchy of nested Namespaces. It is constructed from the names of the
260   --  containing namespaces starting at the root of the hierarchy and ending
261   --  with the name of the NamedElement itself.
262
263   overriding function Get_Element_Import
264    (Self : not null access constant UML_Reception_Proxy)
265       return AMF.UML.Element_Imports.Collections.Set_Of_UML_Element_Import;
266   --  Getter of Namespace::elementImport.
267   --
268   --  References the ElementImports owned by the Namespace.
269
270   overriding function Get_Imported_Member
271    (Self : not null access constant UML_Reception_Proxy)
272       return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element;
273   --  Getter of Namespace::importedMember.
274   --
275   --  References the PackageableElements that are members of this Namespace
276   --  as a result of either PackageImports or ElementImports.
277
278   overriding function Get_Member
279    (Self : not null access constant UML_Reception_Proxy)
280       return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element;
281   --  Getter of Namespace::member.
282   --
283   --  A collection of NamedElements identifiable within the Namespace, either
284   --  by being owned or by being introduced by importing or inheritance.
285
286   overriding function Get_Owned_Member
287    (Self : not null access constant UML_Reception_Proxy)
288       return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element;
289   --  Getter of Namespace::ownedMember.
290   --
291   --  A collection of NamedElements owned by the Namespace.
292
293   overriding function Get_Owned_Rule
294    (Self : not null access constant UML_Reception_Proxy)
295       return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint;
296   --  Getter of Namespace::ownedRule.
297   --
298   --  Specifies a set of Constraints owned by this Namespace.
299
300   overriding function Get_Package_Import
301    (Self : not null access constant UML_Reception_Proxy)
302       return AMF.UML.Package_Imports.Collections.Set_Of_UML_Package_Import;
303   --  Getter of Namespace::packageImport.
304   --
305   --  References the PackageImports owned by the Namespace.
306
307   overriding function Is_Distinguishable_From
308    (Self : not null access constant UML_Reception_Proxy;
309     N : AMF.UML.Named_Elements.UML_Named_Element_Access;
310     Ns : AMF.UML.Namespaces.UML_Namespace_Access)
311       return Boolean;
312   --  Operation BehavioralFeature::isDistinguishableFrom.
313   --
314   --  The query isDistinguishableFrom() determines whether two
315   --  BehavioralFeatures may coexist in the same Namespace. It specifies that
316   --  they have to have different signatures.
317
318   overriding function Is_Consistent_With
319    (Self : not null access constant UML_Reception_Proxy;
320     Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
321       return Boolean;
322   --  Operation RedefinableElement::isConsistentWith.
323   --
324   --  The query isConsistentWith() specifies, for any two RedefinableElements
325   --  in a context in which redefinition is possible, whether redefinition
326   --  would be logically consistent. By default, this is false; this
327   --  operation must be overridden for subclasses of RedefinableElement to
328   --  define the consistency conditions.
329
330   overriding function Is_Redefinition_Context_Valid
331    (Self : not null access constant UML_Reception_Proxy;
332     Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
333       return Boolean;
334   --  Operation RedefinableElement::isRedefinitionContextValid.
335   --
336   --  The query isRedefinitionContextValid() specifies whether the
337   --  redefinition contexts of this RedefinableElement are properly related
338   --  to the redefinition contexts of the specified RedefinableElement to
339   --  allow this element to redefine the other. By default at least one of
340   --  the redefinition contexts of this element must be a specialization of
341   --  at least one of the redefinition contexts of the specified element.
342
343   overriding function All_Owning_Packages
344    (Self : not null access constant UML_Reception_Proxy)
345       return AMF.UML.Packages.Collections.Set_Of_UML_Package;
346   --  Operation NamedElement::allOwningPackages.
347   --
348   --  The query allOwningPackages() returns all the directly or indirectly
349   --  owning packages.
350
351   overriding function Namespace
352    (Self : not null access constant UML_Reception_Proxy)
353       return AMF.UML.Namespaces.UML_Namespace_Access;
354   --  Operation NamedElement::namespace.
355   --
356   --  Missing derivation for NamedElement::/namespace : Namespace
357
358   overriding function Exclude_Collisions
359    (Self : not null access constant UML_Reception_Proxy;
360     Imps : AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element)
361       return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element;
362   --  Operation Namespace::excludeCollisions.
363   --
364   --  The query excludeCollisions() excludes from a set of
365   --  PackageableElements any that would not be distinguishable from each
366   --  other in this namespace.
367
368   overriding function Get_Names_Of_Member
369    (Self : not null access constant UML_Reception_Proxy;
370     Element : AMF.UML.Named_Elements.UML_Named_Element_Access)
371       return AMF.String_Collections.Set_Of_String;
372   --  Operation Namespace::getNamesOfMember.
373   --
374   --  The query getNamesOfMember() takes importing into account. It gives
375   --  back the set of names that an element would have in an importing
376   --  namespace, either because it is owned, or if not owned then imported
377   --  individually, or if not individually then from a package.
378   --  The query getNamesOfMember() gives a set of all of the names that a
379   --  member would have in a Namespace. In general a member can have multiple
380   --  names in a Namespace if it is imported more than once with different
381   --  aliases. The query takes account of importing. It gives back the set of
382   --  names that an element would have in an importing namespace, either
383   --  because it is owned, or if not owned then imported individually, or if
384   --  not individually then from a package.
385
386   overriding function Import_Members
387    (Self : not null access constant UML_Reception_Proxy;
388     Imps : AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element)
389       return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element;
390   --  Operation Namespace::importMembers.
391   --
392   --  The query importMembers() defines which of a set of PackageableElements
393   --  are actually imported into the namespace. This excludes hidden ones,
394   --  i.e., those which have names that conflict with names of owned members,
395   --  and also excludes elements which would have the same name when imported.
396
397   overriding function Imported_Member
398    (Self : not null access constant UML_Reception_Proxy)
399       return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element;
400   --  Operation Namespace::importedMember.
401   --
402   --  The importedMember property is derived from the ElementImports and the
403   --  PackageImports. References the PackageableElements that are members of
404   --  this Namespace as a result of either PackageImports or ElementImports.
405
406   overriding function Members_Are_Distinguishable
407    (Self : not null access constant UML_Reception_Proxy)
408       return Boolean;
409   --  Operation Namespace::membersAreDistinguishable.
410   --
411   --  The Boolean query membersAreDistinguishable() determines whether all of
412   --  the namespace's members are distinguishable within it.
413
414   overriding function Owned_Member
415    (Self : not null access constant UML_Reception_Proxy)
416       return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element;
417   --  Operation Namespace::ownedMember.
418   --
419   --  Missing derivation for Namespace::/ownedMember : NamedElement
420
421   overriding procedure Enter_Element
422    (Self    : not null access constant UML_Reception_Proxy;
423     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
424     Control : in out AMF.Visitors.Traverse_Control);
425   --  Dispatch call to corresponding subprogram of visitor interface.
426
427   overriding procedure Leave_Element
428    (Self    : not null access constant UML_Reception_Proxy;
429     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
430     Control : in out AMF.Visitors.Traverse_Control);
431   --  Dispatch call to corresponding subprogram of visitor interface.
432
433   overriding procedure Visit_Element
434    (Self     : not null access constant UML_Reception_Proxy;
435     Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
436     Visitor  : in out AMF.Visitors.Abstract_Visitor'Class;
437     Control  : in out AMF.Visitors.Traverse_Control);
438   --  Dispatch call to corresponding subprogram of iterator interface.
439
440end AMF.Internals.UML_Receptions;
441