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.Dependencies.Collections;
46with AMF.UML.Instance_Specifications;
47with AMF.UML.Instance_Values;
48with AMF.UML.Named_Elements;
49with AMF.UML.Namespaces;
50with AMF.UML.Packages.Collections;
51with AMF.UML.Parameterable_Elements;
52with AMF.UML.String_Expressions;
53with AMF.UML.Template_Parameters;
54with AMF.UML.Types;
55with AMF.Visitors;
56
57package AMF.Internals.UML_Instance_Values is
58
59   type UML_Instance_Value_Proxy is
60     limited new AMF.Internals.UML_Packageable_Elements.UML_Packageable_Element_Proxy
61       and AMF.UML.Instance_Values.UML_Instance_Value with null record;
62
63   overriding function Get_Instance
64    (Self : not null access constant UML_Instance_Value_Proxy)
65       return AMF.UML.Instance_Specifications.UML_Instance_Specification_Access;
66   --  Getter of InstanceValue::instance.
67   --
68   --  The instance that is the specified value.
69
70   overriding procedure Set_Instance
71    (Self : not null access UML_Instance_Value_Proxy;
72     To   : AMF.UML.Instance_Specifications.UML_Instance_Specification_Access);
73   --  Setter of InstanceValue::instance.
74   --
75   --  The instance that is the specified value.
76
77   overriding function Get_Type
78    (Self : not null access constant UML_Instance_Value_Proxy)
79       return AMF.UML.Types.UML_Type_Access;
80   --  Getter of TypedElement::type.
81   --
82   --  The type of the TypedElement.
83   --  This information is derived from the return result for this Operation.
84
85   overriding procedure Set_Type
86    (Self : not null access UML_Instance_Value_Proxy;
87     To   : AMF.UML.Types.UML_Type_Access);
88   --  Setter of TypedElement::type.
89   --
90   --  The type of the TypedElement.
91   --  This information is derived from the return result for this Operation.
92
93   overriding function Get_Client_Dependency
94    (Self : not null access constant UML_Instance_Value_Proxy)
95       return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency;
96   --  Getter of NamedElement::clientDependency.
97   --
98   --  Indicates the dependencies that reference the client.
99
100   overriding function Get_Name_Expression
101    (Self : not null access constant UML_Instance_Value_Proxy)
102       return AMF.UML.String_Expressions.UML_String_Expression_Access;
103   --  Getter of NamedElement::nameExpression.
104   --
105   --  The string expression used to define the name of this named element.
106
107   overriding procedure Set_Name_Expression
108    (Self : not null access UML_Instance_Value_Proxy;
109     To   : AMF.UML.String_Expressions.UML_String_Expression_Access);
110   --  Setter of NamedElement::nameExpression.
111   --
112   --  The string expression used to define the name of this named element.
113
114   overriding function Get_Namespace
115    (Self : not null access constant UML_Instance_Value_Proxy)
116       return AMF.UML.Namespaces.UML_Namespace_Access;
117   --  Getter of NamedElement::namespace.
118   --
119   --  Specifies the namespace that owns the NamedElement.
120
121   overriding function Get_Qualified_Name
122    (Self : not null access constant UML_Instance_Value_Proxy)
123       return AMF.Optional_String;
124   --  Getter of NamedElement::qualifiedName.
125   --
126   --  A name which allows the NamedElement to be identified within a
127   --  hierarchy of nested Namespaces. It is constructed from the names of the
128   --  containing namespaces starting at the root of the hierarchy and ending
129   --  with the name of the NamedElement itself.
130
131   overriding function Get_Owning_Template_Parameter
132    (Self : not null access constant UML_Instance_Value_Proxy)
133       return AMF.UML.Template_Parameters.UML_Template_Parameter_Access;
134   --  Getter of ParameterableElement::owningTemplateParameter.
135   --
136   --  The formal template parameter that owns this element.
137
138   overriding procedure Set_Owning_Template_Parameter
139    (Self : not null access UML_Instance_Value_Proxy;
140     To   : AMF.UML.Template_Parameters.UML_Template_Parameter_Access);
141   --  Setter of ParameterableElement::owningTemplateParameter.
142   --
143   --  The formal template parameter that owns this element.
144
145   overriding function Get_Template_Parameter
146    (Self : not null access constant UML_Instance_Value_Proxy)
147       return AMF.UML.Template_Parameters.UML_Template_Parameter_Access;
148   --  Getter of ParameterableElement::templateParameter.
149   --
150   --  The template parameter that exposes this element as a formal parameter.
151
152   overriding procedure Set_Template_Parameter
153    (Self : not null access UML_Instance_Value_Proxy;
154     To   : AMF.UML.Template_Parameters.UML_Template_Parameter_Access);
155   --  Setter of ParameterableElement::templateParameter.
156   --
157   --  The template parameter that exposes this element as a formal parameter.
158
159   overriding function Boolean_Value
160    (Self : not null access constant UML_Instance_Value_Proxy)
161       return AMF.Optional_Boolean;
162   --  Operation ValueSpecification::booleanValue.
163   --
164   --  The query booleanValue() gives a single Boolean value when one can be
165   --  computed.
166
167   overriding function Integer_Value
168    (Self : not null access constant UML_Instance_Value_Proxy)
169       return AMF.Optional_Integer;
170   --  Operation ValueSpecification::integerValue.
171   --
172   --  The query integerValue() gives a single Integer value when one can be
173   --  computed.
174
175   overriding function Is_Compatible_With
176    (Self : not null access constant UML_Instance_Value_Proxy;
177     P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access)
178       return Boolean;
179   --  Operation ValueSpecification::isCompatibleWith.
180   --
181   --  The query isCompatibleWith() determines if this parameterable element
182   --  is compatible with the specified parameterable element. By default
183   --  parameterable element P is compatible with parameterable element Q if
184   --  the kind of P is the same or a subtype as the kind of Q. In addition,
185   --  for ValueSpecification, the type must be conformant with the type of
186   --  the specified parameterable element.
187
188   overriding function Is_Computable
189    (Self : not null access constant UML_Instance_Value_Proxy)
190       return Boolean;
191   --  Operation ValueSpecification::isComputable.
192   --
193   --  The query isComputable() determines whether a value specification can
194   --  be computed in a model. This operation cannot be fully defined in OCL.
195   --  A conforming implementation is expected to deliver true for this
196   --  operation for all value specifications that it can compute, and to
197   --  compute all of those for which the operation is true. A conforming
198   --  implementation is expected to be able to compute the value of all
199   --  literals.
200
201   overriding function Is_Null
202    (Self : not null access constant UML_Instance_Value_Proxy)
203       return Boolean;
204   --  Operation ValueSpecification::isNull.
205   --
206   --  The query isNull() returns true when it can be computed that the value
207   --  is null.
208
209   overriding function Real_Value
210    (Self : not null access constant UML_Instance_Value_Proxy)
211       return AMF.Optional_Real;
212   --  Operation ValueSpecification::realValue.
213   --
214   --  The query realValue() gives a single Real value when one can be
215   --  computed.
216
217   overriding function String_Value
218    (Self : not null access constant UML_Instance_Value_Proxy)
219       return AMF.Optional_String;
220   --  Operation ValueSpecification::stringValue.
221   --
222   --  The query stringValue() gives a single String value when one can be
223   --  computed.
224
225   overriding function Unlimited_Value
226    (Self : not null access constant UML_Instance_Value_Proxy)
227       return AMF.Optional_Unlimited_Natural;
228   --  Operation ValueSpecification::unlimitedValue.
229   --
230   --  The query unlimitedValue() gives a single UnlimitedNatural value when
231   --  one can be computed.
232
233   overriding function All_Owning_Packages
234    (Self : not null access constant UML_Instance_Value_Proxy)
235       return AMF.UML.Packages.Collections.Set_Of_UML_Package;
236   --  Operation NamedElement::allOwningPackages.
237   --
238   --  The query allOwningPackages() returns all the directly or indirectly
239   --  owning packages.
240
241   overriding function Is_Distinguishable_From
242    (Self : not null access constant UML_Instance_Value_Proxy;
243     N : AMF.UML.Named_Elements.UML_Named_Element_Access;
244     Ns : AMF.UML.Namespaces.UML_Namespace_Access)
245       return Boolean;
246   --  Operation NamedElement::isDistinguishableFrom.
247   --
248   --  The query isDistinguishableFrom() determines whether two NamedElements
249   --  may logically co-exist within a Namespace. By default, two named
250   --  elements are distinguishable if (a) they have unrelated types or (b)
251   --  they have related types but different names.
252
253   overriding function Namespace
254    (Self : not null access constant UML_Instance_Value_Proxy)
255       return AMF.UML.Namespaces.UML_Namespace_Access;
256   --  Operation NamedElement::namespace.
257   --
258   --  Missing derivation for NamedElement::/namespace : Namespace
259
260   overriding function Is_Template_Parameter
261    (Self : not null access constant UML_Instance_Value_Proxy)
262       return Boolean;
263   --  Operation ParameterableElement::isTemplateParameter.
264   --
265   --  The query isTemplateParameter() determines if this parameterable
266   --  element is exposed as a formal template parameter.
267
268   overriding procedure Enter_Element
269    (Self    : not null access constant UML_Instance_Value_Proxy;
270     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
271     Control : in out AMF.Visitors.Traverse_Control);
272   --  Dispatch call to corresponding subprogram of visitor interface.
273
274   overriding procedure Leave_Element
275    (Self    : not null access constant UML_Instance_Value_Proxy;
276     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
277     Control : in out AMF.Visitors.Traverse_Control);
278   --  Dispatch call to corresponding subprogram of visitor interface.
279
280   overriding procedure Visit_Element
281    (Self     : not null access constant UML_Instance_Value_Proxy;
282     Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
283     Visitor  : in out AMF.Visitors.Abstract_Visitor'Class;
284     Control  : in out AMF.Visitors.Traverse_Control);
285   --  Dispatch call to corresponding subprogram of iterator interface.
286
287end AMF.Internals.UML_Instance_Values;
288