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_Elements;
45with AMF.Internals.UML_Multiplicity_Elements;
46with AMF.UML.Connectable_Elements;
47with AMF.UML.Connector_Ends;
48with AMF.UML.Multiplicity_Elements;
49with AMF.UML.Properties;
50with AMF.Visitors;
51
52package AMF.Internals.UML_Connector_Ends is
53
54   package UML_Multiplicity_Elements is
55     new AMF.Internals.UML_Multiplicity_Elements
56          (AMF.Internals.UML_Elements.UML_Element_Proxy);
57
58   type UML_Connector_End_Proxy is
59     limited new UML_Multiplicity_Elements.UML_Multiplicity_Element_Proxy
60       and AMF.UML.Connector_Ends.UML_Connector_End with null record;
61
62   overriding function Get_Defining_End
63    (Self : not null access constant UML_Connector_End_Proxy)
64       return AMF.UML.Properties.UML_Property_Access;
65   --  Getter of ConnectorEnd::definingEnd.
66   --
67   --  A derived association referencing the corresponding association end on
68   --  the association which types the connector owing this connector end.
69   --  This association is derived by selecting the association end at the
70   --  same place in the ordering of association ends as this connector end.
71
72   overriding function Get_Part_With_Port
73    (Self : not null access constant UML_Connector_End_Proxy)
74       return AMF.UML.Properties.UML_Property_Access;
75   --  Getter of ConnectorEnd::partWithPort.
76   --
77   --  Indicates the role of the internal structure of a classifier with the
78   --  port to which the connector end is attached.
79
80   overriding procedure Set_Part_With_Port
81    (Self : not null access UML_Connector_End_Proxy;
82     To   : AMF.UML.Properties.UML_Property_Access);
83   --  Setter of ConnectorEnd::partWithPort.
84   --
85   --  Indicates the role of the internal structure of a classifier with the
86   --  port to which the connector end is attached.
87
88   overriding function Get_Role
89    (Self : not null access constant UML_Connector_End_Proxy)
90       return AMF.UML.Connectable_Elements.UML_Connectable_Element_Access;
91   --  Getter of ConnectorEnd::role.
92   --
93   --  The connectable element attached at this connector end. When an
94   --  instance of the containing classifier is created, a link may (depending
95   --  on the multiplicities) be created to an instance of the classifier that
96   --  types this connectable element.
97
98   overriding procedure Set_Role
99    (Self : not null access UML_Connector_End_Proxy;
100     To   : AMF.UML.Connectable_Elements.UML_Connectable_Element_Access);
101   --  Setter of ConnectorEnd::role.
102   --
103   --  The connectable element attached at this connector end. When an
104   --  instance of the containing classifier is created, a link may (depending
105   --  on the multiplicities) be created to an instance of the classifier that
106   --  types this connectable element.
107
108   overriding function Defining_End
109    (Self : not null access constant UML_Connector_End_Proxy)
110       return AMF.UML.Properties.UML_Property_Access;
111   --  Operation ConnectorEnd::definingEnd.
112   --
113   --  Missing derivation for ConnectorEnd::/definingEnd : Property
114
115   overriding function Compatible_With
116    (Self : not null access constant UML_Connector_End_Proxy;
117     Other : AMF.UML.Multiplicity_Elements.UML_Multiplicity_Element_Access)
118       return Boolean;
119   --  Operation MultiplicityElement::compatibleWith.
120   --
121   --  The operation compatibleWith takes another multiplicity as input. It
122   --  checks if one multiplicity is compatible with another.
123
124   overriding function Includes_Cardinality
125    (Self : not null access constant UML_Connector_End_Proxy;
126     C : Integer)
127       return Boolean;
128   --  Operation MultiplicityElement::includesCardinality.
129   --
130   --  The query includesCardinality() checks whether the specified
131   --  cardinality is valid for this multiplicity.
132
133   overriding function Includes_Multiplicity
134    (Self : not null access constant UML_Connector_End_Proxy;
135     M : AMF.UML.Multiplicity_Elements.UML_Multiplicity_Element_Access)
136       return Boolean;
137   --  Operation MultiplicityElement::includesMultiplicity.
138   --
139   --  The query includesMultiplicity() checks whether this multiplicity
140   --  includes all the cardinalities allowed by the specified multiplicity.
141
142   overriding function Iss
143    (Self : not null access constant UML_Connector_End_Proxy;
144     Lowerbound : Integer;
145     Upperbound : Integer)
146       return Boolean;
147   --  Operation MultiplicityElement::is.
148   --
149   --  The operation is determines if the upper and lower bound of the ranges
150   --  are the ones given.
151
152   overriding procedure Enter_Element
153    (Self    : not null access constant UML_Connector_End_Proxy;
154     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
155     Control : in out AMF.Visitors.Traverse_Control);
156   --  Dispatch call to corresponding subprogram of visitor interface.
157
158   overriding procedure Leave_Element
159    (Self    : not null access constant UML_Connector_End_Proxy;
160     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
161     Control : in out AMF.Visitors.Traverse_Control);
162   --  Dispatch call to corresponding subprogram of visitor interface.
163
164   overriding procedure Visit_Element
165    (Self     : not null access constant UML_Connector_End_Proxy;
166     Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
167     Visitor  : in out AMF.Visitors.Abstract_Visitor'Class;
168     Control  : in out AMF.Visitors.Traverse_Control);
169   --  Dispatch call to corresponding subprogram of iterator interface.
170
171end AMF.Internals.UML_Connector_Ends;
172