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