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