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