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