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.Elements;
45with AMF.Internals.Element_Collections;
46with AMF.Internals.Helpers;
47with AMF.Internals.Tables.UML_Attributes;
48with AMF.Visitors.UML_Iterators;
49with AMF.Visitors.UML_Visitors;
50with League.Strings.Internals;
51with Matreshka.Internals.Strings;
52
53package body AMF.Internals.UML_Operations is
54
55   -------------------
56   -- Enter_Element --
57   -------------------
58
59   overriding procedure Enter_Element
60    (Self    : not null access constant UML_Operation_Proxy;
61     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
62     Control : in out AMF.Visitors.Traverse_Control) is
63   begin
64      if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
65         AMF.Visitors.UML_Visitors.UML_Visitor'Class
66          (Visitor).Enter_Operation
67            (AMF.UML.Operations.UML_Operation_Access (Self),
68           Control);
69      end if;
70   end Enter_Element;
71
72   -------------------
73   -- Leave_Element --
74   -------------------
75
76   overriding procedure Leave_Element
77    (Self    : not null access constant UML_Operation_Proxy;
78     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
79     Control : in out AMF.Visitors.Traverse_Control) is
80   begin
81      if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
82         AMF.Visitors.UML_Visitors.UML_Visitor'Class
83          (Visitor).Leave_Operation
84            (AMF.UML.Operations.UML_Operation_Access (Self),
85           Control);
86      end if;
87   end Leave_Element;
88
89   -------------------
90   -- Return_Result --
91   -------------------
92
93   overriding function Return_Result
94    (Self : not null access constant UML_Operation_Proxy)
95       return AMF.UML.Parameters.Collections.Set_Of_UML_Parameter
96   is
97      use type AMF.UML.UML_Parameter_Direction_Kind;
98
99      Parameters    : constant
100        AMF.UML.Parameters.Collections.Ordered_Set_Of_UML_Parameter
101          := Self.Get_Owned_Parameter;
102      The_Parameter : AMF.UML.Parameters.UML_Parameter_Access;
103
104   begin
105      return Result : AMF.UML.Parameters.Collections.Set_Of_UML_Parameter do
106         for J in 1 .. Parameters.Length loop
107            The_Parameter := Parameters.Element (J);
108
109            if The_Parameter.Get_Direction = AMF.UML.Return_Parameter then
110               Result.Add (The_Parameter);
111            end if;
112         end loop;
113      end return;
114   end Return_Result;
115
116   -------------------
117   -- Visit_Element --
118   -------------------
119
120   overriding procedure Visit_Element
121    (Self     : not null access constant UML_Operation_Proxy;
122     Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
123     Visitor  : in out AMF.Visitors.Abstract_Visitor'Class;
124     Control  : in out AMF.Visitors.Traverse_Control) is
125   begin
126      if Iterator in AMF.Visitors.UML_Iterators.UML_Iterator'Class then
127         AMF.Visitors.UML_Iterators.UML_Iterator'Class
128          (Iterator).Visit_Operation
129            (Visitor,
130             AMF.UML.Operations.UML_Operation_Access (Self),
131             Control);
132      end if;
133   end Visit_Element;
134
135   ------------------------
136   -- Get_Body_Condition --
137   ------------------------
138
139   overriding function Get_Body_Condition
140    (Self : not null access constant UML_Operation_Proxy)
141       return AMF.UML.Constraints.UML_Constraint_Access is
142   begin
143      return
144        AMF.UML.Constraints.UML_Constraint_Access
145         (AMF.Internals.Helpers.To_Element
146           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Body_Condition
147             (Self.Element)));
148   end Get_Body_Condition;
149
150   ------------------------
151   -- Set_Body_Condition --
152   ------------------------
153
154   overriding procedure Set_Body_Condition
155    (Self : not null access UML_Operation_Proxy;
156     To   : AMF.UML.Constraints.UML_Constraint_Access) is
157   begin
158      AMF.Internals.Tables.UML_Attributes.Internal_Set_Body_Condition
159       (Self.Element,
160        AMF.Internals.Helpers.To_Element
161         (AMF.Elements.Element_Access (To)));
162   end Set_Body_Condition;
163
164   ---------------
165   -- Get_Class --
166   ---------------
167
168   overriding function Get_Class
169    (Self : not null access constant UML_Operation_Proxy)
170       return AMF.UML.Classes.UML_Class_Access is
171   begin
172      return
173        AMF.UML.Classes.UML_Class_Access
174         (AMF.Internals.Helpers.To_Element
175           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Class
176             (Self.Element)));
177   end Get_Class;
178
179   ---------------
180   -- Set_Class --
181   ---------------
182
183   overriding procedure Set_Class
184    (Self : not null access UML_Operation_Proxy;
185     To   : AMF.UML.Classes.UML_Class_Access) is
186   begin
187      AMF.Internals.Tables.UML_Attributes.Internal_Set_Class
188       (Self.Element,
189        AMF.Internals.Helpers.To_Element
190         (AMF.Elements.Element_Access (To)));
191   end Set_Class;
192
193   ------------------
194   -- Get_Datatype --
195   ------------------
196
197   overriding function Get_Datatype
198    (Self : not null access constant UML_Operation_Proxy)
199       return AMF.UML.Data_Types.UML_Data_Type_Access is
200   begin
201      return
202        AMF.UML.Data_Types.UML_Data_Type_Access
203         (AMF.Internals.Helpers.To_Element
204           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Datatype
205             (Self.Element)));
206   end Get_Datatype;
207
208   ------------------
209   -- Set_Datatype --
210   ------------------
211
212   overriding procedure Set_Datatype
213    (Self : not null access UML_Operation_Proxy;
214     To   : AMF.UML.Data_Types.UML_Data_Type_Access) is
215   begin
216      AMF.Internals.Tables.UML_Attributes.Internal_Set_Datatype
217       (Self.Element,
218        AMF.Internals.Helpers.To_Element
219         (AMF.Elements.Element_Access (To)));
220   end Set_Datatype;
221
222   -------------------
223   -- Get_Interface --
224   -------------------
225
226   overriding function Get_Interface
227    (Self : not null access constant UML_Operation_Proxy)
228       return AMF.UML.Interfaces.UML_Interface_Access is
229   begin
230      return
231        AMF.UML.Interfaces.UML_Interface_Access
232         (AMF.Internals.Helpers.To_Element
233           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Interface
234             (Self.Element)));
235   end Get_Interface;
236
237   -------------------
238   -- Set_Interface --
239   -------------------
240
241   overriding procedure Set_Interface
242    (Self : not null access UML_Operation_Proxy;
243     To   : AMF.UML.Interfaces.UML_Interface_Access) is
244   begin
245      AMF.Internals.Tables.UML_Attributes.Internal_Set_Interface
246       (Self.Element,
247        AMF.Internals.Helpers.To_Element
248         (AMF.Elements.Element_Access (To)));
249   end Set_Interface;
250
251   --------------------
252   -- Get_Is_Ordered --
253   --------------------
254
255   overriding function Get_Is_Ordered
256    (Self : not null access constant UML_Operation_Proxy)
257       return Boolean is
258   begin
259      return
260        AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Ordered
261         (Self.Element);
262   end Get_Is_Ordered;
263
264   ------------------
265   -- Get_Is_Query --
266   ------------------
267
268   overriding function Get_Is_Query
269    (Self : not null access constant UML_Operation_Proxy)
270       return Boolean is
271   begin
272      return
273        AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Query
274         (Self.Element);
275   end Get_Is_Query;
276
277   ------------------
278   -- Set_Is_Query --
279   ------------------
280
281   overriding procedure Set_Is_Query
282    (Self : not null access UML_Operation_Proxy;
283     To   : Boolean) is
284   begin
285      AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Query
286       (Self.Element, To);
287   end Set_Is_Query;
288
289   -------------------
290   -- Get_Is_Unique --
291   -------------------
292
293   overriding function Get_Is_Unique
294    (Self : not null access constant UML_Operation_Proxy)
295       return Boolean is
296   begin
297      return
298        AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Unique
299         (Self.Element);
300   end Get_Is_Unique;
301
302   ---------------
303   -- Get_Lower --
304   ---------------
305
306   overriding function Get_Lower
307    (Self : not null access constant UML_Operation_Proxy)
308       return AMF.Optional_Integer is
309   begin
310      return
311        AMF.Internals.Tables.UML_Attributes.Internal_Get_Lower
312         (Self.Element);
313   end Get_Lower;
314
315   -------------------------
316   -- Get_Owned_Parameter --
317   -------------------------
318
319   overriding function Get_Owned_Parameter
320    (Self : not null access constant UML_Operation_Proxy)
321       return AMF.UML.Parameters.Collections.Ordered_Set_Of_UML_Parameter is
322   begin
323      return
324        AMF.UML.Parameters.Collections.Wrap
325         (AMF.Internals.Element_Collections.Wrap
326           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Parameter
327             (Self.Element)));
328   end Get_Owned_Parameter;
329
330   -----------------------
331   -- Get_Postcondition --
332   -----------------------
333
334   overriding function Get_Postcondition
335    (Self : not null access constant UML_Operation_Proxy)
336       return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint is
337   begin
338      return
339        AMF.UML.Constraints.Collections.Wrap
340         (AMF.Internals.Element_Collections.Wrap
341           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Postcondition
342             (Self.Element)));
343   end Get_Postcondition;
344
345   ----------------------
346   -- Get_Precondition --
347   ----------------------
348
349   overriding function Get_Precondition
350    (Self : not null access constant UML_Operation_Proxy)
351       return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint is
352   begin
353      return
354        AMF.UML.Constraints.Collections.Wrap
355         (AMF.Internals.Element_Collections.Wrap
356           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Precondition
357             (Self.Element)));
358   end Get_Precondition;
359
360   --------------------------
361   -- Get_Raised_Exception --
362   --------------------------
363
364   overriding function Get_Raised_Exception
365    (Self : not null access constant UML_Operation_Proxy)
366       return AMF.UML.Types.Collections.Set_Of_UML_Type is
367   begin
368      return
369        AMF.UML.Types.Collections.Wrap
370         (AMF.Internals.Element_Collections.Wrap
371           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Raised_Exception
372             (Self.Element)));
373   end Get_Raised_Exception;
374
375   -----------------------------
376   -- Get_Redefined_Operation --
377   -----------------------------
378
379   overriding function Get_Redefined_Operation
380    (Self : not null access constant UML_Operation_Proxy)
381       return AMF.UML.Operations.Collections.Set_Of_UML_Operation is
382   begin
383      return
384        AMF.UML.Operations.Collections.Wrap
385         (AMF.Internals.Element_Collections.Wrap
386           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefined_Operation
387             (Self.Element)));
388   end Get_Redefined_Operation;
389
390   ----------------------------
391   -- Get_Template_Parameter --
392   ----------------------------
393
394   overriding function Get_Template_Parameter
395    (Self : not null access constant UML_Operation_Proxy)
396       return AMF.UML.Operation_Template_Parameters.UML_Operation_Template_Parameter_Access is
397   begin
398      return
399        AMF.UML.Operation_Template_Parameters.UML_Operation_Template_Parameter_Access
400         (AMF.Internals.Helpers.To_Element
401           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Template_Parameter
402             (Self.Element)));
403   end Get_Template_Parameter;
404
405   ----------------------------
406   -- Set_Template_Parameter --
407   ----------------------------
408
409   overriding procedure Set_Template_Parameter
410    (Self : not null access UML_Operation_Proxy;
411     To   : AMF.UML.Operation_Template_Parameters.UML_Operation_Template_Parameter_Access) is
412   begin
413      AMF.Internals.Tables.UML_Attributes.Internal_Set_Template_Parameter
414       (Self.Element,
415        AMF.Internals.Helpers.To_Element
416         (AMF.Elements.Element_Access (To)));
417   end Set_Template_Parameter;
418
419   --------------
420   -- Get_Type --
421   --------------
422
423   overriding function Get_Type
424    (Self : not null access constant UML_Operation_Proxy)
425       return AMF.UML.Types.UML_Type_Access is
426   begin
427      return
428        AMF.UML.Types.UML_Type_Access
429         (AMF.Internals.Helpers.To_Element
430           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Type
431             (Self.Element)));
432   end Get_Type;
433
434   ---------------
435   -- Get_Upper --
436   ---------------
437
438   overriding function Get_Upper
439    (Self : not null access constant UML_Operation_Proxy)
440       return AMF.Optional_Unlimited_Natural is
441   begin
442      return
443        AMF.Internals.Tables.UML_Attributes.Internal_Get_Upper
444         (Self.Element);
445   end Get_Upper;
446
447   ---------------------
448   -- Get_Concurrency --
449   ---------------------
450
451   overriding function Get_Concurrency
452    (Self : not null access constant UML_Operation_Proxy)
453       return AMF.UML.UML_Call_Concurrency_Kind is
454   begin
455      return
456        AMF.Internals.Tables.UML_Attributes.Internal_Get_Concurrency
457         (Self.Element);
458   end Get_Concurrency;
459
460   ---------------------
461   -- Set_Concurrency --
462   ---------------------
463
464   overriding procedure Set_Concurrency
465    (Self : not null access UML_Operation_Proxy;
466     To   : AMF.UML.UML_Call_Concurrency_Kind) is
467   begin
468      AMF.Internals.Tables.UML_Attributes.Internal_Set_Concurrency
469       (Self.Element, To);
470   end Set_Concurrency;
471
472   ---------------------
473   -- Get_Is_Abstract --
474   ---------------------
475
476   overriding function Get_Is_Abstract
477    (Self : not null access constant UML_Operation_Proxy)
478       return Boolean is
479   begin
480      return
481        AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Abstract
482         (Self.Element);
483   end Get_Is_Abstract;
484
485   ---------------------
486   -- Set_Is_Abstract --
487   ---------------------
488
489   overriding procedure Set_Is_Abstract
490    (Self : not null access UML_Operation_Proxy;
491     To   : Boolean) is
492   begin
493      AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Abstract
494       (Self.Element, To);
495   end Set_Is_Abstract;
496
497   ----------------
498   -- Get_Method --
499   ----------------
500
501   overriding function Get_Method
502    (Self : not null access constant UML_Operation_Proxy)
503       return AMF.UML.Behaviors.Collections.Set_Of_UML_Behavior is
504   begin
505      return
506        AMF.UML.Behaviors.Collections.Wrap
507         (AMF.Internals.Element_Collections.Wrap
508           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Method
509             (Self.Element)));
510   end Get_Method;
511
512   -----------------------------
513   -- Get_Owned_Parameter_Set --
514   -----------------------------
515
516   overriding function Get_Owned_Parameter_Set
517    (Self : not null access constant UML_Operation_Proxy)
518       return AMF.UML.Parameter_Sets.Collections.Set_Of_UML_Parameter_Set is
519   begin
520      return
521        AMF.UML.Parameter_Sets.Collections.Wrap
522         (AMF.Internals.Element_Collections.Wrap
523           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Parameter_Set
524             (Self.Element)));
525   end Get_Owned_Parameter_Set;
526
527   ------------------------------
528   -- Get_Featuring_Classifier --
529   ------------------------------
530
531   overriding function Get_Featuring_Classifier
532    (Self : not null access constant UML_Operation_Proxy)
533       return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is
534   begin
535      return
536        AMF.UML.Classifiers.Collections.Wrap
537         (AMF.Internals.Element_Collections.Wrap
538           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Featuring_Classifier
539             (Self.Element)));
540   end Get_Featuring_Classifier;
541
542   -------------------
543   -- Get_Is_Static --
544   -------------------
545
546   overriding function Get_Is_Static
547    (Self : not null access constant UML_Operation_Proxy)
548       return Boolean is
549   begin
550      return
551        AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Static
552         (Self.Element);
553   end Get_Is_Static;
554
555   -------------------
556   -- Set_Is_Static --
557   -------------------
558
559   overriding procedure Set_Is_Static
560    (Self : not null access UML_Operation_Proxy;
561     To   : Boolean) is
562   begin
563      AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Static
564       (Self.Element, To);
565   end Set_Is_Static;
566
567   -----------------
568   -- Get_Is_Leaf --
569   -----------------
570
571   overriding function Get_Is_Leaf
572    (Self : not null access constant UML_Operation_Proxy)
573       return Boolean is
574   begin
575      return
576        AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Leaf
577         (Self.Element);
578   end Get_Is_Leaf;
579
580   -----------------
581   -- Set_Is_Leaf --
582   -----------------
583
584   overriding procedure Set_Is_Leaf
585    (Self : not null access UML_Operation_Proxy;
586     To   : Boolean) is
587   begin
588      AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Leaf
589       (Self.Element, To);
590   end Set_Is_Leaf;
591
592   ---------------------------
593   -- Get_Redefined_Element --
594   ---------------------------
595
596   overriding function Get_Redefined_Element
597    (Self : not null access constant UML_Operation_Proxy)
598       return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element is
599   begin
600      return
601        AMF.UML.Redefinable_Elements.Collections.Wrap
602         (AMF.Internals.Element_Collections.Wrap
603           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefined_Element
604             (Self.Element)));
605   end Get_Redefined_Element;
606
607   ------------------------------
608   -- Get_Redefinition_Context --
609   ------------------------------
610
611   overriding function Get_Redefinition_Context
612    (Self : not null access constant UML_Operation_Proxy)
613       return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is
614   begin
615      return
616        AMF.UML.Classifiers.Collections.Wrap
617         (AMF.Internals.Element_Collections.Wrap
618           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefinition_Context
619             (Self.Element)));
620   end Get_Redefinition_Context;
621
622   ---------------------------
623   -- Get_Client_Dependency --
624   ---------------------------
625
626   overriding function Get_Client_Dependency
627    (Self : not null access constant UML_Operation_Proxy)
628       return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency is
629   begin
630      return
631        AMF.UML.Dependencies.Collections.Wrap
632         (AMF.Internals.Element_Collections.Wrap
633           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Client_Dependency
634             (Self.Element)));
635   end Get_Client_Dependency;
636
637   -------------------------
638   -- Get_Name_Expression --
639   -------------------------
640
641   overriding function Get_Name_Expression
642    (Self : not null access constant UML_Operation_Proxy)
643       return AMF.UML.String_Expressions.UML_String_Expression_Access is
644   begin
645      return
646        AMF.UML.String_Expressions.UML_String_Expression_Access
647         (AMF.Internals.Helpers.To_Element
648           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Name_Expression
649             (Self.Element)));
650   end Get_Name_Expression;
651
652   -------------------------
653   -- Set_Name_Expression --
654   -------------------------
655
656   overriding procedure Set_Name_Expression
657    (Self : not null access UML_Operation_Proxy;
658     To   : AMF.UML.String_Expressions.UML_String_Expression_Access) is
659   begin
660      AMF.Internals.Tables.UML_Attributes.Internal_Set_Name_Expression
661       (Self.Element,
662        AMF.Internals.Helpers.To_Element
663         (AMF.Elements.Element_Access (To)));
664   end Set_Name_Expression;
665
666   -------------------
667   -- Get_Namespace --
668   -------------------
669
670   overriding function Get_Namespace
671    (Self : not null access constant UML_Operation_Proxy)
672       return AMF.UML.Namespaces.UML_Namespace_Access is
673   begin
674      return
675        AMF.UML.Namespaces.UML_Namespace_Access
676         (AMF.Internals.Helpers.To_Element
677           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Namespace
678             (Self.Element)));
679   end Get_Namespace;
680
681   ------------------------
682   -- Get_Qualified_Name --
683   ------------------------
684
685   overriding function Get_Qualified_Name
686    (Self : not null access constant UML_Operation_Proxy)
687       return AMF.Optional_String is
688   begin
689      declare
690         use type Matreshka.Internals.Strings.Shared_String_Access;
691
692         Aux : constant Matreshka.Internals.Strings.Shared_String_Access
693           := AMF.Internals.Tables.UML_Attributes.Internal_Get_Qualified_Name (Self.Element);
694
695      begin
696         if Aux = null then
697            return (Is_Empty => True);
698
699         else
700            return (False, League.Strings.Internals.Create (Aux));
701         end if;
702      end;
703   end Get_Qualified_Name;
704
705   ------------------------
706   -- Get_Element_Import --
707   ------------------------
708
709   overriding function Get_Element_Import
710    (Self : not null access constant UML_Operation_Proxy)
711       return AMF.UML.Element_Imports.Collections.Set_Of_UML_Element_Import is
712   begin
713      return
714        AMF.UML.Element_Imports.Collections.Wrap
715         (AMF.Internals.Element_Collections.Wrap
716           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Element_Import
717             (Self.Element)));
718   end Get_Element_Import;
719
720   -------------------------
721   -- Get_Imported_Member --
722   -------------------------
723
724   overriding function Get_Imported_Member
725    (Self : not null access constant UML_Operation_Proxy)
726       return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element is
727   begin
728      return
729        AMF.UML.Packageable_Elements.Collections.Wrap
730         (AMF.Internals.Element_Collections.Wrap
731           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Imported_Member
732             (Self.Element)));
733   end Get_Imported_Member;
734
735   ----------------
736   -- Get_Member --
737   ----------------
738
739   overriding function Get_Member
740    (Self : not null access constant UML_Operation_Proxy)
741       return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is
742   begin
743      return
744        AMF.UML.Named_Elements.Collections.Wrap
745         (AMF.Internals.Element_Collections.Wrap
746           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Member
747             (Self.Element)));
748   end Get_Member;
749
750   ----------------------
751   -- Get_Owned_Member --
752   ----------------------
753
754   overriding function Get_Owned_Member
755    (Self : not null access constant UML_Operation_Proxy)
756       return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is
757   begin
758      return
759        AMF.UML.Named_Elements.Collections.Wrap
760         (AMF.Internals.Element_Collections.Wrap
761           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Member
762             (Self.Element)));
763   end Get_Owned_Member;
764
765   --------------------
766   -- Get_Owned_Rule --
767   --------------------
768
769   overriding function Get_Owned_Rule
770    (Self : not null access constant UML_Operation_Proxy)
771       return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint is
772   begin
773      return
774        AMF.UML.Constraints.Collections.Wrap
775         (AMF.Internals.Element_Collections.Wrap
776           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Rule
777             (Self.Element)));
778   end Get_Owned_Rule;
779
780   ------------------------
781   -- Get_Package_Import --
782   ------------------------
783
784   overriding function Get_Package_Import
785    (Self : not null access constant UML_Operation_Proxy)
786       return AMF.UML.Package_Imports.Collections.Set_Of_UML_Package_Import is
787   begin
788      return
789        AMF.UML.Package_Imports.Collections.Wrap
790         (AMF.Internals.Element_Collections.Wrap
791           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Package_Import
792             (Self.Element)));
793   end Get_Package_Import;
794
795   ----------------------------------
796   -- Get_Owned_Template_Signature --
797   ----------------------------------
798
799   overriding function Get_Owned_Template_Signature
800    (Self : not null access constant UML_Operation_Proxy)
801       return AMF.UML.Template_Signatures.UML_Template_Signature_Access is
802   begin
803      return
804        AMF.UML.Template_Signatures.UML_Template_Signature_Access
805         (AMF.Internals.Helpers.To_Element
806           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Template_Signature
807             (Self.Element)));
808   end Get_Owned_Template_Signature;
809
810   ----------------------------------
811   -- Set_Owned_Template_Signature --
812   ----------------------------------
813
814   overriding procedure Set_Owned_Template_Signature
815    (Self : not null access UML_Operation_Proxy;
816     To   : AMF.UML.Template_Signatures.UML_Template_Signature_Access) is
817   begin
818      AMF.Internals.Tables.UML_Attributes.Internal_Set_Owned_Template_Signature
819       (Self.Element,
820        AMF.Internals.Helpers.To_Element
821         (AMF.Elements.Element_Access (To)));
822   end Set_Owned_Template_Signature;
823
824   --------------------------
825   -- Get_Template_Binding --
826   --------------------------
827
828   overriding function Get_Template_Binding
829    (Self : not null access constant UML_Operation_Proxy)
830       return AMF.UML.Template_Bindings.Collections.Set_Of_UML_Template_Binding is
831   begin
832      return
833        AMF.UML.Template_Bindings.Collections.Wrap
834         (AMF.Internals.Element_Collections.Wrap
835           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Template_Binding
836             (Self.Element)));
837   end Get_Template_Binding;
838
839   -----------------------------------
840   -- Get_Owning_Template_Parameter --
841   -----------------------------------
842
843   overriding function Get_Owning_Template_Parameter
844    (Self : not null access constant UML_Operation_Proxy)
845       return AMF.UML.Template_Parameters.UML_Template_Parameter_Access is
846   begin
847      return
848        AMF.UML.Template_Parameters.UML_Template_Parameter_Access
849         (AMF.Internals.Helpers.To_Element
850           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Owning_Template_Parameter
851             (Self.Element)));
852   end Get_Owning_Template_Parameter;
853
854   -----------------------------------
855   -- Set_Owning_Template_Parameter --
856   -----------------------------------
857
858   overriding procedure Set_Owning_Template_Parameter
859    (Self : not null access UML_Operation_Proxy;
860     To   : AMF.UML.Template_Parameters.UML_Template_Parameter_Access) is
861   begin
862      AMF.Internals.Tables.UML_Attributes.Internal_Set_Owning_Template_Parameter
863       (Self.Element,
864        AMF.Internals.Helpers.To_Element
865         (AMF.Elements.Element_Access (To)));
866   end Set_Owning_Template_Parameter;
867
868   ----------------------------
869   -- Get_Template_Parameter --
870   ----------------------------
871
872   overriding function Get_Template_Parameter
873    (Self : not null access constant UML_Operation_Proxy)
874       return AMF.UML.Template_Parameters.UML_Template_Parameter_Access is
875   begin
876      return
877        AMF.UML.Template_Parameters.UML_Template_Parameter_Access
878         (AMF.Internals.Helpers.To_Element
879           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Template_Parameter
880             (Self.Element)));
881   end Get_Template_Parameter;
882
883   ----------------------------
884   -- Set_Template_Parameter --
885   ----------------------------
886
887   overriding procedure Set_Template_Parameter
888    (Self : not null access UML_Operation_Proxy;
889     To   : AMF.UML.Template_Parameters.UML_Template_Parameter_Access) is
890   begin
891      AMF.Internals.Tables.UML_Attributes.Internal_Set_Template_Parameter
892       (Self.Element,
893        AMF.Internals.Helpers.To_Element
894         (AMF.Elements.Element_Access (To)));
895   end Set_Template_Parameter;
896
897   ------------------------
898   -- Is_Consistent_With --
899   ------------------------
900
901   overriding function Is_Consistent_With
902    (Self : not null access constant UML_Operation_Proxy;
903     Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
904       return Boolean is
905   begin
906      --  Generated stub: replace with real body!
907      pragma Compile_Time_Warning (Standard.True, "Is_Consistent_With unimplemented");
908      raise Program_Error with "Unimplemented procedure UML_Operation_Proxy.Is_Consistent_With";
909      return Is_Consistent_With (Self, Redefinee);
910   end Is_Consistent_With;
911
912   ----------------
913   -- Is_Ordered --
914   ----------------
915
916   overriding function Is_Ordered
917    (Self : not null access constant UML_Operation_Proxy)
918       return Boolean is
919   begin
920      --  Generated stub: replace with real body!
921      pragma Compile_Time_Warning (Standard.True, "Is_Ordered unimplemented");
922      raise Program_Error with "Unimplemented procedure UML_Operation_Proxy.Is_Ordered";
923      return Is_Ordered (Self);
924   end Is_Ordered;
925
926   ---------------
927   -- Is_Unique --
928   ---------------
929
930   overriding function Is_Unique
931    (Self : not null access constant UML_Operation_Proxy)
932       return Boolean is
933   begin
934      --  Generated stub: replace with real body!
935      pragma Compile_Time_Warning (Standard.True, "Is_Unique unimplemented");
936      raise Program_Error with "Unimplemented procedure UML_Operation_Proxy.Is_Unique";
937      return Is_Unique (Self);
938   end Is_Unique;
939
940   -----------
941   -- Lower --
942   -----------
943
944   overriding function Lower
945    (Self : not null access constant UML_Operation_Proxy)
946       return Integer is
947   begin
948      --  Generated stub: replace with real body!
949      pragma Compile_Time_Warning (Standard.True, "Lower unimplemented");
950      raise Program_Error with "Unimplemented procedure UML_Operation_Proxy.Lower";
951      return Lower (Self);
952   end Lower;
953
954   -----------
955   -- Types --
956   -----------
957
958   overriding function Types
959    (Self : not null access constant UML_Operation_Proxy)
960       return AMF.UML.Types.UML_Type_Access is
961   begin
962      --  Generated stub: replace with real body!
963      pragma Compile_Time_Warning (Standard.True, "Types unimplemented");
964      raise Program_Error with "Unimplemented procedure UML_Operation_Proxy.Types";
965      return Types (Self);
966   end Types;
967
968   -----------
969   -- Upper --
970   -----------
971
972   overriding function Upper
973    (Self : not null access constant UML_Operation_Proxy)
974       return AMF.Unlimited_Natural is
975   begin
976      --  Generated stub: replace with real body!
977      pragma Compile_Time_Warning (Standard.True, "Upper unimplemented");
978      raise Program_Error with "Unimplemented procedure UML_Operation_Proxy.Upper";
979      return Upper (Self);
980   end Upper;
981
982   -----------------------------
983   -- Is_Distinguishable_From --
984   -----------------------------
985
986   overriding function Is_Distinguishable_From
987    (Self : not null access constant UML_Operation_Proxy;
988     N : AMF.UML.Named_Elements.UML_Named_Element_Access;
989     Ns : AMF.UML.Namespaces.UML_Namespace_Access)
990       return Boolean is
991   begin
992      --  Generated stub: replace with real body!
993      pragma Compile_Time_Warning (Standard.True, "Is_Distinguishable_From unimplemented");
994      raise Program_Error with "Unimplemented procedure UML_Operation_Proxy.Is_Distinguishable_From";
995      return Is_Distinguishable_From (Self, N, Ns);
996   end Is_Distinguishable_From;
997
998   -----------------------------------
999   -- Is_Redefinition_Context_Valid --
1000   -----------------------------------
1001
1002   overriding function Is_Redefinition_Context_Valid
1003    (Self : not null access constant UML_Operation_Proxy;
1004     Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
1005       return Boolean is
1006   begin
1007      --  Generated stub: replace with real body!
1008      pragma Compile_Time_Warning (Standard.True, "Is_Redefinition_Context_Valid unimplemented");
1009      raise Program_Error with "Unimplemented procedure UML_Operation_Proxy.Is_Redefinition_Context_Valid";
1010      return Is_Redefinition_Context_Valid (Self, Redefined);
1011   end Is_Redefinition_Context_Valid;
1012
1013   -------------------------
1014   -- All_Owning_Packages --
1015   -------------------------
1016
1017   overriding function All_Owning_Packages
1018    (Self : not null access constant UML_Operation_Proxy)
1019       return AMF.UML.Packages.Collections.Set_Of_UML_Package is
1020   begin
1021      --  Generated stub: replace with real body!
1022      pragma Compile_Time_Warning (Standard.True, "All_Owning_Packages unimplemented");
1023      raise Program_Error with "Unimplemented procedure UML_Operation_Proxy.All_Owning_Packages";
1024      return All_Owning_Packages (Self);
1025   end All_Owning_Packages;
1026
1027   ---------------
1028   -- Namespace --
1029   ---------------
1030
1031   overriding function Namespace
1032    (Self : not null access constant UML_Operation_Proxy)
1033       return AMF.UML.Namespaces.UML_Namespace_Access is
1034   begin
1035      --  Generated stub: replace with real body!
1036      pragma Compile_Time_Warning (Standard.True, "Namespace unimplemented");
1037      raise Program_Error with "Unimplemented procedure UML_Operation_Proxy.Namespace";
1038      return Namespace (Self);
1039   end Namespace;
1040
1041   ------------------------
1042   -- Exclude_Collisions --
1043   ------------------------
1044
1045   overriding function Exclude_Collisions
1046    (Self : not null access constant UML_Operation_Proxy;
1047     Imps : AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element)
1048       return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element is
1049   begin
1050      --  Generated stub: replace with real body!
1051      pragma Compile_Time_Warning (Standard.True, "Exclude_Collisions unimplemented");
1052      raise Program_Error with "Unimplemented procedure UML_Operation_Proxy.Exclude_Collisions";
1053      return Exclude_Collisions (Self, Imps);
1054   end Exclude_Collisions;
1055
1056   -------------------------
1057   -- Get_Names_Of_Member --
1058   -------------------------
1059
1060   overriding function Get_Names_Of_Member
1061    (Self : not null access constant UML_Operation_Proxy;
1062     Element : AMF.UML.Named_Elements.UML_Named_Element_Access)
1063       return AMF.String_Collections.Set_Of_String is
1064   begin
1065      --  Generated stub: replace with real body!
1066      pragma Compile_Time_Warning (Standard.True, "Get_Names_Of_Member unimplemented");
1067      raise Program_Error with "Unimplemented procedure UML_Operation_Proxy.Get_Names_Of_Member";
1068      return Get_Names_Of_Member (Self, Element);
1069   end Get_Names_Of_Member;
1070
1071   --------------------
1072   -- Import_Members --
1073   --------------------
1074
1075   overriding function Import_Members
1076    (Self : not null access constant UML_Operation_Proxy;
1077     Imps : AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element)
1078       return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element is
1079   begin
1080      --  Generated stub: replace with real body!
1081      pragma Compile_Time_Warning (Standard.True, "Import_Members unimplemented");
1082      raise Program_Error with "Unimplemented procedure UML_Operation_Proxy.Import_Members";
1083      return Import_Members (Self, Imps);
1084   end Import_Members;
1085
1086   ---------------------
1087   -- Imported_Member --
1088   ---------------------
1089
1090   overriding function Imported_Member
1091    (Self : not null access constant UML_Operation_Proxy)
1092       return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element is
1093   begin
1094      --  Generated stub: replace with real body!
1095      pragma Compile_Time_Warning (Standard.True, "Imported_Member unimplemented");
1096      raise Program_Error with "Unimplemented procedure UML_Operation_Proxy.Imported_Member";
1097      return Imported_Member (Self);
1098   end Imported_Member;
1099
1100   ---------------------------------
1101   -- Members_Are_Distinguishable --
1102   ---------------------------------
1103
1104   overriding function Members_Are_Distinguishable
1105    (Self : not null access constant UML_Operation_Proxy)
1106       return Boolean is
1107   begin
1108      --  Generated stub: replace with real body!
1109      pragma Compile_Time_Warning (Standard.True, "Members_Are_Distinguishable unimplemented");
1110      raise Program_Error with "Unimplemented procedure UML_Operation_Proxy.Members_Are_Distinguishable";
1111      return Members_Are_Distinguishable (Self);
1112   end Members_Are_Distinguishable;
1113
1114   ------------------
1115   -- Owned_Member --
1116   ------------------
1117
1118   overriding function Owned_Member
1119    (Self : not null access constant UML_Operation_Proxy)
1120       return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is
1121   begin
1122      --  Generated stub: replace with real body!
1123      pragma Compile_Time_Warning (Standard.True, "Owned_Member unimplemented");
1124      raise Program_Error with "Unimplemented procedure UML_Operation_Proxy.Owned_Member";
1125      return Owned_Member (Self);
1126   end Owned_Member;
1127
1128   -----------------
1129   -- Is_Template --
1130   -----------------
1131
1132   overriding function Is_Template
1133    (Self : not null access constant UML_Operation_Proxy)
1134       return Boolean is
1135   begin
1136      --  Generated stub: replace with real body!
1137      pragma Compile_Time_Warning (Standard.True, "Is_Template unimplemented");
1138      raise Program_Error with "Unimplemented procedure UML_Operation_Proxy.Is_Template";
1139      return Is_Template (Self);
1140   end Is_Template;
1141
1142   ----------------------------
1143   -- Parameterable_Elements --
1144   ----------------------------
1145
1146   overriding function Parameterable_Elements
1147    (Self : not null access constant UML_Operation_Proxy)
1148       return AMF.UML.Parameterable_Elements.Collections.Set_Of_UML_Parameterable_Element is
1149   begin
1150      --  Generated stub: replace with real body!
1151      pragma Compile_Time_Warning (Standard.True, "Parameterable_Elements unimplemented");
1152      raise Program_Error with "Unimplemented procedure UML_Operation_Proxy.Parameterable_Elements";
1153      return Parameterable_Elements (Self);
1154   end Parameterable_Elements;
1155
1156   ------------------------
1157   -- Is_Compatible_With --
1158   ------------------------
1159
1160   overriding function Is_Compatible_With
1161    (Self : not null access constant UML_Operation_Proxy;
1162     P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access)
1163       return Boolean is
1164   begin
1165      --  Generated stub: replace with real body!
1166      pragma Compile_Time_Warning (Standard.True, "Is_Compatible_With unimplemented");
1167      raise Program_Error with "Unimplemented procedure UML_Operation_Proxy.Is_Compatible_With";
1168      return Is_Compatible_With (Self, P);
1169   end Is_Compatible_With;
1170
1171   ---------------------------
1172   -- Is_Template_Parameter --
1173   ---------------------------
1174
1175   overriding function Is_Template_Parameter
1176    (Self : not null access constant UML_Operation_Proxy)
1177       return Boolean is
1178   begin
1179      --  Generated stub: replace with real body!
1180      pragma Compile_Time_Warning (Standard.True, "Is_Template_Parameter unimplemented");
1181      raise Program_Error with "Unimplemented procedure UML_Operation_Proxy.Is_Template_Parameter";
1182      return Is_Template_Parameter (Self);
1183   end Is_Template_Parameter;
1184
1185end AMF.Internals.UML_Operations;
1186