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: 2864 $ $Date: 2012-04-13 14:08:07 +0400 (Fri, 13 Apr 2012) $
43------------------------------------------------------------------------------
44with AMF.Elements;
45with AMF.Internals.Helpers;
46with AMF.Internals.Tables.UML_Attributes;
47with AMF.Visitors.UML_Iterators;
48with AMF.Visitors.UML_Visitors;
49
50package body AMF.Internals.UML_Qualifier_Values is
51
52   -------------------
53   -- Enter_Element --
54   -------------------
55
56   overriding procedure Enter_Element
57    (Self    : not null access constant UML_Qualifier_Value_Proxy;
58     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
59     Control : in out AMF.Visitors.Traverse_Control) is
60   begin
61      if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
62         AMF.Visitors.UML_Visitors.UML_Visitor'Class
63          (Visitor).Enter_Qualifier_Value
64            (AMF.UML.Qualifier_Values.UML_Qualifier_Value_Access (Self),
65           Control);
66      end if;
67   end Enter_Element;
68
69   -------------------
70   -- Leave_Element --
71   -------------------
72
73   overriding procedure Leave_Element
74    (Self    : not null access constant UML_Qualifier_Value_Proxy;
75     Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
76     Control : in out AMF.Visitors.Traverse_Control) is
77   begin
78      if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
79         AMF.Visitors.UML_Visitors.UML_Visitor'Class
80          (Visitor).Leave_Qualifier_Value
81            (AMF.UML.Qualifier_Values.UML_Qualifier_Value_Access (Self),
82           Control);
83      end if;
84   end Leave_Element;
85
86   -------------------
87   -- Visit_Element --
88   -------------------
89
90   overriding procedure Visit_Element
91    (Self     : not null access constant UML_Qualifier_Value_Proxy;
92     Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
93     Visitor  : in out AMF.Visitors.Abstract_Visitor'Class;
94     Control  : in out AMF.Visitors.Traverse_Control) is
95   begin
96      if Iterator in AMF.Visitors.UML_Iterators.UML_Iterator'Class then
97         AMF.Visitors.UML_Iterators.UML_Iterator'Class
98          (Iterator).Visit_Qualifier_Value
99            (Visitor,
100             AMF.UML.Qualifier_Values.UML_Qualifier_Value_Access (Self),
101             Control);
102      end if;
103   end Visit_Element;
104
105   -------------------
106   -- Get_Qualifier --
107   -------------------
108
109   overriding function Get_Qualifier
110    (Self : not null access constant UML_Qualifier_Value_Proxy)
111       return AMF.UML.Properties.UML_Property_Access is
112   begin
113      return
114        AMF.UML.Properties.UML_Property_Access
115         (AMF.Internals.Helpers.To_Element
116           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Qualifier
117             (Self.Element)));
118   end Get_Qualifier;
119
120   -------------------
121   -- Set_Qualifier --
122   -------------------
123
124   overriding procedure Set_Qualifier
125    (Self : not null access UML_Qualifier_Value_Proxy;
126     To   : AMF.UML.Properties.UML_Property_Access) is
127   begin
128      AMF.Internals.Tables.UML_Attributes.Internal_Set_Qualifier
129       (Self.Element,
130        AMF.Internals.Helpers.To_Element
131         (AMF.Elements.Element_Access (To)));
132   end Set_Qualifier;
133
134   ---------------
135   -- Get_Value --
136   ---------------
137
138   overriding function Get_Value
139    (Self : not null access constant UML_Qualifier_Value_Proxy)
140       return AMF.UML.Input_Pins.UML_Input_Pin_Access is
141   begin
142      return
143        AMF.UML.Input_Pins.UML_Input_Pin_Access
144         (AMF.Internals.Helpers.To_Element
145           (AMF.Internals.Tables.UML_Attributes.Internal_Get_Value
146             (Self.Element)));
147   end Get_Value;
148
149   ---------------
150   -- Set_Value --
151   ---------------
152
153   overriding procedure Set_Value
154    (Self : not null access UML_Qualifier_Value_Proxy;
155     To   : AMF.UML.Input_Pins.UML_Input_Pin_Access) is
156   begin
157      AMF.Internals.Tables.UML_Attributes.Internal_Set_Value
158       (Self.Element,
159        AMF.Internals.Helpers.To_Element
160         (AMF.Elements.Element_Access (To)));
161   end Set_Value;
162
163end AMF.Internals.UML_Qualifier_Values;
164