1------------------------------------------------------------------------------
2--                                                                          --
3--                            Matreshka Project                             --
4--                                                                          --
5--                          Ada Modeling Framework                          --
6--                                                                          --
7--                        Runtime Library Component                         --
8--                                                                          --
9------------------------------------------------------------------------------
10--                                                                          --
11-- Copyright © 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: 2671 $ $Date: 2012-03-23 00:51:37 +0400 (Fri, 23 Mar 2012) $
43------------------------------------------------------------------------------
44--  This file is generated, don't edit it.
45------------------------------------------------------------------------------
46with AMF.Elements;
47with AMF.Internals.Element_Collections;
48with AMF.Internals.Helpers;
49with AMF.Internals.Tables.OCL_Attributes;
50with AMF.OCL.Collection_Literal_Parts.Collections;
51with AMF.UML.Comments.Collections;
52with AMF.UML.Dependencies.Collections;
53with AMF.UML.Elements.Collections;
54with AMF.UML.Named_Elements;
55with AMF.UML.Namespaces.Collections;
56with AMF.UML.Packages.Collections;
57with AMF.UML.String_Expressions;
58with AMF.UML.Types;
59with AMF.Visitors.OCL_Iterators;
60with AMF.Visitors.OCL_Visitors;
61with League.Strings.Internals;
62with Matreshka.Internals.Strings;
63
64package body AMF.Internals.OCL_Collection_Literal_Exps is
65
66   --------------
67   -- Get_Kind --
68   --------------
69
70   overriding function Get_Kind
71    (Self : not null access constant OCL_Collection_Literal_Exp_Proxy)
72       return AMF.OCL.OCL_Collection_Kind is
73   begin
74      return
75        AMF.Internals.Tables.OCL_Attributes.Internal_Get_Kind
76         (Self.Element);
77   end Get_Kind;
78
79   --------------
80   -- Set_Kind --
81   --------------
82
83   overriding procedure Set_Kind
84    (Self : not null access OCL_Collection_Literal_Exp_Proxy;
85     To   : AMF.OCL.OCL_Collection_Kind) is
86   begin
87      AMF.Internals.Tables.OCL_Attributes.Internal_Set_Kind
88       (Self.Element, To);
89   end Set_Kind;
90
91   --------------
92   -- Get_Part --
93   --------------
94
95   overriding function Get_Part
96    (Self : not null access constant OCL_Collection_Literal_Exp_Proxy)
97       return AMF.OCL.Collection_Literal_Parts.Collections.Ordered_Set_Of_OCL_Collection_Literal_Part is
98   begin
99      return
100        AMF.OCL.Collection_Literal_Parts.Collections.Wrap
101         (AMF.Internals.Element_Collections.Wrap
102           (AMF.Internals.Tables.OCL_Attributes.Internal_Get_Part
103             (Self.Element)));
104   end Get_Part;
105
106   --------------
107   -- Get_Type --
108   --------------
109
110   overriding function Get_Type
111    (Self : not null access constant OCL_Collection_Literal_Exp_Proxy)
112       return AMF.UML.Types.UML_Type_Access is
113   begin
114      return
115        AMF.UML.Types.UML_Type_Access
116         (AMF.Internals.Helpers.To_Element
117           (AMF.Internals.Tables.OCL_Attributes.Internal_Get_Type
118             (Self.Element)));
119   end Get_Type;
120
121   --------------
122   -- Set_Type --
123   --------------
124
125   overriding procedure Set_Type
126    (Self : not null access OCL_Collection_Literal_Exp_Proxy;
127     To   : AMF.UML.Types.UML_Type_Access) is
128   begin
129      AMF.Internals.Tables.OCL_Attributes.Internal_Set_Type
130       (Self.Element,
131        AMF.Internals.Helpers.To_Element
132         (AMF.Elements.Element_Access (To)));
133   end Set_Type;
134
135   ---------------------------
136   -- Get_Client_Dependency --
137   ---------------------------
138
139   overriding function Get_Client_Dependency
140    (Self : not null access constant OCL_Collection_Literal_Exp_Proxy)
141       return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency is
142   begin
143      return
144        AMF.UML.Dependencies.Collections.Wrap
145         (AMF.Internals.Element_Collections.Wrap
146           (AMF.Internals.Tables.OCL_Attributes.Internal_Get_Client_Dependency
147             (Self.Element)));
148   end Get_Client_Dependency;
149
150   --------------
151   -- Get_Name --
152   --------------
153
154   overriding function Get_Name
155    (Self : not null access constant OCL_Collection_Literal_Exp_Proxy)
156       return AMF.Optional_String is
157   begin
158      declare
159         use type Matreshka.Internals.Strings.Shared_String_Access;
160
161         Aux : constant Matreshka.Internals.Strings.Shared_String_Access
162           := AMF.Internals.Tables.OCL_Attributes.Internal_Get_Name (Self.Element);
163
164      begin
165         if Aux = null then
166            return (Is_Empty => True);
167
168         else
169            return (False, League.Strings.Internals.Create (Aux));
170         end if;
171      end;
172   end Get_Name;
173
174   --------------
175   -- Set_Name --
176   --------------
177
178   overriding procedure Set_Name
179    (Self : not null access OCL_Collection_Literal_Exp_Proxy;
180     To   : AMF.Optional_String) is
181   begin
182      if To.Is_Empty then
183         AMF.Internals.Tables.OCL_Attributes.Internal_Set_Name
184          (Self.Element, null);
185
186      else
187         AMF.Internals.Tables.OCL_Attributes.Internal_Set_Name
188          (Self.Element,
189           League.Strings.Internals.Internal (To.Value));
190      end if;
191   end Set_Name;
192
193   -------------------------
194   -- Get_Name_Expression --
195   -------------------------
196
197   overriding function Get_Name_Expression
198    (Self : not null access constant OCL_Collection_Literal_Exp_Proxy)
199       return AMF.UML.String_Expressions.UML_String_Expression_Access is
200   begin
201      return
202        AMF.UML.String_Expressions.UML_String_Expression_Access
203         (AMF.Internals.Helpers.To_Element
204           (AMF.Internals.Tables.OCL_Attributes.Internal_Get_Name_Expression
205             (Self.Element)));
206   end Get_Name_Expression;
207
208   -------------------------
209   -- Set_Name_Expression --
210   -------------------------
211
212   overriding procedure Set_Name_Expression
213    (Self : not null access OCL_Collection_Literal_Exp_Proxy;
214     To   : AMF.UML.String_Expressions.UML_String_Expression_Access) is
215   begin
216      AMF.Internals.Tables.OCL_Attributes.Internal_Set_Name_Expression
217       (Self.Element,
218        AMF.Internals.Helpers.To_Element
219         (AMF.Elements.Element_Access (To)));
220   end Set_Name_Expression;
221
222   -------------------
223   -- Get_Namespace --
224   -------------------
225
226   overriding function Get_Namespace
227    (Self : not null access constant OCL_Collection_Literal_Exp_Proxy)
228       return AMF.UML.Namespaces.UML_Namespace_Access is
229   begin
230      return
231        AMF.UML.Namespaces.UML_Namespace_Access
232         (AMF.Internals.Helpers.To_Element
233           (AMF.Internals.Tables.OCL_Attributes.Internal_Get_Namespace
234             (Self.Element)));
235   end Get_Namespace;
236
237   ------------------------
238   -- Get_Qualified_Name --
239   ------------------------
240
241   overriding function Get_Qualified_Name
242    (Self : not null access constant OCL_Collection_Literal_Exp_Proxy)
243       return AMF.Optional_String is
244   begin
245      declare
246         use type Matreshka.Internals.Strings.Shared_String_Access;
247
248         Aux : constant Matreshka.Internals.Strings.Shared_String_Access
249           := AMF.Internals.Tables.OCL_Attributes.Internal_Get_Qualified_Name (Self.Element);
250
251      begin
252         if Aux = null then
253            return (Is_Empty => True);
254
255         else
256            return (False, League.Strings.Internals.Create (Aux));
257         end if;
258      end;
259   end Get_Qualified_Name;
260
261   --------------------
262   -- Get_Visibility --
263   --------------------
264
265   overriding function Get_Visibility
266    (Self : not null access constant OCL_Collection_Literal_Exp_Proxy)
267       return AMF.UML.Optional_UML_Visibility_Kind is
268   begin
269      return
270        AMF.Internals.Tables.OCL_Attributes.Internal_Get_Visibility
271         (Self.Element);
272   end Get_Visibility;
273
274   --------------------
275   -- Set_Visibility --
276   --------------------
277
278   overriding procedure Set_Visibility
279    (Self : not null access OCL_Collection_Literal_Exp_Proxy;
280     To   : AMF.UML.Optional_UML_Visibility_Kind) is
281   begin
282      AMF.Internals.Tables.OCL_Attributes.Internal_Set_Visibility
283       (Self.Element, To);
284   end Set_Visibility;
285
286   -----------------------
287   -- Get_Owned_Comment --
288   -----------------------
289
290   overriding function Get_Owned_Comment
291    (Self : not null access constant OCL_Collection_Literal_Exp_Proxy)
292       return AMF.UML.Comments.Collections.Set_Of_UML_Comment is
293   begin
294      return
295        AMF.UML.Comments.Collections.Wrap
296         (AMF.Internals.Element_Collections.Wrap
297           (AMF.Internals.Tables.OCL_Attributes.Internal_Get_Owned_Comment
298             (Self.Element)));
299   end Get_Owned_Comment;
300
301   -----------------------
302   -- Get_Owned_Element --
303   -----------------------
304
305   overriding function Get_Owned_Element
306    (Self : not null access constant OCL_Collection_Literal_Exp_Proxy)
307       return AMF.UML.Elements.Collections.Set_Of_UML_Element is
308   begin
309      return
310        AMF.UML.Elements.Collections.Wrap
311         (AMF.Internals.Element_Collections.Wrap
312           (AMF.Internals.Tables.OCL_Attributes.Internal_Get_Owned_Element
313             (Self.Element)));
314   end Get_Owned_Element;
315
316   ---------------
317   -- Get_Owner --
318   ---------------
319
320   overriding function Get_Owner
321    (Self : not null access constant OCL_Collection_Literal_Exp_Proxy)
322       return AMF.UML.Elements.UML_Element_Access is
323   begin
324      return
325        AMF.UML.Elements.UML_Element_Access
326         (AMF.Internals.Helpers.To_Element
327           (AMF.Internals.Tables.OCL_Attributes.Internal_Get_Owner
328             (Self.Element)));
329   end Get_Owner;
330
331   --------------------
332   -- All_Namespaces --
333   --------------------
334
335   overriding function All_Namespaces
336    (Self : not null access constant OCL_Collection_Literal_Exp_Proxy)
337       return AMF.UML.Namespaces.Collections.Ordered_Set_Of_UML_Namespace is
338   begin
339      --  Generated stub: replace with real body!
340      pragma Compile_Time_Warning (Standard.True, "All_Namespaces unimplemented");
341      raise Program_Error with "Unimplemented procedure OCL_Collection_Literal_Exp_Proxy.All_Namespaces";
342      return All_Namespaces (Self);
343   end All_Namespaces;
344
345   -------------------------
346   -- All_Owning_Packages --
347   -------------------------
348
349   overriding function All_Owning_Packages
350    (Self : not null access constant OCL_Collection_Literal_Exp_Proxy)
351       return AMF.UML.Packages.Collections.Set_Of_UML_Package is
352   begin
353      --  Generated stub: replace with real body!
354      pragma Compile_Time_Warning (Standard.True, "All_Owning_Packages unimplemented");
355      raise Program_Error with "Unimplemented procedure OCL_Collection_Literal_Exp_Proxy.All_Owning_Packages";
356      return All_Owning_Packages (Self);
357   end All_Owning_Packages;
358
359   -----------------------------
360   -- Is_Distinguishable_From --
361   -----------------------------
362
363   overriding function Is_Distinguishable_From
364    (Self : not null access constant OCL_Collection_Literal_Exp_Proxy;
365     N : AMF.UML.Named_Elements.UML_Named_Element_Access;
366     Ns : AMF.UML.Namespaces.UML_Namespace_Access)
367       return Boolean is
368   begin
369      --  Generated stub: replace with real body!
370      pragma Compile_Time_Warning (Standard.True, "Is_Distinguishable_From unimplemented");
371      raise Program_Error with "Unimplemented procedure OCL_Collection_Literal_Exp_Proxy.Is_Distinguishable_From";
372      return Is_Distinguishable_From (Self, N, Ns);
373   end Is_Distinguishable_From;
374
375   ---------------
376   -- Namespace --
377   ---------------
378
379   overriding function Namespace
380    (Self : not null access constant OCL_Collection_Literal_Exp_Proxy)
381       return AMF.UML.Namespaces.UML_Namespace_Access is
382   begin
383      --  Generated stub: replace with real body!
384      pragma Compile_Time_Warning (Standard.True, "Namespace unimplemented");
385      raise Program_Error with "Unimplemented procedure OCL_Collection_Literal_Exp_Proxy.Namespace";
386      return Namespace (Self);
387   end Namespace;
388
389   --------------------
390   -- Qualified_Name --
391   --------------------
392
393   overriding function Qualified_Name
394    (Self : not null access constant OCL_Collection_Literal_Exp_Proxy)
395       return League.Strings.Universal_String is
396   begin
397      --  Generated stub: replace with real body!
398      pragma Compile_Time_Warning (Standard.True, "Qualified_Name unimplemented");
399      raise Program_Error with "Unimplemented procedure OCL_Collection_Literal_Exp_Proxy.Qualified_Name";
400      return Qualified_Name (Self);
401   end Qualified_Name;
402
403   ---------------
404   -- Separator --
405   ---------------
406
407   overriding function Separator
408    (Self : not null access constant OCL_Collection_Literal_Exp_Proxy)
409       return League.Strings.Universal_String is
410   begin
411      --  Generated stub: replace with real body!
412      pragma Compile_Time_Warning (Standard.True, "Separator unimplemented");
413      raise Program_Error with "Unimplemented procedure OCL_Collection_Literal_Exp_Proxy.Separator";
414      return Separator (Self);
415   end Separator;
416
417   ------------------------
418   -- All_Owned_Elements --
419   ------------------------
420
421   overriding function All_Owned_Elements
422    (Self : not null access constant OCL_Collection_Literal_Exp_Proxy)
423       return AMF.UML.Elements.Collections.Set_Of_UML_Element is
424   begin
425      --  Generated stub: replace with real body!
426      pragma Compile_Time_Warning (Standard.True, "All_Owned_Elements unimplemented");
427      raise Program_Error with "Unimplemented procedure OCL_Collection_Literal_Exp_Proxy.All_Owned_Elements";
428      return All_Owned_Elements (Self);
429   end All_Owned_Elements;
430
431   -------------------
432   -- Must_Be_Owned --
433   -------------------
434
435   overriding function Must_Be_Owned
436    (Self : not null access constant OCL_Collection_Literal_Exp_Proxy)
437       return Boolean is
438   begin
439      --  Generated stub: replace with real body!
440      pragma Compile_Time_Warning (Standard.True, "Must_Be_Owned unimplemented");
441      raise Program_Error with "Unimplemented procedure OCL_Collection_Literal_Exp_Proxy.Must_Be_Owned";
442      return Must_Be_Owned (Self);
443   end Must_Be_Owned;
444
445   -------------------
446   -- Enter_Element --
447   -------------------
448
449   overriding procedure Enter_Element
450    (Self    : not null access constant OCL_Collection_Literal_Exp_Proxy;
451     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
452     Control : in out AMF.Visitors.Traverse_Control) is
453   begin
454      if Visitor in AMF.Visitors.OCL_Visitors.OCL_Visitor'Class then
455         AMF.Visitors.OCL_Visitors.OCL_Visitor'Class
456          (Visitor).Enter_Collection_Literal_Exp
457            (AMF.OCL.Collection_Literal_Exps.OCL_Collection_Literal_Exp_Access (Self),
458           Control);
459      end if;
460   end Enter_Element;
461
462   -------------------
463   -- Leave_Element --
464   -------------------
465
466   overriding procedure Leave_Element
467    (Self    : not null access constant OCL_Collection_Literal_Exp_Proxy;
468     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
469     Control : in out AMF.Visitors.Traverse_Control) is
470   begin
471      if Visitor in AMF.Visitors.OCL_Visitors.OCL_Visitor'Class then
472         AMF.Visitors.OCL_Visitors.OCL_Visitor'Class
473          (Visitor).Leave_Collection_Literal_Exp
474            (AMF.OCL.Collection_Literal_Exps.OCL_Collection_Literal_Exp_Access (Self),
475           Control);
476      end if;
477   end Leave_Element;
478
479   -------------------
480   -- Visit_Element --
481   -------------------
482
483   overriding procedure Visit_Element
484    (Self     : not null access constant OCL_Collection_Literal_Exp_Proxy;
485     Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
486     Visitor  : in out AMF.Visitors.Abstract_Visitor'Class;
487     Control  : in out AMF.Visitors.Traverse_Control) is
488   begin
489      if Iterator in AMF.Visitors.OCL_Iterators.OCL_Iterator'Class then
490         AMF.Visitors.OCL_Iterators.OCL_Iterator'Class
491          (Iterator).Visit_Collection_Literal_Exp
492            (Visitor,
493             AMF.OCL.Collection_Literal_Exps.OCL_Collection_Literal_Exp_Access (Self),
494           Control);
495      end if;
496   end Visit_Element;
497
498end AMF.Internals.OCL_Collection_Literal_Exps;
499