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.UML.Associations;
46with AMF.UML.Behaviors.Collections;
47with AMF.UML.Classifiers.Collections;
48with AMF.UML.Connector_Ends.Collections;
49with AMF.UML.Connectors.Collections;
50with AMF.UML.Dependencies.Collections;
51with AMF.UML.Named_Elements;
52with AMF.UML.Namespaces;
53with AMF.UML.Packages.Collections;
54with AMF.UML.Redefinable_Elements.Collections;
55with AMF.UML.String_Expressions;
56with AMF.Visitors;
57
58package AMF.Internals.UML_Connectors is
59
60   type UML_Connector_Proxy is
61     limited new AMF.Internals.UML_Named_Elements.UML_Named_Element_Proxy
62       and AMF.UML.Connectors.UML_Connector with null record;
63
64   overriding function Get_Contract
65    (Self : not null access constant UML_Connector_Proxy)
66       return AMF.UML.Behaviors.Collections.Set_Of_UML_Behavior;
67   --  Getter of Connector::contract.
68   --
69   --  The set of Behaviors that specify the valid interaction patterns across
70   --  the connector.
71
72   overriding function Get_End
73    (Self : not null access constant UML_Connector_Proxy)
74       return AMF.UML.Connector_Ends.Collections.Ordered_Set_Of_UML_Connector_End;
75   --  Getter of Connector::end.
76   --
77   --  A connector consists of at least two connector ends, each representing
78   --  the participation of instances of the classifiers typing the
79   --  connectable elements attached to this end. The set of connector ends is
80   --  ordered.
81
82   overriding function Get_Kind
83    (Self : not null access constant UML_Connector_Proxy)
84       return AMF.UML.UML_Connector_Kind;
85   --  Getter of Connector::kind.
86   --
87   --  Indicates the kind of connector. This is derived: a connector with one
88   --  or more ends connected to a Port which is not on a Part and which is
89   --  not a behavior port is a delegation; otherwise it is an assembly.
90
91   overriding function Get_Redefined_Connector
92    (Self : not null access constant UML_Connector_Proxy)
93       return AMF.UML.Connectors.Collections.Set_Of_UML_Connector;
94   --  Getter of Connector::redefinedConnector.
95   --
96   --  A connector may be redefined when its containing classifier is
97   --  specialized. The redefining connector may have a type that specializes
98   --  the type of the redefined connector. The types of the connector ends of
99   --  the redefining connector may specialize the types of the connector ends
100   --  of the redefined connector. The properties of the connector ends of the
101   --  redefining connector may be replaced.
102
103   overriding function Get_Type
104    (Self : not null access constant UML_Connector_Proxy)
105       return AMF.UML.Associations.UML_Association_Access;
106   --  Getter of Connector::type.
107   --
108   --  An optional association that specifies the link corresponding to this
109   --  connector.
110
111   overriding procedure Set_Type
112    (Self : not null access UML_Connector_Proxy;
113     To   : AMF.UML.Associations.UML_Association_Access);
114   --  Setter of Connector::type.
115   --
116   --  An optional association that specifies the link corresponding to this
117   --  connector.
118
119   overriding function Get_Featuring_Classifier
120    (Self : not null access constant UML_Connector_Proxy)
121       return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier;
122   --  Getter of Feature::featuringClassifier.
123   --
124   --  The Classifiers that have this Feature as a feature.
125
126   overriding function Get_Is_Static
127    (Self : not null access constant UML_Connector_Proxy)
128       return Boolean;
129   --  Getter of Feature::isStatic.
130   --
131   --  Specifies whether this feature characterizes individual instances
132   --  classified by the classifier (false) or the classifier itself (true).
133
134   overriding procedure Set_Is_Static
135    (Self : not null access UML_Connector_Proxy;
136     To   : Boolean);
137   --  Setter of Feature::isStatic.
138   --
139   --  Specifies whether this feature characterizes individual instances
140   --  classified by the classifier (false) or the classifier itself (true).
141
142   overriding function Get_Is_Leaf
143    (Self : not null access constant UML_Connector_Proxy)
144       return Boolean;
145   --  Getter of RedefinableElement::isLeaf.
146   --
147   --  Indicates whether it is possible to further redefine a
148   --  RedefinableElement. If the value is true, then it is not possible to
149   --  further redefine the RedefinableElement. Note that this property is
150   --  preserved through package merge operations; that is, the capability to
151   --  redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in
152   --  the resulting RedefinableElement of a package merge operation where a
153   --  RedefinableElement with isLeaf=false is merged with a matching
154   --  RedefinableElement with isLeaf=true: the resulting RedefinableElement
155   --  will have isLeaf=false. Default value is false.
156
157   overriding procedure Set_Is_Leaf
158    (Self : not null access UML_Connector_Proxy;
159     To   : Boolean);
160   --  Setter of RedefinableElement::isLeaf.
161   --
162   --  Indicates whether it is possible to further redefine a
163   --  RedefinableElement. If the value is true, then it is not possible to
164   --  further redefine the RedefinableElement. Note that this property is
165   --  preserved through package merge operations; that is, the capability to
166   --  redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in
167   --  the resulting RedefinableElement of a package merge operation where a
168   --  RedefinableElement with isLeaf=false is merged with a matching
169   --  RedefinableElement with isLeaf=true: the resulting RedefinableElement
170   --  will have isLeaf=false. Default value is false.
171
172   overriding function Get_Redefined_Element
173    (Self : not null access constant UML_Connector_Proxy)
174       return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element;
175   --  Getter of RedefinableElement::redefinedElement.
176   --
177   --  The redefinable element that is being redefined by this element.
178
179   overriding function Get_Redefinition_Context
180    (Self : not null access constant UML_Connector_Proxy)
181       return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier;
182   --  Getter of RedefinableElement::redefinitionContext.
183   --
184   --  References the contexts that this element may be redefined from.
185
186   overriding function Get_Client_Dependency
187    (Self : not null access constant UML_Connector_Proxy)
188       return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency;
189   --  Getter of NamedElement::clientDependency.
190   --
191   --  Indicates the dependencies that reference the client.
192
193   overriding function Get_Name_Expression
194    (Self : not null access constant UML_Connector_Proxy)
195       return AMF.UML.String_Expressions.UML_String_Expression_Access;
196   --  Getter of NamedElement::nameExpression.
197   --
198   --  The string expression used to define the name of this named element.
199
200   overriding procedure Set_Name_Expression
201    (Self : not null access UML_Connector_Proxy;
202     To   : AMF.UML.String_Expressions.UML_String_Expression_Access);
203   --  Setter of NamedElement::nameExpression.
204   --
205   --  The string expression used to define the name of this named element.
206
207   overriding function Get_Namespace
208    (Self : not null access constant UML_Connector_Proxy)
209       return AMF.UML.Namespaces.UML_Namespace_Access;
210   --  Getter of NamedElement::namespace.
211   --
212   --  Specifies the namespace that owns the NamedElement.
213
214   overriding function Get_Qualified_Name
215    (Self : not null access constant UML_Connector_Proxy)
216       return AMF.Optional_String;
217   --  Getter of NamedElement::qualifiedName.
218   --
219   --  A name which allows the NamedElement to be identified within a
220   --  hierarchy of nested Namespaces. It is constructed from the names of the
221   --  containing namespaces starting at the root of the hierarchy and ending
222   --  with the name of the NamedElement itself.
223
224   overriding function Kind
225    (Self : not null access constant UML_Connector_Proxy)
226       return AMF.UML.UML_Connector_Kind;
227   --  Operation Connector::kind.
228   --
229   --  Missing derivation for Connector::/kind : ConnectorKind
230
231   overriding function Is_Consistent_With
232    (Self : not null access constant UML_Connector_Proxy;
233     Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
234       return Boolean;
235   --  Operation RedefinableElement::isConsistentWith.
236   --
237   --  The query isConsistentWith() specifies, for any two RedefinableElements
238   --  in a context in which redefinition is possible, whether redefinition
239   --  would be logically consistent. By default, this is false; this
240   --  operation must be overridden for subclasses of RedefinableElement to
241   --  define the consistency conditions.
242
243   overriding function Is_Redefinition_Context_Valid
244    (Self : not null access constant UML_Connector_Proxy;
245     Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
246       return Boolean;
247   --  Operation RedefinableElement::isRedefinitionContextValid.
248   --
249   --  The query isRedefinitionContextValid() specifies whether the
250   --  redefinition contexts of this RedefinableElement are properly related
251   --  to the redefinition contexts of the specified RedefinableElement to
252   --  allow this element to redefine the other. By default at least one of
253   --  the redefinition contexts of this element must be a specialization of
254   --  at least one of the redefinition contexts of the specified element.
255
256   overriding function All_Owning_Packages
257    (Self : not null access constant UML_Connector_Proxy)
258       return AMF.UML.Packages.Collections.Set_Of_UML_Package;
259   --  Operation NamedElement::allOwningPackages.
260   --
261   --  The query allOwningPackages() returns all the directly or indirectly
262   --  owning packages.
263
264   overriding function Is_Distinguishable_From
265    (Self : not null access constant UML_Connector_Proxy;
266     N : AMF.UML.Named_Elements.UML_Named_Element_Access;
267     Ns : AMF.UML.Namespaces.UML_Namespace_Access)
268       return Boolean;
269   --  Operation NamedElement::isDistinguishableFrom.
270   --
271   --  The query isDistinguishableFrom() determines whether two NamedElements
272   --  may logically co-exist within a Namespace. By default, two named
273   --  elements are distinguishable if (a) they have unrelated types or (b)
274   --  they have related types but different names.
275
276   overriding function Namespace
277    (Self : not null access constant UML_Connector_Proxy)
278       return AMF.UML.Namespaces.UML_Namespace_Access;
279   --  Operation NamedElement::namespace.
280   --
281   --  Missing derivation for NamedElement::/namespace : Namespace
282
283   overriding procedure Enter_Element
284    (Self    : not null access constant UML_Connector_Proxy;
285     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
286     Control : in out AMF.Visitors.Traverse_Control);
287   --  Dispatch call to corresponding subprogram of visitor interface.
288
289   overriding procedure Leave_Element
290    (Self    : not null access constant UML_Connector_Proxy;
291     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
292     Control : in out AMF.Visitors.Traverse_Control);
293   --  Dispatch call to corresponding subprogram of visitor interface.
294
295   overriding procedure Visit_Element
296    (Self     : not null access constant UML_Connector_Proxy;
297     Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
298     Visitor  : in out AMF.Visitors.Abstract_Visitor'Class;
299     Control  : in out AMF.Visitors.Traverse_Control);
300   --  Dispatch call to corresponding subprogram of iterator interface.
301
302end AMF.Internals.UML_Connectors;
303