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: 2967 $ $Date: 2012-05-12 10:21:56 +0400 (Sat, 12 May 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_Connector_Ends is 51 52 ------------------- 53 -- Enter_Element -- 54 ------------------- 55 56 overriding procedure Enter_Element 57 (Self : not null access constant UML_Connector_End_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_Connector_End 64 (AMF.UML.Connector_Ends.UML_Connector_End_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_Connector_End_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_Connector_End 81 (AMF.UML.Connector_Ends.UML_Connector_End_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_Connector_End_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_Connector_End 99 (Visitor, 100 AMF.UML.Connector_Ends.UML_Connector_End_Access (Self), 101 Control); 102 end if; 103 end Visit_Element; 104 105 ---------------------- 106 -- Get_Defining_End -- 107 ---------------------- 108 109 overriding function Get_Defining_End 110 (Self : not null access constant UML_Connector_End_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_Defining_End 117 (Self.Element))); 118 end Get_Defining_End; 119 120 ------------------------ 121 -- Get_Part_With_Port -- 122 ------------------------ 123 124 overriding function Get_Part_With_Port 125 (Self : not null access constant UML_Connector_End_Proxy) 126 return AMF.UML.Properties.UML_Property_Access is 127 begin 128 return 129 AMF.UML.Properties.UML_Property_Access 130 (AMF.Internals.Helpers.To_Element 131 (AMF.Internals.Tables.UML_Attributes.Internal_Get_Part_With_Port 132 (Self.Element))); 133 end Get_Part_With_Port; 134 135 ------------------------ 136 -- Set_Part_With_Port -- 137 ------------------------ 138 139 overriding procedure Set_Part_With_Port 140 (Self : not null access UML_Connector_End_Proxy; 141 To : AMF.UML.Properties.UML_Property_Access) is 142 begin 143 AMF.Internals.Tables.UML_Attributes.Internal_Set_Part_With_Port 144 (Self.Element, 145 AMF.Internals.Helpers.To_Element 146 (AMF.Elements.Element_Access (To))); 147 end Set_Part_With_Port; 148 149 -------------- 150 -- Get_Role -- 151 -------------- 152 153 overriding function Get_Role 154 (Self : not null access constant UML_Connector_End_Proxy) 155 return AMF.UML.Connectable_Elements.UML_Connectable_Element_Access is 156 begin 157 return 158 AMF.UML.Connectable_Elements.UML_Connectable_Element_Access 159 (AMF.Internals.Helpers.To_Element 160 (AMF.Internals.Tables.UML_Attributes.Internal_Get_Role 161 (Self.Element))); 162 end Get_Role; 163 164 -------------- 165 -- Set_Role -- 166 -------------- 167 168 overriding procedure Set_Role 169 (Self : not null access UML_Connector_End_Proxy; 170 To : AMF.UML.Connectable_Elements.UML_Connectable_Element_Access) is 171 begin 172 AMF.Internals.Tables.UML_Attributes.Internal_Set_Role 173 (Self.Element, 174 AMF.Internals.Helpers.To_Element 175 (AMF.Elements.Element_Access (To))); 176 end Set_Role; 177 178 ------------------ 179 -- Defining_End -- 180 ------------------ 181 182 overriding function Defining_End 183 (Self : not null access constant UML_Connector_End_Proxy) 184 return AMF.UML.Properties.UML_Property_Access is 185 begin 186 -- Generated stub: replace with real body! 187 pragma Compile_Time_Warning (Standard.True, "Defining_End unimplemented"); 188 raise Program_Error with "Unimplemented procedure UML_Connector_End_Proxy.Defining_End"; 189 return Defining_End (Self); 190 end Defining_End; 191 192 --------------------- 193 -- Compatible_With -- 194 --------------------- 195 196 overriding function Compatible_With 197 (Self : not null access constant UML_Connector_End_Proxy; 198 Other : AMF.UML.Multiplicity_Elements.UML_Multiplicity_Element_Access) 199 return Boolean is 200 begin 201 -- Generated stub: replace with real body! 202 pragma Compile_Time_Warning (Standard.True, "Compatible_With unimplemented"); 203 raise Program_Error with "Unimplemented procedure UML_Connector_End_Proxy.Compatible_With"; 204 return Compatible_With (Self, Other); 205 end Compatible_With; 206 207 -------------------------- 208 -- Includes_Cardinality -- 209 -------------------------- 210 211 overriding function Includes_Cardinality 212 (Self : not null access constant UML_Connector_End_Proxy; 213 C : Integer) 214 return Boolean is 215 begin 216 -- Generated stub: replace with real body! 217 pragma Compile_Time_Warning (Standard.True, "Includes_Cardinality unimplemented"); 218 raise Program_Error with "Unimplemented procedure UML_Connector_End_Proxy.Includes_Cardinality"; 219 return Includes_Cardinality (Self, C); 220 end Includes_Cardinality; 221 222 --------------------------- 223 -- Includes_Multiplicity -- 224 --------------------------- 225 226 overriding function Includes_Multiplicity 227 (Self : not null access constant UML_Connector_End_Proxy; 228 M : AMF.UML.Multiplicity_Elements.UML_Multiplicity_Element_Access) 229 return Boolean is 230 begin 231 -- Generated stub: replace with real body! 232 pragma Compile_Time_Warning (Standard.True, "Includes_Multiplicity unimplemented"); 233 raise Program_Error with "Unimplemented procedure UML_Connector_End_Proxy.Includes_Multiplicity"; 234 return Includes_Multiplicity (Self, M); 235 end Includes_Multiplicity; 236 237 --------- 238 -- Iss -- 239 --------- 240 241 overriding function Iss 242 (Self : not null access constant UML_Connector_End_Proxy; 243 Lowerbound : Integer; 244 Upperbound : Integer) 245 return Boolean is 246 begin 247 -- Generated stub: replace with real body! 248 pragma Compile_Time_Warning (Standard.True, "Iss unimplemented"); 249 raise Program_Error with "Unimplemented procedure UML_Connector_End_Proxy.Iss"; 250 return Iss (Self, Lowerbound, Upperbound); 251 end Iss; 252 253end AMF.Internals.UML_Connector_Ends; 254