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: 2807 $ $Date: 2012-04-07 01:28:23 +0400 (Sat, 07 Apr 2012) $
43------------------------------------------------------------------------------
44--  This file is generated, don't edit it.
45------------------------------------------------------------------------------
46with AMF.Elements;
47with AMF.Internals.Helpers;
48with AMF.Internals.Tables.Utp_Attributes;
49with AMF.UML.Dependencies;
50with AMF.Visitors.Utp_Iterators;
51with AMF.Visitors.Utp_Visitors;
52with League.Strings.Internals;
53with Matreshka.Internals.Strings;
54
55package body AMF.Internals.Utp_Test_Objectives is
56
57   -------------------------
58   -- Get_Base_Dependency --
59   -------------------------
60
61   overriding function Get_Base_Dependency
62    (Self : not null access constant Utp_Test_Objective_Proxy)
63       return AMF.UML.Dependencies.UML_Dependency_Access is
64   begin
65      return
66        AMF.UML.Dependencies.UML_Dependency_Access
67         (AMF.Internals.Helpers.To_Element
68           (AMF.Internals.Tables.Utp_Attributes.Internal_Get_Base_Dependency
69             (Self.Element)));
70   end Get_Base_Dependency;
71
72   -------------------------
73   -- Set_Base_Dependency --
74   -------------------------
75
76   overriding procedure Set_Base_Dependency
77    (Self : not null access Utp_Test_Objective_Proxy;
78     To   : AMF.UML.Dependencies.UML_Dependency_Access) is
79   begin
80      AMF.Internals.Tables.Utp_Attributes.Internal_Set_Base_Dependency
81       (Self.Element,
82        AMF.Internals.Helpers.To_Element
83         (AMF.Elements.Element_Access (To)));
84   end Set_Base_Dependency;
85
86   ------------------
87   -- Get_Priority --
88   ------------------
89
90   overriding function Get_Priority
91    (Self : not null access constant Utp_Test_Objective_Proxy)
92       return AMF.Optional_String is
93   begin
94      declare
95         use type Matreshka.Internals.Strings.Shared_String_Access;
96
97         Aux : constant Matreshka.Internals.Strings.Shared_String_Access
98           := AMF.Internals.Tables.Utp_Attributes.Internal_Get_Priority (Self.Element);
99
100      begin
101         if Aux = null then
102            return (Is_Empty => True);
103
104         else
105            return (False, League.Strings.Internals.Create (Aux));
106         end if;
107      end;
108   end Get_Priority;
109
110   ------------------
111   -- Set_Priority --
112   ------------------
113
114   overriding procedure Set_Priority
115    (Self : not null access Utp_Test_Objective_Proxy;
116     To   : AMF.Optional_String) is
117   begin
118      if To.Is_Empty then
119         AMF.Internals.Tables.Utp_Attributes.Internal_Set_Priority
120          (Self.Element, null);
121
122      else
123         AMF.Internals.Tables.Utp_Attributes.Internal_Set_Priority
124          (Self.Element,
125           League.Strings.Internals.Internal (To.Value));
126      end if;
127   end Set_Priority;
128
129   -------------------
130   -- Enter_Element --
131   -------------------
132
133   overriding procedure Enter_Element
134    (Self    : not null access constant Utp_Test_Objective_Proxy;
135     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
136     Control : in out AMF.Visitors.Traverse_Control) is
137   begin
138      if Visitor in AMF.Visitors.Utp_Visitors.Utp_Visitor'Class then
139         AMF.Visitors.Utp_Visitors.Utp_Visitor'Class
140          (Visitor).Enter_Test_Objective
141            (AMF.Utp.Test_Objectives.Utp_Test_Objective_Access (Self),
142           Control);
143      end if;
144   end Enter_Element;
145
146   -------------------
147   -- Leave_Element --
148   -------------------
149
150   overriding procedure Leave_Element
151    (Self    : not null access constant Utp_Test_Objective_Proxy;
152     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
153     Control : in out AMF.Visitors.Traverse_Control) is
154   begin
155      if Visitor in AMF.Visitors.Utp_Visitors.Utp_Visitor'Class then
156         AMF.Visitors.Utp_Visitors.Utp_Visitor'Class
157          (Visitor).Leave_Test_Objective
158            (AMF.Utp.Test_Objectives.Utp_Test_Objective_Access (Self),
159           Control);
160      end if;
161   end Leave_Element;
162
163   -------------------
164   -- Visit_Element --
165   -------------------
166
167   overriding procedure Visit_Element
168    (Self     : not null access constant Utp_Test_Objective_Proxy;
169     Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
170     Visitor  : in out AMF.Visitors.Abstract_Visitor'Class;
171     Control  : in out AMF.Visitors.Traverse_Control) is
172   begin
173      if Iterator in AMF.Visitors.Utp_Iterators.Utp_Iterator'Class then
174         AMF.Visitors.Utp_Iterators.Utp_Iterator'Class
175          (Iterator).Visit_Test_Objective
176            (Visitor,
177             AMF.Utp.Test_Objectives.Utp_Test_Objective_Access (Self),
178           Control);
179      end if;
180   end Visit_Element;
181
182end AMF.Internals.Utp_Test_Objectives;
183