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;
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.Operations.Collections;
54with AMF.UML.Package_Imports.Collections;
55with AMF.UML.Packageable_Elements.Collections;
56with AMF.UML.Packages.Collections;
57with AMF.UML.Protocol_Transitions;
58with AMF.UML.Redefinable_Elements.Collections;
59with AMF.UML.Regions;
60with AMF.UML.State_Machines;
61with AMF.UML.String_Expressions;
62with AMF.UML.Transitions;
63with AMF.UML.Triggers.Collections;
64with AMF.UML.Vertexs;
65with AMF.Visitors;
66
67package AMF.Internals.UML_Protocol_Transitions is
68
69   type UML_Protocol_Transition_Proxy is
70     limited new AMF.Internals.UML_Named_Elements.UML_Named_Element_Proxy
71       and AMF.UML.Protocol_Transitions.UML_Protocol_Transition with null record;
72
73   overriding function Get_Post_Condition
74    (Self : not null access constant UML_Protocol_Transition_Proxy)
75       return AMF.UML.Constraints.UML_Constraint_Access;
76   --  Getter of ProtocolTransition::postCondition.
77   --
78   --  Specifies the post condition of the transition which is the condition
79   --  that should be obtained once the transition is triggered. This post
80   --  condition is part of the post condition of the operation connected to
81   --  the transition.
82
83   overriding procedure Set_Post_Condition
84    (Self : not null access UML_Protocol_Transition_Proxy;
85     To   : AMF.UML.Constraints.UML_Constraint_Access);
86   --  Setter of ProtocolTransition::postCondition.
87   --
88   --  Specifies the post condition of the transition which is the condition
89   --  that should be obtained once the transition is triggered. This post
90   --  condition is part of the post condition of the operation connected to
91   --  the transition.
92
93   overriding function Get_Pre_Condition
94    (Self : not null access constant UML_Protocol_Transition_Proxy)
95       return AMF.UML.Constraints.UML_Constraint_Access;
96   --  Getter of ProtocolTransition::preCondition.
97   --
98   --  Specifies the precondition of the transition. It specifies the
99   --  condition that should be verified before triggering the transition.
100   --  This guard condition added to the source state will be evaluated as
101   --  part of the precondition of the operation referred by the transition if
102   --  any.
103
104   overriding procedure Set_Pre_Condition
105    (Self : not null access UML_Protocol_Transition_Proxy;
106     To   : AMF.UML.Constraints.UML_Constraint_Access);
107   --  Setter of ProtocolTransition::preCondition.
108   --
109   --  Specifies the precondition of the transition. It specifies the
110   --  condition that should be verified before triggering the transition.
111   --  This guard condition added to the source state will be evaluated as
112   --  part of the precondition of the operation referred by the transition if
113   --  any.
114
115   overriding function Get_Referred
116    (Self : not null access constant UML_Protocol_Transition_Proxy)
117       return AMF.UML.Operations.Collections.Set_Of_UML_Operation;
118   --  Getter of ProtocolTransition::referred.
119   --
120   --  This association refers to the associated operation. It is derived from
121   --  the operation of the call trigger when applicable.
122
123   overriding function Get_Container
124    (Self : not null access constant UML_Protocol_Transition_Proxy)
125       return AMF.UML.Regions.UML_Region_Access;
126   --  Getter of Transition::container.
127   --
128   --  Designates the region that owns this transition.
129
130   overriding procedure Set_Container
131    (Self : not null access UML_Protocol_Transition_Proxy;
132     To   : AMF.UML.Regions.UML_Region_Access);
133   --  Setter of Transition::container.
134   --
135   --  Designates the region that owns this transition.
136
137   overriding function Get_Effect
138    (Self : not null access constant UML_Protocol_Transition_Proxy)
139       return AMF.UML.Behaviors.UML_Behavior_Access;
140   --  Getter of Transition::effect.
141   --
142   --  Specifies an optional behavior to be performed when the transition
143   --  fires.
144
145   overriding procedure Set_Effect
146    (Self : not null access UML_Protocol_Transition_Proxy;
147     To   : AMF.UML.Behaviors.UML_Behavior_Access);
148   --  Setter of Transition::effect.
149   --
150   --  Specifies an optional behavior to be performed when the transition
151   --  fires.
152
153   overriding function Get_Guard
154    (Self : not null access constant UML_Protocol_Transition_Proxy)
155       return AMF.UML.Constraints.UML_Constraint_Access;
156   --  Getter of Transition::guard.
157   --
158   --  A guard is a constraint that provides a fine-grained control over the
159   --  firing of the transition. The guard is evaluated when an event
160   --  occurrence is dispatched by the state machine. If the guard is true at
161   --  that time, the transition may be enabled, otherwise, it is disabled.
162   --  Guards should be pure expressions without side effects. Guard
163   --  expressions with side effects are ill formed.
164
165   overriding procedure Set_Guard
166    (Self : not null access UML_Protocol_Transition_Proxy;
167     To   : AMF.UML.Constraints.UML_Constraint_Access);
168   --  Setter of Transition::guard.
169   --
170   --  A guard is a constraint that provides a fine-grained control over the
171   --  firing of the transition. The guard is evaluated when an event
172   --  occurrence is dispatched by the state machine. If the guard is true at
173   --  that time, the transition may be enabled, otherwise, it is disabled.
174   --  Guards should be pure expressions without side effects. Guard
175   --  expressions with side effects are ill formed.
176
177   overriding function Get_Kind
178    (Self : not null access constant UML_Protocol_Transition_Proxy)
179       return AMF.UML.UML_Transition_Kind;
180   --  Getter of Transition::kind.
181   --
182   --  Indicates the precise type of the transition.
183
184   overriding procedure Set_Kind
185    (Self : not null access UML_Protocol_Transition_Proxy;
186     To   : AMF.UML.UML_Transition_Kind);
187   --  Setter of Transition::kind.
188   --
189   --  Indicates the precise type of the transition.
190
191   overriding function Get_Redefined_Transition
192    (Self : not null access constant UML_Protocol_Transition_Proxy)
193       return AMF.UML.Transitions.UML_Transition_Access;
194   --  Getter of Transition::redefinedTransition.
195   --
196   --  The transition that is redefined by this transition.
197
198   overriding procedure Set_Redefined_Transition
199    (Self : not null access UML_Protocol_Transition_Proxy;
200     To   : AMF.UML.Transitions.UML_Transition_Access);
201   --  Setter of Transition::redefinedTransition.
202   --
203   --  The transition that is redefined by this transition.
204
205   overriding function Get_Redefinition_Context
206    (Self : not null access constant UML_Protocol_Transition_Proxy)
207       return AMF.UML.Classifiers.UML_Classifier_Access;
208   --  Getter of Transition::redefinitionContext.
209   --
210   --  References the classifier in which context this element may be
211   --  redefined.
212
213   overriding function Get_Source
214    (Self : not null access constant UML_Protocol_Transition_Proxy)
215       return AMF.UML.Vertexs.UML_Vertex_Access;
216   --  Getter of Transition::source.
217   --
218   --  Designates the originating vertex (state or pseudostate) of the
219   --  transition.
220
221   overriding procedure Set_Source
222    (Self : not null access UML_Protocol_Transition_Proxy;
223     To   : AMF.UML.Vertexs.UML_Vertex_Access);
224   --  Setter of Transition::source.
225   --
226   --  Designates the originating vertex (state or pseudostate) of the
227   --  transition.
228
229   overriding function Get_Target
230    (Self : not null access constant UML_Protocol_Transition_Proxy)
231       return AMF.UML.Vertexs.UML_Vertex_Access;
232   --  Getter of Transition::target.
233   --
234   --  Designates the target vertex that is reached when the transition is
235   --  taken.
236
237   overriding procedure Set_Target
238    (Self : not null access UML_Protocol_Transition_Proxy;
239     To   : AMF.UML.Vertexs.UML_Vertex_Access);
240   --  Setter of Transition::target.
241   --
242   --  Designates the target vertex that is reached when the transition is
243   --  taken.
244
245   overriding function Get_Trigger
246    (Self : not null access constant UML_Protocol_Transition_Proxy)
247       return AMF.UML.Triggers.Collections.Set_Of_UML_Trigger;
248   --  Getter of Transition::trigger.
249   --
250   --  Specifies the triggers that may fire the transition.
251
252   overriding function Get_Element_Import
253    (Self : not null access constant UML_Protocol_Transition_Proxy)
254       return AMF.UML.Element_Imports.Collections.Set_Of_UML_Element_Import;
255   --  Getter of Namespace::elementImport.
256   --
257   --  References the ElementImports owned by the Namespace.
258
259   overriding function Get_Imported_Member
260    (Self : not null access constant UML_Protocol_Transition_Proxy)
261       return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element;
262   --  Getter of Namespace::importedMember.
263   --
264   --  References the PackageableElements that are members of this Namespace
265   --  as a result of either PackageImports or ElementImports.
266
267   overriding function Get_Member
268    (Self : not null access constant UML_Protocol_Transition_Proxy)
269       return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element;
270   --  Getter of Namespace::member.
271   --
272   --  A collection of NamedElements identifiable within the Namespace, either
273   --  by being owned or by being introduced by importing or inheritance.
274
275   overriding function Get_Owned_Member
276    (Self : not null access constant UML_Protocol_Transition_Proxy)
277       return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element;
278   --  Getter of Namespace::ownedMember.
279   --
280   --  A collection of NamedElements owned by the Namespace.
281
282   overriding function Get_Owned_Rule
283    (Self : not null access constant UML_Protocol_Transition_Proxy)
284       return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint;
285   --  Getter of Namespace::ownedRule.
286   --
287   --  Specifies a set of Constraints owned by this Namespace.
288
289   overriding function Get_Package_Import
290    (Self : not null access constant UML_Protocol_Transition_Proxy)
291       return AMF.UML.Package_Imports.Collections.Set_Of_UML_Package_Import;
292   --  Getter of Namespace::packageImport.
293   --
294   --  References the PackageImports owned by the Namespace.
295
296   overriding function Get_Client_Dependency
297    (Self : not null access constant UML_Protocol_Transition_Proxy)
298       return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency;
299   --  Getter of NamedElement::clientDependency.
300   --
301   --  Indicates the dependencies that reference the client.
302
303   overriding function Get_Name_Expression
304    (Self : not null access constant UML_Protocol_Transition_Proxy)
305       return AMF.UML.String_Expressions.UML_String_Expression_Access;
306   --  Getter of NamedElement::nameExpression.
307   --
308   --  The string expression used to define the name of this named element.
309
310   overriding procedure Set_Name_Expression
311    (Self : not null access UML_Protocol_Transition_Proxy;
312     To   : AMF.UML.String_Expressions.UML_String_Expression_Access);
313   --  Setter of NamedElement::nameExpression.
314   --
315   --  The string expression used to define the name of this named element.
316
317   overriding function Get_Namespace
318    (Self : not null access constant UML_Protocol_Transition_Proxy)
319       return AMF.UML.Namespaces.UML_Namespace_Access;
320   --  Getter of NamedElement::namespace.
321   --
322   --  Specifies the namespace that owns the NamedElement.
323
324   overriding function Get_Qualified_Name
325    (Self : not null access constant UML_Protocol_Transition_Proxy)
326       return AMF.Optional_String;
327   --  Getter of NamedElement::qualifiedName.
328   --
329   --  A name which allows the NamedElement to be identified within a
330   --  hierarchy of nested Namespaces. It is constructed from the names of the
331   --  containing namespaces starting at the root of the hierarchy and ending
332   --  with the name of the NamedElement itself.
333
334   overriding function Get_Is_Leaf
335    (Self : not null access constant UML_Protocol_Transition_Proxy)
336       return Boolean;
337   --  Getter of RedefinableElement::isLeaf.
338   --
339   --  Indicates whether it is possible to further redefine a
340   --  RedefinableElement. If the value is true, then it is not possible to
341   --  further redefine the RedefinableElement. Note that this property is
342   --  preserved through package merge operations; that is, the capability to
343   --  redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in
344   --  the resulting RedefinableElement of a package merge operation where a
345   --  RedefinableElement with isLeaf=false is merged with a matching
346   --  RedefinableElement with isLeaf=true: the resulting RedefinableElement
347   --  will have isLeaf=false. Default value is false.
348
349   overriding procedure Set_Is_Leaf
350    (Self : not null access UML_Protocol_Transition_Proxy;
351     To   : Boolean);
352   --  Setter of RedefinableElement::isLeaf.
353   --
354   --  Indicates whether it is possible to further redefine a
355   --  RedefinableElement. If the value is true, then it is not possible to
356   --  further redefine the RedefinableElement. Note that this property is
357   --  preserved through package merge operations; that is, the capability to
358   --  redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in
359   --  the resulting RedefinableElement of a package merge operation where a
360   --  RedefinableElement with isLeaf=false is merged with a matching
361   --  RedefinableElement with isLeaf=true: the resulting RedefinableElement
362   --  will have isLeaf=false. Default value is false.
363
364   overriding function Get_Redefined_Element
365    (Self : not null access constant UML_Protocol_Transition_Proxy)
366       return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element;
367   --  Getter of RedefinableElement::redefinedElement.
368   --
369   --  The redefinable element that is being redefined by this element.
370
371   overriding function Get_Redefinition_Context
372    (Self : not null access constant UML_Protocol_Transition_Proxy)
373       return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier;
374   --  Getter of RedefinableElement::redefinitionContext.
375   --
376   --  References the contexts that this element may be redefined from.
377
378   overriding function Referred
379    (Self : not null access constant UML_Protocol_Transition_Proxy)
380       return AMF.UML.Operations.Collections.Set_Of_UML_Operation;
381   --  Operation ProtocolTransition::referred.
382   --
383   --  Missing derivation for ProtocolTransition::/referred : Operation
384
385   overriding function Containing_State_Machine
386    (Self : not null access constant UML_Protocol_Transition_Proxy)
387       return AMF.UML.State_Machines.UML_State_Machine_Access;
388   --  Operation Transition::containingStateMachine.
389   --
390   --  The query containingStateMachine() returns the state machine that
391   --  contains the transition either directly or transitively.
392
393   overriding function Is_Consistent_With
394    (Self : not null access constant UML_Protocol_Transition_Proxy;
395     Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
396       return Boolean;
397   --  Operation Transition::isConsistentWith.
398   --
399   --  The query isConsistentWith() specifies that a redefining transition is
400   --  consistent with a redefined transition provided that the redefining
401   --  transition has the following relation to the redefined transition: A
402   --  redefining transition redefines all properties of the corresponding
403   --  redefined transition, except the source state and the trigger.
404
405   overriding function Redefinition_Context
406    (Self : not null access constant UML_Protocol_Transition_Proxy)
407       return AMF.UML.Classifiers.UML_Classifier_Access;
408   --  Operation Transition::redefinitionContext.
409   --
410   --  The redefinition context of a transition is the nearest containing
411   --  statemachine.
412
413   overriding function Exclude_Collisions
414    (Self : not null access constant UML_Protocol_Transition_Proxy;
415     Imps : AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element)
416       return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element;
417   --  Operation Namespace::excludeCollisions.
418   --
419   --  The query excludeCollisions() excludes from a set of
420   --  PackageableElements any that would not be distinguishable from each
421   --  other in this namespace.
422
423   overriding function Get_Names_Of_Member
424    (Self : not null access constant UML_Protocol_Transition_Proxy;
425     Element : AMF.UML.Named_Elements.UML_Named_Element_Access)
426       return AMF.String_Collections.Set_Of_String;
427   --  Operation Namespace::getNamesOfMember.
428   --
429   --  The query getNamesOfMember() takes importing into account. It gives
430   --  back the set of names that an element would have in an importing
431   --  namespace, either because it is owned, or if not owned then imported
432   --  individually, or if not individually then from a package.
433   --  The query getNamesOfMember() gives a set of all of the names that a
434   --  member would have in a Namespace. In general a member can have multiple
435   --  names in a Namespace if it is imported more than once with different
436   --  aliases. The query takes account of importing. It gives back the set of
437   --  names that an element would have in an importing namespace, either
438   --  because it is owned, or if not owned then imported individually, or if
439   --  not individually then from a package.
440
441   overriding function Import_Members
442    (Self : not null access constant UML_Protocol_Transition_Proxy;
443     Imps : AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element)
444       return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element;
445   --  Operation Namespace::importMembers.
446   --
447   --  The query importMembers() defines which of a set of PackageableElements
448   --  are actually imported into the namespace. This excludes hidden ones,
449   --  i.e., those which have names that conflict with names of owned members,
450   --  and also excludes elements which would have the same name when imported.
451
452   overriding function Imported_Member
453    (Self : not null access constant UML_Protocol_Transition_Proxy)
454       return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element;
455   --  Operation Namespace::importedMember.
456   --
457   --  The importedMember property is derived from the ElementImports and the
458   --  PackageImports. References the PackageableElements that are members of
459   --  this Namespace as a result of either PackageImports or ElementImports.
460
461   overriding function Members_Are_Distinguishable
462    (Self : not null access constant UML_Protocol_Transition_Proxy)
463       return Boolean;
464   --  Operation Namespace::membersAreDistinguishable.
465   --
466   --  The Boolean query membersAreDistinguishable() determines whether all of
467   --  the namespace's members are distinguishable within it.
468
469   overriding function Owned_Member
470    (Self : not null access constant UML_Protocol_Transition_Proxy)
471       return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element;
472   --  Operation Namespace::ownedMember.
473   --
474   --  Missing derivation for Namespace::/ownedMember : NamedElement
475
476   overriding function All_Owning_Packages
477    (Self : not null access constant UML_Protocol_Transition_Proxy)
478       return AMF.UML.Packages.Collections.Set_Of_UML_Package;
479   --  Operation NamedElement::allOwningPackages.
480   --
481   --  The query allOwningPackages() returns all the directly or indirectly
482   --  owning packages.
483
484   overriding function Is_Distinguishable_From
485    (Self : not null access constant UML_Protocol_Transition_Proxy;
486     N : AMF.UML.Named_Elements.UML_Named_Element_Access;
487     Ns : AMF.UML.Namespaces.UML_Namespace_Access)
488       return Boolean;
489   --  Operation NamedElement::isDistinguishableFrom.
490   --
491   --  The query isDistinguishableFrom() determines whether two NamedElements
492   --  may logically co-exist within a Namespace. By default, two named
493   --  elements are distinguishable if (a) they have unrelated types or (b)
494   --  they have related types but different names.
495
496   overriding function Namespace
497    (Self : not null access constant UML_Protocol_Transition_Proxy)
498       return AMF.UML.Namespaces.UML_Namespace_Access;
499   --  Operation NamedElement::namespace.
500   --
501   --  Missing derivation for NamedElement::/namespace : Namespace
502
503   overriding function Is_Redefinition_Context_Valid
504    (Self : not null access constant UML_Protocol_Transition_Proxy;
505     Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
506       return Boolean;
507   --  Operation RedefinableElement::isRedefinitionContextValid.
508   --
509   --  The query isRedefinitionContextValid() specifies whether the
510   --  redefinition contexts of this RedefinableElement are properly related
511   --  to the redefinition contexts of the specified RedefinableElement to
512   --  allow this element to redefine the other. By default at least one of
513   --  the redefinition contexts of this element must be a specialization of
514   --  at least one of the redefinition contexts of the specified element.
515
516   overriding procedure Enter_Element
517    (Self    : not null access constant UML_Protocol_Transition_Proxy;
518     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
519     Control : in out AMF.Visitors.Traverse_Control);
520   --  Dispatch call to corresponding subprogram of visitor interface.
521
522   overriding procedure Leave_Element
523    (Self    : not null access constant UML_Protocol_Transition_Proxy;
524     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
525     Control : in out AMF.Visitors.Traverse_Control);
526   --  Dispatch call to corresponding subprogram of visitor interface.
527
528   overriding procedure Visit_Element
529    (Self     : not null access constant UML_Protocol_Transition_Proxy;
530     Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
531     Visitor  : in out AMF.Visitors.Abstract_Visitor'Class;
532     Control  : in out AMF.Visitors.Traverse_Control);
533   --  Dispatch call to corresponding subprogram of iterator interface.
534
535end AMF.Internals.UML_Protocol_Transitions;
536