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