entities
list | max_stars_repo_path
stringlengths 6
131
| max_stars_repo_name
stringlengths 9
67
| max_stars_count
int64 0
17k
| content
stringlengths 25
1M
| id
stringlengths 1
5
| new_content
stringlengths 17
1M
| modified
bool 1
class | references
stringlengths 32
1M
|
---|---|---|---|---|---|---|---|---|
[
{
"context": " part of libsparkcrypto.\n--\n-- Copyright (C) 2010, Alexander Senier\n-- Copyright (C) 2010, secunet Security Networks ",
"end": 162,
"score": 0.9997217059135437,
"start": 146,
"tag": "NAME",
"value": "Alexander Senier"
}
] |
src/shared/generic/lsc-internal-sha512-tables.ads
|
Componolit/libsparkcrypto
| 30 |
-------------------------------------------------------------------------------
-- This file is part of libsparkcrypto.
--
-- Copyright (C) 2010, Alexander Senier
-- Copyright (C) 2010, secunet Security Networks AG
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- * Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
--
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
--
-- * Neither the name of the nor the names of its contributors may be used
-- to endorse or promote products derived from this software without
-- specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
-- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
with LSC.Internal.SHA512;
-------------------------------------------------------------------------------
-- Tables for SHA-512 and SHA-384
-------------------------------------------------------------------------------
private package LSC.Internal.SHA512.Tables is
pragma Pure;
K : constant SHA512.Schedule_Type := SHA512.Schedule_Type'
(16#428a2f98d728ae22#, 16#7137449123ef65cd#, 16#b5c0fbcfec4d3b2f#, 16#e9b5dba58189dbbc#,
16#3956c25bf348b538#, 16#59f111f1b605d019#, 16#923f82a4af194f9b#, 16#ab1c5ed5da6d8118#,
16#d807aa98a3030242#, 16#12835b0145706fbe#, 16#243185be4ee4b28c#, 16#550c7dc3d5ffb4e2#,
16#72be5d74f27b896f#, 16#80deb1fe3b1696b1#, 16#9bdc06a725c71235#, 16#c19bf174cf692694#,
16#e49b69c19ef14ad2#, 16#efbe4786384f25e3#, 16#0fc19dc68b8cd5b5#, 16#240ca1cc77ac9c65#,
16#2de92c6f592b0275#, 16#4a7484aa6ea6e483#, 16#5cb0a9dcbd41fbd4#, 16#76f988da831153b5#,
16#983e5152ee66dfab#, 16#a831c66d2db43210#, 16#b00327c898fb213f#, 16#bf597fc7beef0ee4#,
16#c6e00bf33da88fc2#, 16#d5a79147930aa725#, 16#06ca6351e003826f#, 16#142929670a0e6e70#,
16#27b70a8546d22ffc#, 16#2e1b21385c26c926#, 16#4d2c6dfc5ac42aed#, 16#53380d139d95b3df#,
16#650a73548baf63de#, 16#766a0abb3c77b2a8#, 16#81c2c92e47edaee6#, 16#92722c851482353b#,
16#a2bfe8a14cf10364#, 16#a81a664bbc423001#, 16#c24b8b70d0f89791#, 16#c76c51a30654be30#,
16#d192e819d6ef5218#, 16#d69906245565a910#, 16#f40e35855771202a#, 16#106aa07032bbd1b8#,
16#19a4c116b8d2d0c8#, 16#1e376c085141ab53#, 16#2748774cdf8eeb99#, 16#34b0bcb5e19b48a8#,
16#391c0cb3c5c95a63#, 16#4ed8aa4ae3418acb#, 16#5b9cca4f7763e373#, 16#682e6ff3d6b2b8a3#,
16#748f82ee5defb2fc#, 16#78a5636f43172f60#, 16#84c87814a1f0ab72#, 16#8cc702081a6439ec#,
16#90befffa23631e28#, 16#a4506cebde82bde9#, 16#bef9a3f7b2c67915#, 16#c67178f2e372532b#,
16#ca273eceea26619c#, 16#d186b8c721c0c207#, 16#eada7dd6cde0eb1e#, 16#f57d4f7fee6ed178#,
16#06f067aa72176fba#, 16#0a637dc5a2c898a6#, 16#113f9804bef90dae#, 16#1b710b35131c471b#,
16#28db77f523047d84#, 16#32caab7b40c72493#, 16#3c9ebe0a15c9bebc#, 16#431d67c49c100d4c#,
16#4cc5d4becb3e42b6#, 16#597f299cfc657e2a#, 16#5fcb6fab3ad6faec#, 16#6c44198c4a475817#);
end LSC.Internal.SHA512.Tables;
|
20925
|
-------------------------------------------------------------------------------
-- This file is part of libsparkcrypto.
--
-- Copyright (C) 2010, <NAME>
-- Copyright (C) 2010, secunet Security Networks AG
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- * Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
--
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
--
-- * Neither the name of the nor the names of its contributors may be used
-- to endorse or promote products derived from this software without
-- specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
-- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
with LSC.Internal.SHA512;
-------------------------------------------------------------------------------
-- Tables for SHA-512 and SHA-384
-------------------------------------------------------------------------------
private package LSC.Internal.SHA512.Tables is
pragma Pure;
K : constant SHA512.Schedule_Type := SHA512.Schedule_Type'
(16#428a2f98d728ae22#, 16#7137449123ef65cd#, 16#b5c0fbcfec4d3b2f#, 16#e9b5dba58189dbbc#,
16#3956c25bf348b538#, 16#59f111f1b605d019#, 16#923f82a4af194f9b#, 16#ab1c5ed5da6d8118#,
16#d807aa98a3030242#, 16#12835b0145706fbe#, 16#243185be4ee4b28c#, 16#550c7dc3d5ffb4e2#,
16#72be5d74f27b896f#, 16#80deb1fe3b1696b1#, 16#9bdc06a725c71235#, 16#c19bf174cf692694#,
16#e49b69c19ef14ad2#, 16#efbe4786384f25e3#, 16#0fc19dc68b8cd5b5#, 16#240ca1cc77ac9c65#,
16#2de92c6f592b0275#, 16#4a7484aa6ea6e483#, 16#5cb0a9dcbd41fbd4#, 16#76f988da831153b5#,
16#983e5152ee66dfab#, 16#a831c66d2db43210#, 16#b00327c898fb213f#, 16#bf597fc7beef0ee4#,
16#c6e00bf33da88fc2#, 16#d5a79147930aa725#, 16#06ca6351e003826f#, 16#142929670a0e6e70#,
16#27b70a8546d22ffc#, 16#2e1b21385c26c926#, 16#4d2c6dfc5ac42aed#, 16#53380d139d95b3df#,
16#650a73548baf63de#, 16#766a0abb3c77b2a8#, 16#81c2c92e47edaee6#, 16#92722c851482353b#,
16#a2bfe8a14cf10364#, 16#a81a664bbc423001#, 16#c24b8b70d0f89791#, 16#c76c51a30654be30#,
16#d192e819d6ef5218#, 16#d69906245565a910#, 16#f40e35855771202a#, 16#106aa07032bbd1b8#,
16#19a4c116b8d2d0c8#, 16#1e376c085141ab53#, 16#2748774cdf8eeb99#, 16#34b0bcb5e19b48a8#,
16#391c0cb3c5c95a63#, 16#4ed8aa4ae3418acb#, 16#5b9cca4f7763e373#, 16#682e6ff3d6b2b8a3#,
16#748f82ee5defb2fc#, 16#78a5636f43172f60#, 16#84c87814a1f0ab72#, 16#8cc702081a6439ec#,
16#90befffa23631e28#, 16#a4506cebde82bde9#, 16#bef9a3f7b2c67915#, 16#c67178f2e372532b#,
16#ca273eceea26619c#, 16#d186b8c721c0c207#, 16#eada7dd6cde0eb1e#, 16#f57d4f7fee6ed178#,
16#06f067aa72176fba#, 16#0a637dc5a2c898a6#, 16#113f9804bef90dae#, 16#1b710b35131c471b#,
16#28db77f523047d84#, 16#32caab7b40c72493#, 16#3c9ebe0a15c9bebc#, 16#431d67c49c100d4c#,
16#4cc5d4becb3e42b6#, 16#597f299cfc657e2a#, 16#5fcb6fab3ad6faec#, 16#6c44198c4a475817#);
end LSC.Internal.SHA512.Tables;
| true |
-------------------------------------------------------------------------------
-- This file is part of libsparkcrypto.
--
-- Copyright (C) 2010, PI:NAME:<NAME>END_PI
-- Copyright (C) 2010, secunet Security Networks AG
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- * Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
--
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
--
-- * Neither the name of the nor the names of its contributors may be used
-- to endorse or promote products derived from this software without
-- specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
-- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
with LSC.Internal.SHA512;
-------------------------------------------------------------------------------
-- Tables for SHA-512 and SHA-384
-------------------------------------------------------------------------------
private package LSC.Internal.SHA512.Tables is
pragma Pure;
K : constant SHA512.Schedule_Type := SHA512.Schedule_Type'
(16#428a2f98d728ae22#, 16#7137449123ef65cd#, 16#b5c0fbcfec4d3b2f#, 16#e9b5dba58189dbbc#,
16#3956c25bf348b538#, 16#59f111f1b605d019#, 16#923f82a4af194f9b#, 16#ab1c5ed5da6d8118#,
16#d807aa98a3030242#, 16#12835b0145706fbe#, 16#243185be4ee4b28c#, 16#550c7dc3d5ffb4e2#,
16#72be5d74f27b896f#, 16#80deb1fe3b1696b1#, 16#9bdc06a725c71235#, 16#c19bf174cf692694#,
16#e49b69c19ef14ad2#, 16#efbe4786384f25e3#, 16#0fc19dc68b8cd5b5#, 16#240ca1cc77ac9c65#,
16#2de92c6f592b0275#, 16#4a7484aa6ea6e483#, 16#5cb0a9dcbd41fbd4#, 16#76f988da831153b5#,
16#983e5152ee66dfab#, 16#a831c66d2db43210#, 16#b00327c898fb213f#, 16#bf597fc7beef0ee4#,
16#c6e00bf33da88fc2#, 16#d5a79147930aa725#, 16#06ca6351e003826f#, 16#142929670a0e6e70#,
16#27b70a8546d22ffc#, 16#2e1b21385c26c926#, 16#4d2c6dfc5ac42aed#, 16#53380d139d95b3df#,
16#650a73548baf63de#, 16#766a0abb3c77b2a8#, 16#81c2c92e47edaee6#, 16#92722c851482353b#,
16#a2bfe8a14cf10364#, 16#a81a664bbc423001#, 16#c24b8b70d0f89791#, 16#c76c51a30654be30#,
16#d192e819d6ef5218#, 16#d69906245565a910#, 16#f40e35855771202a#, 16#106aa07032bbd1b8#,
16#19a4c116b8d2d0c8#, 16#1e376c085141ab53#, 16#2748774cdf8eeb99#, 16#34b0bcb5e19b48a8#,
16#391c0cb3c5c95a63#, 16#4ed8aa4ae3418acb#, 16#5b9cca4f7763e373#, 16#682e6ff3d6b2b8a3#,
16#748f82ee5defb2fc#, 16#78a5636f43172f60#, 16#84c87814a1f0ab72#, 16#8cc702081a6439ec#,
16#90befffa23631e28#, 16#a4506cebde82bde9#, 16#bef9a3f7b2c67915#, 16#c67178f2e372532b#,
16#ca273eceea26619c#, 16#d186b8c721c0c207#, 16#eada7dd6cde0eb1e#, 16#f57d4f7fee6ed178#,
16#06f067aa72176fba#, 16#0a637dc5a2c898a6#, 16#113f9804bef90dae#, 16#1b710b35131c471b#,
16#28db77f523047d84#, 16#32caab7b40c72493#, 16#3c9ebe0a15c9bebc#, 16#431d67c49c100d4c#,
16#4cc5d4becb3e42b6#, 16#597f299cfc657e2a#, 16#5fcb6fab3ad6faec#, 16#6c44198c4a475817#);
end LSC.Internal.SHA512.Tables;
|
[
{
"context": "--\n-- Uwe R. Zimmer, Australia, 2013\n--\n\nwith Ada.Unchecked_Deallocat",
"end": 19,
"score": 0.9998852610588074,
"start": 6,
"tag": "NAME",
"value": "Uwe R. Zimmer"
}
] |
Sources/Library/generic_protected.ads
|
ForYouEyesOnly/Space-Convoy
| 1 |
--
-- Uwe R. Zimmer, Australia, 2013
--
with Ada.Unchecked_Deallocation;
generic
type Element is private;
Default_Value : Element;
package Generic_Protected is
protected type Monitor is
function Read return Element;
procedure Write (E : Element);
entry Wait_for_Update (E : out Element);
private
Value : Element := Default_Value;
Touched : Boolean := False;
end Monitor;
type Monitor_Ptr is access Monitor;
function Allocate (Value : Element := Default_Value) return Monitor_Ptr;
procedure Free is
new Ada.Unchecked_Deallocation (Object => Monitor, Name => Monitor_Ptr);
end Generic_Protected;
|
18429
|
--
-- <NAME>, Australia, 2013
--
with Ada.Unchecked_Deallocation;
generic
type Element is private;
Default_Value : Element;
package Generic_Protected is
protected type Monitor is
function Read return Element;
procedure Write (E : Element);
entry Wait_for_Update (E : out Element);
private
Value : Element := Default_Value;
Touched : Boolean := False;
end Monitor;
type Monitor_Ptr is access Monitor;
function Allocate (Value : Element := Default_Value) return Monitor_Ptr;
procedure Free is
new Ada.Unchecked_Deallocation (Object => Monitor, Name => Monitor_Ptr);
end Generic_Protected;
| true |
--
-- PI:NAME:<NAME>END_PI, Australia, 2013
--
with Ada.Unchecked_Deallocation;
generic
type Element is private;
Default_Value : Element;
package Generic_Protected is
protected type Monitor is
function Read return Element;
procedure Write (E : Element);
entry Wait_for_Update (E : out Element);
private
Value : Element := Default_Value;
Touched : Boolean := False;
end Monitor;
type Monitor_Ptr is access Monitor;
function Allocate (Value : Element := Default_Value) return Monitor_Ptr;
procedure Free is
new Ada.Unchecked_Deallocation (Object => Monitor, Name => Monitor_Ptr);
end Generic_Protected;
|
[
{
"context": "---------------------------\n-- Copyright (C) 2019 Stephane Carrez\n-- Written by Stephane Carrez (Stephane.Carrez@g",
"end": 473,
"score": 0.9998739957809448,
"start": 458,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": " Copyright (C) 2019 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under",
"end": 504,
"score": 0.9998801946640015,
"start": 489,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "9 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under the Apache License, Versio",
"end": 531,
"score": 0.9999278783798218,
"start": 506,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
awa/plugins/awa-sysadmin/src/model/awa-sysadmin-models.adb
|
twdroeger/ada-awa
| 0 |
-----------------------------------------------------------------------
-- AWA.Sysadmin.Models -- AWA.Sysadmin.Models
-----------------------------------------------------------------------
-- File generated by ada-gen DO NOT MODIFY
-- Template used: templates/model/package-body.xhtml
-- Ada Generator: https://ada-gen.googlecode.com/svn/trunk Revision 1095
-----------------------------------------------------------------------
-- Copyright (C) 2019 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with Util.Beans.Objects.Time;
with ASF.Events.Faces.Actions;
package body AWA.Sysadmin.Models is
use type ADO.Objects.Object_Record_Access;
use type ADO.Objects.Object_Ref;
pragma Warnings (Off, "formal parameter * is not referenced");
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in User_Info;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Id));
elsif Name = "name" then
return Util.Beans.Objects.To_Object (From.Name);
elsif Name = "title" then
return Util.Beans.Objects.To_Object (From.Title);
elsif Name = "is_public" then
return Util.Beans.Objects.To_Object (From.Is_Public);
elsif Name = "last_version" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Last_Version));
elsif Name = "read_count" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Read_Count));
elsif Name = "create_date" then
return Util.Beans.Objects.Time.To_Object (From.Create_Date);
elsif Name = "author" then
return Util.Beans.Objects.To_Object (From.Author);
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out User_Info;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "id" then
Item.Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "name" then
Item.Name := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "title" then
Item.Title := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "is_public" then
Item.Is_Public := Util.Beans.Objects.To_Boolean (Value);
elsif Name = "last_version" then
Item.Last_Version := Util.Beans.Objects.To_Integer (Value);
elsif Name = "read_count" then
Item.Read_Count := Util.Beans.Objects.To_Integer (Value);
elsif Name = "create_date" then
Item.Create_Date := Util.Beans.Objects.Time.To_Time (Value);
elsif Name = "author" then
Item.Author := Util.Beans.Objects.To_Unbounded_String (Value);
end if;
end Set_Value;
-- --------------------
-- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>.
-- --------------------
procedure List (Object : in out User_Info_List_Bean'Class;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
begin
List (Object.List, Session, Context);
end List;
-- --------------------
-- The information about a wiki page.
-- --------------------
procedure List (Object : in out User_Info_Vector;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
procedure Read (Into : in out User_Info);
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Context);
Pos : Positive := 1;
procedure Read (Into : in out User_Info) is
begin
Into.Id := Stmt.Get_Identifier (0);
Into.Name := Stmt.Get_Unbounded_String (1);
Into.Title := Stmt.Get_Unbounded_String (2);
Into.Is_Public := Stmt.Get_Boolean (3);
Into.Last_Version := Stmt.Get_Integer (4);
Into.Read_Count := Stmt.Get_Integer (5);
Into.Create_Date := Stmt.Get_Time (6);
Into.Author := Stmt.Get_Unbounded_String (7);
end Read;
begin
Stmt.Execute;
User_Info_Vectors.Clear (Object);
while Stmt.Has_Elements loop
Object.Insert_Space (Before => Pos);
Object.Update_Element (Index => Pos, Process => Read'Access);
Pos := Pos + 1;
Stmt.Next;
end loop;
end List;
procedure Op_Authenticate (Bean : in out Authenticate_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Authenticate (Bean : in out Authenticate_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Authenticate_Bean'Class (Bean).Authenticate (Outcome);
end Op_Authenticate;
package Binding_Authenticate_Bean_1 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Authenticate_Bean,
Method => Op_Authenticate,
Name => "authenticate");
Binding_Authenticate_Bean_Array : aliased constant Util.Beans.Methods.Method_Binding_Array
:= (1 => Binding_Authenticate_Bean_1.Proxy'Access
);
-- ------------------------------
-- This bean provides some methods that can be used in a Method_Expression.
-- ------------------------------
overriding
function Get_Method_Bindings (From : in Authenticate_Bean)
return Util.Beans.Methods.Method_Binding_Array_Access is
pragma Unreferenced (From);
begin
return Binding_Authenticate_Bean_Array'Access;
end Get_Method_Bindings;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Authenticate_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "password" then
return Util.Beans.Objects.To_Object (From.Password);
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Authenticate_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "password" then
Item.Password := Util.Beans.Objects.To_Unbounded_String (Value);
end if;
end Set_Value;
end AWA.Sysadmin.Models;
|
2525
|
-----------------------------------------------------------------------
-- AWA.Sysadmin.Models -- AWA.Sysadmin.Models
-----------------------------------------------------------------------
-- File generated by ada-gen DO NOT MODIFY
-- Template used: templates/model/package-body.xhtml
-- Ada Generator: https://ada-gen.googlecode.com/svn/trunk Revision 1095
-----------------------------------------------------------------------
-- Copyright (C) 2019 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with Util.Beans.Objects.Time;
with ASF.Events.Faces.Actions;
package body AWA.Sysadmin.Models is
use type ADO.Objects.Object_Record_Access;
use type ADO.Objects.Object_Ref;
pragma Warnings (Off, "formal parameter * is not referenced");
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in User_Info;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Id));
elsif Name = "name" then
return Util.Beans.Objects.To_Object (From.Name);
elsif Name = "title" then
return Util.Beans.Objects.To_Object (From.Title);
elsif Name = "is_public" then
return Util.Beans.Objects.To_Object (From.Is_Public);
elsif Name = "last_version" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Last_Version));
elsif Name = "read_count" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Read_Count));
elsif Name = "create_date" then
return Util.Beans.Objects.Time.To_Object (From.Create_Date);
elsif Name = "author" then
return Util.Beans.Objects.To_Object (From.Author);
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out User_Info;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "id" then
Item.Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "name" then
Item.Name := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "title" then
Item.Title := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "is_public" then
Item.Is_Public := Util.Beans.Objects.To_Boolean (Value);
elsif Name = "last_version" then
Item.Last_Version := Util.Beans.Objects.To_Integer (Value);
elsif Name = "read_count" then
Item.Read_Count := Util.Beans.Objects.To_Integer (Value);
elsif Name = "create_date" then
Item.Create_Date := Util.Beans.Objects.Time.To_Time (Value);
elsif Name = "author" then
Item.Author := Util.Beans.Objects.To_Unbounded_String (Value);
end if;
end Set_Value;
-- --------------------
-- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>.
-- --------------------
procedure List (Object : in out User_Info_List_Bean'Class;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
begin
List (Object.List, Session, Context);
end List;
-- --------------------
-- The information about a wiki page.
-- --------------------
procedure List (Object : in out User_Info_Vector;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
procedure Read (Into : in out User_Info);
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Context);
Pos : Positive := 1;
procedure Read (Into : in out User_Info) is
begin
Into.Id := Stmt.Get_Identifier (0);
Into.Name := Stmt.Get_Unbounded_String (1);
Into.Title := Stmt.Get_Unbounded_String (2);
Into.Is_Public := Stmt.Get_Boolean (3);
Into.Last_Version := Stmt.Get_Integer (4);
Into.Read_Count := Stmt.Get_Integer (5);
Into.Create_Date := Stmt.Get_Time (6);
Into.Author := Stmt.Get_Unbounded_String (7);
end Read;
begin
Stmt.Execute;
User_Info_Vectors.Clear (Object);
while Stmt.Has_Elements loop
Object.Insert_Space (Before => Pos);
Object.Update_Element (Index => Pos, Process => Read'Access);
Pos := Pos + 1;
Stmt.Next;
end loop;
end List;
procedure Op_Authenticate (Bean : in out Authenticate_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Authenticate (Bean : in out Authenticate_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Authenticate_Bean'Class (Bean).Authenticate (Outcome);
end Op_Authenticate;
package Binding_Authenticate_Bean_1 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Authenticate_Bean,
Method => Op_Authenticate,
Name => "authenticate");
Binding_Authenticate_Bean_Array : aliased constant Util.Beans.Methods.Method_Binding_Array
:= (1 => Binding_Authenticate_Bean_1.Proxy'Access
);
-- ------------------------------
-- This bean provides some methods that can be used in a Method_Expression.
-- ------------------------------
overriding
function Get_Method_Bindings (From : in Authenticate_Bean)
return Util.Beans.Methods.Method_Binding_Array_Access is
pragma Unreferenced (From);
begin
return Binding_Authenticate_Bean_Array'Access;
end Get_Method_Bindings;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Authenticate_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "password" then
return Util.Beans.Objects.To_Object (From.Password);
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Authenticate_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "password" then
Item.Password := Util.Beans.Objects.To_Unbounded_String (Value);
end if;
end Set_Value;
end AWA.Sysadmin.Models;
| true |
-----------------------------------------------------------------------
-- AWA.Sysadmin.Models -- AWA.Sysadmin.Models
-----------------------------------------------------------------------
-- File generated by ada-gen DO NOT MODIFY
-- Template used: templates/model/package-body.xhtml
-- Ada Generator: https://ada-gen.googlecode.com/svn/trunk Revision 1095
-----------------------------------------------------------------------
-- Copyright (C) 2019 PI:NAME:<NAME>END_PI
-- Written by PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with Util.Beans.Objects.Time;
with ASF.Events.Faces.Actions;
package body AWA.Sysadmin.Models is
use type ADO.Objects.Object_Record_Access;
use type ADO.Objects.Object_Ref;
pragma Warnings (Off, "formal parameter * is not referenced");
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in User_Info;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Id));
elsif Name = "name" then
return Util.Beans.Objects.To_Object (From.Name);
elsif Name = "title" then
return Util.Beans.Objects.To_Object (From.Title);
elsif Name = "is_public" then
return Util.Beans.Objects.To_Object (From.Is_Public);
elsif Name = "last_version" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Last_Version));
elsif Name = "read_count" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Read_Count));
elsif Name = "create_date" then
return Util.Beans.Objects.Time.To_Object (From.Create_Date);
elsif Name = "author" then
return Util.Beans.Objects.To_Object (From.Author);
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out User_Info;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "id" then
Item.Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "name" then
Item.Name := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "title" then
Item.Title := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "is_public" then
Item.Is_Public := Util.Beans.Objects.To_Boolean (Value);
elsif Name = "last_version" then
Item.Last_Version := Util.Beans.Objects.To_Integer (Value);
elsif Name = "read_count" then
Item.Read_Count := Util.Beans.Objects.To_Integer (Value);
elsif Name = "create_date" then
Item.Create_Date := Util.Beans.Objects.Time.To_Time (Value);
elsif Name = "author" then
Item.Author := Util.Beans.Objects.To_Unbounded_String (Value);
end if;
end Set_Value;
-- --------------------
-- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>.
-- --------------------
procedure List (Object : in out User_Info_List_Bean'Class;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
begin
List (Object.List, Session, Context);
end List;
-- --------------------
-- The information about a wiki page.
-- --------------------
procedure List (Object : in out User_Info_Vector;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
procedure Read (Into : in out User_Info);
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Context);
Pos : Positive := 1;
procedure Read (Into : in out User_Info) is
begin
Into.Id := Stmt.Get_Identifier (0);
Into.Name := Stmt.Get_Unbounded_String (1);
Into.Title := Stmt.Get_Unbounded_String (2);
Into.Is_Public := Stmt.Get_Boolean (3);
Into.Last_Version := Stmt.Get_Integer (4);
Into.Read_Count := Stmt.Get_Integer (5);
Into.Create_Date := Stmt.Get_Time (6);
Into.Author := Stmt.Get_Unbounded_String (7);
end Read;
begin
Stmt.Execute;
User_Info_Vectors.Clear (Object);
while Stmt.Has_Elements loop
Object.Insert_Space (Before => Pos);
Object.Update_Element (Index => Pos, Process => Read'Access);
Pos := Pos + 1;
Stmt.Next;
end loop;
end List;
procedure Op_Authenticate (Bean : in out Authenticate_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Authenticate (Bean : in out Authenticate_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Authenticate_Bean'Class (Bean).Authenticate (Outcome);
end Op_Authenticate;
package Binding_Authenticate_Bean_1 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Authenticate_Bean,
Method => Op_Authenticate,
Name => "authenticate");
Binding_Authenticate_Bean_Array : aliased constant Util.Beans.Methods.Method_Binding_Array
:= (1 => Binding_Authenticate_Bean_1.Proxy'Access
);
-- ------------------------------
-- This bean provides some methods that can be used in a Method_Expression.
-- ------------------------------
overriding
function Get_Method_Bindings (From : in Authenticate_Bean)
return Util.Beans.Methods.Method_Binding_Array_Access is
pragma Unreferenced (From);
begin
return Binding_Authenticate_Bean_Array'Access;
end Get_Method_Bindings;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Authenticate_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "password" then
return Util.Beans.Objects.To_Object (From.Password);
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Authenticate_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "password" then
Item.Password := Util.Beans.Objects.To_Unbounded_String (Value);
end if;
end Set_Value;
end AWA.Sysadmin.Models;
|
[
{
"context": "-- Copyright 2017 Steven Stewart-Gallus\n--\n-- Licensed under the Apache License, Version ",
"end": 39,
"score": 0.999491810798645,
"start": 18,
"tag": "NAME",
"value": "Steven Stewart-Gallus"
}
] |
src/ada-core/src/linted-tagged_accessors.ads
|
mstewartgallus/linted
| 0 |
-- Copyright 2017 Steven Stewart-Gallus
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-- implied. See the License for the specific language governing
-- permissions and limitations under the License.
private with System;
generic
type Element_T;
type Access_T is access Element_T;
package Linted.Tagged_Accessors is
pragma Preelaborate;
type Tagged_Access is private with
Preelaborable_Initialization;
type Tag_Bits is mod 2**22 with
Default_Value => 0;
function To (Ptr : Access_T) return Tagged_Access with
Inline_Always;
function To (Ptr : Access_T; Tag : Tag_Bits) return Tagged_Access with
Inline_Always;
function From (Ptr : Tagged_Access) return Access_T with
Inline_Always;
function Tag (Ptr : Tagged_Access) return Tag_Bits with
Inline_Always;
private
type Uintptr is mod System.Memory_Size;
type Tagged_Access is new Uintptr with
Default_Value => 0;
end Linted.Tagged_Accessors;
|
799
|
-- Copyright 2017 <NAME>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-- implied. See the License for the specific language governing
-- permissions and limitations under the License.
private with System;
generic
type Element_T;
type Access_T is access Element_T;
package Linted.Tagged_Accessors is
pragma Preelaborate;
type Tagged_Access is private with
Preelaborable_Initialization;
type Tag_Bits is mod 2**22 with
Default_Value => 0;
function To (Ptr : Access_T) return Tagged_Access with
Inline_Always;
function To (Ptr : Access_T; Tag : Tag_Bits) return Tagged_Access with
Inline_Always;
function From (Ptr : Tagged_Access) return Access_T with
Inline_Always;
function Tag (Ptr : Tagged_Access) return Tag_Bits with
Inline_Always;
private
type Uintptr is mod System.Memory_Size;
type Tagged_Access is new Uintptr with
Default_Value => 0;
end Linted.Tagged_Accessors;
| true |
-- Copyright 2017 PI:NAME:<NAME>END_PI
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-- implied. See the License for the specific language governing
-- permissions and limitations under the License.
private with System;
generic
type Element_T;
type Access_T is access Element_T;
package Linted.Tagged_Accessors is
pragma Preelaborate;
type Tagged_Access is private with
Preelaborable_Initialization;
type Tag_Bits is mod 2**22 with
Default_Value => 0;
function To (Ptr : Access_T) return Tagged_Access with
Inline_Always;
function To (Ptr : Access_T; Tag : Tag_Bits) return Tagged_Access with
Inline_Always;
function From (Ptr : Tagged_Access) return Access_T with
Inline_Always;
function Tag (Ptr : Tagged_Access) return Tag_Bits with
Inline_Always;
private
type Uintptr is mod System.Memory_Size;
type Tagged_Access is new Uintptr with
Default_Value => 0;
end Linted.Tagged_Accessors;
|
[
{
"context": " --\n-- Copyright © 2012-2015, Vadim Godunko <[email protected]> --\n-- All rig",
"end": 829,
"score": 0.9998899102210999,
"start": 816,
"tag": "NAME",
"value": "Vadim Godunko"
},
{
"context": " --\n-- Copyright © 2012-2015, Vadim Godunko <[email protected]> --\n-- All rights reserved. ",
"end": 849,
"score": 0.999931275844574,
"start": 831,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
source/league/ucd/matreshka-internals-unicode-ucd-core_0003.ads
|
svn2github/matreshka
| 24 |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2015, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
pragma Restrictions (No_Elaboration_Code);
-- GNAT: enforce generation of preinitialized data section instead of
-- generation of elaboration code.
package Matreshka.Internals.Unicode.Ucd.Core_0003 is
pragma Preelaborate;
Group_0003 : aliased constant Core_Second_Stage
:= (16#40# .. 16#41# => -- 0340 .. 0341
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#43# .. 16#44# => -- 0343 .. 0344
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#45# => -- 0345
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Other_Alphabetic
| Other_Lowercase
| Alphabetic
| Cased
| Case_Ignorable
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Extend
| ID_Continue
| Lowercase
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#4F# => -- 034F
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Glue,
(Other_Default_Ignorable_Code_Point
| Case_Ignorable
| Default_Ignorable_Code_Point
| Grapheme_Extend
| ID_Continue
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#58# .. 16#5B# => -- 0358 .. 035B
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Combining_Mark,
(Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#5C# => -- 035C
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Glue,
(Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#5D# .. 16#62# => -- 035D .. 0362
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Glue,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#63# .. 16#6F# => -- 0363 .. 036F
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Combining_Mark,
(Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#70# => -- 0370
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#71# => -- 0371
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#72# => -- 0372
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#73# => -- 0373
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#74# => -- 0374
(Modifier_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Diacritic
| Alphabetic
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#75# => -- 0375
(Modifier_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Diacritic
| Case_Ignorable
| Grapheme_Base => True,
others => False)),
16#76# => -- 0376
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#77# => -- 0377
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#78# .. 16#79# => -- 0378 .. 0379
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#7A# => -- 037A
(Modifier_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Diacritic
| Other_Lowercase
| Alphabetic
| Cased
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#7B# .. 16#7D# => -- 037B .. 037D
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#7E# => -- 037E
(Other_Punctuation, Neutral,
Other, Mid_Num, Other, Infix_Numeric,
(Terminal_Punctuation
| Grapheme_Base
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#7F# => -- 037F
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#80# .. 16#83# => -- 0380 .. 0383
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#84# .. 16#85# => -- 0384 .. 0385
(Modifier_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Diacritic
| Case_Ignorable
| Grapheme_Base
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#86# => -- 0386
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#87# => -- 0387
(Other_Punctuation, Neutral,
Other, Mid_Letter, Other, Alphabetic,
(Other_ID_Continue
| Terminal_Punctuation
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#88# .. 16#8A# => -- 0388 .. 038A
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#8B# => -- 038B
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#8C# => -- 038C
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#8D# => -- 038D
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#8E# .. 16#8F# => -- 038E .. 038F
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#90# => -- 0390
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#91# .. 16#A1# => -- 0391 .. 03A1
(Uppercase_Letter, Ambiguous,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#A2# => -- 03A2
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#A3# .. 16#A9# => -- 03A3 .. 03A9
(Uppercase_Letter, Ambiguous,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#AA# .. 16#AB# => -- 03AA .. 03AB
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#AC# .. 16#B0# => -- 03AC .. 03B0
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#B1# .. 16#C1# => -- 03B1 .. 03C1
(Lowercase_Letter, Ambiguous,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#C2# => -- 03C2
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#C3# .. 16#C9# => -- 03C3 .. 03C9
(Lowercase_Letter, Ambiguous,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#CA# .. 16#CE# => -- 03CA .. 03CE
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#CF# => -- 03CF
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#D0# .. 16#D1# => -- 03D0 .. 03D1
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#D2# => -- 03D2
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Math
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#D3# .. 16#D4# => -- 03D3 .. 03D4
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#D5# => -- 03D5
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#D6# => -- 03D6
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#D7# => -- 03D7
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#D8# => -- 03D8
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#D9# => -- 03D9
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#DA# => -- 03DA
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#DB# => -- 03DB
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#DC# => -- 03DC
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#DD# => -- 03DD
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#DE# => -- 03DE
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#DF# => -- 03DF
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#E0# => -- 03E0
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#E1# => -- 03E1
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#E2# => -- 03E2
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#E3# => -- 03E3
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#E4# => -- 03E4
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#E5# => -- 03E5
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#E6# => -- 03E6
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#E7# => -- 03E7
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#E8# => -- 03E8
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#E9# => -- 03E9
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#EA# => -- 03EA
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#EB# => -- 03EB
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#EC# => -- 03EC
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#ED# => -- 03ED
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#EE# => -- 03EE
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#EF# => -- 03EF
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#F0# .. 16#F1# => -- 03F0 .. 03F1
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#F2# => -- 03F2
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#F3# => -- 03F3
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Soft_Dotted
| Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#F4# => -- 03F4
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Math
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#F5# => -- 03F5
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#F6# => -- 03F6
(Math_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base
| Math => True,
others => False)),
16#F7# => -- 03F7
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#F8# => -- 03F8
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#F9# .. 16#FA# => -- 03F9 .. 03FA
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#FB# => -- 03FB
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#FC# => -- 03FC
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#FD# .. 16#FF# => -- 03FD .. 03FF
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
others =>
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)));
end Matreshka.Internals.Unicode.Ucd.Core_0003;
|
22170
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2015, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
pragma Restrictions (No_Elaboration_Code);
-- GNAT: enforce generation of preinitialized data section instead of
-- generation of elaboration code.
package Matreshka.Internals.Unicode.Ucd.Core_0003 is
pragma Preelaborate;
Group_0003 : aliased constant Core_Second_Stage
:= (16#40# .. 16#41# => -- 0340 .. 0341
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#43# .. 16#44# => -- 0343 .. 0344
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#45# => -- 0345
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Other_Alphabetic
| Other_Lowercase
| Alphabetic
| Cased
| Case_Ignorable
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Extend
| ID_Continue
| Lowercase
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#4F# => -- 034F
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Glue,
(Other_Default_Ignorable_Code_Point
| Case_Ignorable
| Default_Ignorable_Code_Point
| Grapheme_Extend
| ID_Continue
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#58# .. 16#5B# => -- 0358 .. 035B
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Combining_Mark,
(Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#5C# => -- 035C
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Glue,
(Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#5D# .. 16#62# => -- 035D .. 0362
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Glue,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#63# .. 16#6F# => -- 0363 .. 036F
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Combining_Mark,
(Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#70# => -- 0370
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#71# => -- 0371
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#72# => -- 0372
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#73# => -- 0373
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#74# => -- 0374
(Modifier_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Diacritic
| Alphabetic
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#75# => -- 0375
(Modifier_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Diacritic
| Case_Ignorable
| Grapheme_Base => True,
others => False)),
16#76# => -- 0376
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#77# => -- 0377
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#78# .. 16#79# => -- 0378 .. 0379
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#7A# => -- 037A
(Modifier_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Diacritic
| Other_Lowercase
| Alphabetic
| Cased
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#7B# .. 16#7D# => -- 037B .. 037D
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#7E# => -- 037E
(Other_Punctuation, Neutral,
Other, Mid_Num, Other, Infix_Numeric,
(Terminal_Punctuation
| Grapheme_Base
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#7F# => -- 037F
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#80# .. 16#83# => -- 0380 .. 0383
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#84# .. 16#85# => -- 0384 .. 0385
(Modifier_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Diacritic
| Case_Ignorable
| Grapheme_Base
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#86# => -- 0386
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#87# => -- 0387
(Other_Punctuation, Neutral,
Other, Mid_Letter, Other, Alphabetic,
(Other_ID_Continue
| Terminal_Punctuation
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#88# .. 16#8A# => -- 0388 .. 038A
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#8B# => -- 038B
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#8C# => -- 038C
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#8D# => -- 038D
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#8E# .. 16#8F# => -- 038E .. 038F
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#90# => -- 0390
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#91# .. 16#A1# => -- 0391 .. 03A1
(Uppercase_Letter, Ambiguous,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#A2# => -- 03A2
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#A3# .. 16#A9# => -- 03A3 .. 03A9
(Uppercase_Letter, Ambiguous,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#AA# .. 16#AB# => -- 03AA .. 03AB
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#AC# .. 16#B0# => -- 03AC .. 03B0
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#B1# .. 16#C1# => -- 03B1 .. 03C1
(Lowercase_Letter, Ambiguous,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#C2# => -- 03C2
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#C3# .. 16#C9# => -- 03C3 .. 03C9
(Lowercase_Letter, Ambiguous,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#CA# .. 16#CE# => -- 03CA .. 03CE
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#CF# => -- 03CF
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#D0# .. 16#D1# => -- 03D0 .. 03D1
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#D2# => -- 03D2
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Math
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#D3# .. 16#D4# => -- 03D3 .. 03D4
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#D5# => -- 03D5
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#D6# => -- 03D6
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#D7# => -- 03D7
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#D8# => -- 03D8
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#D9# => -- 03D9
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#DA# => -- 03DA
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#DB# => -- 03DB
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#DC# => -- 03DC
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#DD# => -- 03DD
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#DE# => -- 03DE
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#DF# => -- 03DF
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#E0# => -- 03E0
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#E1# => -- 03E1
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#E2# => -- 03E2
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#E3# => -- 03E3
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#E4# => -- 03E4
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#E5# => -- 03E5
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#E6# => -- 03E6
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#E7# => -- 03E7
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#E8# => -- 03E8
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#E9# => -- 03E9
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#EA# => -- 03EA
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#EB# => -- 03EB
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#EC# => -- 03EC
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#ED# => -- 03ED
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#EE# => -- 03EE
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#EF# => -- 03EF
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#F0# .. 16#F1# => -- 03F0 .. 03F1
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#F2# => -- 03F2
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#F3# => -- 03F3
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Soft_Dotted
| Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#F4# => -- 03F4
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Math
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#F5# => -- 03F5
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#F6# => -- 03F6
(Math_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base
| Math => True,
others => False)),
16#F7# => -- 03F7
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#F8# => -- 03F8
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#F9# .. 16#FA# => -- 03F9 .. 03FA
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#FB# => -- 03FB
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#FC# => -- 03FC
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#FD# .. 16#FF# => -- 03FD .. 03FF
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
others =>
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)));
end Matreshka.Internals.Unicode.Ucd.Core_0003;
| true |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2015, PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
pragma Restrictions (No_Elaboration_Code);
-- GNAT: enforce generation of preinitialized data section instead of
-- generation of elaboration code.
package Matreshka.Internals.Unicode.Ucd.Core_0003 is
pragma Preelaborate;
Group_0003 : aliased constant Core_Second_Stage
:= (16#40# .. 16#41# => -- 0340 .. 0341
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#43# .. 16#44# => -- 0343 .. 0344
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#45# => -- 0345
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Other_Alphabetic
| Other_Lowercase
| Alphabetic
| Cased
| Case_Ignorable
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Extend
| ID_Continue
| Lowercase
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#4F# => -- 034F
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Glue,
(Other_Default_Ignorable_Code_Point
| Case_Ignorable
| Default_Ignorable_Code_Point
| Grapheme_Extend
| ID_Continue
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#58# .. 16#5B# => -- 0358 .. 035B
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Combining_Mark,
(Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#5C# => -- 035C
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Glue,
(Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#5D# .. 16#62# => -- 035D .. 0362
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Glue,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#63# .. 16#6F# => -- 0363 .. 036F
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Combining_Mark,
(Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#70# => -- 0370
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#71# => -- 0371
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#72# => -- 0372
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#73# => -- 0373
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#74# => -- 0374
(Modifier_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Diacritic
| Alphabetic
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#75# => -- 0375
(Modifier_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Diacritic
| Case_Ignorable
| Grapheme_Base => True,
others => False)),
16#76# => -- 0376
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#77# => -- 0377
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#78# .. 16#79# => -- 0378 .. 0379
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#7A# => -- 037A
(Modifier_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Diacritic
| Other_Lowercase
| Alphabetic
| Cased
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#7B# .. 16#7D# => -- 037B .. 037D
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#7E# => -- 037E
(Other_Punctuation, Neutral,
Other, Mid_Num, Other, Infix_Numeric,
(Terminal_Punctuation
| Grapheme_Base
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#7F# => -- 037F
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#80# .. 16#83# => -- 0380 .. 0383
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#84# .. 16#85# => -- 0384 .. 0385
(Modifier_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Diacritic
| Case_Ignorable
| Grapheme_Base
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#86# => -- 0386
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#87# => -- 0387
(Other_Punctuation, Neutral,
Other, Mid_Letter, Other, Alphabetic,
(Other_ID_Continue
| Terminal_Punctuation
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#88# .. 16#8A# => -- 0388 .. 038A
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#8B# => -- 038B
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#8C# => -- 038C
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#8D# => -- 038D
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#8E# .. 16#8F# => -- 038E .. 038F
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#90# => -- 0390
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#91# .. 16#A1# => -- 0391 .. 03A1
(Uppercase_Letter, Ambiguous,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#A2# => -- 03A2
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#A3# .. 16#A9# => -- 03A3 .. 03A9
(Uppercase_Letter, Ambiguous,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#AA# .. 16#AB# => -- 03AA .. 03AB
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#AC# .. 16#B0# => -- 03AC .. 03B0
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#B1# .. 16#C1# => -- 03B1 .. 03C1
(Lowercase_Letter, Ambiguous,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#C2# => -- 03C2
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#C3# .. 16#C9# => -- 03C3 .. 03C9
(Lowercase_Letter, Ambiguous,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#CA# .. 16#CE# => -- 03CA .. 03CE
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#CF# => -- 03CF
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#D0# .. 16#D1# => -- 03D0 .. 03D1
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#D2# => -- 03D2
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Math
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#D3# .. 16#D4# => -- 03D3 .. 03D4
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#D5# => -- 03D5
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#D6# => -- 03D6
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#D7# => -- 03D7
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#D8# => -- 03D8
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#D9# => -- 03D9
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#DA# => -- 03DA
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#DB# => -- 03DB
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#DC# => -- 03DC
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#DD# => -- 03DD
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#DE# => -- 03DE
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#DF# => -- 03DF
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#E0# => -- 03E0
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#E1# => -- 03E1
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#E2# => -- 03E2
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#E3# => -- 03E3
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#E4# => -- 03E4
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#E5# => -- 03E5
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#E6# => -- 03E6
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#E7# => -- 03E7
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#E8# => -- 03E8
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#E9# => -- 03E9
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#EA# => -- 03EA
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#EB# => -- 03EB
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#EC# => -- 03EC
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#ED# => -- 03ED
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#EE# => -- 03EE
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#EF# => -- 03EF
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#F0# .. 16#F1# => -- 03F0 .. 03F1
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#F2# => -- 03F2
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#F3# => -- 03F3
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Soft_Dotted
| Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#F4# => -- 03F4
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Math
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#F5# => -- 03F5
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Math
| Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| Math
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#F6# => -- 03F6
(Math_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base
| Math => True,
others => False)),
16#F7# => -- 03F7
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#F8# => -- 03F8
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#F9# .. 16#FA# => -- 03F9 .. 03FA
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#FB# => -- 03FB
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#FC# => -- 03FC
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#FD# .. 16#FF# => -- 03FD .. 03FF
(Uppercase_Letter, Neutral,
Other, A_Letter, Upper, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Lowercased
| Changes_When_Casefolded
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Uppercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
others =>
(Nonspacing_Mark, Ambiguous,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)));
end Matreshka.Internals.Unicode.Ucd.Core_0003;
|
[
{
"context": "-- Copyright (C) 2019 Thierry Rascle <[email protected]>\n-- MIT license. Please refer t",
"end": 36,
"score": 0.9998763203620911,
"start": 22,
"tag": "NAME",
"value": "Thierry Rascle"
},
{
"context": "-- Copyright (C) 2019 Thierry Rascle <[email protected]>\n-- MIT license. Please refer to the LICENSE file",
"end": 54,
"score": 0.9999333620071411,
"start": 38,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
src/_for_debug_purposes/apsepp-debug_trace_class-standard.adb
|
thierr26/ada-apsepp
| 0 |
-- Copyright (C) 2019 Thierry Rascle <[email protected]>
-- MIT license. Please refer to the LICENSE file.
with Ada.Text_IO;
package body Apsepp.Debug_Trace_Class.Standard is
----------------------------------------------------------------------------
protected body Debug_Trace_Standard is
-----------------------------------------------------
function Message_W_Entity (Message : String;
Entity_Name : String) return String
is (Debug_Trace_Stub_Instance.Message_W_Entity (Message, Entity_Name));
-----------------------------------------------------
function E_To_String (E : Exception_Occurrence) return String
is (Debug_Trace_Stub_Instance.E_To_String (E));
-----------------------------------------------------
function Clock_String (Reset_Elapsed : Boolean := False) return String
is (Debug_Trace_Stub_Instance.Clock_String (Reset_Elapsed));
-----------------------------------------------------
procedure Trace (Message : String; Entity_Name : String := "") is
begin
Ada.Text_IO.Put_Line (if Entity_Name'Length /= 0 then
Message_W_Entity (Message, Entity_Name)
else
Message);
end Trace;
-----------------------------------------------------
procedure Trace_E (E : Exception_Occurrence;
Entity_Name : String := "") is
begin
Trace (E_To_String (E), Entity_Name);
end Trace_E;
-----------------------------------------------------
procedure Set_Time_Zone (Time_Zone : Time_Offset) is
begin
Debug_Trace_Stub_Instance.Set_Time_Zone (Time_Zone);
end Set_Time_Zone;
-----------------------------------------------------
procedure Set_Local_Time_Zone is
begin
Debug_Trace_Stub_Instance.Set_Local_Time_Zone;
end Set_Local_Time_Zone;
-----------------------------------------------------
procedure Trace_Time (Entity_Name : String := "";
Reset_Elapsed : Boolean := False) is
begin
Trace (Clock_String (Reset_Elapsed), Entity_Name);
end Trace_Time;
-----------------------------------------------------
end Debug_Trace_Standard;
----------------------------------------------------------------------------
end Apsepp.Debug_Trace_Class.Standard;
|
6597
|
-- Copyright (C) 2019 <NAME> <<EMAIL>>
-- MIT license. Please refer to the LICENSE file.
with Ada.Text_IO;
package body Apsepp.Debug_Trace_Class.Standard is
----------------------------------------------------------------------------
protected body Debug_Trace_Standard is
-----------------------------------------------------
function Message_W_Entity (Message : String;
Entity_Name : String) return String
is (Debug_Trace_Stub_Instance.Message_W_Entity (Message, Entity_Name));
-----------------------------------------------------
function E_To_String (E : Exception_Occurrence) return String
is (Debug_Trace_Stub_Instance.E_To_String (E));
-----------------------------------------------------
function Clock_String (Reset_Elapsed : Boolean := False) return String
is (Debug_Trace_Stub_Instance.Clock_String (Reset_Elapsed));
-----------------------------------------------------
procedure Trace (Message : String; Entity_Name : String := "") is
begin
Ada.Text_IO.Put_Line (if Entity_Name'Length /= 0 then
Message_W_Entity (Message, Entity_Name)
else
Message);
end Trace;
-----------------------------------------------------
procedure Trace_E (E : Exception_Occurrence;
Entity_Name : String := "") is
begin
Trace (E_To_String (E), Entity_Name);
end Trace_E;
-----------------------------------------------------
procedure Set_Time_Zone (Time_Zone : Time_Offset) is
begin
Debug_Trace_Stub_Instance.Set_Time_Zone (Time_Zone);
end Set_Time_Zone;
-----------------------------------------------------
procedure Set_Local_Time_Zone is
begin
Debug_Trace_Stub_Instance.Set_Local_Time_Zone;
end Set_Local_Time_Zone;
-----------------------------------------------------
procedure Trace_Time (Entity_Name : String := "";
Reset_Elapsed : Boolean := False) is
begin
Trace (Clock_String (Reset_Elapsed), Entity_Name);
end Trace_Time;
-----------------------------------------------------
end Debug_Trace_Standard;
----------------------------------------------------------------------------
end Apsepp.Debug_Trace_Class.Standard;
| true |
-- Copyright (C) 2019 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>
-- MIT license. Please refer to the LICENSE file.
with Ada.Text_IO;
package body Apsepp.Debug_Trace_Class.Standard is
----------------------------------------------------------------------------
protected body Debug_Trace_Standard is
-----------------------------------------------------
function Message_W_Entity (Message : String;
Entity_Name : String) return String
is (Debug_Trace_Stub_Instance.Message_W_Entity (Message, Entity_Name));
-----------------------------------------------------
function E_To_String (E : Exception_Occurrence) return String
is (Debug_Trace_Stub_Instance.E_To_String (E));
-----------------------------------------------------
function Clock_String (Reset_Elapsed : Boolean := False) return String
is (Debug_Trace_Stub_Instance.Clock_String (Reset_Elapsed));
-----------------------------------------------------
procedure Trace (Message : String; Entity_Name : String := "") is
begin
Ada.Text_IO.Put_Line (if Entity_Name'Length /= 0 then
Message_W_Entity (Message, Entity_Name)
else
Message);
end Trace;
-----------------------------------------------------
procedure Trace_E (E : Exception_Occurrence;
Entity_Name : String := "") is
begin
Trace (E_To_String (E), Entity_Name);
end Trace_E;
-----------------------------------------------------
procedure Set_Time_Zone (Time_Zone : Time_Offset) is
begin
Debug_Trace_Stub_Instance.Set_Time_Zone (Time_Zone);
end Set_Time_Zone;
-----------------------------------------------------
procedure Set_Local_Time_Zone is
begin
Debug_Trace_Stub_Instance.Set_Local_Time_Zone;
end Set_Local_Time_Zone;
-----------------------------------------------------
procedure Trace_Time (Entity_Name : String := "";
Reset_Elapsed : Boolean := False) is
begin
Trace (Clock_String (Reset_Elapsed), Entity_Name);
end Trace_Time;
-----------------------------------------------------
end Debug_Trace_Standard;
----------------------------------------------------------------------------
end Apsepp.Debug_Trace_Class.Standard;
|
[
{
"context": "-- Copyright (c) 2021 Devin Hill\n-- zlib License -- see LICENSE for details.\n\nwit",
"end": 33,
"score": 0.9998122453689575,
"start": 23,
"tag": "NAME",
"value": "Devin Hill"
}
] |
zfp-gba/gnat_user/s-allare.adb
|
98devin/ada-gba-dev
| 7 |
-- Copyright (c) 2021 Devin Hill
-- zlib License -- see LICENSE for details.
with System.Parameters;
package body System.Allocation.Arenas is
use SSE;
use all type System.Parameters.Size_Type;
procedure Allocate
(Pool : in out Heap_Arena;
Storage_Address : out System.Address;
Storage_Size : Storage_Count;
Alignment : Storage_Count) is
Align_Mask : constant Address := Address (Alignment - 1);
Aligned_Address : constant Address :=
(Pool.Top_Address + Align_Mask) and not Align_Mask;
begin
Storage_Address := Aligned_Address;
Pool.Top_Address := Aligned_Address + Storage_Size;
if Pool.Top_Address > Pool.End_Address then
raise Storage_Error;
end if;
end Allocate;
function Storage_Size (Pool : Heap_Arena) return Storage_Count is
(Storage_Count'(Pool.End_Address - Pool.Start_Address));
function Mark (Pool : Heap_Arena) return Marker is
(Marker (Pool.Top_Address));
procedure Release (Pool : in out Heap_Arena; Mark : Marker) is
begin
Pool.Top_Address := Address (Mark);
end Release;
procedure Allocate
(Pool : in out Local_Arena;
Storage_Address : out System.Address;
Storage_Size : Storage_Count;
Alignment : Storage_Count) is
begin
Allocate (Pool.Heap, Storage_Address, Storage_Size, Alignment);
end Allocate;
function Storage_Size (Pool : Local_Arena) return Storage_Count is
(Storage_Size (Pool.Heap));
function Mark (Pool : Local_Arena) return Marker is
(Mark (Pool.Heap));
procedure Release (Pool : in out Local_Arena; Mark : Marker) is
begin
Release (Pool.Heap, Mark);
end Release;
function Create_Arena (Start_Address, End_Address : Address)
return Heap_Arena
is
pragma Assert (End_Address >= Start_Address);
begin
return Heap_Arena'
(Top_Address | Start_Address => Start_Address,
End_Address => End_Address);
end Create_Arena;
function Create_Arena (Local_Size : Storage_Count) return Local_Arena is
begin
return A : Local_Arena (Local_Size) do
Init_Arena (A);
end return;
end Create_Arena;
procedure Init_Arena (Pool : in out Local_Arena) is
begin
Pool.Heap.Top_Address := Pool.Storage'Address;
Pool.Heap.Start_Address := Pool.Storage'Address;
Pool.Heap.End_Address := Pool.Storage'Address + Pool.Size;
end Init_Arena;
end System.Allocation.Arenas;
|
19591
|
-- Copyright (c) 2021 <NAME>
-- zlib License -- see LICENSE for details.
with System.Parameters;
package body System.Allocation.Arenas is
use SSE;
use all type System.Parameters.Size_Type;
procedure Allocate
(Pool : in out Heap_Arena;
Storage_Address : out System.Address;
Storage_Size : Storage_Count;
Alignment : Storage_Count) is
Align_Mask : constant Address := Address (Alignment - 1);
Aligned_Address : constant Address :=
(Pool.Top_Address + Align_Mask) and not Align_Mask;
begin
Storage_Address := Aligned_Address;
Pool.Top_Address := Aligned_Address + Storage_Size;
if Pool.Top_Address > Pool.End_Address then
raise Storage_Error;
end if;
end Allocate;
function Storage_Size (Pool : Heap_Arena) return Storage_Count is
(Storage_Count'(Pool.End_Address - Pool.Start_Address));
function Mark (Pool : Heap_Arena) return Marker is
(Marker (Pool.Top_Address));
procedure Release (Pool : in out Heap_Arena; Mark : Marker) is
begin
Pool.Top_Address := Address (Mark);
end Release;
procedure Allocate
(Pool : in out Local_Arena;
Storage_Address : out System.Address;
Storage_Size : Storage_Count;
Alignment : Storage_Count) is
begin
Allocate (Pool.Heap, Storage_Address, Storage_Size, Alignment);
end Allocate;
function Storage_Size (Pool : Local_Arena) return Storage_Count is
(Storage_Size (Pool.Heap));
function Mark (Pool : Local_Arena) return Marker is
(Mark (Pool.Heap));
procedure Release (Pool : in out Local_Arena; Mark : Marker) is
begin
Release (Pool.Heap, Mark);
end Release;
function Create_Arena (Start_Address, End_Address : Address)
return Heap_Arena
is
pragma Assert (End_Address >= Start_Address);
begin
return Heap_Arena'
(Top_Address | Start_Address => Start_Address,
End_Address => End_Address);
end Create_Arena;
function Create_Arena (Local_Size : Storage_Count) return Local_Arena is
begin
return A : Local_Arena (Local_Size) do
Init_Arena (A);
end return;
end Create_Arena;
procedure Init_Arena (Pool : in out Local_Arena) is
begin
Pool.Heap.Top_Address := Pool.Storage'Address;
Pool.Heap.Start_Address := Pool.Storage'Address;
Pool.Heap.End_Address := Pool.Storage'Address + Pool.Size;
end Init_Arena;
end System.Allocation.Arenas;
| true |
-- Copyright (c) 2021 PI:NAME:<NAME>END_PI
-- zlib License -- see LICENSE for details.
with System.Parameters;
package body System.Allocation.Arenas is
use SSE;
use all type System.Parameters.Size_Type;
procedure Allocate
(Pool : in out Heap_Arena;
Storage_Address : out System.Address;
Storage_Size : Storage_Count;
Alignment : Storage_Count) is
Align_Mask : constant Address := Address (Alignment - 1);
Aligned_Address : constant Address :=
(Pool.Top_Address + Align_Mask) and not Align_Mask;
begin
Storage_Address := Aligned_Address;
Pool.Top_Address := Aligned_Address + Storage_Size;
if Pool.Top_Address > Pool.End_Address then
raise Storage_Error;
end if;
end Allocate;
function Storage_Size (Pool : Heap_Arena) return Storage_Count is
(Storage_Count'(Pool.End_Address - Pool.Start_Address));
function Mark (Pool : Heap_Arena) return Marker is
(Marker (Pool.Top_Address));
procedure Release (Pool : in out Heap_Arena; Mark : Marker) is
begin
Pool.Top_Address := Address (Mark);
end Release;
procedure Allocate
(Pool : in out Local_Arena;
Storage_Address : out System.Address;
Storage_Size : Storage_Count;
Alignment : Storage_Count) is
begin
Allocate (Pool.Heap, Storage_Address, Storage_Size, Alignment);
end Allocate;
function Storage_Size (Pool : Local_Arena) return Storage_Count is
(Storage_Size (Pool.Heap));
function Mark (Pool : Local_Arena) return Marker is
(Mark (Pool.Heap));
procedure Release (Pool : in out Local_Arena; Mark : Marker) is
begin
Release (Pool.Heap, Mark);
end Release;
function Create_Arena (Start_Address, End_Address : Address)
return Heap_Arena
is
pragma Assert (End_Address >= Start_Address);
begin
return Heap_Arena'
(Top_Address | Start_Address => Start_Address,
End_Address => End_Address);
end Create_Arena;
function Create_Arena (Local_Size : Storage_Count) return Local_Arena is
begin
return A : Local_Arena (Local_Size) do
Init_Arena (A);
end return;
end Create_Arena;
procedure Init_Arena (Pool : in out Local_Arena) is
begin
Pool.Heap.Top_Address := Pool.Storage'Address;
Pool.Heap.Start_Address := Pool.Storage'Address;
Pool.Heap.End_Address := Pool.Storage'Address + Pool.Size;
end Init_Arena;
end System.Allocation.Arenas;
|
[
{
"context": "le DirectMedia Layer\n -- Copyright (C) 1997-2018 Sam Lantinga <[email protected]>\n -- This software is provi",
"end": 660,
"score": 0.9998710751533508,
"start": 648,
"tag": "NAME",
"value": "Sam Lantinga"
},
{
"context": "Layer\n -- Copyright (C) 1997-2018 Sam Lantinga <[email protected]>\n -- This software is provided 'as-is', without",
"end": 680,
"score": 0.999925971031189,
"start": 662,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
extern/gnat_sdl/gnat_sdl2/src/sdl_thread_h.ads
|
AdaCore/training_material
| 15 |
pragma Ada_2005;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
with System;
with umingw_h;
with Interfaces.C.Strings;
with stddef_h;
package SDL_thread_h is
-- arg-macro: procedure SDL_CreateThread (fn, name, data)
-- SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex)
-- arg-macro: procedure SDL_CreateThreadWithStackSize (fn, name, stacksize, data)
-- SDL_CreateThreadWithStackSize(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex)
-- Simple DirectMedia Layer
-- Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
-- 3. This notice may not be removed or altered from any source distribution.
--
--*
-- * \file SDL_thread.h
-- *
-- * Header for the SDL thread management routines.
--
-- Thread synchronization primitives
-- Set up for C function definitions, even when using C++
-- The SDL thread structure, defined in SDL_thread.c
type SDL_Thread is null record; -- incomplete struct
-- The SDL thread ID
subtype SDL_threadID is unsigned_long; -- ..\SDL2_tmp\SDL_thread.h:49
-- Thread local storage ID, 0 is the invalid ID
subtype SDL_TLSID is unsigned; -- ..\SDL2_tmp\SDL_thread.h:52
--*
-- * The SDL thread priority.
-- *
-- * \note On many systems you require special privileges to set high or time critical priority.
--
type SDL_ThreadPriority is
(SDL_THREAD_PRIORITY_LOW,
SDL_THREAD_PRIORITY_NORMAL,
SDL_THREAD_PRIORITY_HIGH,
SDL_THREAD_PRIORITY_TIME_CRITICAL);
pragma Convention (C, SDL_ThreadPriority); -- ..\SDL2_tmp\SDL_thread.h:64
--*
-- * The function passed to SDL_CreateThread().
-- * It is passed a void* user context parameter and returns an int.
--
type SDL_ThreadFunction is access function (arg1 : System.Address) return int;
pragma Convention (C, SDL_ThreadFunction); -- ..\SDL2_tmp\SDL_thread.h:70
--*
-- * \file SDL_thread.h
-- *
-- * We compile SDL into a DLL. This means, that it's the DLL which
-- * creates a new thread for the calling process with the SDL_CreateThread()
-- * API. There is a problem with this, that only the RTL of the SDL2.DLL will
-- * be initialized for those threads, and not the RTL of the calling
-- * application!
-- *
-- * To solve this, we make a little hack here.
-- *
-- * We'll always use the caller's _beginthread() and _endthread() APIs to
-- * start a new thread. This way, if it's the SDL2.DLL which uses this API,
-- * then the RTL of SDL2.DLL will be used to create the new thread, and if it's
-- * the application, then the RTL of the application will be used.
-- *
-- * So, in short:
-- * Always use the _beginthread() and _endthread() of the calling runtime
-- * library!
--
-- _beginthreadex() and _endthreadex()
type pfnSDL_CurrentBeginThread is access function
(arg1 : System.Address;
arg2 : unsigned;
arg3 : access function (arg1 : System.Address) return unsigned;
arg4 : System.Address;
arg5 : unsigned;
arg6 : access unsigned) return umingw_h.uintptr_t;
pragma Convention (C, pfnSDL_CurrentBeginThread); -- ..\SDL2_tmp\SDL_thread.h:96
--arg
-- threadID
type pfnSDL_CurrentEndThread is access procedure (arg1 : unsigned);
pragma Convention (C, pfnSDL_CurrentEndThread); -- ..\SDL2_tmp\SDL_thread.h:99
--*
-- * Create a thread.
--
function SDL_CreateThread
(fn : SDL_ThreadFunction;
name : Interfaces.C.Strings.chars_ptr;
data : System.Address;
pfnBeginThread : pfnSDL_CurrentBeginThread;
pfnEndThread : pfnSDL_CurrentEndThread) return access SDL_Thread; -- ..\SDL2_tmp\SDL_thread.h:105
pragma Import (C, SDL_CreateThread, "SDL_CreateThread");
function SDL_CreateThreadWithStackSize
(fn : access function (arg1 : System.Address) return int;
name : Interfaces.C.Strings.chars_ptr;
stacksize : stddef_h.size_t;
data : System.Address;
pfnBeginThread : pfnSDL_CurrentBeginThread;
pfnEndThread : pfnSDL_CurrentEndThread) return access SDL_Thread; -- ..\SDL2_tmp\SDL_thread.h:110
pragma Import (C, SDL_CreateThreadWithStackSize, "SDL_CreateThreadWithStackSize");
--*
-- * Create a thread.
--
-- * just like the windows case above: We compile SDL2
-- * into a dll with Watcom's runtime statically linked.
--
--arg
--*
-- * Create a thread with a default stack size.
-- *
-- * This is equivalent to calling:
-- * SDL_CreateThreadWithStackSize(fn, name, 0, data);
--
--*
-- * Create a thread.
-- *
-- * Thread naming is a little complicated: Most systems have very small
-- * limits for the string length (Haiku has 32 bytes, Linux currently has 16,
-- * Visual C++ 6.0 has nine!), and possibly other arbitrary rules. You'll
-- * have to see what happens with your system's debugger. The name should be
-- * UTF-8 (but using the naming limits of C identifiers is a better bet).
-- * There are no requirements for thread naming conventions, so long as the
-- * string is null-terminated UTF-8, but these guidelines are helpful in
-- * choosing a name:
-- *
-- * http://stackoverflow.com/questions/149932/naming-conventions-for-threads
-- *
-- * If a system imposes requirements, SDL will try to munge the string for
-- * it (truncate, etc), but the original string contents will be available
-- * from SDL_GetThreadName().
-- *
-- * The size (in bytes) of the new stack can be specified. Zero means "use
-- * the system default" which might be wildly different between platforms
-- * (x86 Linux generally defaults to eight megabytes, an embedded device
-- * might be a few kilobytes instead).
-- *
-- * In SDL 2.1, stacksize will be folded into the original SDL_CreateThread
-- * function.
--
--*
-- * Get the thread name, as it was specified in SDL_CreateThread().
-- * This function returns a pointer to a UTF-8 string that names the
-- * specified thread, or NULL if it doesn't have a name. This is internal
-- * memory, not to be free()'d by the caller, and remains valid until the
-- * specified thread is cleaned up by SDL_WaitThread().
--
function SDL_GetThreadName (thread : access SDL_Thread) return Interfaces.C.Strings.chars_ptr; -- ..\SDL2_tmp\SDL_thread.h:209
pragma Import (C, SDL_GetThreadName, "SDL_GetThreadName");
--*
-- * Get the thread identifier for the current thread.
--
function SDL_ThreadID return SDL_threadID; -- ..\SDL2_tmp\SDL_thread.h:214
pragma Import (C, SDL_ThreadID, "SDL_ThreadID");
--*
-- * Get the thread identifier for the specified thread.
-- *
-- * Equivalent to SDL_ThreadID() if the specified thread is NULL.
--
function SDL_GetThreadID (thread : access SDL_Thread) return SDL_threadID; -- ..\SDL2_tmp\SDL_thread.h:221
pragma Import (C, SDL_GetThreadID, "SDL_GetThreadID");
--*
-- * Set the priority for the current thread
--
function SDL_SetThreadPriority (priority : SDL_ThreadPriority) return int; -- ..\SDL2_tmp\SDL_thread.h:226
pragma Import (C, SDL_SetThreadPriority, "SDL_SetThreadPriority");
--*
-- * Wait for a thread to finish. Threads that haven't been detached will
-- * remain (as a "zombie") until this function cleans them up. Not doing so
-- * is a resource leak.
-- *
-- * Once a thread has been cleaned up through this function, the SDL_Thread
-- * that references it becomes invalid and should not be referenced again.
-- * As such, only one thread may call SDL_WaitThread() on another.
-- *
-- * The return code for the thread function is placed in the area
-- * pointed to by \c status, if \c status is not NULL.
-- *
-- * You may not wait on a thread that has been used in a call to
-- * SDL_DetachThread(). Use either that function or this one, but not
-- * both, or behavior is undefined.
-- *
-- * It is safe to pass NULL to this function; it is a no-op.
--
procedure SDL_WaitThread (thread : access SDL_Thread; status : access int); -- ..\SDL2_tmp\SDL_thread.h:246
pragma Import (C, SDL_WaitThread, "SDL_WaitThread");
--*
-- * A thread may be "detached" to signify that it should not remain until
-- * another thread has called SDL_WaitThread() on it. Detaching a thread
-- * is useful for long-running threads that nothing needs to synchronize
-- * with or further manage. When a detached thread is done, it simply
-- * goes away.
-- *
-- * There is no way to recover the return code of a detached thread. If you
-- * need this, don't detach the thread and instead use SDL_WaitThread().
-- *
-- * Once a thread is detached, you should usually assume the SDL_Thread isn't
-- * safe to reference again, as it will become invalid immediately upon
-- * the detached thread's exit, instead of remaining until someone has called
-- * SDL_WaitThread() to finally clean it up. As such, don't detach the same
-- * thread more than once.
-- *
-- * If a thread has already exited when passed to SDL_DetachThread(), it will
-- * stop waiting for a call to SDL_WaitThread() and clean up immediately.
-- * It is not safe to detach a thread that might be used with SDL_WaitThread().
-- *
-- * You may not call SDL_WaitThread() on a thread that has been detached.
-- * Use either that function or this one, but not both, or behavior is
-- * undefined.
-- *
-- * It is safe to pass NULL to this function; it is a no-op.
--
procedure SDL_DetachThread (thread : access SDL_Thread); -- ..\SDL2_tmp\SDL_thread.h:274
pragma Import (C, SDL_DetachThread, "SDL_DetachThread");
--*
-- * \brief Create an identifier that is globally visible to all threads but refers to data that is thread-specific.
-- *
-- * \return The newly created thread local storage identifier, or 0 on error
-- *
-- * \code
-- * static SDL_SpinLock tls_lock;
-- * static SDL_TLSID thread_local_storage;
-- *
-- * void SetMyThreadData(void *value)
-- * {
-- * if (!thread_local_storage) {
-- * SDL_AtomicLock(&tls_lock);
-- * if (!thread_local_storage) {
-- * thread_local_storage = SDL_TLSCreate();
-- * }
-- * SDL_AtomicUnlock(&tls_lock);
-- * }
-- * SDL_TLSSet(thread_local_storage, value, 0);
-- * }
-- *
-- * void *GetMyThreadData(void)
-- * {
-- * return SDL_TLSGet(thread_local_storage);
-- * }
-- * \endcode
-- *
-- * \sa SDL_TLSGet()
-- * \sa SDL_TLSSet()
--
function SDL_TLSCreate return SDL_TLSID; -- ..\SDL2_tmp\SDL_thread.h:306
pragma Import (C, SDL_TLSCreate, "SDL_TLSCreate");
--*
-- * \brief Get the value associated with a thread local storage ID for the current thread.
-- *
-- * \param id The thread local storage ID
-- *
-- * \return The value associated with the ID for the current thread, or NULL if no value has been set.
-- *
-- * \sa SDL_TLSCreate()
-- * \sa SDL_TLSSet()
--
function SDL_TLSGet (id : SDL_TLSID) return System.Address; -- ..\SDL2_tmp\SDL_thread.h:318
pragma Import (C, SDL_TLSGet, "SDL_TLSGet");
--*
-- * \brief Set the value associated with a thread local storage ID for the current thread.
-- *
-- * \param id The thread local storage ID
-- * \param value The value to associate with the ID for the current thread
-- * \param destructor A function called when the thread exits, to free the value.
-- *
-- * \return 0 on success, -1 on error
-- *
-- * \sa SDL_TLSCreate()
-- * \sa SDL_TLSGet()
--
function SDL_TLSSet
(id : SDL_TLSID;
value : System.Address;
destructor : access procedure (arg1 : System.Address)) return int; -- ..\SDL2_tmp\SDL_thread.h:332
pragma Import (C, SDL_TLSSet, "SDL_TLSSet");
-- Ends C function definitions when using C++
-- vi: set ts=4 sw=4 expandtab:
end SDL_thread_h;
|
4879
|
pragma Ada_2005;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
with System;
with umingw_h;
with Interfaces.C.Strings;
with stddef_h;
package SDL_thread_h is
-- arg-macro: procedure SDL_CreateThread (fn, name, data)
-- SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex)
-- arg-macro: procedure SDL_CreateThreadWithStackSize (fn, name, stacksize, data)
-- SDL_CreateThreadWithStackSize(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex)
-- Simple DirectMedia Layer
-- Copyright (C) 1997-2018 <NAME> <<EMAIL>>
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
-- 3. This notice may not be removed or altered from any source distribution.
--
--*
-- * \file SDL_thread.h
-- *
-- * Header for the SDL thread management routines.
--
-- Thread synchronization primitives
-- Set up for C function definitions, even when using C++
-- The SDL thread structure, defined in SDL_thread.c
type SDL_Thread is null record; -- incomplete struct
-- The SDL thread ID
subtype SDL_threadID is unsigned_long; -- ..\SDL2_tmp\SDL_thread.h:49
-- Thread local storage ID, 0 is the invalid ID
subtype SDL_TLSID is unsigned; -- ..\SDL2_tmp\SDL_thread.h:52
--*
-- * The SDL thread priority.
-- *
-- * \note On many systems you require special privileges to set high or time critical priority.
--
type SDL_ThreadPriority is
(SDL_THREAD_PRIORITY_LOW,
SDL_THREAD_PRIORITY_NORMAL,
SDL_THREAD_PRIORITY_HIGH,
SDL_THREAD_PRIORITY_TIME_CRITICAL);
pragma Convention (C, SDL_ThreadPriority); -- ..\SDL2_tmp\SDL_thread.h:64
--*
-- * The function passed to SDL_CreateThread().
-- * It is passed a void* user context parameter and returns an int.
--
type SDL_ThreadFunction is access function (arg1 : System.Address) return int;
pragma Convention (C, SDL_ThreadFunction); -- ..\SDL2_tmp\SDL_thread.h:70
--*
-- * \file SDL_thread.h
-- *
-- * We compile SDL into a DLL. This means, that it's the DLL which
-- * creates a new thread for the calling process with the SDL_CreateThread()
-- * API. There is a problem with this, that only the RTL of the SDL2.DLL will
-- * be initialized for those threads, and not the RTL of the calling
-- * application!
-- *
-- * To solve this, we make a little hack here.
-- *
-- * We'll always use the caller's _beginthread() and _endthread() APIs to
-- * start a new thread. This way, if it's the SDL2.DLL which uses this API,
-- * then the RTL of SDL2.DLL will be used to create the new thread, and if it's
-- * the application, then the RTL of the application will be used.
-- *
-- * So, in short:
-- * Always use the _beginthread() and _endthread() of the calling runtime
-- * library!
--
-- _beginthreadex() and _endthreadex()
type pfnSDL_CurrentBeginThread is access function
(arg1 : System.Address;
arg2 : unsigned;
arg3 : access function (arg1 : System.Address) return unsigned;
arg4 : System.Address;
arg5 : unsigned;
arg6 : access unsigned) return umingw_h.uintptr_t;
pragma Convention (C, pfnSDL_CurrentBeginThread); -- ..\SDL2_tmp\SDL_thread.h:96
--arg
-- threadID
type pfnSDL_CurrentEndThread is access procedure (arg1 : unsigned);
pragma Convention (C, pfnSDL_CurrentEndThread); -- ..\SDL2_tmp\SDL_thread.h:99
--*
-- * Create a thread.
--
function SDL_CreateThread
(fn : SDL_ThreadFunction;
name : Interfaces.C.Strings.chars_ptr;
data : System.Address;
pfnBeginThread : pfnSDL_CurrentBeginThread;
pfnEndThread : pfnSDL_CurrentEndThread) return access SDL_Thread; -- ..\SDL2_tmp\SDL_thread.h:105
pragma Import (C, SDL_CreateThread, "SDL_CreateThread");
function SDL_CreateThreadWithStackSize
(fn : access function (arg1 : System.Address) return int;
name : Interfaces.C.Strings.chars_ptr;
stacksize : stddef_h.size_t;
data : System.Address;
pfnBeginThread : pfnSDL_CurrentBeginThread;
pfnEndThread : pfnSDL_CurrentEndThread) return access SDL_Thread; -- ..\SDL2_tmp\SDL_thread.h:110
pragma Import (C, SDL_CreateThreadWithStackSize, "SDL_CreateThreadWithStackSize");
--*
-- * Create a thread.
--
-- * just like the windows case above: We compile SDL2
-- * into a dll with Watcom's runtime statically linked.
--
--arg
--*
-- * Create a thread with a default stack size.
-- *
-- * This is equivalent to calling:
-- * SDL_CreateThreadWithStackSize(fn, name, 0, data);
--
--*
-- * Create a thread.
-- *
-- * Thread naming is a little complicated: Most systems have very small
-- * limits for the string length (Haiku has 32 bytes, Linux currently has 16,
-- * Visual C++ 6.0 has nine!), and possibly other arbitrary rules. You'll
-- * have to see what happens with your system's debugger. The name should be
-- * UTF-8 (but using the naming limits of C identifiers is a better bet).
-- * There are no requirements for thread naming conventions, so long as the
-- * string is null-terminated UTF-8, but these guidelines are helpful in
-- * choosing a name:
-- *
-- * http://stackoverflow.com/questions/149932/naming-conventions-for-threads
-- *
-- * If a system imposes requirements, SDL will try to munge the string for
-- * it (truncate, etc), but the original string contents will be available
-- * from SDL_GetThreadName().
-- *
-- * The size (in bytes) of the new stack can be specified. Zero means "use
-- * the system default" which might be wildly different between platforms
-- * (x86 Linux generally defaults to eight megabytes, an embedded device
-- * might be a few kilobytes instead).
-- *
-- * In SDL 2.1, stacksize will be folded into the original SDL_CreateThread
-- * function.
--
--*
-- * Get the thread name, as it was specified in SDL_CreateThread().
-- * This function returns a pointer to a UTF-8 string that names the
-- * specified thread, or NULL if it doesn't have a name. This is internal
-- * memory, not to be free()'d by the caller, and remains valid until the
-- * specified thread is cleaned up by SDL_WaitThread().
--
function SDL_GetThreadName (thread : access SDL_Thread) return Interfaces.C.Strings.chars_ptr; -- ..\SDL2_tmp\SDL_thread.h:209
pragma Import (C, SDL_GetThreadName, "SDL_GetThreadName");
--*
-- * Get the thread identifier for the current thread.
--
function SDL_ThreadID return SDL_threadID; -- ..\SDL2_tmp\SDL_thread.h:214
pragma Import (C, SDL_ThreadID, "SDL_ThreadID");
--*
-- * Get the thread identifier for the specified thread.
-- *
-- * Equivalent to SDL_ThreadID() if the specified thread is NULL.
--
function SDL_GetThreadID (thread : access SDL_Thread) return SDL_threadID; -- ..\SDL2_tmp\SDL_thread.h:221
pragma Import (C, SDL_GetThreadID, "SDL_GetThreadID");
--*
-- * Set the priority for the current thread
--
function SDL_SetThreadPriority (priority : SDL_ThreadPriority) return int; -- ..\SDL2_tmp\SDL_thread.h:226
pragma Import (C, SDL_SetThreadPriority, "SDL_SetThreadPriority");
--*
-- * Wait for a thread to finish. Threads that haven't been detached will
-- * remain (as a "zombie") until this function cleans them up. Not doing so
-- * is a resource leak.
-- *
-- * Once a thread has been cleaned up through this function, the SDL_Thread
-- * that references it becomes invalid and should not be referenced again.
-- * As such, only one thread may call SDL_WaitThread() on another.
-- *
-- * The return code for the thread function is placed in the area
-- * pointed to by \c status, if \c status is not NULL.
-- *
-- * You may not wait on a thread that has been used in a call to
-- * SDL_DetachThread(). Use either that function or this one, but not
-- * both, or behavior is undefined.
-- *
-- * It is safe to pass NULL to this function; it is a no-op.
--
procedure SDL_WaitThread (thread : access SDL_Thread; status : access int); -- ..\SDL2_tmp\SDL_thread.h:246
pragma Import (C, SDL_WaitThread, "SDL_WaitThread");
--*
-- * A thread may be "detached" to signify that it should not remain until
-- * another thread has called SDL_WaitThread() on it. Detaching a thread
-- * is useful for long-running threads that nothing needs to synchronize
-- * with or further manage. When a detached thread is done, it simply
-- * goes away.
-- *
-- * There is no way to recover the return code of a detached thread. If you
-- * need this, don't detach the thread and instead use SDL_WaitThread().
-- *
-- * Once a thread is detached, you should usually assume the SDL_Thread isn't
-- * safe to reference again, as it will become invalid immediately upon
-- * the detached thread's exit, instead of remaining until someone has called
-- * SDL_WaitThread() to finally clean it up. As such, don't detach the same
-- * thread more than once.
-- *
-- * If a thread has already exited when passed to SDL_DetachThread(), it will
-- * stop waiting for a call to SDL_WaitThread() and clean up immediately.
-- * It is not safe to detach a thread that might be used with SDL_WaitThread().
-- *
-- * You may not call SDL_WaitThread() on a thread that has been detached.
-- * Use either that function or this one, but not both, or behavior is
-- * undefined.
-- *
-- * It is safe to pass NULL to this function; it is a no-op.
--
procedure SDL_DetachThread (thread : access SDL_Thread); -- ..\SDL2_tmp\SDL_thread.h:274
pragma Import (C, SDL_DetachThread, "SDL_DetachThread");
--*
-- * \brief Create an identifier that is globally visible to all threads but refers to data that is thread-specific.
-- *
-- * \return The newly created thread local storage identifier, or 0 on error
-- *
-- * \code
-- * static SDL_SpinLock tls_lock;
-- * static SDL_TLSID thread_local_storage;
-- *
-- * void SetMyThreadData(void *value)
-- * {
-- * if (!thread_local_storage) {
-- * SDL_AtomicLock(&tls_lock);
-- * if (!thread_local_storage) {
-- * thread_local_storage = SDL_TLSCreate();
-- * }
-- * SDL_AtomicUnlock(&tls_lock);
-- * }
-- * SDL_TLSSet(thread_local_storage, value, 0);
-- * }
-- *
-- * void *GetMyThreadData(void)
-- * {
-- * return SDL_TLSGet(thread_local_storage);
-- * }
-- * \endcode
-- *
-- * \sa SDL_TLSGet()
-- * \sa SDL_TLSSet()
--
function SDL_TLSCreate return SDL_TLSID; -- ..\SDL2_tmp\SDL_thread.h:306
pragma Import (C, SDL_TLSCreate, "SDL_TLSCreate");
--*
-- * \brief Get the value associated with a thread local storage ID for the current thread.
-- *
-- * \param id The thread local storage ID
-- *
-- * \return The value associated with the ID for the current thread, or NULL if no value has been set.
-- *
-- * \sa SDL_TLSCreate()
-- * \sa SDL_TLSSet()
--
function SDL_TLSGet (id : SDL_TLSID) return System.Address; -- ..\SDL2_tmp\SDL_thread.h:318
pragma Import (C, SDL_TLSGet, "SDL_TLSGet");
--*
-- * \brief Set the value associated with a thread local storage ID for the current thread.
-- *
-- * \param id The thread local storage ID
-- * \param value The value to associate with the ID for the current thread
-- * \param destructor A function called when the thread exits, to free the value.
-- *
-- * \return 0 on success, -1 on error
-- *
-- * \sa SDL_TLSCreate()
-- * \sa SDL_TLSGet()
--
function SDL_TLSSet
(id : SDL_TLSID;
value : System.Address;
destructor : access procedure (arg1 : System.Address)) return int; -- ..\SDL2_tmp\SDL_thread.h:332
pragma Import (C, SDL_TLSSet, "SDL_TLSSet");
-- Ends C function definitions when using C++
-- vi: set ts=4 sw=4 expandtab:
end SDL_thread_h;
| true |
pragma Ada_2005;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
with System;
with umingw_h;
with Interfaces.C.Strings;
with stddef_h;
package SDL_thread_h is
-- arg-macro: procedure SDL_CreateThread (fn, name, data)
-- SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex)
-- arg-macro: procedure SDL_CreateThreadWithStackSize (fn, name, stacksize, data)
-- SDL_CreateThreadWithStackSize(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex)
-- Simple DirectMedia Layer
-- Copyright (C) 1997-2018 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
-- 3. This notice may not be removed or altered from any source distribution.
--
--*
-- * \file SDL_thread.h
-- *
-- * Header for the SDL thread management routines.
--
-- Thread synchronization primitives
-- Set up for C function definitions, even when using C++
-- The SDL thread structure, defined in SDL_thread.c
type SDL_Thread is null record; -- incomplete struct
-- The SDL thread ID
subtype SDL_threadID is unsigned_long; -- ..\SDL2_tmp\SDL_thread.h:49
-- Thread local storage ID, 0 is the invalid ID
subtype SDL_TLSID is unsigned; -- ..\SDL2_tmp\SDL_thread.h:52
--*
-- * The SDL thread priority.
-- *
-- * \note On many systems you require special privileges to set high or time critical priority.
--
type SDL_ThreadPriority is
(SDL_THREAD_PRIORITY_LOW,
SDL_THREAD_PRIORITY_NORMAL,
SDL_THREAD_PRIORITY_HIGH,
SDL_THREAD_PRIORITY_TIME_CRITICAL);
pragma Convention (C, SDL_ThreadPriority); -- ..\SDL2_tmp\SDL_thread.h:64
--*
-- * The function passed to SDL_CreateThread().
-- * It is passed a void* user context parameter and returns an int.
--
type SDL_ThreadFunction is access function (arg1 : System.Address) return int;
pragma Convention (C, SDL_ThreadFunction); -- ..\SDL2_tmp\SDL_thread.h:70
--*
-- * \file SDL_thread.h
-- *
-- * We compile SDL into a DLL. This means, that it's the DLL which
-- * creates a new thread for the calling process with the SDL_CreateThread()
-- * API. There is a problem with this, that only the RTL of the SDL2.DLL will
-- * be initialized for those threads, and not the RTL of the calling
-- * application!
-- *
-- * To solve this, we make a little hack here.
-- *
-- * We'll always use the caller's _beginthread() and _endthread() APIs to
-- * start a new thread. This way, if it's the SDL2.DLL which uses this API,
-- * then the RTL of SDL2.DLL will be used to create the new thread, and if it's
-- * the application, then the RTL of the application will be used.
-- *
-- * So, in short:
-- * Always use the _beginthread() and _endthread() of the calling runtime
-- * library!
--
-- _beginthreadex() and _endthreadex()
type pfnSDL_CurrentBeginThread is access function
(arg1 : System.Address;
arg2 : unsigned;
arg3 : access function (arg1 : System.Address) return unsigned;
arg4 : System.Address;
arg5 : unsigned;
arg6 : access unsigned) return umingw_h.uintptr_t;
pragma Convention (C, pfnSDL_CurrentBeginThread); -- ..\SDL2_tmp\SDL_thread.h:96
--arg
-- threadID
type pfnSDL_CurrentEndThread is access procedure (arg1 : unsigned);
pragma Convention (C, pfnSDL_CurrentEndThread); -- ..\SDL2_tmp\SDL_thread.h:99
--*
-- * Create a thread.
--
function SDL_CreateThread
(fn : SDL_ThreadFunction;
name : Interfaces.C.Strings.chars_ptr;
data : System.Address;
pfnBeginThread : pfnSDL_CurrentBeginThread;
pfnEndThread : pfnSDL_CurrentEndThread) return access SDL_Thread; -- ..\SDL2_tmp\SDL_thread.h:105
pragma Import (C, SDL_CreateThread, "SDL_CreateThread");
function SDL_CreateThreadWithStackSize
(fn : access function (arg1 : System.Address) return int;
name : Interfaces.C.Strings.chars_ptr;
stacksize : stddef_h.size_t;
data : System.Address;
pfnBeginThread : pfnSDL_CurrentBeginThread;
pfnEndThread : pfnSDL_CurrentEndThread) return access SDL_Thread; -- ..\SDL2_tmp\SDL_thread.h:110
pragma Import (C, SDL_CreateThreadWithStackSize, "SDL_CreateThreadWithStackSize");
--*
-- * Create a thread.
--
-- * just like the windows case above: We compile SDL2
-- * into a dll with Watcom's runtime statically linked.
--
--arg
--*
-- * Create a thread with a default stack size.
-- *
-- * This is equivalent to calling:
-- * SDL_CreateThreadWithStackSize(fn, name, 0, data);
--
--*
-- * Create a thread.
-- *
-- * Thread naming is a little complicated: Most systems have very small
-- * limits for the string length (Haiku has 32 bytes, Linux currently has 16,
-- * Visual C++ 6.0 has nine!), and possibly other arbitrary rules. You'll
-- * have to see what happens with your system's debugger. The name should be
-- * UTF-8 (but using the naming limits of C identifiers is a better bet).
-- * There are no requirements for thread naming conventions, so long as the
-- * string is null-terminated UTF-8, but these guidelines are helpful in
-- * choosing a name:
-- *
-- * http://stackoverflow.com/questions/149932/naming-conventions-for-threads
-- *
-- * If a system imposes requirements, SDL will try to munge the string for
-- * it (truncate, etc), but the original string contents will be available
-- * from SDL_GetThreadName().
-- *
-- * The size (in bytes) of the new stack can be specified. Zero means "use
-- * the system default" which might be wildly different between platforms
-- * (x86 Linux generally defaults to eight megabytes, an embedded device
-- * might be a few kilobytes instead).
-- *
-- * In SDL 2.1, stacksize will be folded into the original SDL_CreateThread
-- * function.
--
--*
-- * Get the thread name, as it was specified in SDL_CreateThread().
-- * This function returns a pointer to a UTF-8 string that names the
-- * specified thread, or NULL if it doesn't have a name. This is internal
-- * memory, not to be free()'d by the caller, and remains valid until the
-- * specified thread is cleaned up by SDL_WaitThread().
--
function SDL_GetThreadName (thread : access SDL_Thread) return Interfaces.C.Strings.chars_ptr; -- ..\SDL2_tmp\SDL_thread.h:209
pragma Import (C, SDL_GetThreadName, "SDL_GetThreadName");
--*
-- * Get the thread identifier for the current thread.
--
function SDL_ThreadID return SDL_threadID; -- ..\SDL2_tmp\SDL_thread.h:214
pragma Import (C, SDL_ThreadID, "SDL_ThreadID");
--*
-- * Get the thread identifier for the specified thread.
-- *
-- * Equivalent to SDL_ThreadID() if the specified thread is NULL.
--
function SDL_GetThreadID (thread : access SDL_Thread) return SDL_threadID; -- ..\SDL2_tmp\SDL_thread.h:221
pragma Import (C, SDL_GetThreadID, "SDL_GetThreadID");
--*
-- * Set the priority for the current thread
--
function SDL_SetThreadPriority (priority : SDL_ThreadPriority) return int; -- ..\SDL2_tmp\SDL_thread.h:226
pragma Import (C, SDL_SetThreadPriority, "SDL_SetThreadPriority");
--*
-- * Wait for a thread to finish. Threads that haven't been detached will
-- * remain (as a "zombie") until this function cleans them up. Not doing so
-- * is a resource leak.
-- *
-- * Once a thread has been cleaned up through this function, the SDL_Thread
-- * that references it becomes invalid and should not be referenced again.
-- * As such, only one thread may call SDL_WaitThread() on another.
-- *
-- * The return code for the thread function is placed in the area
-- * pointed to by \c status, if \c status is not NULL.
-- *
-- * You may not wait on a thread that has been used in a call to
-- * SDL_DetachThread(). Use either that function or this one, but not
-- * both, or behavior is undefined.
-- *
-- * It is safe to pass NULL to this function; it is a no-op.
--
procedure SDL_WaitThread (thread : access SDL_Thread; status : access int); -- ..\SDL2_tmp\SDL_thread.h:246
pragma Import (C, SDL_WaitThread, "SDL_WaitThread");
--*
-- * A thread may be "detached" to signify that it should not remain until
-- * another thread has called SDL_WaitThread() on it. Detaching a thread
-- * is useful for long-running threads that nothing needs to synchronize
-- * with or further manage. When a detached thread is done, it simply
-- * goes away.
-- *
-- * There is no way to recover the return code of a detached thread. If you
-- * need this, don't detach the thread and instead use SDL_WaitThread().
-- *
-- * Once a thread is detached, you should usually assume the SDL_Thread isn't
-- * safe to reference again, as it will become invalid immediately upon
-- * the detached thread's exit, instead of remaining until someone has called
-- * SDL_WaitThread() to finally clean it up. As such, don't detach the same
-- * thread more than once.
-- *
-- * If a thread has already exited when passed to SDL_DetachThread(), it will
-- * stop waiting for a call to SDL_WaitThread() and clean up immediately.
-- * It is not safe to detach a thread that might be used with SDL_WaitThread().
-- *
-- * You may not call SDL_WaitThread() on a thread that has been detached.
-- * Use either that function or this one, but not both, or behavior is
-- * undefined.
-- *
-- * It is safe to pass NULL to this function; it is a no-op.
--
procedure SDL_DetachThread (thread : access SDL_Thread); -- ..\SDL2_tmp\SDL_thread.h:274
pragma Import (C, SDL_DetachThread, "SDL_DetachThread");
--*
-- * \brief Create an identifier that is globally visible to all threads but refers to data that is thread-specific.
-- *
-- * \return The newly created thread local storage identifier, or 0 on error
-- *
-- * \code
-- * static SDL_SpinLock tls_lock;
-- * static SDL_TLSID thread_local_storage;
-- *
-- * void SetMyThreadData(void *value)
-- * {
-- * if (!thread_local_storage) {
-- * SDL_AtomicLock(&tls_lock);
-- * if (!thread_local_storage) {
-- * thread_local_storage = SDL_TLSCreate();
-- * }
-- * SDL_AtomicUnlock(&tls_lock);
-- * }
-- * SDL_TLSSet(thread_local_storage, value, 0);
-- * }
-- *
-- * void *GetMyThreadData(void)
-- * {
-- * return SDL_TLSGet(thread_local_storage);
-- * }
-- * \endcode
-- *
-- * \sa SDL_TLSGet()
-- * \sa SDL_TLSSet()
--
function SDL_TLSCreate return SDL_TLSID; -- ..\SDL2_tmp\SDL_thread.h:306
pragma Import (C, SDL_TLSCreate, "SDL_TLSCreate");
--*
-- * \brief Get the value associated with a thread local storage ID for the current thread.
-- *
-- * \param id The thread local storage ID
-- *
-- * \return The value associated with the ID for the current thread, or NULL if no value has been set.
-- *
-- * \sa SDL_TLSCreate()
-- * \sa SDL_TLSSet()
--
function SDL_TLSGet (id : SDL_TLSID) return System.Address; -- ..\SDL2_tmp\SDL_thread.h:318
pragma Import (C, SDL_TLSGet, "SDL_TLSGet");
--*
-- * \brief Set the value associated with a thread local storage ID for the current thread.
-- *
-- * \param id The thread local storage ID
-- * \param value The value to associate with the ID for the current thread
-- * \param destructor A function called when the thread exits, to free the value.
-- *
-- * \return 0 on success, -1 on error
-- *
-- * \sa SDL_TLSCreate()
-- * \sa SDL_TLSGet()
--
function SDL_TLSSet
(id : SDL_TLSID;
value : System.Address;
destructor : access procedure (arg1 : System.Address)) return int; -- ..\SDL2_tmp\SDL_thread.h:332
pragma Import (C, SDL_TLSSet, "SDL_TLSSet");
-- Ends C function definitions when using C++
-- vi: set ts=4 sw=4 expandtab:
end SDL_thread_h;
|
[
{
"context": "========================\n--\n-- Copyright 2022 (C) Holger Rodriguez\n--\n-- SPDX-License-Identifier: BSD-3-Clause\n--\nw",
"end": 315,
"score": 0.9998619556427002,
"start": 299,
"tag": "NAME",
"value": "Holger Rodriguez"
}
] |
example_pico/src/demos.adb
|
hgrodriguez/sh1107
| 1 |
--===========================================================================
--
-- This package is the implementation of the demo package showing examples
-- for the SH1107 OLED controller
--
--===========================================================================
--
-- Copyright 2022 (C) Holger Rodriguez
--
-- SPDX-License-Identifier: BSD-3-Clause
--
with HAL;
with HAL.Bitmap;
with HAL.Framebuffer;
with RP.Timer;
package body Demos is
procedure Black_Background_White_Arrow (S : in out SH1107.SH1107_Screen);
procedure White_Background_With_Black_Rectangle_Full_Screen
(S : in out SH1107.SH1107_Screen);
procedure Black_Background_With_White_Rectangle_Full_Screen
(S : in out SH1107.SH1107_Screen);
procedure White_Background_4_Black_Corners
(S : in out SH1107.SH1107_Screen);
procedure Black_Background_4_White_Corners
(S : in out SH1107.SH1107_Screen);
procedure Black_Background_White_Geometry (S : in out SH1107.SH1107_Screen);
procedure White_Background_Black_Geometry (S : in out SH1107.SH1107_Screen);
procedure White_Diagonal_Line_On_Black (S : in out SH1107.SH1107_Screen);
procedure Black_Diagonal_Line_On_White (S : in out SH1107.SH1107_Screen);
type Demo_Procedure is
not null access procedure (S : in out SH1107.SH1107_Screen);
Demos_Procedures : constant array (Demos_Available) of Demo_Procedure
:= (Demos.Black_Background_White_Arrow =>
(Black_Background_White_Arrow'Access),
Demos.White_Background_With_Black_Rectangle_Full_Screen =>
(
White_Background_With_Black_Rectangle_Full_Screen'Access),
Demos.Black_Background_With_White_Rectangle_Full_Screen =>
(
Black_Background_With_White_Rectangle_Full_Screen'Access),
Demos.White_Background_4_Black_Corners =>
(White_Background_4_Black_Corners'Access),
Demos.Black_Background_4_White_Corners =>
(Black_Background_4_White_Corners'Access),
Demos.Black_Background_White_Geometry =>
(Black_Background_White_Geometry'Access),
Demos.White_Background_Black_Geometry =>
(White_Background_Black_Geometry'Access),
Demos.White_Diagonal_Line_On_Black =>
(White_Diagonal_Line_On_Black'Access),
Demos.Black_Diagonal_Line_On_White =>
(Black_Diagonal_Line_On_White'Access)
);
Another_Timer : RP.Timer.Delays;
THE_LAYER : constant Positive := 1;
Corner_0_0 : constant HAL.Bitmap.Point := (0, 0);
Corner_1_1 : constant HAL.Bitmap.Point := (1, 1);
Corner_0_127 : constant HAL.Bitmap.Point := (0, SH1107.THE_HEIGHT - 1);
Corner_127_0 : constant HAL.Bitmap.Point := (SH1107.THE_WIDTH - 1, 0);
Corner_127_127 : constant HAL.Bitmap.Point := (SH1107.THE_WIDTH - 1,
SH1107.THE_HEIGHT - 1);
My_Area : constant HAL.Bitmap.Rect
:= (Position => Corner_0_0,
Width => SH1107.THE_WIDTH - 1,
Height => SH1107.THE_HEIGHT - 1);
My_Circle_Center : constant HAL.Bitmap.Point := (X => 64, Y => 38);
My_Circle_Radius : constant Natural := 10;
My_Rectangle : constant HAL.Bitmap.Rect
:= (Position => (X => 38, Y => 78),
Width => 20,
Height => 10);
procedure Black_Background_White_Arrow
(S : in out SH1107.SH1107_Screen) is
Corners : constant HAL.Bitmap.Point_Array (1 .. 7)
:= (
1 => (40, 118),
2 => (86, 118),
3 => (86, 60),
4 => (96, 60),
5 => (63, 10),
6 => (30, 60),
7 => (40, 60));
Start : HAL.Bitmap.Point;
Stop : HAL.Bitmap.Point;
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 1);
for N in Corners'First .. Corners'Last loop
Start := Corners (N);
if N = Corners'Last then
Stop := Corners (1);
else
Stop := Corners (N + 1);
end if;
My_Hidden_Buffer.Draw_Line (Start, Stop);
end loop;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end Black_Background_White_Arrow;
procedure White_Background_With_Black_Rectangle_Full_Screen
(S : in out SH1107.SH1107_Screen) is
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Draw_Rect (Area => My_Area);
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end White_Background_With_Black_Rectangle_Full_Screen;
procedure Black_Background_With_White_Rectangle_Full_Screen
(S : in out SH1107.SH1107_Screen) is
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Draw_Rect (Area => My_Area);
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end Black_Background_With_White_Rectangle_Full_Screen;
procedure White_Background_4_Black_Corners
(S : in out SH1107.SH1107_Screen) is
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_0_0,
Native => 0);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_1_1,
Native => 0);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_0_127,
Native => 0);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_127_0,
Native => 0);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_127_127,
Native => 0);
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end White_Background_4_Black_Corners;
procedure Black_Background_4_White_Corners
(S : in out SH1107.SH1107_Screen) is
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_0_0,
Native => 1);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_0_127,
Native => 1);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_127_0,
Native => 1);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_127_127,
Native => 1);
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end Black_Background_4_White_Corners;
procedure Black_Background_White_Geometry
(S : in out SH1107.SH1107_Screen) is
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Draw_Circle (Center => My_Circle_Center,
Radius => My_Circle_Radius);
My_Hidden_Buffer.Draw_Rounded_Rect (Area => My_Rectangle,
Radius => 4);
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end Black_Background_White_Geometry;
procedure White_Background_Black_Geometry
(S : in out SH1107.SH1107_Screen) is
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Draw_Circle (Center => My_Circle_Center,
Radius => My_Circle_Radius);
My_Hidden_Buffer.Draw_Rounded_Rect (Area => My_Rectangle,
Radius => 4);
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end White_Background_Black_Geometry;
procedure White_Diagonal_Line_On_Black
(S : in out SH1107.SH1107_Screen) is
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Draw_Line (Start => Corner_0_0,
Stop => Corner_127_127);
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end White_Diagonal_Line_On_Black;
procedure Black_Diagonal_Line_On_White
(S : in out SH1107.SH1107_Screen) is
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Draw_Line (Start => Corner_0_0,
Stop => Corner_127_127);
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end Black_Diagonal_Line_On_White;
procedure Show_Multiple_Demos (S : in out SH1107.SH1107_Screen;
O : SH1107.SH1107_Orientation;
DA : Demo_Array) is
begin
for D in Demos_Available'First .. Demos_Available'Last loop
if DA (D) then
Show_1_Demo (S, O, D);
end if;
end loop;
end Show_Multiple_Demos;
procedure Show_1_Demo (S : in out SH1107.SH1107_Screen;
O : SH1107.SH1107_Orientation;
Demo : Demos_Available) is
My_Color_Mode : HAL.Framebuffer.FB_Color_Mode;
begin
My_Color_Mode := SH1107.Color_Mode (This => S);
SH1107.Initialize_Layer (This => S,
Layer => THE_LAYER,
Mode => My_Color_Mode);
S.Set_Orientation (O);
Demos_Procedures (Demo).all (S);
end Show_1_Demo;
end Demos;
|
8594
|
--===========================================================================
--
-- This package is the implementation of the demo package showing examples
-- for the SH1107 OLED controller
--
--===========================================================================
--
-- Copyright 2022 (C) <NAME>
--
-- SPDX-License-Identifier: BSD-3-Clause
--
with HAL;
with HAL.Bitmap;
with HAL.Framebuffer;
with RP.Timer;
package body Demos is
procedure Black_Background_White_Arrow (S : in out SH1107.SH1107_Screen);
procedure White_Background_With_Black_Rectangle_Full_Screen
(S : in out SH1107.SH1107_Screen);
procedure Black_Background_With_White_Rectangle_Full_Screen
(S : in out SH1107.SH1107_Screen);
procedure White_Background_4_Black_Corners
(S : in out SH1107.SH1107_Screen);
procedure Black_Background_4_White_Corners
(S : in out SH1107.SH1107_Screen);
procedure Black_Background_White_Geometry (S : in out SH1107.SH1107_Screen);
procedure White_Background_Black_Geometry (S : in out SH1107.SH1107_Screen);
procedure White_Diagonal_Line_On_Black (S : in out SH1107.SH1107_Screen);
procedure Black_Diagonal_Line_On_White (S : in out SH1107.SH1107_Screen);
type Demo_Procedure is
not null access procedure (S : in out SH1107.SH1107_Screen);
Demos_Procedures : constant array (Demos_Available) of Demo_Procedure
:= (Demos.Black_Background_White_Arrow =>
(Black_Background_White_Arrow'Access),
Demos.White_Background_With_Black_Rectangle_Full_Screen =>
(
White_Background_With_Black_Rectangle_Full_Screen'Access),
Demos.Black_Background_With_White_Rectangle_Full_Screen =>
(
Black_Background_With_White_Rectangle_Full_Screen'Access),
Demos.White_Background_4_Black_Corners =>
(White_Background_4_Black_Corners'Access),
Demos.Black_Background_4_White_Corners =>
(Black_Background_4_White_Corners'Access),
Demos.Black_Background_White_Geometry =>
(Black_Background_White_Geometry'Access),
Demos.White_Background_Black_Geometry =>
(White_Background_Black_Geometry'Access),
Demos.White_Diagonal_Line_On_Black =>
(White_Diagonal_Line_On_Black'Access),
Demos.Black_Diagonal_Line_On_White =>
(Black_Diagonal_Line_On_White'Access)
);
Another_Timer : RP.Timer.Delays;
THE_LAYER : constant Positive := 1;
Corner_0_0 : constant HAL.Bitmap.Point := (0, 0);
Corner_1_1 : constant HAL.Bitmap.Point := (1, 1);
Corner_0_127 : constant HAL.Bitmap.Point := (0, SH1107.THE_HEIGHT - 1);
Corner_127_0 : constant HAL.Bitmap.Point := (SH1107.THE_WIDTH - 1, 0);
Corner_127_127 : constant HAL.Bitmap.Point := (SH1107.THE_WIDTH - 1,
SH1107.THE_HEIGHT - 1);
My_Area : constant HAL.Bitmap.Rect
:= (Position => Corner_0_0,
Width => SH1107.THE_WIDTH - 1,
Height => SH1107.THE_HEIGHT - 1);
My_Circle_Center : constant HAL.Bitmap.Point := (X => 64, Y => 38);
My_Circle_Radius : constant Natural := 10;
My_Rectangle : constant HAL.Bitmap.Rect
:= (Position => (X => 38, Y => 78),
Width => 20,
Height => 10);
procedure Black_Background_White_Arrow
(S : in out SH1107.SH1107_Screen) is
Corners : constant HAL.Bitmap.Point_Array (1 .. 7)
:= (
1 => (40, 118),
2 => (86, 118),
3 => (86, 60),
4 => (96, 60),
5 => (63, 10),
6 => (30, 60),
7 => (40, 60));
Start : HAL.Bitmap.Point;
Stop : HAL.Bitmap.Point;
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 1);
for N in Corners'First .. Corners'Last loop
Start := Corners (N);
if N = Corners'Last then
Stop := Corners (1);
else
Stop := Corners (N + 1);
end if;
My_Hidden_Buffer.Draw_Line (Start, Stop);
end loop;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end Black_Background_White_Arrow;
procedure White_Background_With_Black_Rectangle_Full_Screen
(S : in out SH1107.SH1107_Screen) is
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Draw_Rect (Area => My_Area);
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end White_Background_With_Black_Rectangle_Full_Screen;
procedure Black_Background_With_White_Rectangle_Full_Screen
(S : in out SH1107.SH1107_Screen) is
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Draw_Rect (Area => My_Area);
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end Black_Background_With_White_Rectangle_Full_Screen;
procedure White_Background_4_Black_Corners
(S : in out SH1107.SH1107_Screen) is
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_0_0,
Native => 0);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_1_1,
Native => 0);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_0_127,
Native => 0);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_127_0,
Native => 0);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_127_127,
Native => 0);
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end White_Background_4_Black_Corners;
procedure Black_Background_4_White_Corners
(S : in out SH1107.SH1107_Screen) is
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_0_0,
Native => 1);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_0_127,
Native => 1);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_127_0,
Native => 1);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_127_127,
Native => 1);
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end Black_Background_4_White_Corners;
procedure Black_Background_White_Geometry
(S : in out SH1107.SH1107_Screen) is
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Draw_Circle (Center => My_Circle_Center,
Radius => My_Circle_Radius);
My_Hidden_Buffer.Draw_Rounded_Rect (Area => My_Rectangle,
Radius => 4);
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end Black_Background_White_Geometry;
procedure White_Background_Black_Geometry
(S : in out SH1107.SH1107_Screen) is
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Draw_Circle (Center => My_Circle_Center,
Radius => My_Circle_Radius);
My_Hidden_Buffer.Draw_Rounded_Rect (Area => My_Rectangle,
Radius => 4);
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end White_Background_Black_Geometry;
procedure White_Diagonal_Line_On_Black
(S : in out SH1107.SH1107_Screen) is
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Draw_Line (Start => Corner_0_0,
Stop => Corner_127_127);
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end White_Diagonal_Line_On_Black;
procedure Black_Diagonal_Line_On_White
(S : in out SH1107.SH1107_Screen) is
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Draw_Line (Start => Corner_0_0,
Stop => Corner_127_127);
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end Black_Diagonal_Line_On_White;
procedure Show_Multiple_Demos (S : in out SH1107.SH1107_Screen;
O : SH1107.SH1107_Orientation;
DA : Demo_Array) is
begin
for D in Demos_Available'First .. Demos_Available'Last loop
if DA (D) then
Show_1_Demo (S, O, D);
end if;
end loop;
end Show_Multiple_Demos;
procedure Show_1_Demo (S : in out SH1107.SH1107_Screen;
O : SH1107.SH1107_Orientation;
Demo : Demos_Available) is
My_Color_Mode : HAL.Framebuffer.FB_Color_Mode;
begin
My_Color_Mode := SH1107.Color_Mode (This => S);
SH1107.Initialize_Layer (This => S,
Layer => THE_LAYER,
Mode => My_Color_Mode);
S.Set_Orientation (O);
Demos_Procedures (Demo).all (S);
end Show_1_Demo;
end Demos;
| true |
--===========================================================================
--
-- This package is the implementation of the demo package showing examples
-- for the SH1107 OLED controller
--
--===========================================================================
--
-- Copyright 2022 (C) PI:NAME:<NAME>END_PI
--
-- SPDX-License-Identifier: BSD-3-Clause
--
with HAL;
with HAL.Bitmap;
with HAL.Framebuffer;
with RP.Timer;
package body Demos is
procedure Black_Background_White_Arrow (S : in out SH1107.SH1107_Screen);
procedure White_Background_With_Black_Rectangle_Full_Screen
(S : in out SH1107.SH1107_Screen);
procedure Black_Background_With_White_Rectangle_Full_Screen
(S : in out SH1107.SH1107_Screen);
procedure White_Background_4_Black_Corners
(S : in out SH1107.SH1107_Screen);
procedure Black_Background_4_White_Corners
(S : in out SH1107.SH1107_Screen);
procedure Black_Background_White_Geometry (S : in out SH1107.SH1107_Screen);
procedure White_Background_Black_Geometry (S : in out SH1107.SH1107_Screen);
procedure White_Diagonal_Line_On_Black (S : in out SH1107.SH1107_Screen);
procedure Black_Diagonal_Line_On_White (S : in out SH1107.SH1107_Screen);
type Demo_Procedure is
not null access procedure (S : in out SH1107.SH1107_Screen);
Demos_Procedures : constant array (Demos_Available) of Demo_Procedure
:= (Demos.Black_Background_White_Arrow =>
(Black_Background_White_Arrow'Access),
Demos.White_Background_With_Black_Rectangle_Full_Screen =>
(
White_Background_With_Black_Rectangle_Full_Screen'Access),
Demos.Black_Background_With_White_Rectangle_Full_Screen =>
(
Black_Background_With_White_Rectangle_Full_Screen'Access),
Demos.White_Background_4_Black_Corners =>
(White_Background_4_Black_Corners'Access),
Demos.Black_Background_4_White_Corners =>
(Black_Background_4_White_Corners'Access),
Demos.Black_Background_White_Geometry =>
(Black_Background_White_Geometry'Access),
Demos.White_Background_Black_Geometry =>
(White_Background_Black_Geometry'Access),
Demos.White_Diagonal_Line_On_Black =>
(White_Diagonal_Line_On_Black'Access),
Demos.Black_Diagonal_Line_On_White =>
(Black_Diagonal_Line_On_White'Access)
);
Another_Timer : RP.Timer.Delays;
THE_LAYER : constant Positive := 1;
Corner_0_0 : constant HAL.Bitmap.Point := (0, 0);
Corner_1_1 : constant HAL.Bitmap.Point := (1, 1);
Corner_0_127 : constant HAL.Bitmap.Point := (0, SH1107.THE_HEIGHT - 1);
Corner_127_0 : constant HAL.Bitmap.Point := (SH1107.THE_WIDTH - 1, 0);
Corner_127_127 : constant HAL.Bitmap.Point := (SH1107.THE_WIDTH - 1,
SH1107.THE_HEIGHT - 1);
My_Area : constant HAL.Bitmap.Rect
:= (Position => Corner_0_0,
Width => SH1107.THE_WIDTH - 1,
Height => SH1107.THE_HEIGHT - 1);
My_Circle_Center : constant HAL.Bitmap.Point := (X => 64, Y => 38);
My_Circle_Radius : constant Natural := 10;
My_Rectangle : constant HAL.Bitmap.Rect
:= (Position => (X => 38, Y => 78),
Width => 20,
Height => 10);
procedure Black_Background_White_Arrow
(S : in out SH1107.SH1107_Screen) is
Corners : constant HAL.Bitmap.Point_Array (1 .. 7)
:= (
1 => (40, 118),
2 => (86, 118),
3 => (86, 60),
4 => (96, 60),
5 => (63, 10),
6 => (30, 60),
7 => (40, 60));
Start : HAL.Bitmap.Point;
Stop : HAL.Bitmap.Point;
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 1);
for N in Corners'First .. Corners'Last loop
Start := Corners (N);
if N = Corners'Last then
Stop := Corners (1);
else
Stop := Corners (N + 1);
end if;
My_Hidden_Buffer.Draw_Line (Start, Stop);
end loop;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end Black_Background_White_Arrow;
procedure White_Background_With_Black_Rectangle_Full_Screen
(S : in out SH1107.SH1107_Screen) is
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Draw_Rect (Area => My_Area);
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end White_Background_With_Black_Rectangle_Full_Screen;
procedure Black_Background_With_White_Rectangle_Full_Screen
(S : in out SH1107.SH1107_Screen) is
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Draw_Rect (Area => My_Area);
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end Black_Background_With_White_Rectangle_Full_Screen;
procedure White_Background_4_Black_Corners
(S : in out SH1107.SH1107_Screen) is
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_0_0,
Native => 0);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_1_1,
Native => 0);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_0_127,
Native => 0);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_127_0,
Native => 0);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_127_127,
Native => 0);
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end White_Background_4_Black_Corners;
procedure Black_Background_4_White_Corners
(S : in out SH1107.SH1107_Screen) is
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_0_0,
Native => 1);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_0_127,
Native => 1);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_127_0,
Native => 1);
My_Hidden_Buffer.Set_Pixel (Pt => Corner_127_127,
Native => 1);
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end Black_Background_4_White_Corners;
procedure Black_Background_White_Geometry
(S : in out SH1107.SH1107_Screen) is
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Draw_Circle (Center => My_Circle_Center,
Radius => My_Circle_Radius);
My_Hidden_Buffer.Draw_Rounded_Rect (Area => My_Rectangle,
Radius => 4);
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end Black_Background_White_Geometry;
procedure White_Background_Black_Geometry
(S : in out SH1107.SH1107_Screen) is
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Draw_Circle (Center => My_Circle_Center,
Radius => My_Circle_Radius);
My_Hidden_Buffer.Draw_Rounded_Rect (Area => My_Rectangle,
Radius => 4);
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end White_Background_Black_Geometry;
procedure White_Diagonal_Line_On_Black
(S : in out SH1107.SH1107_Screen) is
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Draw_Line (Start => Corner_0_0,
Stop => Corner_127_127);
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end White_Diagonal_Line_On_Black;
procedure Black_Diagonal_Line_On_White
(S : in out SH1107.SH1107_Screen) is
My_Hidden_Buffer : HAL.Bitmap.Any_Bitmap_Buffer;
begin
My_Hidden_Buffer := SH1107.Hidden_Buffer (This => S,
Layer => THE_LAYER);
My_Hidden_Buffer.Set_Source (Native => 1);
My_Hidden_Buffer.Fill;
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
My_Hidden_Buffer.Set_Source (Native => 0);
My_Hidden_Buffer.Draw_Line (Start => Corner_0_0,
Stop => Corner_127_127);
SH1107.Update_Layer (This => S,
Layer => THE_LAYER);
RP.Timer.Delay_Seconds (This => Another_Timer,
S => 1);
end Black_Diagonal_Line_On_White;
procedure Show_Multiple_Demos (S : in out SH1107.SH1107_Screen;
O : SH1107.SH1107_Orientation;
DA : Demo_Array) is
begin
for D in Demos_Available'First .. Demos_Available'Last loop
if DA (D) then
Show_1_Demo (S, O, D);
end if;
end loop;
end Show_Multiple_Demos;
procedure Show_1_Demo (S : in out SH1107.SH1107_Screen;
O : SH1107.SH1107_Orientation;
Demo : Demos_Available) is
My_Color_Mode : HAL.Framebuffer.FB_Color_Mode;
begin
My_Color_Mode := SH1107.Color_Mode (This => S);
SH1107.Initialize_Layer (This => S,
Layer => THE_LAYER,
Mode => My_Color_Mode);
S.Set_Orientation (O);
Demos_Procedures (Demo).all (S);
end Show_1_Demo;
end Demos;
|
[
{
"context": "-- Copyright (c) 2019 Maxim Reznik <[email protected]>\n--\n-- SPDX-License-Identifi",
"end": 35,
"score": 0.9998506307601929,
"start": 23,
"tag": "NAME",
"value": "Maxim Reznik"
},
{
"context": "-- Copyright (c) 2019 Maxim Reznik <[email protected]>\n--\n-- SPDX-License-Identifier: MIT\n-- License-",
"end": 55,
"score": 0.9999301433563232,
"start": 37,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
source/oasis/program-elements-function_access_types.ads
|
optikos/oasis
| 0 |
-- Copyright (c) 2019 Maxim Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Elements.Access_Types;
with Program.Lexical_Elements;
with Program.Elements.Parameter_Specifications;
package Program.Elements.Function_Access_Types is
pragma Pure (Program.Elements.Function_Access_Types);
type Function_Access_Type is
limited interface and Program.Elements.Access_Types.Access_Type;
type Function_Access_Type_Access is access all Function_Access_Type'Class
with Storage_Size => 0;
not overriding function Parameters
(Self : Function_Access_Type)
return Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access is abstract;
not overriding function Result_Subtype
(Self : Function_Access_Type)
return not null Program.Elements.Element_Access is abstract;
not overriding function Has_Not_Null
(Self : Function_Access_Type)
return Boolean is abstract;
not overriding function Has_Protected
(Self : Function_Access_Type)
return Boolean is abstract;
not overriding function Has_Not_Null_2
(Self : Function_Access_Type)
return Boolean is abstract;
type Function_Access_Type_Text is limited interface;
type Function_Access_Type_Text_Access is
access all Function_Access_Type_Text'Class with Storage_Size => 0;
not overriding function To_Function_Access_Type_Text
(Self : aliased in out Function_Access_Type)
return Function_Access_Type_Text_Access is abstract;
not overriding function Not_Token
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Null_Token
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Access_Token
(Self : Function_Access_Type_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Protected_Token
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Function_Token
(Self : Function_Access_Type_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Left_Bracket_Token
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Right_Bracket_Token
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Return_Token
(Self : Function_Access_Type_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Not_Token_2
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Null_Token_2
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
end Program.Elements.Function_Access_Types;
|
26888
|
-- Copyright (c) 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Elements.Access_Types;
with Program.Lexical_Elements;
with Program.Elements.Parameter_Specifications;
package Program.Elements.Function_Access_Types is
pragma Pure (Program.Elements.Function_Access_Types);
type Function_Access_Type is
limited interface and Program.Elements.Access_Types.Access_Type;
type Function_Access_Type_Access is access all Function_Access_Type'Class
with Storage_Size => 0;
not overriding function Parameters
(Self : Function_Access_Type)
return Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access is abstract;
not overriding function Result_Subtype
(Self : Function_Access_Type)
return not null Program.Elements.Element_Access is abstract;
not overriding function Has_Not_Null
(Self : Function_Access_Type)
return Boolean is abstract;
not overriding function Has_Protected
(Self : Function_Access_Type)
return Boolean is abstract;
not overriding function Has_Not_Null_2
(Self : Function_Access_Type)
return Boolean is abstract;
type Function_Access_Type_Text is limited interface;
type Function_Access_Type_Text_Access is
access all Function_Access_Type_Text'Class with Storage_Size => 0;
not overriding function To_Function_Access_Type_Text
(Self : aliased in out Function_Access_Type)
return Function_Access_Type_Text_Access is abstract;
not overriding function Not_Token
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Null_Token
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Access_Token
(Self : Function_Access_Type_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Protected_Token
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Function_Token
(Self : Function_Access_Type_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Left_Bracket_Token
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Right_Bracket_Token
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Return_Token
(Self : Function_Access_Type_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Not_Token_2
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Null_Token_2
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
end Program.Elements.Function_Access_Types;
| true |
-- Copyright (c) 2019 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Elements.Access_Types;
with Program.Lexical_Elements;
with Program.Elements.Parameter_Specifications;
package Program.Elements.Function_Access_Types is
pragma Pure (Program.Elements.Function_Access_Types);
type Function_Access_Type is
limited interface and Program.Elements.Access_Types.Access_Type;
type Function_Access_Type_Access is access all Function_Access_Type'Class
with Storage_Size => 0;
not overriding function Parameters
(Self : Function_Access_Type)
return Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access is abstract;
not overriding function Result_Subtype
(Self : Function_Access_Type)
return not null Program.Elements.Element_Access is abstract;
not overriding function Has_Not_Null
(Self : Function_Access_Type)
return Boolean is abstract;
not overriding function Has_Protected
(Self : Function_Access_Type)
return Boolean is abstract;
not overriding function Has_Not_Null_2
(Self : Function_Access_Type)
return Boolean is abstract;
type Function_Access_Type_Text is limited interface;
type Function_Access_Type_Text_Access is
access all Function_Access_Type_Text'Class with Storage_Size => 0;
not overriding function To_Function_Access_Type_Text
(Self : aliased in out Function_Access_Type)
return Function_Access_Type_Text_Access is abstract;
not overriding function Not_Token
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Null_Token
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Access_Token
(Self : Function_Access_Type_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Protected_Token
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Function_Token
(Self : Function_Access_Type_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Left_Bracket_Token
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Right_Bracket_Token
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Return_Token
(Self : Function_Access_Type_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Not_Token_2
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Null_Token_2
(Self : Function_Access_Type_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
end Program.Elements.Function_Access_Types;
|
[
{
"context": "-- Copyright 2015,2016 Steven Stewart-Gallus\n--\n-- Licensed under the Apache License, Version ",
"end": 44,
"score": 0.9998073577880859,
"start": 23,
"tag": "NAME",
"value": "Steven Stewart-Gallus"
}
] |
src/ada-core/src/linted-update.ads
|
mstewartgallus/linted
| 0 |
-- Copyright 2015,2016 Steven Stewart-Gallus
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-- implied. See the License for the specific language governing
-- permissions and limitations under the License.
with System.Storage_Elements;
package Linted.Update is
pragma Pure;
type Int is range -2**(32 - 1) .. 2**(32 - 1) - 1;
type Nat is mod 2**32;
type Packet is record
X_Position : Int := 0;
Y_Position : Int := 0;
Z_Position : Int := 0;
MX_Position : Int := 0;
MY_Position : Int := 0;
MZ_Position : Int := 0;
Z_Rotation : Nat := 0;
X_Rotation : Nat := 0;
end record;
Storage_Size : constant := 8 * 4;
subtype Storage is
System.Storage_Elements.Storage_Array (1 .. Storage_Size);
procedure To_Storage (U : Packet; S : out Storage);
procedure From_Storage (S : Storage; U : out Packet);
end Linted.Update;
|
27411
|
-- Copyright 2015,2016 <NAME>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-- implied. See the License for the specific language governing
-- permissions and limitations under the License.
with System.Storage_Elements;
package Linted.Update is
pragma Pure;
type Int is range -2**(32 - 1) .. 2**(32 - 1) - 1;
type Nat is mod 2**32;
type Packet is record
X_Position : Int := 0;
Y_Position : Int := 0;
Z_Position : Int := 0;
MX_Position : Int := 0;
MY_Position : Int := 0;
MZ_Position : Int := 0;
Z_Rotation : Nat := 0;
X_Rotation : Nat := 0;
end record;
Storage_Size : constant := 8 * 4;
subtype Storage is
System.Storage_Elements.Storage_Array (1 .. Storage_Size);
procedure To_Storage (U : Packet; S : out Storage);
procedure From_Storage (S : Storage; U : out Packet);
end Linted.Update;
| true |
-- Copyright 2015,2016 PI:NAME:<NAME>END_PI
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-- implied. See the License for the specific language governing
-- permissions and limitations under the License.
with System.Storage_Elements;
package Linted.Update is
pragma Pure;
type Int is range -2**(32 - 1) .. 2**(32 - 1) - 1;
type Nat is mod 2**32;
type Packet is record
X_Position : Int := 0;
Y_Position : Int := 0;
Z_Position : Int := 0;
MX_Position : Int := 0;
MY_Position : Int := 0;
MZ_Position : Int := 0;
Z_Rotation : Nat := 0;
X_Rotation : Nat := 0;
end record;
Storage_Size : constant := 8 * 4;
subtype Storage is
System.Storage_Elements.Storage_Array (1 .. Storage_Size);
procedure To_Storage (U : Packet; S : out Storage);
procedure From_Storage (S : Storage; U : out Packet);
end Linted.Update;
|
[
{
"context": " a directory and parse mail\n-- Copyright (C) 2020 Stephane Carrez\n-- Written by Stephane Carrez (Stephane.Carrez@g",
"end": 163,
"score": 0.999872088432312,
"start": 148,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": " Copyright (C) 2020 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under",
"end": 194,
"score": 0.9998800158500671,
"start": 179,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "0 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under the Apache License, Versio",
"end": 221,
"score": 0.9999297261238098,
"start": 196,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
tools/mgrep-scanner.ads
|
stcarrez/ada-mail
| 2 |
-----------------------------------------------------------------------
-- mgrep-scanner -- Scan a directory and parse mail
-- Copyright (C) 2020 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Strings.Unbounded;
with Mgrep.Matcher;
private with Util.Strings.Vectors;
private with Ada.Finalization;
private with Ada.Exceptions;
private with Util.Executors;
private with Util.Concurrent.Counters;
package Mgrep.Scanner is
type Scanner_Type (Count : Positive;
Rule : access Matcher.Mail_Rule) is tagged limited private;
procedure Add_Directory (Scanner : in out Scanner_Type;
Path : in String);
procedure Add_File (Scanner : in out Scanner_Type;
Path : in String);
procedure Scan_File (Scanner : in out Scanner_Type;
Path : in String);
procedure Scan_Directory (Scanner : in out Scanner_Type;
Path : in String);
procedure Start (Scanner : in out Scanner_Type);
procedure Stop (Scanner : in out Scanner_Type);
procedure Process (Scanner : in out Scanner_Type;
Done : out Boolean);
function Get_File_Count (Scanner : in Scanner_Type) return Natural;
function Get_Directory_Count (Scanner : in Scanner_Type) return Natural;
private
type Scanner_Access is access all Scanner_Type'Class;
type Work_Kind is (SCAN_DIRECTORY, SCAN_MAIL);
type Work_Type is record
Kind : Work_Kind;
Scanner : Scanner_Access;
Path : Ada.Strings.Unbounded.Unbounded_String;
end record;
procedure Execute (Work : in out Work_Type);
procedure Error (Work : in out Work_Type;
Ex : in Ada.Exceptions.Exception_Occurrence);
QUEUE_SIZE : constant := 100000;
package Executors is
new Util.Executors (Work_Type => Work_Type,
Execute => Execute,
Error => Error,
Default_Queue_Size => QUEUE_SIZE);
type Task_Manager (Count : Positive) is limited
new Executors.Executor_Manager (Count) with null record;
type Scanner_Type (Count : Positive;
Rule : access Matcher.Mail_Rule) is
limited new Ada.Finalization.Limited_Controlled with record
Job_Count : Util.Concurrent.Counters.Counter;
Scan_Dir_Count : Util.Concurrent.Counters.Counter;
Scan_File_Count : Util.Concurrent.Counters.Counter;
Dir_Count : Util.Concurrent.Counters.Counter;
File_Count : Util.Concurrent.Counters.Counter;
Self : Scanner_Access;
Directories : Util.Strings.Vectors.Vector;
Manager : Task_Manager (Count);
end record;
overriding
procedure Initialize (Scanner : in out Scanner_Type);
end Mgrep.Scanner;
|
4749
|
-----------------------------------------------------------------------
-- mgrep-scanner -- Scan a directory and parse mail
-- Copyright (C) 2020 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Strings.Unbounded;
with Mgrep.Matcher;
private with Util.Strings.Vectors;
private with Ada.Finalization;
private with Ada.Exceptions;
private with Util.Executors;
private with Util.Concurrent.Counters;
package Mgrep.Scanner is
type Scanner_Type (Count : Positive;
Rule : access Matcher.Mail_Rule) is tagged limited private;
procedure Add_Directory (Scanner : in out Scanner_Type;
Path : in String);
procedure Add_File (Scanner : in out Scanner_Type;
Path : in String);
procedure Scan_File (Scanner : in out Scanner_Type;
Path : in String);
procedure Scan_Directory (Scanner : in out Scanner_Type;
Path : in String);
procedure Start (Scanner : in out Scanner_Type);
procedure Stop (Scanner : in out Scanner_Type);
procedure Process (Scanner : in out Scanner_Type;
Done : out Boolean);
function Get_File_Count (Scanner : in Scanner_Type) return Natural;
function Get_Directory_Count (Scanner : in Scanner_Type) return Natural;
private
type Scanner_Access is access all Scanner_Type'Class;
type Work_Kind is (SCAN_DIRECTORY, SCAN_MAIL);
type Work_Type is record
Kind : Work_Kind;
Scanner : Scanner_Access;
Path : Ada.Strings.Unbounded.Unbounded_String;
end record;
procedure Execute (Work : in out Work_Type);
procedure Error (Work : in out Work_Type;
Ex : in Ada.Exceptions.Exception_Occurrence);
QUEUE_SIZE : constant := 100000;
package Executors is
new Util.Executors (Work_Type => Work_Type,
Execute => Execute,
Error => Error,
Default_Queue_Size => QUEUE_SIZE);
type Task_Manager (Count : Positive) is limited
new Executors.Executor_Manager (Count) with null record;
type Scanner_Type (Count : Positive;
Rule : access Matcher.Mail_Rule) is
limited new Ada.Finalization.Limited_Controlled with record
Job_Count : Util.Concurrent.Counters.Counter;
Scan_Dir_Count : Util.Concurrent.Counters.Counter;
Scan_File_Count : Util.Concurrent.Counters.Counter;
Dir_Count : Util.Concurrent.Counters.Counter;
File_Count : Util.Concurrent.Counters.Counter;
Self : Scanner_Access;
Directories : Util.Strings.Vectors.Vector;
Manager : Task_Manager (Count);
end record;
overriding
procedure Initialize (Scanner : in out Scanner_Type);
end Mgrep.Scanner;
| true |
-----------------------------------------------------------------------
-- mgrep-scanner -- Scan a directory and parse mail
-- Copyright (C) 2020 PI:NAME:<NAME>END_PI
-- Written by PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Strings.Unbounded;
with Mgrep.Matcher;
private with Util.Strings.Vectors;
private with Ada.Finalization;
private with Ada.Exceptions;
private with Util.Executors;
private with Util.Concurrent.Counters;
package Mgrep.Scanner is
type Scanner_Type (Count : Positive;
Rule : access Matcher.Mail_Rule) is tagged limited private;
procedure Add_Directory (Scanner : in out Scanner_Type;
Path : in String);
procedure Add_File (Scanner : in out Scanner_Type;
Path : in String);
procedure Scan_File (Scanner : in out Scanner_Type;
Path : in String);
procedure Scan_Directory (Scanner : in out Scanner_Type;
Path : in String);
procedure Start (Scanner : in out Scanner_Type);
procedure Stop (Scanner : in out Scanner_Type);
procedure Process (Scanner : in out Scanner_Type;
Done : out Boolean);
function Get_File_Count (Scanner : in Scanner_Type) return Natural;
function Get_Directory_Count (Scanner : in Scanner_Type) return Natural;
private
type Scanner_Access is access all Scanner_Type'Class;
type Work_Kind is (SCAN_DIRECTORY, SCAN_MAIL);
type Work_Type is record
Kind : Work_Kind;
Scanner : Scanner_Access;
Path : Ada.Strings.Unbounded.Unbounded_String;
end record;
procedure Execute (Work : in out Work_Type);
procedure Error (Work : in out Work_Type;
Ex : in Ada.Exceptions.Exception_Occurrence);
QUEUE_SIZE : constant := 100000;
package Executors is
new Util.Executors (Work_Type => Work_Type,
Execute => Execute,
Error => Error,
Default_Queue_Size => QUEUE_SIZE);
type Task_Manager (Count : Positive) is limited
new Executors.Executor_Manager (Count) with null record;
type Scanner_Type (Count : Positive;
Rule : access Matcher.Mail_Rule) is
limited new Ada.Finalization.Limited_Controlled with record
Job_Count : Util.Concurrent.Counters.Counter;
Scan_Dir_Count : Util.Concurrent.Counters.Counter;
Scan_File_Count : Util.Concurrent.Counters.Counter;
Dir_Count : Util.Concurrent.Counters.Counter;
File_Count : Util.Concurrent.Counters.Counter;
Self : Scanner_Access;
Directories : Util.Strings.Vectors.Vector;
Manager : Task_Manager (Count);
end record;
overriding
procedure Initialize (Scanner : in out Scanner_Type);
end Mgrep.Scanner;
|
[
{
"context": " library specification\n-- Copyright (c) 2003-2018 Maxim Reznik <[email protected]>\n-- Copyright (c) 2004-2016 ",
"end": 97,
"score": 0.999767005443573,
"start": 85,
"tag": "NAME",
"value": "Maxim Reznik"
},
{
"context": "ication\n-- Copyright (c) 2003-2018 Maxim Reznik <[email protected]>\n-- Copyright (c) 2004-2016 AXE Consultants\n-- ",
"end": 117,
"score": 0.9999303221702576,
"start": 99,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
ada-dispatching-edf.ads
|
mgrojo/adalib
| 15 |
-- Standard Ada library specification
-- Copyright (c) 2003-2018 Maxim Reznik <[email protected]>
-- Copyright (c) 2004-2016 AXE Consultants
-- Copyright (c) 2004, 2005, 2006 Ada-Europe
-- Copyright (c) 2000 The MITRE Corporation, Inc.
-- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc.
-- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual
---------------------------------------------------------------------------
with Ada.Real_Time;
with Ada.Task_Identification;
package Ada.Dispatching.EDF is
subtype Deadline is Ada.Real_Time.Time;
Default_Deadline : constant Deadline := Ada.Real_Time.Time_Last;
procedure Set_Deadline (D : in Deadline;
T : in Ada.Task_Identification.Task_Id
:= Ada.Task_Identification.Current_Task);
procedure Delay_Until_And_Set_Deadline
(Delay_Until_Time : in Ada.Real_Time.Time;
Deadline_Offset : in Ada.Real_Time.Time_Span);
function Get_Deadline (T : Ada.Task_Identification.Task_Id
:= Ada.Task_Identification.Current_Task)
return Deadline;
end Ada.Dispatching.EDF;
|
1918
|
-- Standard Ada library specification
-- Copyright (c) 2003-2018 <NAME> <<EMAIL>>
-- Copyright (c) 2004-2016 AXE Consultants
-- Copyright (c) 2004, 2005, 2006 Ada-Europe
-- Copyright (c) 2000 The MITRE Corporation, Inc.
-- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc.
-- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual
---------------------------------------------------------------------------
with Ada.Real_Time;
with Ada.Task_Identification;
package Ada.Dispatching.EDF is
subtype Deadline is Ada.Real_Time.Time;
Default_Deadline : constant Deadline := Ada.Real_Time.Time_Last;
procedure Set_Deadline (D : in Deadline;
T : in Ada.Task_Identification.Task_Id
:= Ada.Task_Identification.Current_Task);
procedure Delay_Until_And_Set_Deadline
(Delay_Until_Time : in Ada.Real_Time.Time;
Deadline_Offset : in Ada.Real_Time.Time_Span);
function Get_Deadline (T : Ada.Task_Identification.Task_Id
:= Ada.Task_Identification.Current_Task)
return Deadline;
end Ada.Dispatching.EDF;
| true |
-- Standard Ada library specification
-- Copyright (c) 2003-2018 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>
-- Copyright (c) 2004-2016 AXE Consultants
-- Copyright (c) 2004, 2005, 2006 Ada-Europe
-- Copyright (c) 2000 The MITRE Corporation, Inc.
-- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc.
-- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual
---------------------------------------------------------------------------
with Ada.Real_Time;
with Ada.Task_Identification;
package Ada.Dispatching.EDF is
subtype Deadline is Ada.Real_Time.Time;
Default_Deadline : constant Deadline := Ada.Real_Time.Time_Last;
procedure Set_Deadline (D : in Deadline;
T : in Ada.Task_Identification.Task_Id
:= Ada.Task_Identification.Current_Task);
procedure Delay_Until_And_Set_Deadline
(Delay_Until_Time : in Ada.Real_Time.Time;
Deadline_Offset : in Ada.Real_Time.Time_Span);
function Get_Deadline (T : Ada.Task_Identification.Task_Id
:= Ada.Task_Identification.Current_Task)
return Deadline;
end Ada.Dispatching.EDF;
|
[
{
"context": "e-Identifier: Apache-2.0\n--\n-- Copyright (c) 2021 onox <[email protected]>\n--\n-- Licensed under the A",
"end": 70,
"score": 0.999424934387207,
"start": 66,
"tag": "USERNAME",
"value": "onox"
},
{
"context": "ifier: Apache-2.0\n--\n-- Copyright (c) 2021 onox <[email protected]>\n--\n-- Licensed under the Apache License, Versio",
"end": 91,
"score": 0.9999221563339233,
"start": 72,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
orka_simd/src/x86/gnat/orka-simd-sse2-integers-shift.ads
|
onox/orka
| 52 |
-- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2021 onox <[email protected]>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
package Orka.SIMD.SSE2.Integers.Shift is
pragma Pure;
function Shift_Bits_Left_Zeros (Elements, Bits : m128i) return m128i
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_pslld128";
-- Shift each element to the left by the given amount of bits from the
-- first Double of the Count register
function Shift_Bits_Right_Zeros (Elements, Bits : m128i) return m128i
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_psrld128";
-- Shift each element to the right by the given amount of bits from the
-- first Double of the Count register, shifting in zeros
function Shift_Bits_Right_Signs (Elements, Bits : m128i) return m128i
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_psrad128";
-- Shift each element to the right by the given amount of bits from the
-- first Double of the Count register, shifting in sign bits
--
-- If the value of the Double is > 31, then the elements will be either 16#FFFF_FFFF# or 0.
----------------------------------------------------------------------------
type Bits_Count is new Integer range 1 .. 32;
function Shift_Bits_Left_Zeros (Elements : m128i; Bits : Bits_Count) return m128i
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_pslldi128";
-- Shift each element to the left by the given amount of bits from the
-- first Double of the Count register, shifting in zeros
function Shift_Bits_Right_Zeros (Elements : m128i; Bits : Bits_Count) return m128i
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_psrldi128";
-- Shift each element to the right by the given amount of bits from the
-- first Double of the Count register, shifting in zeros
function Shift_Bits_Right_Signs (Elements : m128i; Bits : Bits_Count) return m128i
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_psradi128";
-- Shift each element to the right by the given amount of bits, shifting in
-- sign bits
--
-- If Bits is > 31, then the elements will be either 16#FFFF_FFFF# or 0.
end Orka.SIMD.SSE2.Integers.Shift;
|
25516
|
-- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2021 onox <<EMAIL>>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
package Orka.SIMD.SSE2.Integers.Shift is
pragma Pure;
function Shift_Bits_Left_Zeros (Elements, Bits : m128i) return m128i
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_pslld128";
-- Shift each element to the left by the given amount of bits from the
-- first Double of the Count register
function Shift_Bits_Right_Zeros (Elements, Bits : m128i) return m128i
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_psrld128";
-- Shift each element to the right by the given amount of bits from the
-- first Double of the Count register, shifting in zeros
function Shift_Bits_Right_Signs (Elements, Bits : m128i) return m128i
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_psrad128";
-- Shift each element to the right by the given amount of bits from the
-- first Double of the Count register, shifting in sign bits
--
-- If the value of the Double is > 31, then the elements will be either 16#FFFF_FFFF# or 0.
----------------------------------------------------------------------------
type Bits_Count is new Integer range 1 .. 32;
function Shift_Bits_Left_Zeros (Elements : m128i; Bits : Bits_Count) return m128i
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_pslldi128";
-- Shift each element to the left by the given amount of bits from the
-- first Double of the Count register, shifting in zeros
function Shift_Bits_Right_Zeros (Elements : m128i; Bits : Bits_Count) return m128i
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_psrldi128";
-- Shift each element to the right by the given amount of bits from the
-- first Double of the Count register, shifting in zeros
function Shift_Bits_Right_Signs (Elements : m128i; Bits : Bits_Count) return m128i
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_psradi128";
-- Shift each element to the right by the given amount of bits, shifting in
-- sign bits
--
-- If Bits is > 31, then the elements will be either 16#FFFF_FFFF# or 0.
end Orka.SIMD.SSE2.Integers.Shift;
| true |
-- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2021 onox <PI:EMAIL:<EMAIL>END_PI>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
package Orka.SIMD.SSE2.Integers.Shift is
pragma Pure;
function Shift_Bits_Left_Zeros (Elements, Bits : m128i) return m128i
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_pslld128";
-- Shift each element to the left by the given amount of bits from the
-- first Double of the Count register
function Shift_Bits_Right_Zeros (Elements, Bits : m128i) return m128i
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_psrld128";
-- Shift each element to the right by the given amount of bits from the
-- first Double of the Count register, shifting in zeros
function Shift_Bits_Right_Signs (Elements, Bits : m128i) return m128i
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_psrad128";
-- Shift each element to the right by the given amount of bits from the
-- first Double of the Count register, shifting in sign bits
--
-- If the value of the Double is > 31, then the elements will be either 16#FFFF_FFFF# or 0.
----------------------------------------------------------------------------
type Bits_Count is new Integer range 1 .. 32;
function Shift_Bits_Left_Zeros (Elements : m128i; Bits : Bits_Count) return m128i
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_pslldi128";
-- Shift each element to the left by the given amount of bits from the
-- first Double of the Count register, shifting in zeros
function Shift_Bits_Right_Zeros (Elements : m128i; Bits : Bits_Count) return m128i
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_psrldi128";
-- Shift each element to the right by the given amount of bits from the
-- first Double of the Count register, shifting in zeros
function Shift_Bits_Right_Signs (Elements : m128i; Bits : Bits_Count) return m128i
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_psradi128";
-- Shift each element to the right by the given amount of bits, shifting in
-- sign bits
--
-- If Bits is > 31, then the elements will be either 16#FFFF_FFFF# or 0.
end Orka.SIMD.SSE2.Integers.Shift;
|
[
{
"context": "---------------------------\n-- Copyright (c) 2015, Natacha Porté --\n-- ",
"end": 115,
"score": 0.9998617172241211,
"start": 102,
"tag": "NAME",
"value": "Natacha Porté"
}
] |
src/natools-s_expressions-conditionals-strings.ads
|
faelys/natools
| 0 |
------------------------------------------------------------------------------
-- Copyright (c) 2015, Natacha Porté --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Natools.S_Expressions.Conditionals.Strings provides primitives to --
-- evaluate S-expression conditions about strings. --
------------------------------------------------------------------------------
with Natools.S_Expressions.Conditionals.Generic_Evaluate;
with Natools.S_Expressions.Lockable;
package Natools.S_Expressions.Conditionals.Strings is
pragma Preelaborate;
type Settings (Data : not null access constant String) is record
Case_Sensitive : Boolean := True;
end record;
type Context
(Data : not null access constant String;
Parametric_Fallback : access function
(Settings : in Strings.Settings;
Name : in Atom;
Arguments : in out Lockable.Descriptor'Class)
return Boolean;
Simple_Fallback : access function
(Settings : in Strings.Settings;
Name : in Atom)
return Boolean)
is record
Settings : Strings.Settings (Data);
end record;
function Parametric_Evaluate
(Context : in Strings.Context;
Name : in Atom;
Arguments : in out Lockable.Descriptor'Class)
return Boolean;
function Simple_Evaluate
(Context : in Strings.Context;
Name : in Atom)
return Boolean;
function Evaluate is new Generic_Evaluate
(Context, Parametric_Evaluate, Simple_Evaluate);
function Evaluate
(Text : in String;
Expression : in out Lockable.Descriptor'Class)
return Boolean;
end Natools.S_Expressions.Conditionals.Strings;
|
17984
|
------------------------------------------------------------------------------
-- Copyright (c) 2015, <NAME> --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Natools.S_Expressions.Conditionals.Strings provides primitives to --
-- evaluate S-expression conditions about strings. --
------------------------------------------------------------------------------
with Natools.S_Expressions.Conditionals.Generic_Evaluate;
with Natools.S_Expressions.Lockable;
package Natools.S_Expressions.Conditionals.Strings is
pragma Preelaborate;
type Settings (Data : not null access constant String) is record
Case_Sensitive : Boolean := True;
end record;
type Context
(Data : not null access constant String;
Parametric_Fallback : access function
(Settings : in Strings.Settings;
Name : in Atom;
Arguments : in out Lockable.Descriptor'Class)
return Boolean;
Simple_Fallback : access function
(Settings : in Strings.Settings;
Name : in Atom)
return Boolean)
is record
Settings : Strings.Settings (Data);
end record;
function Parametric_Evaluate
(Context : in Strings.Context;
Name : in Atom;
Arguments : in out Lockable.Descriptor'Class)
return Boolean;
function Simple_Evaluate
(Context : in Strings.Context;
Name : in Atom)
return Boolean;
function Evaluate is new Generic_Evaluate
(Context, Parametric_Evaluate, Simple_Evaluate);
function Evaluate
(Text : in String;
Expression : in out Lockable.Descriptor'Class)
return Boolean;
end Natools.S_Expressions.Conditionals.Strings;
| true |
------------------------------------------------------------------------------
-- Copyright (c) 2015, PI:NAME:<NAME>END_PI --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Natools.S_Expressions.Conditionals.Strings provides primitives to --
-- evaluate S-expression conditions about strings. --
------------------------------------------------------------------------------
with Natools.S_Expressions.Conditionals.Generic_Evaluate;
with Natools.S_Expressions.Lockable;
package Natools.S_Expressions.Conditionals.Strings is
pragma Preelaborate;
type Settings (Data : not null access constant String) is record
Case_Sensitive : Boolean := True;
end record;
type Context
(Data : not null access constant String;
Parametric_Fallback : access function
(Settings : in Strings.Settings;
Name : in Atom;
Arguments : in out Lockable.Descriptor'Class)
return Boolean;
Simple_Fallback : access function
(Settings : in Strings.Settings;
Name : in Atom)
return Boolean)
is record
Settings : Strings.Settings (Data);
end record;
function Parametric_Evaluate
(Context : in Strings.Context;
Name : in Atom;
Arguments : in out Lockable.Descriptor'Class)
return Boolean;
function Simple_Evaluate
(Context : in Strings.Context;
Name : in Atom)
return Boolean;
function Evaluate is new Generic_Evaluate
(Context, Parametric_Evaluate, Simple_Evaluate);
function Evaluate
(Text : in String;
Expression : in out Lockable.Descriptor'Class)
return Boolean;
end Natools.S_Expressions.Conditionals.Strings;
|
[
{
"context": "-- SPDX-FileCopyrightText: 2020 Max Reznik <[email protected]>\n--\n-- SPDX-License-Identifi",
"end": 43,
"score": 0.9998583793640137,
"start": 33,
"tag": "NAME",
"value": "Max Reznik"
},
{
"context": "-- SPDX-FileCopyrightText: 2020 Max Reznik <[email protected]>\n--\n-- SPDX-License-Identifier: MIT\n------------",
"end": 63,
"score": 0.9999314546585083,
"start": 45,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
source/library/program-unit_naming.ads
|
reznikmm/gela
| 0 |
-- SPDX-FileCopyrightText: 2020 Max Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
--
-- This package provides Unit_Naming_Schema interface and its methods.
package Program.Unit_Naming is
pragma Preelaborate;
type Unit_Naming_Schema is limited interface;
-- Interface to get compilation Text_Name for given compilation unit.
type Unit_Naming_Schema_Access is access all Unit_Naming_Schema'Class;
for Unit_Naming_Schema_Access'Storage_Size use 0;
not overriding function Standard_Text_Name (Self : Unit_Naming_Schema)
return Text is abstract;
-- Get compilation Text_Name for Standard library package.
not overriding function Declaration_Text_Name
(Self : Unit_Naming_Schema;
Name : Program.Text)
return Text is abstract;
-- Get compilation Text_Name for given library declaration unit.
not overriding function Body_Text_Name
(Self : Unit_Naming_Schema;
Name : Program.Text)
return Text is abstract;
-- Get compilation Text_Name for given body.
not overriding function Subunit_Text_Name
(Self : Unit_Naming_Schema;
Name : Program.Text)
return Text is abstract;
-- Get compilation Text_Name for given subunit.
end Program.Unit_Naming;
|
30669
|
-- SPDX-FileCopyrightText: 2020 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
--
-- This package provides Unit_Naming_Schema interface and its methods.
package Program.Unit_Naming is
pragma Preelaborate;
type Unit_Naming_Schema is limited interface;
-- Interface to get compilation Text_Name for given compilation unit.
type Unit_Naming_Schema_Access is access all Unit_Naming_Schema'Class;
for Unit_Naming_Schema_Access'Storage_Size use 0;
not overriding function Standard_Text_Name (Self : Unit_Naming_Schema)
return Text is abstract;
-- Get compilation Text_Name for Standard library package.
not overriding function Declaration_Text_Name
(Self : Unit_Naming_Schema;
Name : Program.Text)
return Text is abstract;
-- Get compilation Text_Name for given library declaration unit.
not overriding function Body_Text_Name
(Self : Unit_Naming_Schema;
Name : Program.Text)
return Text is abstract;
-- Get compilation Text_Name for given body.
not overriding function Subunit_Text_Name
(Self : Unit_Naming_Schema;
Name : Program.Text)
return Text is abstract;
-- Get compilation Text_Name for given subunit.
end Program.Unit_Naming;
| true |
-- SPDX-FileCopyrightText: 2020 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
--
-- This package provides Unit_Naming_Schema interface and its methods.
package Program.Unit_Naming is
pragma Preelaborate;
type Unit_Naming_Schema is limited interface;
-- Interface to get compilation Text_Name for given compilation unit.
type Unit_Naming_Schema_Access is access all Unit_Naming_Schema'Class;
for Unit_Naming_Schema_Access'Storage_Size use 0;
not overriding function Standard_Text_Name (Self : Unit_Naming_Schema)
return Text is abstract;
-- Get compilation Text_Name for Standard library package.
not overriding function Declaration_Text_Name
(Self : Unit_Naming_Schema;
Name : Program.Text)
return Text is abstract;
-- Get compilation Text_Name for given library declaration unit.
not overriding function Body_Text_Name
(Self : Unit_Naming_Schema;
Name : Program.Text)
return Text is abstract;
-- Get compilation Text_Name for given body.
not overriding function Subunit_Text_Name
(Self : Unit_Naming_Schema;
Name : Program.Text)
return Text is abstract;
-- Get compilation Text_Name for given subunit.
end Program.Unit_Naming;
|
[
{
"context": "-- Copyright (c) 2015-2017 Maxim Reznik <[email protected]>\n--\n-- SPDX-License-Identifi",
"end": 40,
"score": 0.9998487234115601,
"start": 28,
"tag": "NAME",
"value": "Maxim Reznik"
},
{
"context": "-- Copyright (c) 2015-2017 Maxim Reznik <[email protected]>\n--\n-- SPDX-License-Identifier: MIT\n-- License-",
"end": 60,
"score": 0.9999306797981262,
"start": 42,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
source/base/incr-lexers-batch_lexers-generic_lexers.adb
|
reznikmm/increment
| 5 |
-- Copyright (c) 2015-2017 Maxim Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
package body Incr.Lexers.Batch_Lexers.Generic_Lexers is
---------------
-- Get_Token --
---------------
overriding procedure Get_Token
(Self : access Batch_Lexer;
Result : out Rule_Index)
is
Input : Wide_Wide_Character;
Code_Unit : Matreshka.Internals.Unicode.Code_Unit_32;
Pos : Buffer_Index := 1;
Current_State : State := Self.Start;
Char : Character_Class;
begin
if Self.To = 1 and then Self.Buffer (1) = End_Of_Input then
Result := 0;
return;
end if;
Self.Classes (1 .. Self.Next - Self.To - 1) :=
Self.Classes (Self.To + 1 .. Self.Next - 1);
Self.Buffer (1 .. Self.Next - Self.To - 1) :=
Self.Buffer (Self.To + 1 .. Self.Next - 1);
Self.Next := Self.Next - Self.To;
Self.To := 0;
Self.Rule := 0;
loop
if Pos = Self.Next then
Input := Self.Source.Get_Next;
Self.Buffer (Pos) := Input;
Code_Unit := Wide_Wide_Character'Pos (Input);
if Input in End_Of_Input then
Self.Classes (Pos) := Error_Character;
else
Self.Classes (Pos) := To_Class (Code_Unit);
end if;
Self.Next := Self.Next + 1;
end if;
Char := Self.Classes (Pos);
exit when Char = Error_Character;
Current_State := Switch (Current_State, Char);
if Current_State in First_Final .. Error_State - 1 then
Self.Rule := Rule (Current_State);
Self.To := Pos;
end if;
exit when Current_State > Last_Looping;
Pos := Pos + 1;
end loop;
Result := Self.Rule;
end Get_Token;
end Incr.Lexers.Batch_Lexers.Generic_Lexers;
|
7473
|
-- Copyright (c) 2015-2017 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
package body Incr.Lexers.Batch_Lexers.Generic_Lexers is
---------------
-- Get_Token --
---------------
overriding procedure Get_Token
(Self : access Batch_Lexer;
Result : out Rule_Index)
is
Input : Wide_Wide_Character;
Code_Unit : Matreshka.Internals.Unicode.Code_Unit_32;
Pos : Buffer_Index := 1;
Current_State : State := Self.Start;
Char : Character_Class;
begin
if Self.To = 1 and then Self.Buffer (1) = End_Of_Input then
Result := 0;
return;
end if;
Self.Classes (1 .. Self.Next - Self.To - 1) :=
Self.Classes (Self.To + 1 .. Self.Next - 1);
Self.Buffer (1 .. Self.Next - Self.To - 1) :=
Self.Buffer (Self.To + 1 .. Self.Next - 1);
Self.Next := Self.Next - Self.To;
Self.To := 0;
Self.Rule := 0;
loop
if Pos = Self.Next then
Input := Self.Source.Get_Next;
Self.Buffer (Pos) := Input;
Code_Unit := Wide_Wide_Character'Pos (Input);
if Input in End_Of_Input then
Self.Classes (Pos) := Error_Character;
else
Self.Classes (Pos) := To_Class (Code_Unit);
end if;
Self.Next := Self.Next + 1;
end if;
Char := Self.Classes (Pos);
exit when Char = Error_Character;
Current_State := Switch (Current_State, Char);
if Current_State in First_Final .. Error_State - 1 then
Self.Rule := Rule (Current_State);
Self.To := Pos;
end if;
exit when Current_State > Last_Looping;
Pos := Pos + 1;
end loop;
Result := Self.Rule;
end Get_Token;
end Incr.Lexers.Batch_Lexers.Generic_Lexers;
| true |
-- Copyright (c) 2015-2017 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
package body Incr.Lexers.Batch_Lexers.Generic_Lexers is
---------------
-- Get_Token --
---------------
overriding procedure Get_Token
(Self : access Batch_Lexer;
Result : out Rule_Index)
is
Input : Wide_Wide_Character;
Code_Unit : Matreshka.Internals.Unicode.Code_Unit_32;
Pos : Buffer_Index := 1;
Current_State : State := Self.Start;
Char : Character_Class;
begin
if Self.To = 1 and then Self.Buffer (1) = End_Of_Input then
Result := 0;
return;
end if;
Self.Classes (1 .. Self.Next - Self.To - 1) :=
Self.Classes (Self.To + 1 .. Self.Next - 1);
Self.Buffer (1 .. Self.Next - Self.To - 1) :=
Self.Buffer (Self.To + 1 .. Self.Next - 1);
Self.Next := Self.Next - Self.To;
Self.To := 0;
Self.Rule := 0;
loop
if Pos = Self.Next then
Input := Self.Source.Get_Next;
Self.Buffer (Pos) := Input;
Code_Unit := Wide_Wide_Character'Pos (Input);
if Input in End_Of_Input then
Self.Classes (Pos) := Error_Character;
else
Self.Classes (Pos) := To_Class (Code_Unit);
end if;
Self.Next := Self.Next + 1;
end if;
Char := Self.Classes (Pos);
exit when Char = Error_Character;
Current_State := Switch (Current_State, Char);
if Current_State in First_Final .. Error_State - 1 then
Self.Rule := Rule (Current_State);
Self.To := Pos;
end if;
exit when Current_State > Last_Looping;
Pos := Pos + 1;
end loop;
Result := Self.Rule;
end Get_Token;
end Incr.Lexers.Batch_Lexers.Generic_Lexers;
|
[
{
"context": "s -- REST application\n-- Copyright (C) 2017, 2018 Stephane Carrez\n-- Written by Stephane Carrez (Stephane.Carrez@g",
"end": 168,
"score": 0.999874472618103,
"start": 153,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "ight (C) 2017, 2018 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under",
"end": 199,
"score": 0.9998775720596313,
"start": 184,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "8 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under the Apache License, Versio",
"end": 226,
"score": 0.9999228715896606,
"start": 201,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
src/server/swagger-servers-applications.ads
|
jquorning/swagger-ada
| 17 |
-----------------------------------------------------------------------
-- swagger-server-applications -- REST application
-- Copyright (C) 2017, 2018 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Properties;
private with Security.OAuth.Servers;
private with Servlet.Core.Rest;
private with Servlet.Core.Files;
private with Servlet.Security.OAuth;
private with Servlet.Security.Filters.OAuth;
private with Security.OAuth.File_Registry;
package Swagger.Servers.Applications is
type Application_Type is limited new Swagger.Servers.Application_Type with private;
-- Configures the REST application so that it is ready to handler REST
-- operations as well as give access to the Swagger UI that describes them.
not overriding
procedure Configure (App : in out Application_Type;
Config : in Util.Properties.Manager'Class);
private
type Application_Type is limited new Swagger.Servers.Application_Type with record
Api : aliased Servlet.Core.Rest.Rest_Servlet;
OAuth : aliased Servlet.Security.OAuth.Token_Servlet;
Filter : aliased Servlet.Security.Filters.OAuth.Auth_Filter;
Files : aliased Servlet.Core.Files.File_Servlet;
Ui_Files : aliased Servlet.Core.Files.File_Servlet;
Auth : aliased Security.OAuth.Servers.Auth_Manager;
Apps : aliased Security.OAuth.File_Registry.File_Application_Manager;
Realm : aliased Security.OAuth.File_Registry.File_Realm_Manager;
end record;
end Swagger.Servers.Applications;
|
5157
|
-----------------------------------------------------------------------
-- swagger-server-applications -- REST application
-- Copyright (C) 2017, 2018 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Properties;
private with Security.OAuth.Servers;
private with Servlet.Core.Rest;
private with Servlet.Core.Files;
private with Servlet.Security.OAuth;
private with Servlet.Security.Filters.OAuth;
private with Security.OAuth.File_Registry;
package Swagger.Servers.Applications is
type Application_Type is limited new Swagger.Servers.Application_Type with private;
-- Configures the REST application so that it is ready to handler REST
-- operations as well as give access to the Swagger UI that describes them.
not overriding
procedure Configure (App : in out Application_Type;
Config : in Util.Properties.Manager'Class);
private
type Application_Type is limited new Swagger.Servers.Application_Type with record
Api : aliased Servlet.Core.Rest.Rest_Servlet;
OAuth : aliased Servlet.Security.OAuth.Token_Servlet;
Filter : aliased Servlet.Security.Filters.OAuth.Auth_Filter;
Files : aliased Servlet.Core.Files.File_Servlet;
Ui_Files : aliased Servlet.Core.Files.File_Servlet;
Auth : aliased Security.OAuth.Servers.Auth_Manager;
Apps : aliased Security.OAuth.File_Registry.File_Application_Manager;
Realm : aliased Security.OAuth.File_Registry.File_Realm_Manager;
end record;
end Swagger.Servers.Applications;
| true |
-----------------------------------------------------------------------
-- swagger-server-applications -- REST application
-- Copyright (C) 2017, 2018 PI:NAME:<NAME>END_PI
-- Written by PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Properties;
private with Security.OAuth.Servers;
private with Servlet.Core.Rest;
private with Servlet.Core.Files;
private with Servlet.Security.OAuth;
private with Servlet.Security.Filters.OAuth;
private with Security.OAuth.File_Registry;
package Swagger.Servers.Applications is
type Application_Type is limited new Swagger.Servers.Application_Type with private;
-- Configures the REST application so that it is ready to handler REST
-- operations as well as give access to the Swagger UI that describes them.
not overriding
procedure Configure (App : in out Application_Type;
Config : in Util.Properties.Manager'Class);
private
type Application_Type is limited new Swagger.Servers.Application_Type with record
Api : aliased Servlet.Core.Rest.Rest_Servlet;
OAuth : aliased Servlet.Security.OAuth.Token_Servlet;
Filter : aliased Servlet.Security.Filters.OAuth.Auth_Filter;
Files : aliased Servlet.Core.Files.File_Servlet;
Ui_Files : aliased Servlet.Core.Files.File_Servlet;
Auth : aliased Security.OAuth.Servers.Auth_Manager;
Apps : aliased Security.OAuth.File_Registry.File_Application_Manager;
Realm : aliased Security.OAuth.File_Registry.File_Realm_Manager;
end record;
end Swagger.Servers.Applications;
|
[
{
"context": "ule\n-- Copyright (C) 2011, 2012, 2015, 2017, 2018 Stephane Carrez\n-- Written by Stephane Carrez (Stephane.Carrez@g",
"end": 162,
"score": 0.9998735189437866,
"start": 147,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "2, 2015, 2017, 2018 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under",
"end": 193,
"score": 0.9998823404312134,
"start": 178,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "8 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under the Apache License, Versio",
"end": 220,
"score": 0.9999306797981262,
"start": 195,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
awa/plugins/awa-mail/src/awa-mail-modules.adb
|
twdroeger/ada-awa
| 0 |
-----------------------------------------------------------------------
-- awa-mail -- Mail module
-- Copyright (C) 2011, 2012, 2015, 2017, 2018 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with AWA.Modules.Beans;
with AWA.Modules.Get;
with AWA.Mail.Beans;
with AWA.Mail.Components.Factory;
with AWA.Applications;
with Servlet.Core;
with ASF.Requests.Mockup;
with ASF.Responses.Mockup;
with Util.Beans.Basic;
with Util.Beans.Objects;
with Util.Log.Loggers;
package body AWA.Mail.Modules is
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("AWA.Mail.Module");
package Register is new AWA.Modules.Beans (Module => Mail_Module,
Module_Access => Mail_Module_Access);
-- ------------------------------
-- Initialize the mail module.
-- ------------------------------
overriding
procedure Initialize (Plugin : in out Mail_Module;
App : in AWA.Modules.Application_Access;
Props : in ASF.Applications.Config) is
begin
Log.Info ("Initializing the mail module");
-- Add the Mail UI components.
App.Add_Components (AWA.Mail.Components.Factory.Definition);
-- Register here any bean class, servlet, filter.
Register.Register (Plugin => Plugin,
Name => "AWA.Mail.Beans.Mail_Bean",
Handler => AWA.Mail.Beans.Create_Mail_Bean'Access);
AWA.Modules.Module (Plugin).Initialize (App, Props);
end Initialize;
-- ------------------------------
-- Configures the module after its initialization and after having read its XML configuration.
-- ------------------------------
overriding
procedure Configure (Plugin : in out Mail_Module;
Props : in ASF.Applications.Config) is
Mailer : constant String := Props.Get ("mailer", "smtp");
begin
Log.Info ("Mail plugin is using {0} mailer", Mailer);
Plugin.Mailer := AWA.Mail.Clients.Factory (Mailer, Props);
end Configure;
-- ------------------------------
-- Create a new mail message.
-- ------------------------------
function Create_Message (Plugin : in Mail_Module)
return AWA.Mail.Clients.Mail_Message_Access is
begin
return Plugin.Mailer.Create_Message;
end Create_Message;
-- ------------------------------
-- Receive an event sent by another module with <b>Send_Event</b> method.
-- Format and send an email.
-- ------------------------------
procedure Send_Mail (Plugin : in Mail_Module;
Template : in String;
Props : in Util.Beans.Objects.Maps.Map;
Content : in AWA.Events.Module_Event'Class) is
Name : constant String := Content.Get_Parameter ("name");
begin
Log.Info ("Receive event {0} with template {1}", Name, Template);
if Template = "" then
Log.Debug ("No email template associated with event {0}", Name);
return;
end if;
declare
Req : ASF.Requests.Mockup.Request;
Reply : ASF.Responses.Mockup.Response;
Ptr : constant Util.Beans.Basic.Readonly_Bean_Access := Content'Unrestricted_Access;
Bean : constant Util.Beans.Objects.Object
:= Util.Beans.Objects.To_Object (Ptr, Util.Beans.Objects.STATIC);
Dispatcher : constant Servlet.Core.Request_Dispatcher
:= Plugin.Get_Application.Get_Request_Dispatcher (Template);
begin
Req.Set_Request_URI (Template);
Req.Set_Method ("GET");
Req.Set_Attribute (Name => "event", Value => Bean);
Req.Set_Attributes (Props);
Servlet.Core.Forward (Dispatcher, Req, Reply);
end;
end Send_Mail;
-- ------------------------------
-- Get the mail module instance associated with the current application.
-- ------------------------------
function Get_Mail_Module return Mail_Module_Access is
function Get is new AWA.Modules.Get (Mail_Module, Mail_Module_Access, NAME);
begin
return Get;
end Get_Mail_Module;
end AWA.Mail.Modules;
|
10358
|
-----------------------------------------------------------------------
-- awa-mail -- Mail module
-- Copyright (C) 2011, 2012, 2015, 2017, 2018 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with AWA.Modules.Beans;
with AWA.Modules.Get;
with AWA.Mail.Beans;
with AWA.Mail.Components.Factory;
with AWA.Applications;
with Servlet.Core;
with ASF.Requests.Mockup;
with ASF.Responses.Mockup;
with Util.Beans.Basic;
with Util.Beans.Objects;
with Util.Log.Loggers;
package body AWA.Mail.Modules is
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("AWA.Mail.Module");
package Register is new AWA.Modules.Beans (Module => Mail_Module,
Module_Access => Mail_Module_Access);
-- ------------------------------
-- Initialize the mail module.
-- ------------------------------
overriding
procedure Initialize (Plugin : in out Mail_Module;
App : in AWA.Modules.Application_Access;
Props : in ASF.Applications.Config) is
begin
Log.Info ("Initializing the mail module");
-- Add the Mail UI components.
App.Add_Components (AWA.Mail.Components.Factory.Definition);
-- Register here any bean class, servlet, filter.
Register.Register (Plugin => Plugin,
Name => "AWA.Mail.Beans.Mail_Bean",
Handler => AWA.Mail.Beans.Create_Mail_Bean'Access);
AWA.Modules.Module (Plugin).Initialize (App, Props);
end Initialize;
-- ------------------------------
-- Configures the module after its initialization and after having read its XML configuration.
-- ------------------------------
overriding
procedure Configure (Plugin : in out Mail_Module;
Props : in ASF.Applications.Config) is
Mailer : constant String := Props.Get ("mailer", "smtp");
begin
Log.Info ("Mail plugin is using {0} mailer", Mailer);
Plugin.Mailer := AWA.Mail.Clients.Factory (Mailer, Props);
end Configure;
-- ------------------------------
-- Create a new mail message.
-- ------------------------------
function Create_Message (Plugin : in Mail_Module)
return AWA.Mail.Clients.Mail_Message_Access is
begin
return Plugin.Mailer.Create_Message;
end Create_Message;
-- ------------------------------
-- Receive an event sent by another module with <b>Send_Event</b> method.
-- Format and send an email.
-- ------------------------------
procedure Send_Mail (Plugin : in Mail_Module;
Template : in String;
Props : in Util.Beans.Objects.Maps.Map;
Content : in AWA.Events.Module_Event'Class) is
Name : constant String := Content.Get_Parameter ("name");
begin
Log.Info ("Receive event {0} with template {1}", Name, Template);
if Template = "" then
Log.Debug ("No email template associated with event {0}", Name);
return;
end if;
declare
Req : ASF.Requests.Mockup.Request;
Reply : ASF.Responses.Mockup.Response;
Ptr : constant Util.Beans.Basic.Readonly_Bean_Access := Content'Unrestricted_Access;
Bean : constant Util.Beans.Objects.Object
:= Util.Beans.Objects.To_Object (Ptr, Util.Beans.Objects.STATIC);
Dispatcher : constant Servlet.Core.Request_Dispatcher
:= Plugin.Get_Application.Get_Request_Dispatcher (Template);
begin
Req.Set_Request_URI (Template);
Req.Set_Method ("GET");
Req.Set_Attribute (Name => "event", Value => Bean);
Req.Set_Attributes (Props);
Servlet.Core.Forward (Dispatcher, Req, Reply);
end;
end Send_Mail;
-- ------------------------------
-- Get the mail module instance associated with the current application.
-- ------------------------------
function Get_Mail_Module return Mail_Module_Access is
function Get is new AWA.Modules.Get (Mail_Module, Mail_Module_Access, NAME);
begin
return Get;
end Get_Mail_Module;
end AWA.Mail.Modules;
| true |
-----------------------------------------------------------------------
-- awa-mail -- Mail module
-- Copyright (C) 2011, 2012, 2015, 2017, 2018 PI:NAME:<NAME>END_PI
-- Written by PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with AWA.Modules.Beans;
with AWA.Modules.Get;
with AWA.Mail.Beans;
with AWA.Mail.Components.Factory;
with AWA.Applications;
with Servlet.Core;
with ASF.Requests.Mockup;
with ASF.Responses.Mockup;
with Util.Beans.Basic;
with Util.Beans.Objects;
with Util.Log.Loggers;
package body AWA.Mail.Modules is
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("AWA.Mail.Module");
package Register is new AWA.Modules.Beans (Module => Mail_Module,
Module_Access => Mail_Module_Access);
-- ------------------------------
-- Initialize the mail module.
-- ------------------------------
overriding
procedure Initialize (Plugin : in out Mail_Module;
App : in AWA.Modules.Application_Access;
Props : in ASF.Applications.Config) is
begin
Log.Info ("Initializing the mail module");
-- Add the Mail UI components.
App.Add_Components (AWA.Mail.Components.Factory.Definition);
-- Register here any bean class, servlet, filter.
Register.Register (Plugin => Plugin,
Name => "AWA.Mail.Beans.Mail_Bean",
Handler => AWA.Mail.Beans.Create_Mail_Bean'Access);
AWA.Modules.Module (Plugin).Initialize (App, Props);
end Initialize;
-- ------------------------------
-- Configures the module after its initialization and after having read its XML configuration.
-- ------------------------------
overriding
procedure Configure (Plugin : in out Mail_Module;
Props : in ASF.Applications.Config) is
Mailer : constant String := Props.Get ("mailer", "smtp");
begin
Log.Info ("Mail plugin is using {0} mailer", Mailer);
Plugin.Mailer := AWA.Mail.Clients.Factory (Mailer, Props);
end Configure;
-- ------------------------------
-- Create a new mail message.
-- ------------------------------
function Create_Message (Plugin : in Mail_Module)
return AWA.Mail.Clients.Mail_Message_Access is
begin
return Plugin.Mailer.Create_Message;
end Create_Message;
-- ------------------------------
-- Receive an event sent by another module with <b>Send_Event</b> method.
-- Format and send an email.
-- ------------------------------
procedure Send_Mail (Plugin : in Mail_Module;
Template : in String;
Props : in Util.Beans.Objects.Maps.Map;
Content : in AWA.Events.Module_Event'Class) is
Name : constant String := Content.Get_Parameter ("name");
begin
Log.Info ("Receive event {0} with template {1}", Name, Template);
if Template = "" then
Log.Debug ("No email template associated with event {0}", Name);
return;
end if;
declare
Req : ASF.Requests.Mockup.Request;
Reply : ASF.Responses.Mockup.Response;
Ptr : constant Util.Beans.Basic.Readonly_Bean_Access := Content'Unrestricted_Access;
Bean : constant Util.Beans.Objects.Object
:= Util.Beans.Objects.To_Object (Ptr, Util.Beans.Objects.STATIC);
Dispatcher : constant Servlet.Core.Request_Dispatcher
:= Plugin.Get_Application.Get_Request_Dispatcher (Template);
begin
Req.Set_Request_URI (Template);
Req.Set_Method ("GET");
Req.Set_Attribute (Name => "event", Value => Bean);
Req.Set_Attributes (Props);
Servlet.Core.Forward (Dispatcher, Req, Reply);
end;
end Send_Mail;
-- ------------------------------
-- Get the mail module instance associated with the current application.
-- ------------------------------
function Get_Mail_Module return Mail_Module_Access is
function Get is new AWA.Modules.Get (Mail_Module, Mail_Module_Access, NAME);
begin
return Get;
end Get_Mail_Module;
end AWA.Mail.Modules;
|
[
{
"context": " --\n-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --\n-- All rig",
"end": 829,
"score": 0.9998886585235596,
"start": 816,
"tag": "NAME",
"value": "Vadim Godunko"
},
{
"context": " --\n-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --\n-- All rights reserved. ",
"end": 849,
"score": 0.9999330043792725,
"start": 831,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
source/amf/uml/amf-standard_profile_l2-model_libraries.ads
|
svn2github/matreshka
| 24 |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
-- A package that contains model elements that are intended to be reused by
-- other packages. Model libraries are frequently used in conjunction with
-- applied profiles. This is expressed by defining a dependency between a
-- profile and a model library package, or by defining a model library as
-- contained in a profile package. The classes in a model library are not
-- stereotypes and tagged definitions extending the metamodel. A model
-- library is analogous to a class library in some programming languages.
-- When a model library is defined as a part of a profile, it is imported or
-- deleted with the application or removal of the profile. The profile is
-- implicitly applied to its model library. In the other case, when the model
-- library is defined as an external package imported by a profile, the
-- profile requires that the model library be there in the model at the stage
-- of the profile application. The application or the removal of the profile
-- does not affect the presence of the model library elements.
------------------------------------------------------------------------------
limited with AMF.UML.Packages;
package AMF.Standard_Profile_L2.Model_Libraries is
pragma Preelaborate;
type Standard_Profile_L2_Model_Library is limited interface;
type Standard_Profile_L2_Model_Library_Access is
access all Standard_Profile_L2_Model_Library'Class;
for Standard_Profile_L2_Model_Library_Access'Storage_Size use 0;
not overriding function Get_Base_Package
(Self : not null access constant Standard_Profile_L2_Model_Library)
return AMF.UML.Packages.UML_Package_Access is abstract;
-- Getter of ModelLibrary::base_Package.
--
not overriding procedure Set_Base_Package
(Self : not null access Standard_Profile_L2_Model_Library;
To : AMF.UML.Packages.UML_Package_Access) is abstract;
-- Setter of ModelLibrary::base_Package.
--
end AMF.Standard_Profile_L2.Model_Libraries;
|
15935
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
-- A package that contains model elements that are intended to be reused by
-- other packages. Model libraries are frequently used in conjunction with
-- applied profiles. This is expressed by defining a dependency between a
-- profile and a model library package, or by defining a model library as
-- contained in a profile package. The classes in a model library are not
-- stereotypes and tagged definitions extending the metamodel. A model
-- library is analogous to a class library in some programming languages.
-- When a model library is defined as a part of a profile, it is imported or
-- deleted with the application or removal of the profile. The profile is
-- implicitly applied to its model library. In the other case, when the model
-- library is defined as an external package imported by a profile, the
-- profile requires that the model library be there in the model at the stage
-- of the profile application. The application or the removal of the profile
-- does not affect the presence of the model library elements.
------------------------------------------------------------------------------
limited with AMF.UML.Packages;
package AMF.Standard_Profile_L2.Model_Libraries is
pragma Preelaborate;
type Standard_Profile_L2_Model_Library is limited interface;
type Standard_Profile_L2_Model_Library_Access is
access all Standard_Profile_L2_Model_Library'Class;
for Standard_Profile_L2_Model_Library_Access'Storage_Size use 0;
not overriding function Get_Base_Package
(Self : not null access constant Standard_Profile_L2_Model_Library)
return AMF.UML.Packages.UML_Package_Access is abstract;
-- Getter of ModelLibrary::base_Package.
--
not overriding procedure Set_Base_Package
(Self : not null access Standard_Profile_L2_Model_Library;
To : AMF.UML.Packages.UML_Package_Access) is abstract;
-- Setter of ModelLibrary::base_Package.
--
end AMF.Standard_Profile_L2.Model_Libraries;
| true |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
-- A package that contains model elements that are intended to be reused by
-- other packages. Model libraries are frequently used in conjunction with
-- applied profiles. This is expressed by defining a dependency between a
-- profile and a model library package, or by defining a model library as
-- contained in a profile package. The classes in a model library are not
-- stereotypes and tagged definitions extending the metamodel. A model
-- library is analogous to a class library in some programming languages.
-- When a model library is defined as a part of a profile, it is imported or
-- deleted with the application or removal of the profile. The profile is
-- implicitly applied to its model library. In the other case, when the model
-- library is defined as an external package imported by a profile, the
-- profile requires that the model library be there in the model at the stage
-- of the profile application. The application or the removal of the profile
-- does not affect the presence of the model library elements.
------------------------------------------------------------------------------
limited with AMF.UML.Packages;
package AMF.Standard_Profile_L2.Model_Libraries is
pragma Preelaborate;
type Standard_Profile_L2_Model_Library is limited interface;
type Standard_Profile_L2_Model_Library_Access is
access all Standard_Profile_L2_Model_Library'Class;
for Standard_Profile_L2_Model_Library_Access'Storage_Size use 0;
not overriding function Get_Base_Package
(Self : not null access constant Standard_Profile_L2_Model_Library)
return AMF.UML.Packages.UML_Package_Access is abstract;
-- Getter of ModelLibrary::base_Package.
--
not overriding procedure Set_Base_Package
(Self : not null access Standard_Profile_L2_Model_Library;
To : AMF.UML.Packages.UML_Package_Access) is abstract;
-- Setter of ModelLibrary::base_Package.
--
end AMF.Standard_Profile_L2.Model_Libraries;
|
[
{
"context": "Fast Multimedia Library\n-- Copyright (C) 2007-2015 Laurent Gomila ([email protected])\n-- This software is provid",
"end": 148,
"score": 0.9998751878738403,
"start": 134,
"tag": "NAME",
"value": "Laurent Gomila"
},
{
"context": "ibrary\n-- Copyright (C) 2007-2015 Laurent Gomila ([email protected])\n-- This software is provided 'as-is', without an",
"end": 170,
"score": 0.9999327063560486,
"start": 150,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
include/sf-window-mouse.ads
|
Fabien-Chouteau/ASFML
| 0 |
--//////////////////////////////////////////////////////////
-- SFML - Simple and Fast Multimedia Library
-- Copyright (C) 2007-2015 Laurent Gomila ([email protected])
-- This software is provided 'as-is', without any express or implied warranty.
-- In no event will the authors be held liable for any damages arising from the use of this software.
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it freely,
-- subject to the following restrictions:
-- 1. The origin of this software must not be misrepresented;
-- you must not claim that you wrote the original software.
-- If you use this software in a product, an acknowledgment
-- in the product documentation would be appreciated but is not required.
-- 2. Altered source versions must be plainly marked as such,
-- and must not be misrepresented as being the original software.
-- 3. This notice may not be removed or altered from any source distribution.
--//////////////////////////////////////////////////////////
--//////////////////////////////////////////////////////////
with Sf.System.Vector2;
package Sf.Window.Mouse is
--//////////////////////////////////////////////////////////
--//////////////////////////////////////////////////////////
--//////////////////////////////////////////////////////////
--/ @brief Mouse buttons
--/
--//////////////////////////////////////////////////////////
--/< The left mouse button
--/< The right mouse button
--/< The middle (wheel) mouse button
--/< The first extra mouse button
--/< The second extra mouse button
--/< Keep last -- the total number of mouse buttons
type sfMouseButton is
(sfMouseLeft,
sfMouseRight,
sfMouseMiddle,
sfMouseXButton1,
sfMouseXButton2,
sfMouseButtonCount);
--//////////////////////////////////////////////////////////
--/ @brief Mouse wheels
--/
--//////////////////////////////////////////////////////////
--/< The vertical mouse wheel
--/< The horizontal mouse wheel
type sfMouseWheel is
(sfMouseVerticalWheel,
sfMouseHorizontalWheel);
--//////////////////////////////////////////////////////////
--/ @brief Check if a mouse button is pressed
--/
--/ @param button Button to check
--/
--/ @return sfTrue if the button is pressed, sfFalse otherwise
--/
--//////////////////////////////////////////////////////////
function isButtonPressed (button : sfMouseButton) return sfBool;
--//////////////////////////////////////////////////////////
--/ @brief Get the current position of the mouse
--/
--/ This function returns the current position of the mouse
--/ cursor relative to the given window, or desktop if NULL is passed.
--/
--/ @param relativeTo Reference window
--/
--/ @return Position of the mouse cursor, relative to the given window
--/
--//////////////////////////////////////////////////////////
function getPosition (relativeTo : sfWindow_Ptr) return Sf.System.Vector2.sfVector2i;
--//////////////////////////////////////////////////////////
--/ @brief Set the current position of the mouse
--/
--/ This function sets the current position of the mouse
--/ cursor relative to the given window, or desktop if NULL is passed.
--/
--/ @param position New position of the mouse
--/ @param relativeTo Reference window
--/
--//////////////////////////////////////////////////////////
procedure setPosition (position : Sf.System.Vector2.sfVector2i; relativeTo : sfWindow_Ptr);
private
pragma Convention (C, sfMouseButton);
pragma Convention (C, sfMouseWheel);
pragma Import (C, isButtonPressed, "sfMouse_isButtonPressed");
pragma Import (C, getPosition, "sfMouse_getPosition");
pragma Import (C, setPosition, "sfMouse_setPosition");
end Sf.Window.Mouse;
|
14577
|
--//////////////////////////////////////////////////////////
-- SFML - Simple and Fast Multimedia Library
-- Copyright (C) 2007-2015 <NAME> (<EMAIL>)
-- This software is provided 'as-is', without any express or implied warranty.
-- In no event will the authors be held liable for any damages arising from the use of this software.
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it freely,
-- subject to the following restrictions:
-- 1. The origin of this software must not be misrepresented;
-- you must not claim that you wrote the original software.
-- If you use this software in a product, an acknowledgment
-- in the product documentation would be appreciated but is not required.
-- 2. Altered source versions must be plainly marked as such,
-- and must not be misrepresented as being the original software.
-- 3. This notice may not be removed or altered from any source distribution.
--//////////////////////////////////////////////////////////
--//////////////////////////////////////////////////////////
with Sf.System.Vector2;
package Sf.Window.Mouse is
--//////////////////////////////////////////////////////////
--//////////////////////////////////////////////////////////
--//////////////////////////////////////////////////////////
--/ @brief Mouse buttons
--/
--//////////////////////////////////////////////////////////
--/< The left mouse button
--/< The right mouse button
--/< The middle (wheel) mouse button
--/< The first extra mouse button
--/< The second extra mouse button
--/< Keep last -- the total number of mouse buttons
type sfMouseButton is
(sfMouseLeft,
sfMouseRight,
sfMouseMiddle,
sfMouseXButton1,
sfMouseXButton2,
sfMouseButtonCount);
--//////////////////////////////////////////////////////////
--/ @brief Mouse wheels
--/
--//////////////////////////////////////////////////////////
--/< The vertical mouse wheel
--/< The horizontal mouse wheel
type sfMouseWheel is
(sfMouseVerticalWheel,
sfMouseHorizontalWheel);
--//////////////////////////////////////////////////////////
--/ @brief Check if a mouse button is pressed
--/
--/ @param button Button to check
--/
--/ @return sfTrue if the button is pressed, sfFalse otherwise
--/
--//////////////////////////////////////////////////////////
function isButtonPressed (button : sfMouseButton) return sfBool;
--//////////////////////////////////////////////////////////
--/ @brief Get the current position of the mouse
--/
--/ This function returns the current position of the mouse
--/ cursor relative to the given window, or desktop if NULL is passed.
--/
--/ @param relativeTo Reference window
--/
--/ @return Position of the mouse cursor, relative to the given window
--/
--//////////////////////////////////////////////////////////
function getPosition (relativeTo : sfWindow_Ptr) return Sf.System.Vector2.sfVector2i;
--//////////////////////////////////////////////////////////
--/ @brief Set the current position of the mouse
--/
--/ This function sets the current position of the mouse
--/ cursor relative to the given window, or desktop if NULL is passed.
--/
--/ @param position New position of the mouse
--/ @param relativeTo Reference window
--/
--//////////////////////////////////////////////////////////
procedure setPosition (position : Sf.System.Vector2.sfVector2i; relativeTo : sfWindow_Ptr);
private
pragma Convention (C, sfMouseButton);
pragma Convention (C, sfMouseWheel);
pragma Import (C, isButtonPressed, "sfMouse_isButtonPressed");
pragma Import (C, getPosition, "sfMouse_getPosition");
pragma Import (C, setPosition, "sfMouse_setPosition");
end Sf.Window.Mouse;
| true |
--//////////////////////////////////////////////////////////
-- SFML - Simple and Fast Multimedia Library
-- Copyright (C) 2007-2015 PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI)
-- This software is provided 'as-is', without any express or implied warranty.
-- In no event will the authors be held liable for any damages arising from the use of this software.
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it freely,
-- subject to the following restrictions:
-- 1. The origin of this software must not be misrepresented;
-- you must not claim that you wrote the original software.
-- If you use this software in a product, an acknowledgment
-- in the product documentation would be appreciated but is not required.
-- 2. Altered source versions must be plainly marked as such,
-- and must not be misrepresented as being the original software.
-- 3. This notice may not be removed or altered from any source distribution.
--//////////////////////////////////////////////////////////
--//////////////////////////////////////////////////////////
with Sf.System.Vector2;
package Sf.Window.Mouse is
--//////////////////////////////////////////////////////////
--//////////////////////////////////////////////////////////
--//////////////////////////////////////////////////////////
--/ @brief Mouse buttons
--/
--//////////////////////////////////////////////////////////
--/< The left mouse button
--/< The right mouse button
--/< The middle (wheel) mouse button
--/< The first extra mouse button
--/< The second extra mouse button
--/< Keep last -- the total number of mouse buttons
type sfMouseButton is
(sfMouseLeft,
sfMouseRight,
sfMouseMiddle,
sfMouseXButton1,
sfMouseXButton2,
sfMouseButtonCount);
--//////////////////////////////////////////////////////////
--/ @brief Mouse wheels
--/
--//////////////////////////////////////////////////////////
--/< The vertical mouse wheel
--/< The horizontal mouse wheel
type sfMouseWheel is
(sfMouseVerticalWheel,
sfMouseHorizontalWheel);
--//////////////////////////////////////////////////////////
--/ @brief Check if a mouse button is pressed
--/
--/ @param button Button to check
--/
--/ @return sfTrue if the button is pressed, sfFalse otherwise
--/
--//////////////////////////////////////////////////////////
function isButtonPressed (button : sfMouseButton) return sfBool;
--//////////////////////////////////////////////////////////
--/ @brief Get the current position of the mouse
--/
--/ This function returns the current position of the mouse
--/ cursor relative to the given window, or desktop if NULL is passed.
--/
--/ @param relativeTo Reference window
--/
--/ @return Position of the mouse cursor, relative to the given window
--/
--//////////////////////////////////////////////////////////
function getPosition (relativeTo : sfWindow_Ptr) return Sf.System.Vector2.sfVector2i;
--//////////////////////////////////////////////////////////
--/ @brief Set the current position of the mouse
--/
--/ This function sets the current position of the mouse
--/ cursor relative to the given window, or desktop if NULL is passed.
--/
--/ @param position New position of the mouse
--/ @param relativeTo Reference window
--/
--//////////////////////////////////////////////////////////
procedure setPosition (position : Sf.System.Vector2.sfVector2i; relativeTo : sfWindow_Ptr);
private
pragma Convention (C, sfMouseButton);
pragma Convention (C, sfMouseWheel);
pragma Import (C, isButtonPressed, "sfMouse_isButtonPressed");
pragma Import (C, getPosition, "sfMouse_getPosition");
pragma Import (C, setPosition, "sfMouse_setPosition");
end Sf.Window.Mouse;
|
[
{
"context": " --\n-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --\n-- All rig",
"end": 829,
"score": 0.9998864531517029,
"start": 816,
"tag": "NAME",
"value": "Vadim Godunko"
},
{
"context": " --\n-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --\n-- All rights reserved. ",
"end": 849,
"score": 0.9999328851699829,
"start": 831,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
source/amf/uml/amf-umldi-uml_diagrams-collections.ads
|
svn2github/matreshka
| 24 |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Generic_Collections;
package AMF.UMLDI.UML_Diagrams.Collections is
pragma Preelaborate;
package UMLDI_UML_Diagram_Collections is
new AMF.Generic_Collections
(UMLDI_UML_Diagram,
UMLDI_UML_Diagram_Access);
type Set_Of_UMLDI_UML_Diagram is
new UMLDI_UML_Diagram_Collections.Set with null record;
Empty_Set_Of_UMLDI_UML_Diagram : constant Set_Of_UMLDI_UML_Diagram;
type Ordered_Set_Of_UMLDI_UML_Diagram is
new UMLDI_UML_Diagram_Collections.Ordered_Set with null record;
Empty_Ordered_Set_Of_UMLDI_UML_Diagram : constant Ordered_Set_Of_UMLDI_UML_Diagram;
type Bag_Of_UMLDI_UML_Diagram is
new UMLDI_UML_Diagram_Collections.Bag with null record;
Empty_Bag_Of_UMLDI_UML_Diagram : constant Bag_Of_UMLDI_UML_Diagram;
type Sequence_Of_UMLDI_UML_Diagram is
new UMLDI_UML_Diagram_Collections.Sequence with null record;
Empty_Sequence_Of_UMLDI_UML_Diagram : constant Sequence_Of_UMLDI_UML_Diagram;
private
Empty_Set_Of_UMLDI_UML_Diagram : constant Set_Of_UMLDI_UML_Diagram
:= (UMLDI_UML_Diagram_Collections.Set with null record);
Empty_Ordered_Set_Of_UMLDI_UML_Diagram : constant Ordered_Set_Of_UMLDI_UML_Diagram
:= (UMLDI_UML_Diagram_Collections.Ordered_Set with null record);
Empty_Bag_Of_UMLDI_UML_Diagram : constant Bag_Of_UMLDI_UML_Diagram
:= (UMLDI_UML_Diagram_Collections.Bag with null record);
Empty_Sequence_Of_UMLDI_UML_Diagram : constant Sequence_Of_UMLDI_UML_Diagram
:= (UMLDI_UML_Diagram_Collections.Sequence with null record);
end AMF.UMLDI.UML_Diagrams.Collections;
|
25622
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Generic_Collections;
package AMF.UMLDI.UML_Diagrams.Collections is
pragma Preelaborate;
package UMLDI_UML_Diagram_Collections is
new AMF.Generic_Collections
(UMLDI_UML_Diagram,
UMLDI_UML_Diagram_Access);
type Set_Of_UMLDI_UML_Diagram is
new UMLDI_UML_Diagram_Collections.Set with null record;
Empty_Set_Of_UMLDI_UML_Diagram : constant Set_Of_UMLDI_UML_Diagram;
type Ordered_Set_Of_UMLDI_UML_Diagram is
new UMLDI_UML_Diagram_Collections.Ordered_Set with null record;
Empty_Ordered_Set_Of_UMLDI_UML_Diagram : constant Ordered_Set_Of_UMLDI_UML_Diagram;
type Bag_Of_UMLDI_UML_Diagram is
new UMLDI_UML_Diagram_Collections.Bag with null record;
Empty_Bag_Of_UMLDI_UML_Diagram : constant Bag_Of_UMLDI_UML_Diagram;
type Sequence_Of_UMLDI_UML_Diagram is
new UMLDI_UML_Diagram_Collections.Sequence with null record;
Empty_Sequence_Of_UMLDI_UML_Diagram : constant Sequence_Of_UMLDI_UML_Diagram;
private
Empty_Set_Of_UMLDI_UML_Diagram : constant Set_Of_UMLDI_UML_Diagram
:= (UMLDI_UML_Diagram_Collections.Set with null record);
Empty_Ordered_Set_Of_UMLDI_UML_Diagram : constant Ordered_Set_Of_UMLDI_UML_Diagram
:= (UMLDI_UML_Diagram_Collections.Ordered_Set with null record);
Empty_Bag_Of_UMLDI_UML_Diagram : constant Bag_Of_UMLDI_UML_Diagram
:= (UMLDI_UML_Diagram_Collections.Bag with null record);
Empty_Sequence_Of_UMLDI_UML_Diagram : constant Sequence_Of_UMLDI_UML_Diagram
:= (UMLDI_UML_Diagram_Collections.Sequence with null record);
end AMF.UMLDI.UML_Diagrams.Collections;
| true |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Generic_Collections;
package AMF.UMLDI.UML_Diagrams.Collections is
pragma Preelaborate;
package UMLDI_UML_Diagram_Collections is
new AMF.Generic_Collections
(UMLDI_UML_Diagram,
UMLDI_UML_Diagram_Access);
type Set_Of_UMLDI_UML_Diagram is
new UMLDI_UML_Diagram_Collections.Set with null record;
Empty_Set_Of_UMLDI_UML_Diagram : constant Set_Of_UMLDI_UML_Diagram;
type Ordered_Set_Of_UMLDI_UML_Diagram is
new UMLDI_UML_Diagram_Collections.Ordered_Set with null record;
Empty_Ordered_Set_Of_UMLDI_UML_Diagram : constant Ordered_Set_Of_UMLDI_UML_Diagram;
type Bag_Of_UMLDI_UML_Diagram is
new UMLDI_UML_Diagram_Collections.Bag with null record;
Empty_Bag_Of_UMLDI_UML_Diagram : constant Bag_Of_UMLDI_UML_Diagram;
type Sequence_Of_UMLDI_UML_Diagram is
new UMLDI_UML_Diagram_Collections.Sequence with null record;
Empty_Sequence_Of_UMLDI_UML_Diagram : constant Sequence_Of_UMLDI_UML_Diagram;
private
Empty_Set_Of_UMLDI_UML_Diagram : constant Set_Of_UMLDI_UML_Diagram
:= (UMLDI_UML_Diagram_Collections.Set with null record);
Empty_Ordered_Set_Of_UMLDI_UML_Diagram : constant Ordered_Set_Of_UMLDI_UML_Diagram
:= (UMLDI_UML_Diagram_Collections.Ordered_Set with null record);
Empty_Bag_Of_UMLDI_UML_Diagram : constant Bag_Of_UMLDI_UML_Diagram
:= (UMLDI_UML_Diagram_Collections.Bag with null record);
Empty_Sequence_Of_UMLDI_UML_Diagram : constant Sequence_Of_UMLDI_UML_Diagram
:= (UMLDI_UML_Diagram_Collections.Sequence with null record);
end AMF.UMLDI.UML_Diagrams.Collections;
|
[
{
"context": "variables in text and links\n-- Copyright (C) 2020 Stephane Carrez\n-- Written by Stephane Carrez (Stephane.Carrez@g",
"end": 175,
"score": 0.9998763203620911,
"start": 160,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": " Copyright (C) 2020 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under",
"end": 206,
"score": 0.9998828172683716,
"start": 191,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "0 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under the Apache License, Versio",
"end": 233,
"score": 0.9999282956123352,
"start": 208,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
src/wiki-filters-variables.adb
|
jquorning/ada-wiki
| 18 |
-----------------------------------------------------------------------
-- wiki-filters-variables -- Expand variables in text and links
-- Copyright (C) 2020 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
package body Wiki.Filters.Variables is
function Need_Expand (Text : in Wiki.Strings.WString) return Boolean;
function Need_Expand (Text : in Wiki.Strings.WString) return Boolean is
begin
return Wiki.Strings.Index (Text, "$") > 0;
end Need_Expand;
procedure Add_Variable (Chain : in Wiki.Filters.Filter_Chain;
Name : in Wiki.Strings.WString;
Value : in Wiki.Strings.WString) is
Filter : Filter_Type_Access := Chain.Next;
begin
while Filter /= null loop
if Filter.all in Variable_Filter'Class then
Variable_Filter'Class (Filter.all).Add_Variable (Name, Value);
return;
end if;
Filter := Filter.Next;
end loop;
end Add_Variable;
-- ------------------------------
-- Add a variable to replace the given name by its value.
-- ------------------------------
procedure Add_Variable (Filter : in out Variable_Filter;
Name : in Wiki.Strings.WString;
Value : in Wiki.Strings.WString) is
begin
Filter.Variables.Include (Name, Value);
end Add_Variable;
procedure Add_Variable (Filter : in out Variable_Filter;
Name : in String;
Value : in Wiki.Strings.WString) is
begin
Filter.Variables.Include (Wiki.Strings.To_WString (Name), Value);
end Add_Variable;
-- ------------------------------
-- Add a section header with the given level in the document.
-- ------------------------------
overriding
procedure Add_Header (Filter : in out Variable_Filter;
Document : in out Wiki.Documents.Document;
Header : in Wiki.Strings.WString;
Level : in Natural) is
begin
if Need_Expand (Header) then
Filter_Type (Filter).Add_Header (Document, Filter.Expand (Header), Level);
else
Filter_Type (Filter).Add_Header (Document, Header, Level);
end if;
end Add_Header;
-- ------------------------------
-- Add a text content with the given format to the document. Replace variables
-- that are contained in the text.
-- ------------------------------
overriding
procedure Add_Text (Filter : in out Variable_Filter;
Document : in out Wiki.Documents.Document;
Text : in Wiki.Strings.WString;
Format : in Wiki.Format_Map) is
begin
if Need_Expand (Text) then
Filter_Type (Filter).Add_Text (Document, Filter.Expand (Text), Format);
else
Filter_Type (Filter).Add_Text (Document, Text, Format);
end if;
end Add_Text;
-- ------------------------------
-- Add a link.
-- ------------------------------
overriding
procedure Add_Link (Filter : in out Variable_Filter;
Document : in out Wiki.Documents.Document;
Name : in Wiki.Strings.WString;
Attributes : in out Wiki.Attributes.Attribute_List) is
begin
if Need_Expand (Name) then
Filter_Type (Filter).Add_Link (Document, Filter.Expand (Name), Attributes);
else
Filter_Type (Filter).Add_Link (Document, Name, Attributes);
end if;
end Add_Link;
-- ------------------------------
-- Add a quote.
-- ------------------------------
overriding
procedure Add_Quote (Filter : in out Variable_Filter;
Document : in out Wiki.Documents.Document;
Name : in Wiki.Strings.WString;
Attributes : in out Wiki.Attributes.Attribute_List) is
begin
if Need_Expand (Name) then
Filter_Type (Filter).Add_Quote (Document, Filter.Expand (Name), Attributes);
else
Filter_Type (Filter).Add_Quote (Document, Name, Attributes);
end if;
end Add_Quote;
-- ------------------------------
-- Expand the variables contained in the text.
-- ------------------------------
function Expand (Filter : in Variable_Filter;
Text : in Wiki.Strings.WString) return Wiki.Strings.WString is
First : Natural := Text'First;
Pos : Natural;
Last : Natural;
Name_Start : Natural;
Name_End : Natural;
Result : Wiki.Strings.BString (256);
Item : Variable_Cursor;
Match_End : Wiki.Strings.WChar;
begin
while First <= Text'Last loop
Pos := First;
while Pos <= Text'Last and then Text (Pos) /= '$' loop
Pos := Pos + 1;
end loop;
exit when Pos >= Text'Last;
Strings.Wide_Wide_Builders.Append (Result, Text (First .. Pos - 1));
First := Pos;
Name_Start := Pos + 1;
if Text (Name_Start) = '(' or Text (Name_Start) = '{' then
Match_End := (if Text (Name_Start) = '(' then ')' else '}');
Name_Start := Name_Start + 1;
Name_End := Name_Start;
while Name_End <= Text'Last and then Text (Name_End) /= Match_End loop
Name_End := Name_End + 1;
end loop;
exit when Name_End > Text'Last;
exit when Text (Name_End) /= Match_End;
Last := Name_End + 1;
Name_End := Name_End - 1;
else
Name_End := Name_Start;
while Name_End <= Text'Last and then Text (Name_End) /= ' ' loop
Name_End := Name_End + 1;
end loop;
Last := Name_End;
Name_End := Name_End - 1;
end if;
Item := Filter.Variables.Find (Text (Name_Start .. Name_End));
if Variable_Maps.Has_Element (Item) then
Strings.Wide_Wide_Builders.Append (Result, Variable_Maps.Element (Item));
First := Last;
elsif Last > Text'Last then
exit;
else
Strings.Wide_Wide_Builders.Append (Result, Text (First .. Last));
First := Last + 1;
end if;
end loop;
if First <= Text'Last then
Strings.Wide_Wide_Builders.Append (Result, Text (First .. Text'Last));
end if;
return Strings.Wide_Wide_Builders.To_Array (Result);
end Expand;
-- ------------------------------
-- Iterate over the filter variables.
-- ------------------------------
procedure Iterate (Filter : in Variable_Filter;
Process : not null
access procedure (Name, Value : in Strings.WString)) is
Iter : Variable_Cursor := Filter.Variables.First;
begin
while Variable_Maps.Has_Element (Iter) loop
Variable_Maps.Query_Element (Iter, Process);
Variable_Maps.Next (Iter);
end loop;
end Iterate;
procedure Iterate (Chain : in Wiki.Filters.Filter_Chain;
Process : not null
access procedure (Name, Value : in Strings.WString)) is
Filter : Filter_Type_Access := Chain.Next;
begin
while Filter /= null loop
if Filter.all in Variable_Filter'Class then
Variable_Filter'Class (Filter.all).Iterate (Process);
return;
end if;
Filter := Filter.Next;
end loop;
end Iterate;
end Wiki.Filters.Variables;
|
10516
|
-----------------------------------------------------------------------
-- wiki-filters-variables -- Expand variables in text and links
-- Copyright (C) 2020 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
package body Wiki.Filters.Variables is
function Need_Expand (Text : in Wiki.Strings.WString) return Boolean;
function Need_Expand (Text : in Wiki.Strings.WString) return Boolean is
begin
return Wiki.Strings.Index (Text, "$") > 0;
end Need_Expand;
procedure Add_Variable (Chain : in Wiki.Filters.Filter_Chain;
Name : in Wiki.Strings.WString;
Value : in Wiki.Strings.WString) is
Filter : Filter_Type_Access := Chain.Next;
begin
while Filter /= null loop
if Filter.all in Variable_Filter'Class then
Variable_Filter'Class (Filter.all).Add_Variable (Name, Value);
return;
end if;
Filter := Filter.Next;
end loop;
end Add_Variable;
-- ------------------------------
-- Add a variable to replace the given name by its value.
-- ------------------------------
procedure Add_Variable (Filter : in out Variable_Filter;
Name : in Wiki.Strings.WString;
Value : in Wiki.Strings.WString) is
begin
Filter.Variables.Include (Name, Value);
end Add_Variable;
procedure Add_Variable (Filter : in out Variable_Filter;
Name : in String;
Value : in Wiki.Strings.WString) is
begin
Filter.Variables.Include (Wiki.Strings.To_WString (Name), Value);
end Add_Variable;
-- ------------------------------
-- Add a section header with the given level in the document.
-- ------------------------------
overriding
procedure Add_Header (Filter : in out Variable_Filter;
Document : in out Wiki.Documents.Document;
Header : in Wiki.Strings.WString;
Level : in Natural) is
begin
if Need_Expand (Header) then
Filter_Type (Filter).Add_Header (Document, Filter.Expand (Header), Level);
else
Filter_Type (Filter).Add_Header (Document, Header, Level);
end if;
end Add_Header;
-- ------------------------------
-- Add a text content with the given format to the document. Replace variables
-- that are contained in the text.
-- ------------------------------
overriding
procedure Add_Text (Filter : in out Variable_Filter;
Document : in out Wiki.Documents.Document;
Text : in Wiki.Strings.WString;
Format : in Wiki.Format_Map) is
begin
if Need_Expand (Text) then
Filter_Type (Filter).Add_Text (Document, Filter.Expand (Text), Format);
else
Filter_Type (Filter).Add_Text (Document, Text, Format);
end if;
end Add_Text;
-- ------------------------------
-- Add a link.
-- ------------------------------
overriding
procedure Add_Link (Filter : in out Variable_Filter;
Document : in out Wiki.Documents.Document;
Name : in Wiki.Strings.WString;
Attributes : in out Wiki.Attributes.Attribute_List) is
begin
if Need_Expand (Name) then
Filter_Type (Filter).Add_Link (Document, Filter.Expand (Name), Attributes);
else
Filter_Type (Filter).Add_Link (Document, Name, Attributes);
end if;
end Add_Link;
-- ------------------------------
-- Add a quote.
-- ------------------------------
overriding
procedure Add_Quote (Filter : in out Variable_Filter;
Document : in out Wiki.Documents.Document;
Name : in Wiki.Strings.WString;
Attributes : in out Wiki.Attributes.Attribute_List) is
begin
if Need_Expand (Name) then
Filter_Type (Filter).Add_Quote (Document, Filter.Expand (Name), Attributes);
else
Filter_Type (Filter).Add_Quote (Document, Name, Attributes);
end if;
end Add_Quote;
-- ------------------------------
-- Expand the variables contained in the text.
-- ------------------------------
function Expand (Filter : in Variable_Filter;
Text : in Wiki.Strings.WString) return Wiki.Strings.WString is
First : Natural := Text'First;
Pos : Natural;
Last : Natural;
Name_Start : Natural;
Name_End : Natural;
Result : Wiki.Strings.BString (256);
Item : Variable_Cursor;
Match_End : Wiki.Strings.WChar;
begin
while First <= Text'Last loop
Pos := First;
while Pos <= Text'Last and then Text (Pos) /= '$' loop
Pos := Pos + 1;
end loop;
exit when Pos >= Text'Last;
Strings.Wide_Wide_Builders.Append (Result, Text (First .. Pos - 1));
First := Pos;
Name_Start := Pos + 1;
if Text (Name_Start) = '(' or Text (Name_Start) = '{' then
Match_End := (if Text (Name_Start) = '(' then ')' else '}');
Name_Start := Name_Start + 1;
Name_End := Name_Start;
while Name_End <= Text'Last and then Text (Name_End) /= Match_End loop
Name_End := Name_End + 1;
end loop;
exit when Name_End > Text'Last;
exit when Text (Name_End) /= Match_End;
Last := Name_End + 1;
Name_End := Name_End - 1;
else
Name_End := Name_Start;
while Name_End <= Text'Last and then Text (Name_End) /= ' ' loop
Name_End := Name_End + 1;
end loop;
Last := Name_End;
Name_End := Name_End - 1;
end if;
Item := Filter.Variables.Find (Text (Name_Start .. Name_End));
if Variable_Maps.Has_Element (Item) then
Strings.Wide_Wide_Builders.Append (Result, Variable_Maps.Element (Item));
First := Last;
elsif Last > Text'Last then
exit;
else
Strings.Wide_Wide_Builders.Append (Result, Text (First .. Last));
First := Last + 1;
end if;
end loop;
if First <= Text'Last then
Strings.Wide_Wide_Builders.Append (Result, Text (First .. Text'Last));
end if;
return Strings.Wide_Wide_Builders.To_Array (Result);
end Expand;
-- ------------------------------
-- Iterate over the filter variables.
-- ------------------------------
procedure Iterate (Filter : in Variable_Filter;
Process : not null
access procedure (Name, Value : in Strings.WString)) is
Iter : Variable_Cursor := Filter.Variables.First;
begin
while Variable_Maps.Has_Element (Iter) loop
Variable_Maps.Query_Element (Iter, Process);
Variable_Maps.Next (Iter);
end loop;
end Iterate;
procedure Iterate (Chain : in Wiki.Filters.Filter_Chain;
Process : not null
access procedure (Name, Value : in Strings.WString)) is
Filter : Filter_Type_Access := Chain.Next;
begin
while Filter /= null loop
if Filter.all in Variable_Filter'Class then
Variable_Filter'Class (Filter.all).Iterate (Process);
return;
end if;
Filter := Filter.Next;
end loop;
end Iterate;
end Wiki.Filters.Variables;
| true |
-----------------------------------------------------------------------
-- wiki-filters-variables -- Expand variables in text and links
-- Copyright (C) 2020 PI:NAME:<NAME>END_PI
-- Written by PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
package body Wiki.Filters.Variables is
function Need_Expand (Text : in Wiki.Strings.WString) return Boolean;
function Need_Expand (Text : in Wiki.Strings.WString) return Boolean is
begin
return Wiki.Strings.Index (Text, "$") > 0;
end Need_Expand;
procedure Add_Variable (Chain : in Wiki.Filters.Filter_Chain;
Name : in Wiki.Strings.WString;
Value : in Wiki.Strings.WString) is
Filter : Filter_Type_Access := Chain.Next;
begin
while Filter /= null loop
if Filter.all in Variable_Filter'Class then
Variable_Filter'Class (Filter.all).Add_Variable (Name, Value);
return;
end if;
Filter := Filter.Next;
end loop;
end Add_Variable;
-- ------------------------------
-- Add a variable to replace the given name by its value.
-- ------------------------------
procedure Add_Variable (Filter : in out Variable_Filter;
Name : in Wiki.Strings.WString;
Value : in Wiki.Strings.WString) is
begin
Filter.Variables.Include (Name, Value);
end Add_Variable;
procedure Add_Variable (Filter : in out Variable_Filter;
Name : in String;
Value : in Wiki.Strings.WString) is
begin
Filter.Variables.Include (Wiki.Strings.To_WString (Name), Value);
end Add_Variable;
-- ------------------------------
-- Add a section header with the given level in the document.
-- ------------------------------
overriding
procedure Add_Header (Filter : in out Variable_Filter;
Document : in out Wiki.Documents.Document;
Header : in Wiki.Strings.WString;
Level : in Natural) is
begin
if Need_Expand (Header) then
Filter_Type (Filter).Add_Header (Document, Filter.Expand (Header), Level);
else
Filter_Type (Filter).Add_Header (Document, Header, Level);
end if;
end Add_Header;
-- ------------------------------
-- Add a text content with the given format to the document. Replace variables
-- that are contained in the text.
-- ------------------------------
overriding
procedure Add_Text (Filter : in out Variable_Filter;
Document : in out Wiki.Documents.Document;
Text : in Wiki.Strings.WString;
Format : in Wiki.Format_Map) is
begin
if Need_Expand (Text) then
Filter_Type (Filter).Add_Text (Document, Filter.Expand (Text), Format);
else
Filter_Type (Filter).Add_Text (Document, Text, Format);
end if;
end Add_Text;
-- ------------------------------
-- Add a link.
-- ------------------------------
overriding
procedure Add_Link (Filter : in out Variable_Filter;
Document : in out Wiki.Documents.Document;
Name : in Wiki.Strings.WString;
Attributes : in out Wiki.Attributes.Attribute_List) is
begin
if Need_Expand (Name) then
Filter_Type (Filter).Add_Link (Document, Filter.Expand (Name), Attributes);
else
Filter_Type (Filter).Add_Link (Document, Name, Attributes);
end if;
end Add_Link;
-- ------------------------------
-- Add a quote.
-- ------------------------------
overriding
procedure Add_Quote (Filter : in out Variable_Filter;
Document : in out Wiki.Documents.Document;
Name : in Wiki.Strings.WString;
Attributes : in out Wiki.Attributes.Attribute_List) is
begin
if Need_Expand (Name) then
Filter_Type (Filter).Add_Quote (Document, Filter.Expand (Name), Attributes);
else
Filter_Type (Filter).Add_Quote (Document, Name, Attributes);
end if;
end Add_Quote;
-- ------------------------------
-- Expand the variables contained in the text.
-- ------------------------------
function Expand (Filter : in Variable_Filter;
Text : in Wiki.Strings.WString) return Wiki.Strings.WString is
First : Natural := Text'First;
Pos : Natural;
Last : Natural;
Name_Start : Natural;
Name_End : Natural;
Result : Wiki.Strings.BString (256);
Item : Variable_Cursor;
Match_End : Wiki.Strings.WChar;
begin
while First <= Text'Last loop
Pos := First;
while Pos <= Text'Last and then Text (Pos) /= '$' loop
Pos := Pos + 1;
end loop;
exit when Pos >= Text'Last;
Strings.Wide_Wide_Builders.Append (Result, Text (First .. Pos - 1));
First := Pos;
Name_Start := Pos + 1;
if Text (Name_Start) = '(' or Text (Name_Start) = '{' then
Match_End := (if Text (Name_Start) = '(' then ')' else '}');
Name_Start := Name_Start + 1;
Name_End := Name_Start;
while Name_End <= Text'Last and then Text (Name_End) /= Match_End loop
Name_End := Name_End + 1;
end loop;
exit when Name_End > Text'Last;
exit when Text (Name_End) /= Match_End;
Last := Name_End + 1;
Name_End := Name_End - 1;
else
Name_End := Name_Start;
while Name_End <= Text'Last and then Text (Name_End) /= ' ' loop
Name_End := Name_End + 1;
end loop;
Last := Name_End;
Name_End := Name_End - 1;
end if;
Item := Filter.Variables.Find (Text (Name_Start .. Name_End));
if Variable_Maps.Has_Element (Item) then
Strings.Wide_Wide_Builders.Append (Result, Variable_Maps.Element (Item));
First := Last;
elsif Last > Text'Last then
exit;
else
Strings.Wide_Wide_Builders.Append (Result, Text (First .. Last));
First := Last + 1;
end if;
end loop;
if First <= Text'Last then
Strings.Wide_Wide_Builders.Append (Result, Text (First .. Text'Last));
end if;
return Strings.Wide_Wide_Builders.To_Array (Result);
end Expand;
-- ------------------------------
-- Iterate over the filter variables.
-- ------------------------------
procedure Iterate (Filter : in Variable_Filter;
Process : not null
access procedure (Name, Value : in Strings.WString)) is
Iter : Variable_Cursor := Filter.Variables.First;
begin
while Variable_Maps.Has_Element (Iter) loop
Variable_Maps.Query_Element (Iter, Process);
Variable_Maps.Next (Iter);
end loop;
end Iterate;
procedure Iterate (Chain : in Wiki.Filters.Filter_Chain;
Process : not null
access procedure (Name, Value : in Strings.WString)) is
Filter : Filter_Type_Access := Chain.Next;
begin
while Filter /= null loop
if Filter.all in Variable_Filter'Class then
Variable_Filter'Class (Filter.all).Iterate (Process);
return;
end if;
Filter := Filter.Next;
end loop;
end Iterate;
end Wiki.Filters.Variables;
|
[
{
"context": "ersion of the OpenAPI document: 1.0.0\n-- Contact: [email protected]\n--\n-- NOTE: This package is auto generated by Op",
"end": 175,
"score": 0.9999207258224487,
"start": 153,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
openapi-client/ada/src/model/-models.adb
|
interserver/mailbaby-api-samples
| 0 |
-- Mail Baby API
-- This is an API defintion for accesssing the Mail.Baby mail service.
--
-- The version of the OpenAPI document: 1.0.0
-- Contact: [email protected]
--
-- NOTE: This package is auto generated by OpenAPI-Generator 6.0.0-SNAPSHOT.
-- https://openapi-generator.tech
-- Do not edit the class manually.
package body .Models is
pragma Style_Checks ("-mr");
pragma Warnings (Off, "*use clause for package*");
use Swagger.Streams;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SendMailAdvFrom_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("email", Value.Email);
Into.Write_Entity ("name", Value.Name);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SendMailAdvFrom_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SendMailAdvFrom_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "email", Value.Email);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SendMailAdvFrom_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SendMailAdvFrom_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in MailLog_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Long_Entity ("id", Value.Id);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in MailLog_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out MailLog_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "id", Value.Id);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out MailLog_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : MailLog_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in GenericResponse_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("status", Value.Status);
Into.Write_Entity ("text", Value.Text);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in GenericResponse_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out GenericResponse_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "status", Value.Status);
Swagger.Streams.Deserialize (Object, "text", Value.Text);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out GenericResponse_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : GenericResponse_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in ErrorResponse_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("code", Value.Code);
Into.Write_Entity ("message", Value.Message);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in ErrorResponse_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out ErrorResponse_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "code", Value.Code);
Swagger.Streams.Deserialize (Object, "message", Value.Message);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out ErrorResponse_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : ErrorResponse_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in MailOrder_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("id", Value.Id);
Into.Write_Entity ("status", Value.Status);
Into.Write_Entity ("username", Value.Username);
Into.Write_Entity ("password", Value.Password);
Into.Write_Entity ("comment", Value.Comment);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in MailOrder_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out MailOrder_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "id", Value.Id);
Swagger.Streams.Deserialize (Object, "status", Value.Status);
Swagger.Streams.Deserialize (Object, "username", Value.Username);
Swagger.Streams.Deserialize (Object, "password", Value.Password);
Swagger.Streams.Deserialize (Object, "comment", Value.Comment);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out MailOrder_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : MailOrder_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in MailContact_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("email", Value.Email);
Into.Write_Entity ("name", Value.Name);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in MailContact_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out MailContact_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "email", Value.Email);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out MailContact_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : MailContact_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SendMail_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("to", Value.To);
Into.Write_Entity ("from", Value.From);
Into.Write_Entity ("subject", Value.Subject);
Into.Write_Entity ("body", Value.P_Body);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SendMail_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SendMail_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "to", Value.To);
Swagger.Streams.Deserialize (Object, "from", Value.From);
Swagger.Streams.Deserialize (Object, "subject", Value.Subject);
Swagger.Streams.Deserialize (Object, "body", Value.P_Body);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SendMail_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SendMail_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in InlineResponse401_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("code", Value.Code);
Into.Write_Entity ("message", Value.Message);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in InlineResponse401_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out InlineResponse401_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "code", Value.Code);
Swagger.Streams.Deserialize (Object, "message", Value.Message);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out InlineResponse401_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : InlineResponse401_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in MailAttachment_Type) is
begin
Into.Start_Entity (Name);
Serialize (Into, "data", Value.Data);
Into.Write_Entity ("filename", Value.Filename);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in MailAttachment_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out MailAttachment_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Deserialize (Object, "data", Value.Data);
Swagger.Streams.Deserialize (Object, "filename", Value.Filename);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out MailAttachment_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : MailAttachment_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SendMailAdv_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("subject", Value.Subject);
Into.Write_Entity ("body", Value.P_Body);
Serialize (Into, "from", Value.From);
Serialize (Into, "to", Value.To);
Into.Write_Long_Entity ("id", Value.Id);
Serialize (Into, "replyto", Value.Replyto);
Serialize (Into, "cc", Value.Cc);
Serialize (Into, "bcc", Value.Bcc);
Serialize (Into, "attachments", Value.Attachments);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SendMailAdv_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SendMailAdv_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "subject", Value.Subject);
Swagger.Streams.Deserialize (Object, "body", Value.P_Body);
Deserialize (Object, "from", Value.From);
Deserialize (Object, "to", Value.To);
Swagger.Streams.Deserialize (Object, "id", Value.Id);
Deserialize (Object, "replyto", Value.Replyto);
Deserialize (Object, "cc", Value.Cc);
Deserialize (Object, "bcc", Value.Bcc);
Deserialize (Object, "attachments", Value.Attachments);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SendMailAdv_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SendMailAdv_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
end .Models;
|
22204
|
-- Mail Baby API
-- This is an API defintion for accesssing the Mail.Baby mail service.
--
-- The version of the OpenAPI document: 1.0.0
-- Contact: <EMAIL>
--
-- NOTE: This package is auto generated by OpenAPI-Generator 6.0.0-SNAPSHOT.
-- https://openapi-generator.tech
-- Do not edit the class manually.
package body .Models is
pragma Style_Checks ("-mr");
pragma Warnings (Off, "*use clause for package*");
use Swagger.Streams;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SendMailAdvFrom_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("email", Value.Email);
Into.Write_Entity ("name", Value.Name);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SendMailAdvFrom_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SendMailAdvFrom_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "email", Value.Email);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SendMailAdvFrom_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SendMailAdvFrom_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in MailLog_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Long_Entity ("id", Value.Id);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in MailLog_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out MailLog_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "id", Value.Id);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out MailLog_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : MailLog_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in GenericResponse_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("status", Value.Status);
Into.Write_Entity ("text", Value.Text);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in GenericResponse_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out GenericResponse_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "status", Value.Status);
Swagger.Streams.Deserialize (Object, "text", Value.Text);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out GenericResponse_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : GenericResponse_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in ErrorResponse_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("code", Value.Code);
Into.Write_Entity ("message", Value.Message);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in ErrorResponse_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out ErrorResponse_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "code", Value.Code);
Swagger.Streams.Deserialize (Object, "message", Value.Message);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out ErrorResponse_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : ErrorResponse_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in MailOrder_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("id", Value.Id);
Into.Write_Entity ("status", Value.Status);
Into.Write_Entity ("username", Value.Username);
Into.Write_Entity ("password", Value.Password);
Into.Write_Entity ("comment", Value.Comment);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in MailOrder_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out MailOrder_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "id", Value.Id);
Swagger.Streams.Deserialize (Object, "status", Value.Status);
Swagger.Streams.Deserialize (Object, "username", Value.Username);
Swagger.Streams.Deserialize (Object, "password", Value.Password);
Swagger.Streams.Deserialize (Object, "comment", Value.Comment);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out MailOrder_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : MailOrder_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in MailContact_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("email", Value.Email);
Into.Write_Entity ("name", Value.Name);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in MailContact_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out MailContact_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "email", Value.Email);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out MailContact_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : MailContact_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SendMail_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("to", Value.To);
Into.Write_Entity ("from", Value.From);
Into.Write_Entity ("subject", Value.Subject);
Into.Write_Entity ("body", Value.P_Body);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SendMail_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SendMail_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "to", Value.To);
Swagger.Streams.Deserialize (Object, "from", Value.From);
Swagger.Streams.Deserialize (Object, "subject", Value.Subject);
Swagger.Streams.Deserialize (Object, "body", Value.P_Body);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SendMail_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SendMail_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in InlineResponse401_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("code", Value.Code);
Into.Write_Entity ("message", Value.Message);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in InlineResponse401_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out InlineResponse401_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "code", Value.Code);
Swagger.Streams.Deserialize (Object, "message", Value.Message);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out InlineResponse401_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : InlineResponse401_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in MailAttachment_Type) is
begin
Into.Start_Entity (Name);
Serialize (Into, "data", Value.Data);
Into.Write_Entity ("filename", Value.Filename);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in MailAttachment_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out MailAttachment_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Deserialize (Object, "data", Value.Data);
Swagger.Streams.Deserialize (Object, "filename", Value.Filename);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out MailAttachment_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : MailAttachment_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SendMailAdv_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("subject", Value.Subject);
Into.Write_Entity ("body", Value.P_Body);
Serialize (Into, "from", Value.From);
Serialize (Into, "to", Value.To);
Into.Write_Long_Entity ("id", Value.Id);
Serialize (Into, "replyto", Value.Replyto);
Serialize (Into, "cc", Value.Cc);
Serialize (Into, "bcc", Value.Bcc);
Serialize (Into, "attachments", Value.Attachments);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SendMailAdv_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SendMailAdv_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "subject", Value.Subject);
Swagger.Streams.Deserialize (Object, "body", Value.P_Body);
Deserialize (Object, "from", Value.From);
Deserialize (Object, "to", Value.To);
Swagger.Streams.Deserialize (Object, "id", Value.Id);
Deserialize (Object, "replyto", Value.Replyto);
Deserialize (Object, "cc", Value.Cc);
Deserialize (Object, "bcc", Value.Bcc);
Deserialize (Object, "attachments", Value.Attachments);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SendMailAdv_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SendMailAdv_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
end .Models;
| true |
-- Mail Baby API
-- This is an API defintion for accesssing the Mail.Baby mail service.
--
-- The version of the OpenAPI document: 1.0.0
-- Contact: PI:EMAIL:<EMAIL>END_PI
--
-- NOTE: This package is auto generated by OpenAPI-Generator 6.0.0-SNAPSHOT.
-- https://openapi-generator.tech
-- Do not edit the class manually.
package body .Models is
pragma Style_Checks ("-mr");
pragma Warnings (Off, "*use clause for package*");
use Swagger.Streams;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SendMailAdvFrom_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("email", Value.Email);
Into.Write_Entity ("name", Value.Name);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SendMailAdvFrom_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SendMailAdvFrom_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "email", Value.Email);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SendMailAdvFrom_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SendMailAdvFrom_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in MailLog_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Long_Entity ("id", Value.Id);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in MailLog_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out MailLog_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "id", Value.Id);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out MailLog_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : MailLog_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in GenericResponse_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("status", Value.Status);
Into.Write_Entity ("text", Value.Text);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in GenericResponse_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out GenericResponse_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "status", Value.Status);
Swagger.Streams.Deserialize (Object, "text", Value.Text);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out GenericResponse_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : GenericResponse_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in ErrorResponse_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("code", Value.Code);
Into.Write_Entity ("message", Value.Message);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in ErrorResponse_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out ErrorResponse_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "code", Value.Code);
Swagger.Streams.Deserialize (Object, "message", Value.Message);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out ErrorResponse_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : ErrorResponse_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in MailOrder_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("id", Value.Id);
Into.Write_Entity ("status", Value.Status);
Into.Write_Entity ("username", Value.Username);
Into.Write_Entity ("password", Value.Password);
Into.Write_Entity ("comment", Value.Comment);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in MailOrder_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out MailOrder_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "id", Value.Id);
Swagger.Streams.Deserialize (Object, "status", Value.Status);
Swagger.Streams.Deserialize (Object, "username", Value.Username);
Swagger.Streams.Deserialize (Object, "password", Value.Password);
Swagger.Streams.Deserialize (Object, "comment", Value.Comment);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out MailOrder_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : MailOrder_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in MailContact_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("email", Value.Email);
Into.Write_Entity ("name", Value.Name);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in MailContact_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out MailContact_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "email", Value.Email);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out MailContact_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : MailContact_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SendMail_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("to", Value.To);
Into.Write_Entity ("from", Value.From);
Into.Write_Entity ("subject", Value.Subject);
Into.Write_Entity ("body", Value.P_Body);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SendMail_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SendMail_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "to", Value.To);
Swagger.Streams.Deserialize (Object, "from", Value.From);
Swagger.Streams.Deserialize (Object, "subject", Value.Subject);
Swagger.Streams.Deserialize (Object, "body", Value.P_Body);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SendMail_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SendMail_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in InlineResponse401_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("code", Value.Code);
Into.Write_Entity ("message", Value.Message);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in InlineResponse401_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out InlineResponse401_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "code", Value.Code);
Swagger.Streams.Deserialize (Object, "message", Value.Message);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out InlineResponse401_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : InlineResponse401_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in MailAttachment_Type) is
begin
Into.Start_Entity (Name);
Serialize (Into, "data", Value.Data);
Into.Write_Entity ("filename", Value.Filename);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in MailAttachment_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out MailAttachment_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Deserialize (Object, "data", Value.Data);
Swagger.Streams.Deserialize (Object, "filename", Value.Filename);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out MailAttachment_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : MailAttachment_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SendMailAdv_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("subject", Value.Subject);
Into.Write_Entity ("body", Value.P_Body);
Serialize (Into, "from", Value.From);
Serialize (Into, "to", Value.To);
Into.Write_Long_Entity ("id", Value.Id);
Serialize (Into, "replyto", Value.Replyto);
Serialize (Into, "cc", Value.Cc);
Serialize (Into, "bcc", Value.Bcc);
Serialize (Into, "attachments", Value.Attachments);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SendMailAdv_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SendMailAdv_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "subject", Value.Subject);
Swagger.Streams.Deserialize (Object, "body", Value.P_Body);
Deserialize (Object, "from", Value.From);
Deserialize (Object, "to", Value.To);
Swagger.Streams.Deserialize (Object, "id", Value.Id);
Deserialize (Object, "replyto", Value.Replyto);
Deserialize (Object, "cc", Value.Cc);
Deserialize (Object, "bcc", Value.Bcc);
Deserialize (Object, "attachments", Value.Attachments);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SendMailAdv_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SendMailAdv_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
end .Models;
|
[
{
"context": "--\n-- Copyright (c) 2002-2003, David Holm\n-- All rights reserved.\n--\n-- Redistribution an",
"end": 43,
"score": 0.999415934085846,
"start": 33,
"tag": "NAME",
"value": "David Holm"
}
] |
adagl/linux/glx-ext.ads
|
Lucretia/old_nehe_ada95
| 0 |
--
-- Copyright (c) 2002-2003, David Holm
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are
-- met:
--
-- * Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
-- * Redistributions in binary form must reproduce the above copyright
-- notice,
-- this list of conditions and the following disclaimer in the
-- documentation
-- and/or other materials provided with the distribution.
-- * The names of its contributors may not be used to endorse or promote
-- products derived from this software without specific prior written
-- permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-- "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES;
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
--
with OpenGL.GLX;
with X_Lib;
package OpenGL.GLX.EXT is
GLX_GLXEXT_VERSION : constant := 5;
GLX_SAMPLE_BUFFERS_ARB : constant := 100000;
GLX_SAMPLES_ARB : constant := 100001;
GLX_SAMPLE_BUFFERS_SGIS : constant := 100000;
GLX_SAMPLES_SGIS : constant := 100001;
GLX_X_VISUAL_TYPE_EXT : constant := 16#0022#;
GLX_TRANSPARENT_TYPE_EXT : constant := 16#0023#;
GLX_TRANSPARENT_INDEX_VALUE_EXT : constant := 16#0024#;
GLX_TRANSPARENT_RED_VALUE_EXT : constant := 16#0025#;
GLX_TRANSPARENT_GREEN_VALUE_EXT : constant := 16#0026#;
GLX_TRANSPARENT_BLUE_VALUE_EXT : constant := 16#0027#;
GLX_TRANSPARENT_ALPHA_VALUE_EXT : constant := 16#0028#;
GLX_NONE_EXT : constant := 16#8000#;
GLX_TRUE_COLOR_EXT : constant := 16#0000_8002#;
GLX_DIRECT_COLOR_EXT : constant := 16#0000_8003#;
GLX_PSEUDO_COLOR_EXT : constant := 16#0000_8004#;
GLX_STATIC_COLOR_EXT : constant := 16#0000_8005#;
GLX_GRAY_SCALE_EXT : constant := 16#0000_8006#;
GLX_STATIC_GRAY_EXT : constant := 16#0000_8007#;
GLX_TRANSPARENT_RGB_EXT : constant := 16#0000_8008#;
GLX_TRANSPARENT_INDEX_EXT : constant := 16#0000_8009#;
GLX_VISUAL_CAVEAT_EXT : constant := 16#0020#;
GLX_SLOW_VISUAL_EXT : constant := 16#0000_8001#;
GLX_NON_CONFORMANT_VISUAL_EXT : constant := 16#0000_800D#;
GLX_SHARE_CONTEXT_EXT : constant := 16#0000_800A#;
GLX_VISUAL_ID_EXT : constant := 16#0000_800B#;
GLX_SCREEN_EXT : constant := 16#0000_800C#;
GLX_WINDOW_BIT_SGIX : constant := 16#0001#;
GLX_PIXMAP_BIT_SGIX : constant := 16#0002#;
GLX_RGBA_BIT_SGIX : constant := 16#0001#;
GLX_COLOR_INDEX_BIT_SGIX : constant := 16#0002#;
GLX_DRAWABLE_TYPE_SGIX : constant := 16#0000_8010#;
GLX_RENDER_TYPE_SGIX : constant := 16#0000_8011#;
GLX_X_RENDERABLE_SGIX : constant := 16#0000_8012#;
GLX_FBCONFIG_ID_SGIX : constant := 16#0000_8013#;
GLX_RGBA_TYPE_SGIX : constant := 16#0000_8014#;
GLX_COLOR_INDEX_TYPE_SGIX : constant := 16#0000_8015#;
GLX_PBUFFER_BIT_SGIX : constant := 16#0004#;
GLX_BUFFER_CLOBBER_MASK_SGIX : constant := 16#0800_0000#;
GLX_FRONT_LEFT_BUFFER_BIT_SGIX : constant := 16#0001#;
GLX_FRONT_RIGHT_BUFFER_BIT_SGIX : constant := 16#0002#;
GLX_BACK_LEFT_BUFFER_BIT_SGIX : constant := 16#0004#;
GLX_BACK_RIGHT_BUFFER_BIT_SGIX : constant := 16#0008#;
GLX_AUX_BUFFERS_BIT_SGIX : constant := 16#0010#;
GLX_DEPTH_BUFFER_BIT_SGIX : constant := 16#0020#;
GLX_STENCIL_BUFFER_BIT_SGIX : constant := 16#0040#;
GLX_ACCUM_BUFFER_BIT_SGIX : constant := 16#0080#;
GLX_SAMPLE_BUFFERS_BIT_SGIX : constant := 16#0100#;
GLX_MAX_PBUFFER_WIDTH_SGIX : constant := 16#0000_8016#;
GLX_MAX_PBUFFER_HEIGHT_SGIX : constant := 16#0000_8017#;
GLX_MAX_PBUFFER_PIXELS_SGIX : constant := 16#0000_8018#;
GLX_OPTIMAL_PBUFFER_WIDTH_SGIX : constant := 16#0000_8019#;
GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX : constant := 16#0000_801A#;
GLX_PRESERVED_CONTENTS_SGIX : constant := 16#0000_801B#;
GLX_LARGEST_PBUFFER_SGIX : constant := 16#0000_801C#;
GLX_WIDTH_SGIX : constant := 16#0000_801D#;
GLX_HEIGHT_SGIX : constant := 16#0000_801E#;
GLX_EVENT_MASK_SGIX : constant := 16#0000_801F#;
GLX_DAMAGED_SGIX : constant := 16#0000_8020#;
GLX_SAVED_SGIX : constant := 16#0000_8021#;
GLX_WINDOW_SGIX : constant := 16#0000_8022#;
GLX_PBUFFER_SGIX : constant := 16#0000_8023#;
GLX_SYNC_FRAME_SGIX : constant := 16#0000#;
GLX_SYNC_SWAP_SGIX : constant := 16#0001#;
GLX_DIGITAL_MEDIA_PBUFFER_SGIX : constant := 16#0000_8024#;
GLX_BLENDED_RGBA_SGIS : constant := 16#0000_8025#;
GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS : constant := 16#0000_8026#;
GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS : constant := 16#0000_8027#;
GLX_SAMPLE_BUFFERS_3DFX : constant := 16#0000_8050#;
GLX_SAMPLES_3DFX : constant := 16#0000_8051#;
GLX_3DFX_WINDOW_MODE_MESA : constant := 16#0001#;
GLX_3DFX_FULLSCREEN_MODE_MESA : constant := 16#0002#;
GLX_VISUAL_SELECT_GROUP_SGIX : constant := 16#0000_8028#;
GLX_SWAP_METHOD_OML : constant := 16#0000_8060#;
GLX_SWAP_EXCHANGE_OML : constant := 16#0000_8061#;
GLX_SWAP_COPY_OML : constant := 16#0000_8062#;
GLX_SWAP_UNDEFINED_OML : constant := 16#0000_8063#;
type GLXVIDEOSOURCESGIX is new X_Lib.XID;
type GLXFBCONFIGIDSGIX is new X_Lib.XID;
type GLXPBUFFERSGIX is new X_Lib.XID;
type GLXFBCONFIGSGIX is access all OpenGL.GLX.struct_GLXFBConfigRec;
type GLXEXTFUNCPTR is access procedure;
end OpenGL.GLX.EXT;
|
11590
|
--
-- Copyright (c) 2002-2003, <NAME>
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are
-- met:
--
-- * Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
-- * Redistributions in binary form must reproduce the above copyright
-- notice,
-- this list of conditions and the following disclaimer in the
-- documentation
-- and/or other materials provided with the distribution.
-- * The names of its contributors may not be used to endorse or promote
-- products derived from this software without specific prior written
-- permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-- "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES;
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
--
with OpenGL.GLX;
with X_Lib;
package OpenGL.GLX.EXT is
GLX_GLXEXT_VERSION : constant := 5;
GLX_SAMPLE_BUFFERS_ARB : constant := 100000;
GLX_SAMPLES_ARB : constant := 100001;
GLX_SAMPLE_BUFFERS_SGIS : constant := 100000;
GLX_SAMPLES_SGIS : constant := 100001;
GLX_X_VISUAL_TYPE_EXT : constant := 16#0022#;
GLX_TRANSPARENT_TYPE_EXT : constant := 16#0023#;
GLX_TRANSPARENT_INDEX_VALUE_EXT : constant := 16#0024#;
GLX_TRANSPARENT_RED_VALUE_EXT : constant := 16#0025#;
GLX_TRANSPARENT_GREEN_VALUE_EXT : constant := 16#0026#;
GLX_TRANSPARENT_BLUE_VALUE_EXT : constant := 16#0027#;
GLX_TRANSPARENT_ALPHA_VALUE_EXT : constant := 16#0028#;
GLX_NONE_EXT : constant := 16#8000#;
GLX_TRUE_COLOR_EXT : constant := 16#0000_8002#;
GLX_DIRECT_COLOR_EXT : constant := 16#0000_8003#;
GLX_PSEUDO_COLOR_EXT : constant := 16#0000_8004#;
GLX_STATIC_COLOR_EXT : constant := 16#0000_8005#;
GLX_GRAY_SCALE_EXT : constant := 16#0000_8006#;
GLX_STATIC_GRAY_EXT : constant := 16#0000_8007#;
GLX_TRANSPARENT_RGB_EXT : constant := 16#0000_8008#;
GLX_TRANSPARENT_INDEX_EXT : constant := 16#0000_8009#;
GLX_VISUAL_CAVEAT_EXT : constant := 16#0020#;
GLX_SLOW_VISUAL_EXT : constant := 16#0000_8001#;
GLX_NON_CONFORMANT_VISUAL_EXT : constant := 16#0000_800D#;
GLX_SHARE_CONTEXT_EXT : constant := 16#0000_800A#;
GLX_VISUAL_ID_EXT : constant := 16#0000_800B#;
GLX_SCREEN_EXT : constant := 16#0000_800C#;
GLX_WINDOW_BIT_SGIX : constant := 16#0001#;
GLX_PIXMAP_BIT_SGIX : constant := 16#0002#;
GLX_RGBA_BIT_SGIX : constant := 16#0001#;
GLX_COLOR_INDEX_BIT_SGIX : constant := 16#0002#;
GLX_DRAWABLE_TYPE_SGIX : constant := 16#0000_8010#;
GLX_RENDER_TYPE_SGIX : constant := 16#0000_8011#;
GLX_X_RENDERABLE_SGIX : constant := 16#0000_8012#;
GLX_FBCONFIG_ID_SGIX : constant := 16#0000_8013#;
GLX_RGBA_TYPE_SGIX : constant := 16#0000_8014#;
GLX_COLOR_INDEX_TYPE_SGIX : constant := 16#0000_8015#;
GLX_PBUFFER_BIT_SGIX : constant := 16#0004#;
GLX_BUFFER_CLOBBER_MASK_SGIX : constant := 16#0800_0000#;
GLX_FRONT_LEFT_BUFFER_BIT_SGIX : constant := 16#0001#;
GLX_FRONT_RIGHT_BUFFER_BIT_SGIX : constant := 16#0002#;
GLX_BACK_LEFT_BUFFER_BIT_SGIX : constant := 16#0004#;
GLX_BACK_RIGHT_BUFFER_BIT_SGIX : constant := 16#0008#;
GLX_AUX_BUFFERS_BIT_SGIX : constant := 16#0010#;
GLX_DEPTH_BUFFER_BIT_SGIX : constant := 16#0020#;
GLX_STENCIL_BUFFER_BIT_SGIX : constant := 16#0040#;
GLX_ACCUM_BUFFER_BIT_SGIX : constant := 16#0080#;
GLX_SAMPLE_BUFFERS_BIT_SGIX : constant := 16#0100#;
GLX_MAX_PBUFFER_WIDTH_SGIX : constant := 16#0000_8016#;
GLX_MAX_PBUFFER_HEIGHT_SGIX : constant := 16#0000_8017#;
GLX_MAX_PBUFFER_PIXELS_SGIX : constant := 16#0000_8018#;
GLX_OPTIMAL_PBUFFER_WIDTH_SGIX : constant := 16#0000_8019#;
GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX : constant := 16#0000_801A#;
GLX_PRESERVED_CONTENTS_SGIX : constant := 16#0000_801B#;
GLX_LARGEST_PBUFFER_SGIX : constant := 16#0000_801C#;
GLX_WIDTH_SGIX : constant := 16#0000_801D#;
GLX_HEIGHT_SGIX : constant := 16#0000_801E#;
GLX_EVENT_MASK_SGIX : constant := 16#0000_801F#;
GLX_DAMAGED_SGIX : constant := 16#0000_8020#;
GLX_SAVED_SGIX : constant := 16#0000_8021#;
GLX_WINDOW_SGIX : constant := 16#0000_8022#;
GLX_PBUFFER_SGIX : constant := 16#0000_8023#;
GLX_SYNC_FRAME_SGIX : constant := 16#0000#;
GLX_SYNC_SWAP_SGIX : constant := 16#0001#;
GLX_DIGITAL_MEDIA_PBUFFER_SGIX : constant := 16#0000_8024#;
GLX_BLENDED_RGBA_SGIS : constant := 16#0000_8025#;
GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS : constant := 16#0000_8026#;
GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS : constant := 16#0000_8027#;
GLX_SAMPLE_BUFFERS_3DFX : constant := 16#0000_8050#;
GLX_SAMPLES_3DFX : constant := 16#0000_8051#;
GLX_3DFX_WINDOW_MODE_MESA : constant := 16#0001#;
GLX_3DFX_FULLSCREEN_MODE_MESA : constant := 16#0002#;
GLX_VISUAL_SELECT_GROUP_SGIX : constant := 16#0000_8028#;
GLX_SWAP_METHOD_OML : constant := 16#0000_8060#;
GLX_SWAP_EXCHANGE_OML : constant := 16#0000_8061#;
GLX_SWAP_COPY_OML : constant := 16#0000_8062#;
GLX_SWAP_UNDEFINED_OML : constant := 16#0000_8063#;
type GLXVIDEOSOURCESGIX is new X_Lib.XID;
type GLXFBCONFIGIDSGIX is new X_Lib.XID;
type GLXPBUFFERSGIX is new X_Lib.XID;
type GLXFBCONFIGSGIX is access all OpenGL.GLX.struct_GLXFBConfigRec;
type GLXEXTFUNCPTR is access procedure;
end OpenGL.GLX.EXT;
| true |
--
-- Copyright (c) 2002-2003, PI:NAME:<NAME>END_PI
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are
-- met:
--
-- * Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
-- * Redistributions in binary form must reproduce the above copyright
-- notice,
-- this list of conditions and the following disclaimer in the
-- documentation
-- and/or other materials provided with the distribution.
-- * The names of its contributors may not be used to endorse or promote
-- products derived from this software without specific prior written
-- permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-- "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES;
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
--
with OpenGL.GLX;
with X_Lib;
package OpenGL.GLX.EXT is
GLX_GLXEXT_VERSION : constant := 5;
GLX_SAMPLE_BUFFERS_ARB : constant := 100000;
GLX_SAMPLES_ARB : constant := 100001;
GLX_SAMPLE_BUFFERS_SGIS : constant := 100000;
GLX_SAMPLES_SGIS : constant := 100001;
GLX_X_VISUAL_TYPE_EXT : constant := 16#0022#;
GLX_TRANSPARENT_TYPE_EXT : constant := 16#0023#;
GLX_TRANSPARENT_INDEX_VALUE_EXT : constant := 16#0024#;
GLX_TRANSPARENT_RED_VALUE_EXT : constant := 16#0025#;
GLX_TRANSPARENT_GREEN_VALUE_EXT : constant := 16#0026#;
GLX_TRANSPARENT_BLUE_VALUE_EXT : constant := 16#0027#;
GLX_TRANSPARENT_ALPHA_VALUE_EXT : constant := 16#0028#;
GLX_NONE_EXT : constant := 16#8000#;
GLX_TRUE_COLOR_EXT : constant := 16#0000_8002#;
GLX_DIRECT_COLOR_EXT : constant := 16#0000_8003#;
GLX_PSEUDO_COLOR_EXT : constant := 16#0000_8004#;
GLX_STATIC_COLOR_EXT : constant := 16#0000_8005#;
GLX_GRAY_SCALE_EXT : constant := 16#0000_8006#;
GLX_STATIC_GRAY_EXT : constant := 16#0000_8007#;
GLX_TRANSPARENT_RGB_EXT : constant := 16#0000_8008#;
GLX_TRANSPARENT_INDEX_EXT : constant := 16#0000_8009#;
GLX_VISUAL_CAVEAT_EXT : constant := 16#0020#;
GLX_SLOW_VISUAL_EXT : constant := 16#0000_8001#;
GLX_NON_CONFORMANT_VISUAL_EXT : constant := 16#0000_800D#;
GLX_SHARE_CONTEXT_EXT : constant := 16#0000_800A#;
GLX_VISUAL_ID_EXT : constant := 16#0000_800B#;
GLX_SCREEN_EXT : constant := 16#0000_800C#;
GLX_WINDOW_BIT_SGIX : constant := 16#0001#;
GLX_PIXMAP_BIT_SGIX : constant := 16#0002#;
GLX_RGBA_BIT_SGIX : constant := 16#0001#;
GLX_COLOR_INDEX_BIT_SGIX : constant := 16#0002#;
GLX_DRAWABLE_TYPE_SGIX : constant := 16#0000_8010#;
GLX_RENDER_TYPE_SGIX : constant := 16#0000_8011#;
GLX_X_RENDERABLE_SGIX : constant := 16#0000_8012#;
GLX_FBCONFIG_ID_SGIX : constant := 16#0000_8013#;
GLX_RGBA_TYPE_SGIX : constant := 16#0000_8014#;
GLX_COLOR_INDEX_TYPE_SGIX : constant := 16#0000_8015#;
GLX_PBUFFER_BIT_SGIX : constant := 16#0004#;
GLX_BUFFER_CLOBBER_MASK_SGIX : constant := 16#0800_0000#;
GLX_FRONT_LEFT_BUFFER_BIT_SGIX : constant := 16#0001#;
GLX_FRONT_RIGHT_BUFFER_BIT_SGIX : constant := 16#0002#;
GLX_BACK_LEFT_BUFFER_BIT_SGIX : constant := 16#0004#;
GLX_BACK_RIGHT_BUFFER_BIT_SGIX : constant := 16#0008#;
GLX_AUX_BUFFERS_BIT_SGIX : constant := 16#0010#;
GLX_DEPTH_BUFFER_BIT_SGIX : constant := 16#0020#;
GLX_STENCIL_BUFFER_BIT_SGIX : constant := 16#0040#;
GLX_ACCUM_BUFFER_BIT_SGIX : constant := 16#0080#;
GLX_SAMPLE_BUFFERS_BIT_SGIX : constant := 16#0100#;
GLX_MAX_PBUFFER_WIDTH_SGIX : constant := 16#0000_8016#;
GLX_MAX_PBUFFER_HEIGHT_SGIX : constant := 16#0000_8017#;
GLX_MAX_PBUFFER_PIXELS_SGIX : constant := 16#0000_8018#;
GLX_OPTIMAL_PBUFFER_WIDTH_SGIX : constant := 16#0000_8019#;
GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX : constant := 16#0000_801A#;
GLX_PRESERVED_CONTENTS_SGIX : constant := 16#0000_801B#;
GLX_LARGEST_PBUFFER_SGIX : constant := 16#0000_801C#;
GLX_WIDTH_SGIX : constant := 16#0000_801D#;
GLX_HEIGHT_SGIX : constant := 16#0000_801E#;
GLX_EVENT_MASK_SGIX : constant := 16#0000_801F#;
GLX_DAMAGED_SGIX : constant := 16#0000_8020#;
GLX_SAVED_SGIX : constant := 16#0000_8021#;
GLX_WINDOW_SGIX : constant := 16#0000_8022#;
GLX_PBUFFER_SGIX : constant := 16#0000_8023#;
GLX_SYNC_FRAME_SGIX : constant := 16#0000#;
GLX_SYNC_SWAP_SGIX : constant := 16#0001#;
GLX_DIGITAL_MEDIA_PBUFFER_SGIX : constant := 16#0000_8024#;
GLX_BLENDED_RGBA_SGIS : constant := 16#0000_8025#;
GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS : constant := 16#0000_8026#;
GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS : constant := 16#0000_8027#;
GLX_SAMPLE_BUFFERS_3DFX : constant := 16#0000_8050#;
GLX_SAMPLES_3DFX : constant := 16#0000_8051#;
GLX_3DFX_WINDOW_MODE_MESA : constant := 16#0001#;
GLX_3DFX_FULLSCREEN_MODE_MESA : constant := 16#0002#;
GLX_VISUAL_SELECT_GROUP_SGIX : constant := 16#0000_8028#;
GLX_SWAP_METHOD_OML : constant := 16#0000_8060#;
GLX_SWAP_EXCHANGE_OML : constant := 16#0000_8061#;
GLX_SWAP_COPY_OML : constant := 16#0000_8062#;
GLX_SWAP_UNDEFINED_OML : constant := 16#0000_8063#;
type GLXVIDEOSOURCESGIX is new X_Lib.XID;
type GLXFBCONFIGIDSGIX is new X_Lib.XID;
type GLXPBUFFERSGIX is new X_Lib.XID;
type GLXFBCONFIGSGIX is access all OpenGL.GLX.struct_GLXFBConfigRec;
type GLXEXTFUNCPTR is access procedure;
end OpenGL.GLX.EXT;
|
[
{
"context": " --\r\n-- Copyright (C) John English 2000. Contact address: [email protected] --\r\n-",
"end": 751,
"score": 0.9997204542160034,
"start": 739,
"tag": "NAME",
"value": "John English"
},
{
"context": " Copyright (C) John English 2000. Contact address: [email protected] --\r\n-- This software is released under the t",
"end": 792,
"score": 0.9999290704727173,
"start": 775,
"tag": "EMAIL",
"value": "[email protected]"
},
{
"context": "changes to GNAT\r\n-- GPL 2006 compiler (thanks to John McCormick for this)\r\n-- * Added delay in message loop to av",
"end": 1544,
"score": 0.8226208686828613,
"start": 1530,
"tag": "NAME",
"value": "John McCormick"
},
{
"context": "ard output\r\n-- instead of to the file (thanks to Jeff Carter for pointing this out).\r\n-- * Panels fixed so tha",
"end": 4031,
"score": 0.9998612999916077,
"start": 4020,
"tag": "NAME",
"value": "Jeff Carter"
},
{
"context": "tion corrected and updated following comments from Moti Ben-Ari\r\n-- and Don Overheu.\r\n--\r\n-- Revision 1.2 2000",
"end": 4373,
"score": 0.9996870160102844,
"start": 4361,
"tag": "NAME",
"value": "Moti Ben-Ari"
},
{
"context": "ted following comments from Moti Ben-Ari\r\n-- and Don Overheu.\r\n--\r\n-- Revision 1.2 2000/04/18 20:00:00 je\r\n-",
"end": 4395,
"score": 0.9998449087142944,
"start": 4384,
"tag": "NAME",
"value": "Don Overheu"
}
] |
src/JEWL/jewl-windows.ads
|
leomlr/sudoku_ada-jewl
| 0 |
------------------------------------------------------------------------------
-- --
-- J E W L . W I N D O W S --
-- --
-- A package for developing GUI-based programs for beginners. --
-- --
-- This is a large package, but splitting it into child packages would --
-- require multiple generic instantiations in order to use it. --
-- --
-- Copyright (C) John English 2000. Contact address: [email protected] --
-- This software is released under the terms of the GNU General Public --
-- License and is intended primarily for educational use. Please contact --
-- the author to report bugs, suggestions and modifications. --
-- --
------------------------------------------------------------------------------
-- $Id: jewl-windows.ads 1.7 2007/01/08 17:00:00 JE Exp $
------------------------------------------------------------------------------
--
-- $Log: jewl-windows.ads $
-- Revision 1.7 2007/01/08 17:00:00 JE
-- * Fixed linker options in JEWL.Win32_Interface to accommodate changes to GNAT
-- GPL 2006 compiler (thanks to John McCormick for this)
-- * Added delay in message loop to avoid the appearance of hogging 100% of CPU
-- time
--
-- Revision 1.6 2001/11/02 16:00:00 JE
-- * Fixed canvas bug when saving an empty canvas
-- * Restore with no prior save now acts as erase
-- * Removed redundant variable declaration in Image function
--
-- Revision 1.5 2001/08/22 15:00:00 JE
-- * Minor bugfix to Get_Text for combo boxes
-- * Minor changes to documentation (including new example involving dialogs)
--
-- Revision 1.4 2001/01/25 09:00:00 je
-- Changes visible to the user:
--
-- * Added support for drawing bitmaps on canvases (Draw_Image operations
-- and new type Image_Type)
-- * Added Play_Sound
-- * Added several new operations on all windows: Get_Origin, Get_Width,
-- Get_Height, Set_Origin, Set_Size and Focus
-- * Added several functions giving screen and window dimensions: Screen_Width,
-- Screen_Height, Frame_Width, Frame_Height, Dialog_Width, Dialog_Height and
-- Menu_Height
-- * Canvases can now handle keyboard events: new constructor and Key_Code added
-- * Added procedure Play_Sound
-- * Operations "+" and "-" added for Point_Type
-- * Pens can now be zero pixels wide
-- * The absolute origin of a frame can now have be specified when the frame
-- is created
-- * Added new File_Dialog operations Add_Filter and Set_Directory
-- * Added Get_Line renames to JEWL.IO for compatibility with Ada.Text_IO
-- * Added all the Get(File,Item) operations mentioned in documentation but
-- unaccountably missing :-(
-- * Documentation updated to reflect the above changes
-- * HTML versions of public package specifications added with links from
-- main documentation pages
--
-- Other internal changes:
--
-- * Canvas fonts, pens etc. now use JEWL.Reference_Counted_Type rather than
-- reinventing this particular wheel, as do images
-- * Various minor code formatting changes: some code reordered for clarity,
-- some comments added or amended,
-- * Changes introduced in 1.2 to support GNAT 3.10 have been reversed, since
-- GNAT 3.10 still couldn't compile this code correctly... ;-(
--
-- Outstanding issues:
--
-- * Optimisation breaks the code (workaround: don't optimise)
--
-- Revision 1.3 2000/07/07 12:00:00 je
-- * JEWL.Simple_Windows added; JEWL.IO modified to use JEWL.Simple_Windows.
-- * JEWL.IO bug fix: Put_Line to file wrote newline to standard output
-- instead of to the file (thanks to Jeff Carter for pointing this out).
-- * Panels fixed so that mouse clicks are passed on correctly to subwindows.
-- * Memos fixed so that tabs are handled properly.
-- * Password feature added to editboxes.
-- * Minor typos fixed in comments within the package sources.
-- * Documentation corrected and updated following comments from Moti Ben-Ari
-- and Don Overheu.
--
-- Revision 1.2 2000/04/18 20:00:00 je
-- * Minor code changes to enable compilation by GNAT 3.10
-- * Minor documentation errors corrected
-- * Some redundant "with" clauses removed
--
-- Revision 1.1 2000/04/09 21:00:00 je
-- Initial revision
--
------------------------------------------------------------------------------
generic -- This is a generic package which must be
type Command_Type is (<>); -- instantiated with a list of possible
-- command values to be generated whenever
package JEWL.Windows is -- a window is closed, a button is clicked
-- or a menu item is selected.
----------------------------------------------------------------------------
-- Miscellaneous operations
----------------------------------------------------------------------------
procedure Show_Error (Text : in String; -- an error message
Title : in String := "Error");
function Show_Query (Text : in String; -- a yes/no query
Title : in String := "Query")
return Boolean;
procedure Show_Message (Text : in String; -- an information message
Title : in String := "Message");
procedure Play_Sound (Sound : in String); -- play a sound file
function Screen_Width return Natural; -- width of display screen
function Screen_Height return Natural; -- height of display screen
----------------------------------------------------------------------------
--
-- S U P P O R T T Y P E S
--
-- Except for Alignment_Type, these types are defined in the top-level
-- package JEWL and are renamed here for convenience:
--
-- Alignment_Type : used to specify text alignment with a window.
-- Angle_Type : an angle specified as an integral number of
-- degrees (0 to 359)
-- Colour_Type : a colour specified as an RGB value.
-- Font_Type : a font specified by a name, point size and bold
-- and italic style options.
-- Point_Type : a pair of (X,Y) coordinates within a window.
-- Point_List : an array of (X,Y) coordinate pairs.
--
----------------------------------------------------------------------------
type Alignment_Type is (Left, Centre, Right);
subtype Angle_Type is JEWL.Angle_Type;
subtype Colour_Range is JEWL.Colour_Range;
subtype Colour_Type is JEWL.Colour_Type;
subtype Font_Type is JEWL.Font_Type;
type Image_Type is private;
subtype Point_Type is JEWL.Point_Type;
subtype Point_List is JEWL.Point_List;
----------------------------------------------------------------------------
-- Renamings for our transatlantic cousins, in the hope that some day
-- they'll repay the favour/favor... ;-)
----------------------------------------------------------------------------
subtype Color_Range is Colour_Range;
subtype Color_Type is Colour_Type;
function Center return Alignment_Type renames Centre;
----------------------------------------------------------------------------
--
-- O P E R A T I O N S O N S U P P O R T T Y P E S
--
-- These are renamings of the operations defined in the parent package
-- provided for convenience.
--
-- Colour operations:
-- Light : Generate a lightened version of a colour, e.g. Light(Red).
-- Dark : Generate a darkened version of a colour, e.g. Dark(Green).
--
-- Font operations:
-- Font : Generate a font with the specified properties.
-- Name : Get the name of the font typeface.
-- Size : Get the font size in points.
-- Bold : Test if the font is bold.
-- Italic : Test if the font is italic.
--
-- Image operations:
-- Image : Load an image from a bitmap file.
-- Valid : Test if an image is valid.
-- Width : Get the width of an image.
-- Height : Get the height of an image.
--
-- Point operations:
-- Endpoint : Calculate the endpoint of a line from a starting point,
-- length and angle
-- Inside : Test if a specified point is inside a specified rectangle
-- (defined by the coordinates of two diagonally opposite
-- corners).
-- P1 + P2 : Add two points (P1.X+P2.X, P1.Y+P2.Y).
-- P1 - P2 : Subtract two points (P1.X-P2.X, P1.Y-P2.Y).
--
----------------------------------------------------------------------------
function Light (Colour : JEWL.Colour_Type) return JEWL.Colour_Type
renames JEWL.Light;
function Dark (Colour : JEWL.Colour_Type) return JEWL.Colour_Type
renames JEWL.Dark;
function Font (Name : String;
Size : Positive;
Bold : Boolean := False;
Italic : Boolean := False) return JEWL.Font_Type
renames JEWL.Font;
function Name (Font : Font_Type) return String
renames JEWL.Name;
function Size (Font : Font_Type) return Natural
renames JEWL.Size;
function Bold (Font : Font_Type) return Boolean
renames JEWL.Bold;
function Italic (Font : Font_Type) return Boolean
renames JEWL.Italic;
function Image (Name : String) return Image_Type;
function Valid (Image : Image_Type) return Boolean;
function Width (Image : Image_Type) return Natural;
function Height (Image : Image_Type) return Natural;
function Endpoint (From : JEWL.Point_Type;
Length : Positive;
Angle : JEWL.Angle_Type) return JEWL.Point_Type
renames JEWL.Endpoint;
function Inside (Point : JEWL.Point_Type;
From : JEWL.Point_Type;
To : JEWL.Point_Type) return Boolean
renames JEWL.Inside;
function "+" (P1, P2 : Point_Type) return Point_Type
renames JEWL."+";
function "-" (P1, P2 : Point_Type) return Point_Type
renames JEWL."-";
----------------------------------------------------------------------------
--
-- S U P P O R T T Y P E C O N S T A N T S
--
-- Angles : North, South, East and West
-- Colours : Black, White, Red, Green, Blue, etc.
-- Fonts : Default_Font (the default font for top-level windows) and
-- Parent_Font (the same font as a window's parent uses)
--
----------------------------------------------------------------------------
North : constant Angle_Type := 0;
South : constant Angle_Type := 180;
East : constant Angle_Type := 90;
West : constant Angle_Type := 270;
Black : constant Colour_Type := ( 0, 0, 0);
White : constant Colour_Type := (255,255,255);
Red : constant Colour_Type := (255, 0, 0);
Green : constant Colour_Type := ( 0,255, 0);
Blue : constant Colour_Type := ( 0, 0,255);
Gray : constant Colour_Type := (128,128,128);
Yellow : constant Colour_Type := (255,255, 0);
Cyan : constant Colour_Type := ( 0,255,255);
Magenta : constant Colour_Type := (255, 0,255);
Default_Font : constant Font_Type := Font("Arial",9);
Parent_Font : constant Font_Type := Font("",1);
----------------------------------------------------------------------------
--
-- W I N D O W _ T Y P E
--
-- An abstract class providing basic behaviour which all windows share.
--
----------------------------------------------------------------------------
type Window_Type is abstract tagged private;
Invalid_Window : exception; -- raised if an attempt is made to use an
-- invalid (non-open) window
----------------------------------------------------------------------------
--
-- Window operations (common to all windows):
--
-- Show (Window, -- make the window visible or invisible depending
-- Visible) -- on the value of Visible (default: True).
-- Hide (Window) -- make the window invisible.
-- Focus (Window) -- give the window the input focus.
-- Visible (Window) -- return True if the window is visible.
-- Get_Origin (Window) -- get the origin (top left point) of the
-- -- specified window.
-- Get_Width (Window) -- get the width of the specified window.
-- Get_Height (Window) -- get the height of the specified window.
-- Set_Origin (Window, -- set the origin (top left point) of the
-- Origin) -- specified window to this value.
-- Set_Size (Window, -- set the size of the specified window
-- Width, -- to this width (optional)
-- Height) -- and this height (optional).
-- Get_Font (Window) -- get the font for the specified window.
-- Set_Font (Window, -- set the font for the specified window
-- Font) -- to this one.
--
----------------------------------------------------------------------------
procedure Show (Window : in Window_Type;
Visible : in Boolean := True);
procedure Hide (Window : in Window_Type);
procedure Focus (Window : in Window_Type);
function Visible (Window : Window_Type) return Boolean;
function Get_Origin (Window : Window_Type) return Point_Type;
function Get_Width (Window : Window_Type) return Natural;
function Get_Height (Window : Window_Type) return Natural;
procedure Set_Origin (Window : in Window_Type;
Origin : in Point_Type);
procedure Set_Size (Window : in Window_Type;
Width : in Natural := 0;
Height : in Natural := 0);
function Get_Font (Window : Window_Type) return Font_Type;
procedure Set_Font (Window : in Window_Type;
Font : in Font_Type);
----------------------------------------------------------------------------
--
-- W I N D O W S U B C L A S S E S
--
-- The primary window subclasses are containers and controls. They
-- share the behaviour common to all windows (above) and provide extra
-- behaviour as well.
--
-- Container_Type : the abstract base type for all containers.
-- Control_Type : the abstract base type for all controls.
--
----------------------------------------------------------------------------
type Container_Type is abstract new Window_Type with private;
type Control_Type is abstract new Window_Type with private;
----------------------------------------------------------------------------
--
-- C O N T A I N E R S
--
-- Containers are windows which can contain other windows. All windows
-- except frames and dialogs (see below) must be contained within some
-- other container window. There are some restrictions on the types of
-- container that a window can be attached to (for example, a menu item
-- must be attached to a menu).
--
-- Most windows specify an origin, a width and a height whose coordinates
-- are taken relative to the enclosing container. Positive widths and
-- heights are absolute values, but zero and negative widths and heights
-- are interpreted as being relative to the width and height of the
-- enclosing container (so a width of 0 means the width of the enclosing
-- container, a height of -10 means 10 pixels less than the height of the
-- enclosing container).
--
-- The types of container windows available are as follows:
--
-- Frame_Type : a main window with a title bar, system menu, minimise
-- and maximise buttons, and a close button.
-- Dialog_Type : a top level window which is used for modal interaction,
-- disabling other windows while the interaction takes
-- place.
-- Panel_Type : a plain window which is used as a container for other
-- subwindows.
-- Menu_Type : a menu which can contain menu items and submenus.
--
----------------------------------------------------------------------------
type Frame_Type is new Container_Type with private;
type Dialog_Type is new Container_Type with private;
type Panel_Type is new Container_Type with private;
type Menu_Type is new Container_Type with private;
----------------------------------------------------------------------------
--
-- F R A M E S
--
-- A frame is a top level window with a title bar, system menu, minimise
-- and maximise buttons, and a close button. Closing a frame generates a
-- command. Frames are normally visible, but can be hidden if required.
-- A frame should be used as the main window for an application.
--
-- Frame operations:
--
-- Frame (Origin, -- create a frame at the specified position
-- Width, -- with the specified width
-- Height, -- and height in pixels,
-- Title, -- with the specified title in the title bar,
-- Command, -- generating this command when it is closed,
-- Font) -- using this font (default: Default_Font).
-- Frame (Width, -- create a frame with the specified width
-- Height, -- and height in pixels, placed randomly,
-- Title, -- with the specified title in the title bar,
-- Command, -- generating this command when it is closed,
-- Font) -- using this font (default: Default_Font).
--
-- Close (Frame) -- close the frame.
-- Valid (Frame) -- true until the frame is closed.
--
-- Frame_Width -- return the width of the frame border.
-- Frame_Height -- return the height of the frame border.
--
-- Next_Command -- return the next command generated by any
-- -- control in any existing frame.
-- Command_Ready -- test if there is a command pending
--
----------------------------------------------------------------------------
function Frame (Origin : Point_Type;
Width : Positive;
Height : Positive;
Title : String;
Command : Command_Type;
Font : Font_Type := Default_Font) return Frame_Type;
function Frame (Width : Positive;
Height : Positive;
Title : String;
Command : Command_Type;
Font : Font_Type := Default_Font) return Frame_Type;
procedure Close (Frame : in Frame_Type);
function Valid (Frame : Frame_Type) return Boolean;
function Frame_Width return Natural;
function Frame_Height return Natural;
function Next_Command return Command_Type;
function Command_Ready return Boolean;
----------------------------------------------------------------------------
--
-- D I A L O G S
--
-- A dialog is a top level window like a frame, but it only has a close
-- button on its title bar. Dialogs are intended for user interaction.
-- When a dialog is executed it becomes visible and all other windows
-- are disabled. Execution of a dialog continues until a command is
-- generated by closing the dialog window or by clicking on a button
-- attached to the dialog. Dialog windows do not have a menu bar.
--
-- Dialog operations:
--
-- Dialog (Width, -- create a dialog with the given width and
-- Height, -- and height in pixels,
-- Title, -- with the specified title in the title bar,
-- Command, -- generating this command when it is closed,
-- Font) -- using this font (default: Default_Font).
--
-- Execute (Dialog) -- execute a dialog and return the command code
-- -- used to exit from it.
--
-- Dialog_Width -- return the width of the dialog border.
-- Dialog_Height -- return the height of the dialog border.
--
----------------------------------------------------------------------------
function Dialog (Width : Positive;
Height : Positive;
Title : String;
Command : Command_Type;
Font : Font_Type := Default_Font) return Dialog_Type;
function Execute (Dialog : in Dialog_Type) return Command_Type;
function Dialog_Width return Natural;
function Dialog_Height return Natural;
----------------------------------------------------------------------------
--
-- P A N E L S
--
--
-- Panel operations:
--
-- Panel (Parent, -- create a panel inside a parent container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- with the specified width
-- Height, -- and the specified height, and
-- Title, -- with this title on the border (default: none)
-- Font) -- using this font (default: same as Parent).
--
----------------------------------------------------------------------------
function Panel (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Title : String := "";
Font : Font_Type := Parent_Font) return Panel_Type;
----------------------------------------------------------------------------
--
-- M E N U S
--
-- A menu is a pull-down list of items attached to a frame's menu bar.
-- The items on a menu are either menuitems (which generate a command
-- when they are selected, submenus (which display another menu when
-- selected) or separators (horizontal bars used to separate a menu
-- into subsections.
--
-- If the text label for a menu contains the character "&", the character
-- which follows is underlined and the menu can be activated by pressing
-- Alt + that character. The character "&" is not displayed.
--
-- Menu operations:
--
-- Menu (Parent, -- create a menu attached to a frame or a menu
-- Text) -- with the specified text label.
--
-- Menu_Height -- return the height of a menu bar.
--
----------------------------------------------------------------------------
function Menu (Parent : Frame_Type'Class;
Text : String) return Menu_Type;
function Menu (Parent : Menu_Type'Class;
Text : String) return Menu_Type;
function Menu_Height return Natural;
----------------------------------------------------------------------------
--
-- C O N T R O L S
--
-- Controls are windows for user interaction. They hold values (e.g. a
-- text string) which can normally be set by the user, as well as being
-- accessed and altered by the program itself. Some controls (e.g. menu
-- items) generate command values which can be used to trigger actions
-- in the program. The following operations are common to all controls:
--
-- Enable (Control, -- enable or disable the control depending on
-- Enabled) -- the value of Enabled (default: True).
-- Disable (Control) -- disable the control.
-- Enabled (Control) -- test if the control is enabled.
--
----------------------------------------------------------------------------
procedure Enable (Control : in Control_Type;
Enabled : in Boolean := True);
procedure Disable (Control : in Control_Type);
function Enabled (Control : Control_Type) return Boolean;
----------------------------------------------------------------------------
--
-- The types of control available are as follows:
--
-- Menuitem_Type : controls which can appear on pull-down menus
-- Text_Control_Type : controls containing with a single-line text string
-- Multiline_Type : controls containing multiple text strings
-- Canvas_Type : a plain window for drawing arbitrary shapes on
--
----------------------------------------------------------------------------
type Text_Control_Type is abstract new Control_Type with private;
type Multiline_Type is abstract new Control_Type with private;
type Canvas_Type is new Control_Type with private;
----------------------------------------------------------------------------
--
-- T E X T C O N T R O L S
--
-- Text controls include a single-line text string. The following
-- operations are common to all text controls:
--
-- Get_Length (Control) -- get the length of the text associated with the
-- -- control.
-- Get_Text (Control) -- get the text associated with the control as a
-- -- string of indefinite size.
-- Get_Text (Control, -- get the text associated with the control into
-- Text, -- this fixed-size string variable
-- Length) -- and set this integer variable to the actual
-- -- number of characters copied.
-- Set_Text (Control, -- set the text associated with the control.
-- Text) -- to the specified new text value.
--
----------------------------------------------------------------------------
function Get_Length (Control : Text_Control_Type) return Natural;
function Get_Text (Control : Text_Control_Type) return String;
procedure Get_Text (Control : in Text_Control_Type;
Text : out String;
Length : out Natural);
procedure Set_Text (Control : in Text_Control_Type;
Text : in String);
----------------------------------------------------------------------------
--
-- The types of text control available are as follows:
--
-- Button_Type : a pushbutton which generates a command code.
-- Label_Type : a static non-interactive label.
-- Editbox_Type : a single-line edit control for text input.
--
-- There is a further subclass of text control, as follows:
--
-- Boolean_Control_Type : a text control with an associated Boolean state
--
----------------------------------------------------------------------------
type Button_Type is new Text_Control_Type with private;
type Label_Type is new Text_Control_Type with private;
type Editbox_Type is new Text_Control_Type with private;
type Boolean_Control_Type is abstract new Text_Control_Type with private;
----------------------------------------------------------------------------
--
-- B U T T O N S
--
-- Buttons are rectangular labelled controls which generate a command
-- code when pressed. "Default" buttons are displayed with a heavier
-- border and respond when the Enter key is pressed.
--
-- Button operations:
--
-- Button (Parent, -- create a button in a parent container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- with the specified width
-- Height, -- and the specified height,
-- Text, -- labelled with the specified text,
-- Command, -- generating this command when it is pressed,
-- Default, -- set up as a "default" button (default: False),
-- Font) -- using this font (default: same as Parent).
--
----------------------------------------------------------------------------
function Button (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Text : String;
Command : Command_Type;
Default : Boolean := False;
Font : Font_Type := Parent_Font) return Button_Type;
----------------------------------------------------------------------------
--
-- L A B E L S
--
-- A label is a static text control that can be used to label other
-- controls. Labels do not respond to user interaction, but their
-- values can be read and altered by the program in the same way as
-- any other text control.
--
-- Label operations:
--
-- Label (Parent, -- create a label inside a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- with the specified width
-- Height, -- and the specified height, and
-- Text, -- labelled with the specified text
-- Align, -- aligned left, right or centre (default: Left),
-- Font) -- using this font (default: same as Parent).
--
----------------------------------------------------------------------------
function Label (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Text : String;
Align : Alignment_Type := Left;
Font : Font_Type := Parent_Font) return Label_Type;
----------------------------------------------------------------------------
--
-- E D I T B O X E S
--
-- An editbox is a text control containing a single line of text whose
-- value can be edited by the user.
--
-- Editbox operations:
--
-- Editbox (Parent, -- create an editbox inside a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- with the specified width
-- Height, -- and the specified height, and
-- Text, -- initialised with the specified text,
-- Password, -- optionally set up as a password editbox,
-- Font) -- using this font (default: same as Parent).
--
-- Modified (Editbox) -- test if the editbox has been modified by the
-- -- user.
--
----------------------------------------------------------------------------
function Editbox (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Text : String := "";
Password : Boolean := False;
Font : Font_Type := Parent_Font) return Editbox_Type;
function Modified (Editbox : Editbox_Type) return Boolean;
----------------------------------------------------------------------------
--
-- B O O L E A N C O N T R O L S
--
-- Boolean controls are text controls which can be toggled between two
-- states (checked or unchecked). The following operations are common
-- to all Boolean controls:
--
-- Get_State (Control) -- get the current state of the control
-- Set_State (Control, -- set the current state of the control
-- State) -- to the specified value
--
----------------------------------------------------------------------------
function Get_State (Control : Boolean_Control_Type) return Boolean;
procedure Set_State (Control : in Boolean_Control_Type;
State : in Boolean);
----------------------------------------------------------------------------
--
-- The types of Boolean controls available are as follows:
--
-- Checkbox_Type : a checkbox which can be checked or unchecked.
-- Radiobutton_Type : a radio button which can be checked or unchecked.
--
----------------------------------------------------------------------------
type Menuitem_Type is new Boolean_Control_Type with private;
type Checkbox_Type is new Boolean_Control_Type with private;
type Radiobutton_Type is new Boolean_Control_Type with private;
----------------------------------------------------------------------------
--
-- M E N U I T E M S
--
-- Menu items can only be attached to menus. When a menu is clicked, a
-- pull-down menu appears which can consist of menu items (which generate
-- a command when clicked) or further menus.
--
-- Each menu and menu item has a text label in which the character "&"
-- is treated specially. "&" will not be displayed, but the following
-- character (e.g. 'X') will be underlined to indicate that it can be
-- selected by pressing Alt + 'X' when the menu is visible.
--
-- Menuitem operations:
--
-- Menuitem (Parent, -- create a menu item attached to a parent menu
-- Text, -- with this text label,
-- Command) -- generating this command code when selected
--
-- Separator (Parent) -- create a separator (an inactive horizontal
-- -- bar) attached to a parent menu
--
----------------------------------------------------------------------------
function Menuitem (Parent : Menu_Type'Class;
Text : String;
Command : Command_Type) return Menuitem_Type;
function Separator (Parent : Menu_Type'Class) return Menuitem_Type;
----------------------------------------------------------------------------
-- Menu items behave slightly differently to other controls, so the
-- following operations are overridden:
--
procedure Enable (Control : in Menuitem_Type;
Enabled : in Boolean := True);
function Enabled (Control : Menuitem_Type) return Boolean;
function Get_Length (Control : Menuitem_Type) return Natural;
function Get_Text (Control : Menuitem_Type) return String;
procedure Set_Text (Control : in Menuitem_Type;
Text : in String);
function Get_State (Control : Menuitem_Type) return Boolean;
procedure Set_State (Control : in Menuitem_Type;
State : in Boolean);
----------------------------------------------------------------------------
--
-- C H E C K B O X E S
--
-- A checkbox is a labelled control with a left-aligned box that can be
-- checked or unchecked. Clicking on a checkbox (or pressing Space when
-- it is selected) toggles the checkbox between the checked and unchecked
-- states.
--
-- Checkbox operations:
--
-- Checkbox (Parent, -- create a checkbox in a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- with the specified width
-- Height, -- and the specified height, and
-- Text, -- labelled with the specified text, and
-- Checked, -- set to this initial state (default: False),
-- Font) -- using this font (default: same as Parent).
--
----------------------------------------------------------------------------
function Checkbox (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Text : String;
Checked : Boolean := False;
Font : Font_Type := Parent_Font) return Checkbox_Type;
----------------------------------------------------------------------------
--
-- R A D I O B U T T O N S
--
-- A radiobutton is a Boolean control with a left-aligned box that can be
-- checked or unchecked. Radiobuttons attached to the same container form
-- a group. Clicking on an unchecked radiobutton will set the radiobutton
-- to the checked state and will also uncheck the other radiobuttons which
-- belong to the same group (i.e. which are attached to the same container).
-- Unlike a checkbox, a radiobutton cannot be turned off by clicking on it;
-- you can only uncheck a radiobutton by checking another one in the same
-- group.
--
-- Radiobutton operations:
--
-- Radiobutton (Parent, -- create a radiobutton in a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- with the specified width
-- Height, -- and the specified height, and
-- Text, -- labelled with the specified text, and
-- Checked, -- set to this initial state (default: False),
-- Font) -- using this font (default: Default_Font).
--
----------------------------------------------------------------------------
function Radiobutton (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Text : String;
Checked : Boolean := False;
Font : Font_Type := Parent_Font)
return Radiobutton_Type;
----------------------------------------------------------------------------
--
-- M U L T I L I N E C O N T R O L S
--
-- Multiline controls contain multiple lines of text numbered from 1
-- upwards. Individual lines can be accessed by specifying a line
-- number. The user can select a particular line by clicking on it
-- with the mouse or using the keyboard arrow keys when the control
-- is selected. Specifying the line number to access as 0 will access
-- the currently selected line. If no line is selected, the current
-- line number will be reported as 0 but its contents can still be
-- accessed . A Constraint_Error will be raised if an attempt is made
-- to access a line beyond the last one.
--
-- The following operations are common to all multiline controls, but
-- their precise effects vary slightly according to the actual type of
-- the control (see below):
--
-- Get_Count (Control) -- get the number of lines of text in the control.
-- Get_Line (Control) -- get the number of the currently selected line.
-- Get_Length (Control, -- get the length of the specified line
-- Line) -- (default: current line).
-- Get_Text (Control, -- get the text of the specified line as a string
-- Line) -- of indefinite length (default: current line).
--
-- Get_Text (Control, -- get the text of the control
-- Line, -- from the specified line (default: current line)
-- Text, -- into a fixed-size string variable, together
-- Length) -- with the number of characters transferred.
-- Set_Text (Control, -- set the text of the control
-- Line, -- at the specified line
-- Text) -- to the specified value.
--
-- Select_Line (Control, -- select the line at the specified line number
-- Line) -- (default: 0, meaning deselect).
-- Append_Line (Control, -- append a line to the end of the control, where
-- Text) -- this is the text to append.
-- Insert_Line (Control, -- insert a new line above the specified
-- Line, -- line number, where
-- Text) -- this is the text to insert.
-- Delete_Line (Control, -- delete the specified line.
-- Line)
-- Delete_All (Control) -- delete all lines.
--
----------------------------------------------------------------------------
function Get_Count (Control : Multiline_Type) return Natural is abstract;
function Get_Line (Control : Multiline_Type) return Natural is abstract;
function Get_Length (Control : Multiline_Type;
Line : Natural := 0) return Natural is abstract;
function Get_Text (Control : Multiline_Type;
Line : Natural := 0) return String is abstract;
procedure Get_Text (Control : in Multiline_Type;
Line : in Natural := 0;
Text : out String;
Length : out Natural);
procedure Set_Text (Control : in Multiline_Type;
Text : in String;
Line : in Natural := 0) is abstract;
procedure Select_Line (Control : in Multiline_Type;
Line : in Natural := 0) is abstract;
procedure Append_Line (Control : in Multiline_Type;
Text : in String) is abstract;
procedure Insert_Line (Control : in Multiline_Type;
Text : in String;
Line : in Natural := 0) is abstract;
procedure Delete_Line (Control : in Multiline_Type;
Line : in Natural := 0) is abstract;
procedure Delete_All (Control : in Multiline_Type) is abstract;
----------------------------------------------------------------------------
--
-- The types of multiline controls available are as follows:
--
-- Listbox_Type : a list of text items in a scrollable window
-- Combobox_Type : an editbox in combination with a drop-down list box
-- Memo_Type : a multi-line text editor
--
----------------------------------------------------------------------------
type Listbox_Type is new Multiline_Type with private;
type Combobox_Type is new Multiline_Type with private;
type Memo_Type is new Multiline_Type with private;
----------------------------------------------------------------------------
--
-- L I S T B O X E S
--
-- A listbox is a list of lines of text (initially empty). The lines are
-- sorted into ascending order by default, but can be left unsorted if
-- required. For a sorted list, the position at which a new line is added
-- will be ignored, with the new line being inserted at the appropriate
-- position according to its value. When no line has been selected, the
-- contents of the current line will be reported as an empty string ("").
--
-- Listbox operations:
--
-- Listbox (Parent, -- create a listbox inside a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- the specified width
-- Height, -- and the specified height, using
-- Font) -- this font (default: same as Parent).
--
----------------------------------------------------------------------------
function Listbox (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Font : Font_Type := Parent_Font) return Listbox_Type;
----------------------------------------------------------------------------
--
-- C O M B O B O X E S
--
-- A combobox consists of an edit control together with a drop-down list
-- (effectively a combination of an editbox and a listbox). The currently
-- selected line is displayed in the edit control, and you can specify
-- whether the user is able to manually edit this value. If not, only
-- the values in the drop-down list can be selected.
--
-- If the contents of the edit control match one of the values in the list,
-- the position of the corresponding line in the list is reported as the
-- number of the currently selected line. Otherwise, the number of the
-- current line is reported as 0. Accessing the value of the current line
-- (line 0) will report the current value of the edit control.
--
-- Combobox operations:
--
-- Combobox (Parent, -- create a combobox inside a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- with the specified width, whose value can
-- Editable, -- be manually edited (default: True),
-- Font) -- using this font (default: same as Parent).
--
----------------------------------------------------------------------------
function Combobox (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Editable : Boolean := True;
Font : Font_Type := Parent_Font) return Combobox_Type;
----------------------------------------------------------------------------
--
-- M E M O S
--
-- A memo is a simple multi-line text editor similar to Windows Notepad.
-- There are several memo-specific operations in addition to the standard
-- operations on multi-line controls. The user can select a block of text
-- spanning multiple lines using the mouse (or by moving the cursor with
-- the Shift key held down) and there are operations to fetch, replace
-- and delete the selected text, find the line and column position of
-- the start and end of the selected text, and get its total length (which
-- will include one or more additional end-of-line characters if the text
-- spans more than one line).
--
-- Memo operations:
--
-- Memo (Parent, -- create a memo inside a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- the specified width
-- Height) -- and the specified height
-- Font) -- using this font (default: same as Parent).
--
-- Get_Column (Memo) -- get the column position of the current
-- -- selection.
-- Modified (Memo) -- test if the user has modified the memo.
-- Cut_Selection (Memo) -- cut the current selection to the clipboard.
-- Copy_Selection (Memo) -- copy the current selection to the clipboard.
-- Paste_Selection (Memo) -- paste the clipboard contents to the memo,
-- -- replacing the current selection.
-- Undo_Change (Memo) -- undo the user's last change to the memo.
-- Show_Selection (Memo) -- scroll the memo so that the current position
-- -- is visible on the screen.
--
----------------------------------------------------------------------------
function Memo (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Font : Font_Type := Parent_Font) return Memo_Type;
function Get_Column (Memo : Memo_Type) return Natural;
function Modified (Memo : Memo_Type) return Boolean;
procedure Cut_Selection (Memo : in Memo_Type);
procedure Copy_Selection (Memo : in Memo_Type);
procedure Paste_Selection (Memo : in Memo_Type);
procedure Undo_Change (Memo : in Memo_Type);
procedure Show_Selection (Memo : in Memo_Type);
----------------------------------------------------------------------------
-- Most operations on multiline types are implemented in different ways,
-- so they are overridden here:
--
function Get_Count (Control : Listbox_Type) return Natural;
function Get_Count (Control : Combobox_Type) return Natural;
function Get_Count (Control : Memo_Type) return Natural;
function Get_Line (Control : Listbox_Type) return Natural;
function Get_Line (Control : Combobox_Type) return Natural;
function Get_Line (Control : Memo_Type) return Natural;
function Get_Length (Control : Listbox_Type;
Line : Natural := 0) return Natural;
function Get_Length (Control : Combobox_Type;
Line : Natural := 0) return Natural;
function Get_Length (Control : Memo_Type;
Line : Natural := 0) return Natural;
function Get_Text (Control : Listbox_Type;
Line : Natural := 0) return String;
function Get_Text (Control : Combobox_Type;
Line : Natural := 0) return String;
function Get_Text (Control : Memo_Type;
Line : Natural := 0) return String;
procedure Set_Text (Control : in Listbox_Type;
Text : in String;
Line : in Natural := 0);
procedure Set_Text (Control : in Combobox_Type;
Text : in String;
Line : in Natural := 0);
procedure Set_Text (Control : in Memo_Type;
Text : in String;
Line : in Natural := 0);
procedure Select_Line (Control : in Listbox_Type;
Line : in Natural := 0);
procedure Select_Line (Control : in Combobox_Type;
Line : in Natural := 0);
procedure Select_Line (Control : in Memo_Type;
Line : in Natural := 0);
procedure Append_Line (Control : in Listbox_Type;
Text : in String);
procedure Append_Line (Control : in Combobox_Type;
Text : in String);
procedure Append_Line (Control : in Memo_Type;
Text : in String);
procedure Insert_Line (Control : in Listbox_Type;
Text : in String;
Line : in Natural := 0);
procedure Insert_Line (Control : in Combobox_Type;
Text : in String;
Line : in Natural := 0);
procedure Insert_Line (Control : in Memo_Type;
Text : in String;
Line : in Natural := 0);
procedure Delete_Line (Control : in Listbox_Type;
Line : in Natural := 0);
procedure Delete_Line (Control : in Combobox_Type;
Line : in Natural := 0);
procedure Delete_Line (Control : in Memo_Type;
Line : in Natural:= 0);
procedure Delete_All (Control : in Listbox_Type);
procedure Delete_All (Control : in Combobox_Type);
procedure Delete_All (Control : in Memo_Type);
----------------------------------------------------------------------------
--
-- C A N V A S E S
--
-- A canvas is a blank rectangle for drawing on which can optionally
-- be set to generate a command code when the mouse is clicked on it.
-- A canvas has an associated font (the same as the parent window by
-- default), a background colour (initially white), a pen for drawing
-- lines (initially black, one pixel wide) and a fill colour used to
-- colour closed shapes (initially white).
--
-- The freedom of expression available with canvases make these the
-- most complex component of all, with over 20 available operations.
-- There are operations to draw lines, rectangles (with or without
-- rounded corners), ellipses, circles, line sequences, polygons and
-- text. The font, pen size and colour and fill colour can be changed
-- at any time any will affect all subsequent drawing operations (but
-- everything drawn previously will be unaffected). Rectangles can be
-- given rounded corners by specifying a rounding factor, which gives
-- the X and Y offsets from the corners to the points where the rounded
-- corner begins.
--
-- Anything drawn on a canvas will normally stay there, but the canvas
-- can be erased or the current state of a drawing can be saved and then
-- restored later (which provides a basic "undo" facility). For example,
-- a clock can be drawn by drawing a circle, saving the drawing, and then
-- drawing the hands. To change the position of the hands, restore the
-- saved drawing (thus erasing the hands) and then redraw the hands in
-- the new position. You can only save one copy of the drawing, so if you
-- save it a second time you will lose the previous saved copy.
--
-- A canvas can be set up to generate a command when the mouse button
-- is pressed inside its borders. There are operations to get the
-- position at which the button was pressed, to get the current mouse
-- position, and to test if the mouse button is still down and whether
-- the mouse has been moved. As long as the button is down, the mouse
-- position will be tracked even if the mouse is moved outside the canvas.
-- You can track the mouse visually by saving the drawing when the mouse
-- is first pressed, then restoring the drawing and drawing a new line
-- from the initial mouse position to the current one.
--
-- Canvas operations:
--
-- Canvas (Parent, -- create a canvas inside a container, with
-- Origin, -- top left coordinates relative to Parent,
-- Width, -- the specified width
-- Height, -- and the specified height, using
-- Font) -- this font (default: same as Parent).
--
-- Canvas (Parent, -- create a canvas inside a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- the specified width
-- Height, -- and the specified height,
-- Command, -- which generates this command code, and
-- Font) -- uses this font (default: same as Parent).
--
-- Canvas (Parent, -- create a canvas inside a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- the specified width
-- Height, -- and the specified height,
-- Command, -- which generates this command code, and
-- Keypress, -- this one when a key is pressed, and
-- Font) -- uses this font (default: same as Parent).
--
-- Set_Colour (Canvas, -- set the background colour for a canvas
-- Colour) -- using this colour (default: white)
--
-- Erase (Canvas) -- erase the drawing in a canvas. This will
-- -- also erase any saved drawing.
-- Save (Canvas) -- save the current drawing.
-- Restore (Canvas) -- restore a saved drawing, erasing anything
-- -- drawn since. If the drawing has never been
-- -- saved, or the window has been erased using
-- -- Erase, this will do nothing.
-- Set_Font (Canvas, -- set a new font for all subsequent text
-- Font) -- drawn on the canvas.
-- Set_Pen (Canvas, -- set the pen used to draw lines on the
-- Colour, -- canvas to this colour (default: black)
-- Width) -- and thickness (default: 1 pixel).
-- Set_Fill (Canvas, -- set the colour used to fill subsequent
-- Colour) -- closed shapes drawn on the canvas.
-- Set_Fill (Canvas) -- clear the colour used to fill subsequent
-- -- closed shapes drawn on the canvas.
-- Draw_Text (Canvas, -- draw a text string on the canvas
-- From, -- from this top-left point, where
-- Text) -- this is the text to be drawn.
-- Draw_Text (Canvas, -- draw a text string on the canvas
-- From, -- in a rectangle between this point
-- To, -- and this one, where
-- Text, -- this is the text to be drawn
-- Align) -- with this alignment (default: left).
-- Draw_Text (Canvas, -- draw a text string on the canvas
-- From, -- in a rectangle starting at this point
-- Width, -- with this width
-- Height, -- and this height, where
-- Text, -- this is the text to be drawn
-- Align) -- with this alignment (default: left).
--
-- Draw_Line (Canvas, -- draw a line on the canvas
-- From, -- from this point
-- To) -- to this one.
-- Draw_Line (Canvas, -- draw a line on the canvas
-- From, -- from this point
-- Length, -- for this length
-- Angle) -- at this angle.
-- Draw_Line_List (Canvas, -- draw lines on the canvas connecting
-- Points) -- the points in this list.
--
-- Draw_Rectangle (Canvas, -- draw a rectangle on the canvas
-- From, -- from this corner point
-- To, -- to this diagonally-opposite point
-- Rounding) -- with corners rounded this much
-- -- (default: no rounding).
-- Draw_Rectangle (Canvas, -- draw a rectangle on the canvas
-- From, -- from this top-left point
-- Width, -- with this width
-- Height, -- and this height
-- Rounding) -- with corners rounded this much
-- -- (default: no rounding).
--
-- Draw_Ellipse (Canvas, -- draw an ellipse on the canvas
-- From, -- bounded by a rectangle from this point
-- To) -- to this point.
-- Draw_Ellipse (Canvas, -- draw an ellipse on the canvas
-- From, -- bounded by a rectangle from this point
-- Width, -- with this width.
-- Height) -- and this height
-- Draw_Circle (Canvas, -- draw a circle on the canvas
-- Centre, -- with this centre point
-- Radius) -- and this radius.
--
-- Draw_Polygon (Canvas, -- draw a polygon on the canvas
-- Points) -- with vertices at these points.
--
-- Draw_Image (Canvas, -- draw an image on the canvas
-- From, -- from this point
-- Image) -- using this image object.
-- Draw_Image (Canvas, -- draw an image on the canvas
-- From, -- from this point
-- To, -- to this one (stretching the image to fit)
-- Image) -- using this image object.
-- Draw_Image (Canvas, -- draw an image on the canvas
-- From, -- from this point
-- Width, -- with this width
-- Height, -- and this height
-- Image) -- using this image object.
--
-- Mouse_Down (Canvas) -- test if the left mouse button is down.
-- Mouse_Moved (Canvas) -- test if the mouse has been moved.
-- Start_Point (Canvas) -- get the point where the mouse button
-- -- was first pressed.
-- End_Point (Canvas) -- get the point where the mouse is now
-- -- (or its final position when the left
-- -- button was released).
-- Key_Code (Canvas) -- get the character code for the last
-- -- key pressed.
--
----------------------------------------------------------------------------
function Canvas (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Font : Font_Type := Parent_Font) return Canvas_Type;
function Canvas (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Command : Command_Type;
Font : Font_Type := Parent_Font) return Canvas_Type;
function Canvas (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Command : Command_Type;
Keypress : Command_Type;
Font : Font_Type := Parent_Font) return Canvas_Type;
procedure Set_Colour (Canvas : in Canvas_Type;
Colour : in Colour_Type := White);
procedure Erase (Canvas : in Canvas_Type);
procedure Save (Canvas : in Canvas_Type);
procedure Restore (Canvas : in Canvas_Type);
procedure Set_Font (Canvas : in Canvas_Type;
Font : in Font_Type);
procedure Set_Pen (Canvas : in Canvas_Type;
Colour : in Colour_Type := Black;
Width : in Natural := 1);
procedure Set_Fill (Canvas : in Canvas_Type;
Colour : in Colour_Type);
procedure Set_Fill (Canvas : in Canvas_Type);
procedure Draw_Text (Canvas : in Canvas_Type;
From : in Point_Type;
Text : in String);
procedure Draw_Text (Canvas : in Canvas_Type;
From : in Point_Type;
To : in Point_Type;
Text : in String;
Align : in Alignment_Type := Left);
procedure Draw_Text (Canvas : in Canvas_Type;
From : in Point_Type;
Width : in Integer;
Height : in Integer;
Text : in String;
Align : in Alignment_Type := Left);
procedure Draw_Line (Canvas : in Canvas_Type;
From : in Point_Type;
To : in Point_Type);
procedure Draw_Line (Canvas : in Canvas_Type;
From : in Point_Type;
Length : in Positive;
Angle : in Angle_Type);
procedure Draw_Line_List
(Canvas : in Canvas_Type;
Points : in Point_List);
procedure Draw_Rectangle
(Canvas : in Canvas_Type;
From : in Point_Type;
To : in Point_Type;
Rounding : in Point_Type := (0,0));
procedure Draw_Rectangle
(Canvas : in Canvas_Type;
From : in Point_Type;
Width : in Positive;
Height : in Positive;
Rounding : in Point_Type := (0,0));
procedure Draw_Ellipse
(Canvas : in Canvas_Type;
From : in Point_Type;
To : in Point_Type);
procedure Draw_Ellipse
(Canvas : in Canvas_Type;
From : in Point_Type;
Width : in Positive;
Height : in Positive);
procedure Draw_Circle
(Canvas : in Canvas_Type;
Centre : in Point_Type;
Radius : in Positive);
procedure Draw_Polygon
(Canvas : in Canvas_Type;
Points : in Point_List);
procedure Draw_Image (Canvas : in Canvas_Type;
From : in Point_Type;
Image : in Image_Type);
procedure Draw_Image (Canvas : in Canvas_Type;
From : in Point_Type;
To : in Point_Type;
Image : in Image_Type);
procedure Draw_Image (Canvas : in Canvas_Type;
From : in Point_Type;
Width : in Natural;
Height : in Natural;
Image : in Image_Type);
function Start_Point (Canvas : Canvas_Type) return Point_Type;
function End_Point (Canvas : Canvas_Type) return Point_Type;
function Mouse_Down (Canvas : Canvas_Type) return Boolean;
function Mouse_Moved (Canvas : Canvas_Type) return Boolean;
function Key_Code (Canvas : Canvas_Type) return Character;
----------------------------------------------------------------------------
--
-- C O M M O N D I A L O G S
--
-- Common dialogs are pre-packaged dialog widgets which are not treated
-- as normal windows (although they are made to look similar for ease of
-- use).
--
-- Common dialog operations (common to all dialogs):
--
-- Execute (Dialog) -- execute the dialog and return True if the OK
-- -- button was used to close the dialog and False
-- -- otherwise.
--
----------------------------------------------------------------------------
type Common_Dialog_Type is abstract tagged private;
function Execute (Dialog : Common_Dialog_Type) return Boolean;
----------------------------------------------------------------------------
--
-- C O M M O N D I A L O G S U B C L A S S E S
--
-- The available dialog subclasses are colour, font and file dialogs.
--
-- Colour_Dialog_Type : a dialog to allow the user to select a colour.
-- Font_Dialog_Type : a dialog to allow the user to select a font.
-- File_Dialog_Type : a dialog to allow the user to select a file name.
--
----------------------------------------------------------------------------
type Colour_Dialog_Type is new Common_Dialog_Type with private;
type Font_Dialog_Type is new Common_Dialog_Type with private;
type File_Dialog_Type is abstract new Common_Dialog_Type with private;
----------------------------------------------------------------------------
--
-- C O L O U R D I A L O G S
--
-- Colour dialogs allow the user to select or create a colour.
--
-- Colour dialog operations:
--
-- Colour_Dialog -- create a colour dialog.
-- Set_Colour (Dialog, -- set the initial colour displayed in the
-- Colour) -- dialog to this colour.
-- Get_Colour (Dialog) -- get the colour contained in the dialog.
--
----------------------------------------------------------------------------
function Colour_Dialog return Colour_Dialog_Type;
procedure Set_Colour (Dialog : in Colour_Dialog_Type;
Colour : in Colour_Type);
function Get_Colour (Dialog : in Colour_Dialog_Type) return Colour_Type;
----------------------------------------------------------------------------
--
-- F O N T D I A L O G S
--
-- Font dialogs allow the user to select a font.
--
-- Font dialog operations:
--
-- Font_Dialog -- create a font dialog.
-- Set_Font (Dialog, -- set the initial font displayed in the
-- Font) -- dialog to this font.
-- Get_Font (Dialog) -- get the font contained in the dialog.
--
----------------------------------------------------------------------------
function Font_Dialog return Font_Dialog_Type;
procedure Set_Font (Dialog : in Font_Dialog_Type;
Font : in Font_Type);
function Get_Font (Dialog : in Font_Dialog_Type) return Font_Type;
----------------------------------------------------------------------------
--
-- F I L E D I A L O G S
--
-- File dialogs allow the user to select or enter a file name. This is an
-- abstract type which is further subclassed below.
--
-- File dialog operations (common to all file dialogs):
--
-- Set_Name (Dialog, -- set the initial file name displayed in the
-- Name) -- dialog to this string.
-- Get_Name (Dialog) -- get the file name contained in the dialog.
-- Add_Filter (Dialog, -- add a file type filter to the dialog
-- Text, -- with this description
-- Filter) -- to match this wildcard specification.
-- Set_Directory (Dialog, -- set the initial directory for the dialog
-- Name) -- to this directory.
--
----------------------------------------------------------------------------
procedure Set_Name (Dialog : in File_Dialog_Type;
Name : in String);
function Get_Name (Dialog : in File_Dialog_Type) return String;
procedure Add_Filter (Dialog : in File_Dialog_Type;
Text : in String;
Filter : in String);
procedure Set_Directory (Dialog : in File_Dialog_Type;
Name : in String);
----------------------------------------------------------------------------
--
-- O P E N D I A L O G S
--
-- Open dialogs allow the user to select or enter a file name for use as
-- an input file. The file name selected must be the name of an existing
-- file.
--
-- Open dialog operations:
--
-- Open_Dialog (Title) -- create an open file dialog with this title.
--
----------------------------------------------------------------------------
type Open_Dialog_Type is new File_Dialog_Type with private;
function Open_Dialog (Title : String) return Open_Dialog_Type;
----------------------------------------------------------------------------
--
-- S A V E D I A L O G S
--
-- Save dialogs allow the user to select or enter a file name for use as
-- an output file. If the Create parameter to the constructor function
-- below is True (as it is by default) and an existing file is selected,
-- the user will be asked if the file should be overwritten. If it is
-- False and the file does not exist, the user will be asked if it should
-- be created.
--
-- Save dialog operations:
--
-- Save_Dialog (Title, -- create a save file dialog with this title
-- Create) -- which will prompt the user as described above.
--
----------------------------------------------------------------------------
type Save_Dialog_Type is new File_Dialog_Type with private;
function Save_Dialog (Title : String;
Create : Boolean := True) return Save_Dialog_Type;
----------------------------------------------------------------------------
-- Renamings for our transatlantic cousins, in the hope that some day
-- they'll repay the favour/favor...
----------------------------------------------------------------------------
procedure Set_Color (Canvas : in Canvas_Type;
Colour : in Colour_Type := White) renames Set_Colour;
subtype Color_Dialog_Type is Colour_Dialog_Type;
function Color_Dialog return Colour_Dialog_Type renames Colour_Dialog;
procedure Set_Color (Dialog : in Colour_Dialog_Type;
Colour : in Colour_Type) renames Set_Colour;
function Get_Color (Dialog : in Colour_Dialog_Type) return Colour_Type
renames Get_Colour;
private -- and deliberately uninformative!
type Window_Type is abstract tagged
record
Internals : JEWL.Controlled_Type; -- see package JEWL
end record;
type Container_Type is abstract new Window_Type with null record;
type Control_Type is abstract new Window_Type with null record;
type Frame_Type is new Container_Type with null record;
type Dialog_Type is new Container_Type with null record;
type Panel_Type is new Container_Type with null record;
type Menu_Type is new Container_Type with null record;
type Text_Control_Type is abstract new Control_Type with null record;
type Multiline_Type is abstract new Control_Type with null record;
type Canvas_Type is new Control_Type with null record;
type Button_Type is new Text_Control_Type with null record;
type Label_Type is new Text_Control_Type with null record;
type Editbox_Type is new Text_Control_Type with null record;
type Boolean_Control_Type is abstract new Text_Control_Type with null record;
type Menuitem_Type is new Boolean_Control_Type with null record;
type Checkbox_Type is new Boolean_Control_Type with null record;
type Radiobutton_Type is new Boolean_Control_Type with null record;
type Listbox_Type is new Multiline_Type with null record;
type Combobox_Type is new Multiline_Type with null record;
type Memo_Type is new Multiline_Type with null record;
type Common_Dialog_Type is abstract tagged
record
Internals : JEWL.Controlled_Type; -- see package JEWL
end record;
type Colour_Dialog_Type is new Common_Dialog_Type with null record;
type Font_Dialog_Type is new Common_Dialog_Type with null record;
type File_Dialog_Type is abstract new Common_Dialog_Type with null record;
type Open_Dialog_Type is new File_Dialog_Type with null record;
type Save_Dialog_Type is new File_Dialog_Type with null record;
type Image_Type is
record
Internals : JEWL.Controlled_Type; -- see package JEWL
end record;
end JEWL.Windows;
|
30622
|
------------------------------------------------------------------------------
-- --
-- J E W L . W I N D O W S --
-- --
-- A package for developing GUI-based programs for beginners. --
-- --
-- This is a large package, but splitting it into child packages would --
-- require multiple generic instantiations in order to use it. --
-- --
-- Copyright (C) <NAME> 2000. Contact address: <EMAIL> --
-- This software is released under the terms of the GNU General Public --
-- License and is intended primarily for educational use. Please contact --
-- the author to report bugs, suggestions and modifications. --
-- --
------------------------------------------------------------------------------
-- $Id: jewl-windows.ads 1.7 2007/01/08 17:00:00 JE Exp $
------------------------------------------------------------------------------
--
-- $Log: jewl-windows.ads $
-- Revision 1.7 2007/01/08 17:00:00 JE
-- * Fixed linker options in JEWL.Win32_Interface to accommodate changes to GNAT
-- GPL 2006 compiler (thanks to <NAME> for this)
-- * Added delay in message loop to avoid the appearance of hogging 100% of CPU
-- time
--
-- Revision 1.6 2001/11/02 16:00:00 JE
-- * Fixed canvas bug when saving an empty canvas
-- * Restore with no prior save now acts as erase
-- * Removed redundant variable declaration in Image function
--
-- Revision 1.5 2001/08/22 15:00:00 JE
-- * Minor bugfix to Get_Text for combo boxes
-- * Minor changes to documentation (including new example involving dialogs)
--
-- Revision 1.4 2001/01/25 09:00:00 je
-- Changes visible to the user:
--
-- * Added support for drawing bitmaps on canvases (Draw_Image operations
-- and new type Image_Type)
-- * Added Play_Sound
-- * Added several new operations on all windows: Get_Origin, Get_Width,
-- Get_Height, Set_Origin, Set_Size and Focus
-- * Added several functions giving screen and window dimensions: Screen_Width,
-- Screen_Height, Frame_Width, Frame_Height, Dialog_Width, Dialog_Height and
-- Menu_Height
-- * Canvases can now handle keyboard events: new constructor and Key_Code added
-- * Added procedure Play_Sound
-- * Operations "+" and "-" added for Point_Type
-- * Pens can now be zero pixels wide
-- * The absolute origin of a frame can now have be specified when the frame
-- is created
-- * Added new File_Dialog operations Add_Filter and Set_Directory
-- * Added Get_Line renames to JEWL.IO for compatibility with Ada.Text_IO
-- * Added all the Get(File,Item) operations mentioned in documentation but
-- unaccountably missing :-(
-- * Documentation updated to reflect the above changes
-- * HTML versions of public package specifications added with links from
-- main documentation pages
--
-- Other internal changes:
--
-- * Canvas fonts, pens etc. now use JEWL.Reference_Counted_Type rather than
-- reinventing this particular wheel, as do images
-- * Various minor code formatting changes: some code reordered for clarity,
-- some comments added or amended,
-- * Changes introduced in 1.2 to support GNAT 3.10 have been reversed, since
-- GNAT 3.10 still couldn't compile this code correctly... ;-(
--
-- Outstanding issues:
--
-- * Optimisation breaks the code (workaround: don't optimise)
--
-- Revision 1.3 2000/07/07 12:00:00 je
-- * JEWL.Simple_Windows added; JEWL.IO modified to use JEWL.Simple_Windows.
-- * JEWL.IO bug fix: Put_Line to file wrote newline to standard output
-- instead of to the file (thanks to <NAME> for pointing this out).
-- * Panels fixed so that mouse clicks are passed on correctly to subwindows.
-- * Memos fixed so that tabs are handled properly.
-- * Password feature added to editboxes.
-- * Minor typos fixed in comments within the package sources.
-- * Documentation corrected and updated following comments from <NAME>
-- and <NAME>.
--
-- Revision 1.2 2000/04/18 20:00:00 je
-- * Minor code changes to enable compilation by GNAT 3.10
-- * Minor documentation errors corrected
-- * Some redundant "with" clauses removed
--
-- Revision 1.1 2000/04/09 21:00:00 je
-- Initial revision
--
------------------------------------------------------------------------------
generic -- This is a generic package which must be
type Command_Type is (<>); -- instantiated with a list of possible
-- command values to be generated whenever
package JEWL.Windows is -- a window is closed, a button is clicked
-- or a menu item is selected.
----------------------------------------------------------------------------
-- Miscellaneous operations
----------------------------------------------------------------------------
procedure Show_Error (Text : in String; -- an error message
Title : in String := "Error");
function Show_Query (Text : in String; -- a yes/no query
Title : in String := "Query")
return Boolean;
procedure Show_Message (Text : in String; -- an information message
Title : in String := "Message");
procedure Play_Sound (Sound : in String); -- play a sound file
function Screen_Width return Natural; -- width of display screen
function Screen_Height return Natural; -- height of display screen
----------------------------------------------------------------------------
--
-- S U P P O R T T Y P E S
--
-- Except for Alignment_Type, these types are defined in the top-level
-- package JEWL and are renamed here for convenience:
--
-- Alignment_Type : used to specify text alignment with a window.
-- Angle_Type : an angle specified as an integral number of
-- degrees (0 to 359)
-- Colour_Type : a colour specified as an RGB value.
-- Font_Type : a font specified by a name, point size and bold
-- and italic style options.
-- Point_Type : a pair of (X,Y) coordinates within a window.
-- Point_List : an array of (X,Y) coordinate pairs.
--
----------------------------------------------------------------------------
type Alignment_Type is (Left, Centre, Right);
subtype Angle_Type is JEWL.Angle_Type;
subtype Colour_Range is JEWL.Colour_Range;
subtype Colour_Type is JEWL.Colour_Type;
subtype Font_Type is JEWL.Font_Type;
type Image_Type is private;
subtype Point_Type is JEWL.Point_Type;
subtype Point_List is JEWL.Point_List;
----------------------------------------------------------------------------
-- Renamings for our transatlantic cousins, in the hope that some day
-- they'll repay the favour/favor... ;-)
----------------------------------------------------------------------------
subtype Color_Range is Colour_Range;
subtype Color_Type is Colour_Type;
function Center return Alignment_Type renames Centre;
----------------------------------------------------------------------------
--
-- O P E R A T I O N S O N S U P P O R T T Y P E S
--
-- These are renamings of the operations defined in the parent package
-- provided for convenience.
--
-- Colour operations:
-- Light : Generate a lightened version of a colour, e.g. Light(Red).
-- Dark : Generate a darkened version of a colour, e.g. Dark(Green).
--
-- Font operations:
-- Font : Generate a font with the specified properties.
-- Name : Get the name of the font typeface.
-- Size : Get the font size in points.
-- Bold : Test if the font is bold.
-- Italic : Test if the font is italic.
--
-- Image operations:
-- Image : Load an image from a bitmap file.
-- Valid : Test if an image is valid.
-- Width : Get the width of an image.
-- Height : Get the height of an image.
--
-- Point operations:
-- Endpoint : Calculate the endpoint of a line from a starting point,
-- length and angle
-- Inside : Test if a specified point is inside a specified rectangle
-- (defined by the coordinates of two diagonally opposite
-- corners).
-- P1 + P2 : Add two points (P1.X+P2.X, P1.Y+P2.Y).
-- P1 - P2 : Subtract two points (P1.X-P2.X, P1.Y-P2.Y).
--
----------------------------------------------------------------------------
function Light (Colour : JEWL.Colour_Type) return JEWL.Colour_Type
renames JEWL.Light;
function Dark (Colour : JEWL.Colour_Type) return JEWL.Colour_Type
renames JEWL.Dark;
function Font (Name : String;
Size : Positive;
Bold : Boolean := False;
Italic : Boolean := False) return JEWL.Font_Type
renames JEWL.Font;
function Name (Font : Font_Type) return String
renames JEWL.Name;
function Size (Font : Font_Type) return Natural
renames JEWL.Size;
function Bold (Font : Font_Type) return Boolean
renames JEWL.Bold;
function Italic (Font : Font_Type) return Boolean
renames JEWL.Italic;
function Image (Name : String) return Image_Type;
function Valid (Image : Image_Type) return Boolean;
function Width (Image : Image_Type) return Natural;
function Height (Image : Image_Type) return Natural;
function Endpoint (From : JEWL.Point_Type;
Length : Positive;
Angle : JEWL.Angle_Type) return JEWL.Point_Type
renames JEWL.Endpoint;
function Inside (Point : JEWL.Point_Type;
From : JEWL.Point_Type;
To : JEWL.Point_Type) return Boolean
renames JEWL.Inside;
function "+" (P1, P2 : Point_Type) return Point_Type
renames JEWL."+";
function "-" (P1, P2 : Point_Type) return Point_Type
renames JEWL."-";
----------------------------------------------------------------------------
--
-- S U P P O R T T Y P E C O N S T A N T S
--
-- Angles : North, South, East and West
-- Colours : Black, White, Red, Green, Blue, etc.
-- Fonts : Default_Font (the default font for top-level windows) and
-- Parent_Font (the same font as a window's parent uses)
--
----------------------------------------------------------------------------
North : constant Angle_Type := 0;
South : constant Angle_Type := 180;
East : constant Angle_Type := 90;
West : constant Angle_Type := 270;
Black : constant Colour_Type := ( 0, 0, 0);
White : constant Colour_Type := (255,255,255);
Red : constant Colour_Type := (255, 0, 0);
Green : constant Colour_Type := ( 0,255, 0);
Blue : constant Colour_Type := ( 0, 0,255);
Gray : constant Colour_Type := (128,128,128);
Yellow : constant Colour_Type := (255,255, 0);
Cyan : constant Colour_Type := ( 0,255,255);
Magenta : constant Colour_Type := (255, 0,255);
Default_Font : constant Font_Type := Font("Arial",9);
Parent_Font : constant Font_Type := Font("",1);
----------------------------------------------------------------------------
--
-- W I N D O W _ T Y P E
--
-- An abstract class providing basic behaviour which all windows share.
--
----------------------------------------------------------------------------
type Window_Type is abstract tagged private;
Invalid_Window : exception; -- raised if an attempt is made to use an
-- invalid (non-open) window
----------------------------------------------------------------------------
--
-- Window operations (common to all windows):
--
-- Show (Window, -- make the window visible or invisible depending
-- Visible) -- on the value of Visible (default: True).
-- Hide (Window) -- make the window invisible.
-- Focus (Window) -- give the window the input focus.
-- Visible (Window) -- return True if the window is visible.
-- Get_Origin (Window) -- get the origin (top left point) of the
-- -- specified window.
-- Get_Width (Window) -- get the width of the specified window.
-- Get_Height (Window) -- get the height of the specified window.
-- Set_Origin (Window, -- set the origin (top left point) of the
-- Origin) -- specified window to this value.
-- Set_Size (Window, -- set the size of the specified window
-- Width, -- to this width (optional)
-- Height) -- and this height (optional).
-- Get_Font (Window) -- get the font for the specified window.
-- Set_Font (Window, -- set the font for the specified window
-- Font) -- to this one.
--
----------------------------------------------------------------------------
procedure Show (Window : in Window_Type;
Visible : in Boolean := True);
procedure Hide (Window : in Window_Type);
procedure Focus (Window : in Window_Type);
function Visible (Window : Window_Type) return Boolean;
function Get_Origin (Window : Window_Type) return Point_Type;
function Get_Width (Window : Window_Type) return Natural;
function Get_Height (Window : Window_Type) return Natural;
procedure Set_Origin (Window : in Window_Type;
Origin : in Point_Type);
procedure Set_Size (Window : in Window_Type;
Width : in Natural := 0;
Height : in Natural := 0);
function Get_Font (Window : Window_Type) return Font_Type;
procedure Set_Font (Window : in Window_Type;
Font : in Font_Type);
----------------------------------------------------------------------------
--
-- W I N D O W S U B C L A S S E S
--
-- The primary window subclasses are containers and controls. They
-- share the behaviour common to all windows (above) and provide extra
-- behaviour as well.
--
-- Container_Type : the abstract base type for all containers.
-- Control_Type : the abstract base type for all controls.
--
----------------------------------------------------------------------------
type Container_Type is abstract new Window_Type with private;
type Control_Type is abstract new Window_Type with private;
----------------------------------------------------------------------------
--
-- C O N T A I N E R S
--
-- Containers are windows which can contain other windows. All windows
-- except frames and dialogs (see below) must be contained within some
-- other container window. There are some restrictions on the types of
-- container that a window can be attached to (for example, a menu item
-- must be attached to a menu).
--
-- Most windows specify an origin, a width and a height whose coordinates
-- are taken relative to the enclosing container. Positive widths and
-- heights are absolute values, but zero and negative widths and heights
-- are interpreted as being relative to the width and height of the
-- enclosing container (so a width of 0 means the width of the enclosing
-- container, a height of -10 means 10 pixels less than the height of the
-- enclosing container).
--
-- The types of container windows available are as follows:
--
-- Frame_Type : a main window with a title bar, system menu, minimise
-- and maximise buttons, and a close button.
-- Dialog_Type : a top level window which is used for modal interaction,
-- disabling other windows while the interaction takes
-- place.
-- Panel_Type : a plain window which is used as a container for other
-- subwindows.
-- Menu_Type : a menu which can contain menu items and submenus.
--
----------------------------------------------------------------------------
type Frame_Type is new Container_Type with private;
type Dialog_Type is new Container_Type with private;
type Panel_Type is new Container_Type with private;
type Menu_Type is new Container_Type with private;
----------------------------------------------------------------------------
--
-- F R A M E S
--
-- A frame is a top level window with a title bar, system menu, minimise
-- and maximise buttons, and a close button. Closing a frame generates a
-- command. Frames are normally visible, but can be hidden if required.
-- A frame should be used as the main window for an application.
--
-- Frame operations:
--
-- Frame (Origin, -- create a frame at the specified position
-- Width, -- with the specified width
-- Height, -- and height in pixels,
-- Title, -- with the specified title in the title bar,
-- Command, -- generating this command when it is closed,
-- Font) -- using this font (default: Default_Font).
-- Frame (Width, -- create a frame with the specified width
-- Height, -- and height in pixels, placed randomly,
-- Title, -- with the specified title in the title bar,
-- Command, -- generating this command when it is closed,
-- Font) -- using this font (default: Default_Font).
--
-- Close (Frame) -- close the frame.
-- Valid (Frame) -- true until the frame is closed.
--
-- Frame_Width -- return the width of the frame border.
-- Frame_Height -- return the height of the frame border.
--
-- Next_Command -- return the next command generated by any
-- -- control in any existing frame.
-- Command_Ready -- test if there is a command pending
--
----------------------------------------------------------------------------
function Frame (Origin : Point_Type;
Width : Positive;
Height : Positive;
Title : String;
Command : Command_Type;
Font : Font_Type := Default_Font) return Frame_Type;
function Frame (Width : Positive;
Height : Positive;
Title : String;
Command : Command_Type;
Font : Font_Type := Default_Font) return Frame_Type;
procedure Close (Frame : in Frame_Type);
function Valid (Frame : Frame_Type) return Boolean;
function Frame_Width return Natural;
function Frame_Height return Natural;
function Next_Command return Command_Type;
function Command_Ready return Boolean;
----------------------------------------------------------------------------
--
-- D I A L O G S
--
-- A dialog is a top level window like a frame, but it only has a close
-- button on its title bar. Dialogs are intended for user interaction.
-- When a dialog is executed it becomes visible and all other windows
-- are disabled. Execution of a dialog continues until a command is
-- generated by closing the dialog window or by clicking on a button
-- attached to the dialog. Dialog windows do not have a menu bar.
--
-- Dialog operations:
--
-- Dialog (Width, -- create a dialog with the given width and
-- Height, -- and height in pixels,
-- Title, -- with the specified title in the title bar,
-- Command, -- generating this command when it is closed,
-- Font) -- using this font (default: Default_Font).
--
-- Execute (Dialog) -- execute a dialog and return the command code
-- -- used to exit from it.
--
-- Dialog_Width -- return the width of the dialog border.
-- Dialog_Height -- return the height of the dialog border.
--
----------------------------------------------------------------------------
function Dialog (Width : Positive;
Height : Positive;
Title : String;
Command : Command_Type;
Font : Font_Type := Default_Font) return Dialog_Type;
function Execute (Dialog : in Dialog_Type) return Command_Type;
function Dialog_Width return Natural;
function Dialog_Height return Natural;
----------------------------------------------------------------------------
--
-- P A N E L S
--
--
-- Panel operations:
--
-- Panel (Parent, -- create a panel inside a parent container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- with the specified width
-- Height, -- and the specified height, and
-- Title, -- with this title on the border (default: none)
-- Font) -- using this font (default: same as Parent).
--
----------------------------------------------------------------------------
function Panel (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Title : String := "";
Font : Font_Type := Parent_Font) return Panel_Type;
----------------------------------------------------------------------------
--
-- M E N U S
--
-- A menu is a pull-down list of items attached to a frame's menu bar.
-- The items on a menu are either menuitems (which generate a command
-- when they are selected, submenus (which display another menu when
-- selected) or separators (horizontal bars used to separate a menu
-- into subsections.
--
-- If the text label for a menu contains the character "&", the character
-- which follows is underlined and the menu can be activated by pressing
-- Alt + that character. The character "&" is not displayed.
--
-- Menu operations:
--
-- Menu (Parent, -- create a menu attached to a frame or a menu
-- Text) -- with the specified text label.
--
-- Menu_Height -- return the height of a menu bar.
--
----------------------------------------------------------------------------
function Menu (Parent : Frame_Type'Class;
Text : String) return Menu_Type;
function Menu (Parent : Menu_Type'Class;
Text : String) return Menu_Type;
function Menu_Height return Natural;
----------------------------------------------------------------------------
--
-- C O N T R O L S
--
-- Controls are windows for user interaction. They hold values (e.g. a
-- text string) which can normally be set by the user, as well as being
-- accessed and altered by the program itself. Some controls (e.g. menu
-- items) generate command values which can be used to trigger actions
-- in the program. The following operations are common to all controls:
--
-- Enable (Control, -- enable or disable the control depending on
-- Enabled) -- the value of Enabled (default: True).
-- Disable (Control) -- disable the control.
-- Enabled (Control) -- test if the control is enabled.
--
----------------------------------------------------------------------------
procedure Enable (Control : in Control_Type;
Enabled : in Boolean := True);
procedure Disable (Control : in Control_Type);
function Enabled (Control : Control_Type) return Boolean;
----------------------------------------------------------------------------
--
-- The types of control available are as follows:
--
-- Menuitem_Type : controls which can appear on pull-down menus
-- Text_Control_Type : controls containing with a single-line text string
-- Multiline_Type : controls containing multiple text strings
-- Canvas_Type : a plain window for drawing arbitrary shapes on
--
----------------------------------------------------------------------------
type Text_Control_Type is abstract new Control_Type with private;
type Multiline_Type is abstract new Control_Type with private;
type Canvas_Type is new Control_Type with private;
----------------------------------------------------------------------------
--
-- T E X T C O N T R O L S
--
-- Text controls include a single-line text string. The following
-- operations are common to all text controls:
--
-- Get_Length (Control) -- get the length of the text associated with the
-- -- control.
-- Get_Text (Control) -- get the text associated with the control as a
-- -- string of indefinite size.
-- Get_Text (Control, -- get the text associated with the control into
-- Text, -- this fixed-size string variable
-- Length) -- and set this integer variable to the actual
-- -- number of characters copied.
-- Set_Text (Control, -- set the text associated with the control.
-- Text) -- to the specified new text value.
--
----------------------------------------------------------------------------
function Get_Length (Control : Text_Control_Type) return Natural;
function Get_Text (Control : Text_Control_Type) return String;
procedure Get_Text (Control : in Text_Control_Type;
Text : out String;
Length : out Natural);
procedure Set_Text (Control : in Text_Control_Type;
Text : in String);
----------------------------------------------------------------------------
--
-- The types of text control available are as follows:
--
-- Button_Type : a pushbutton which generates a command code.
-- Label_Type : a static non-interactive label.
-- Editbox_Type : a single-line edit control for text input.
--
-- There is a further subclass of text control, as follows:
--
-- Boolean_Control_Type : a text control with an associated Boolean state
--
----------------------------------------------------------------------------
type Button_Type is new Text_Control_Type with private;
type Label_Type is new Text_Control_Type with private;
type Editbox_Type is new Text_Control_Type with private;
type Boolean_Control_Type is abstract new Text_Control_Type with private;
----------------------------------------------------------------------------
--
-- B U T T O N S
--
-- Buttons are rectangular labelled controls which generate a command
-- code when pressed. "Default" buttons are displayed with a heavier
-- border and respond when the Enter key is pressed.
--
-- Button operations:
--
-- Button (Parent, -- create a button in a parent container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- with the specified width
-- Height, -- and the specified height,
-- Text, -- labelled with the specified text,
-- Command, -- generating this command when it is pressed,
-- Default, -- set up as a "default" button (default: False),
-- Font) -- using this font (default: same as Parent).
--
----------------------------------------------------------------------------
function Button (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Text : String;
Command : Command_Type;
Default : Boolean := False;
Font : Font_Type := Parent_Font) return Button_Type;
----------------------------------------------------------------------------
--
-- L A B E L S
--
-- A label is a static text control that can be used to label other
-- controls. Labels do not respond to user interaction, but their
-- values can be read and altered by the program in the same way as
-- any other text control.
--
-- Label operations:
--
-- Label (Parent, -- create a label inside a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- with the specified width
-- Height, -- and the specified height, and
-- Text, -- labelled with the specified text
-- Align, -- aligned left, right or centre (default: Left),
-- Font) -- using this font (default: same as Parent).
--
----------------------------------------------------------------------------
function Label (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Text : String;
Align : Alignment_Type := Left;
Font : Font_Type := Parent_Font) return Label_Type;
----------------------------------------------------------------------------
--
-- E D I T B O X E S
--
-- An editbox is a text control containing a single line of text whose
-- value can be edited by the user.
--
-- Editbox operations:
--
-- Editbox (Parent, -- create an editbox inside a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- with the specified width
-- Height, -- and the specified height, and
-- Text, -- initialised with the specified text,
-- Password, -- optionally set up as a password editbox,
-- Font) -- using this font (default: same as Parent).
--
-- Modified (Editbox) -- test if the editbox has been modified by the
-- -- user.
--
----------------------------------------------------------------------------
function Editbox (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Text : String := "";
Password : Boolean := False;
Font : Font_Type := Parent_Font) return Editbox_Type;
function Modified (Editbox : Editbox_Type) return Boolean;
----------------------------------------------------------------------------
--
-- B O O L E A N C O N T R O L S
--
-- Boolean controls are text controls which can be toggled between two
-- states (checked or unchecked). The following operations are common
-- to all Boolean controls:
--
-- Get_State (Control) -- get the current state of the control
-- Set_State (Control, -- set the current state of the control
-- State) -- to the specified value
--
----------------------------------------------------------------------------
function Get_State (Control : Boolean_Control_Type) return Boolean;
procedure Set_State (Control : in Boolean_Control_Type;
State : in Boolean);
----------------------------------------------------------------------------
--
-- The types of Boolean controls available are as follows:
--
-- Checkbox_Type : a checkbox which can be checked or unchecked.
-- Radiobutton_Type : a radio button which can be checked or unchecked.
--
----------------------------------------------------------------------------
type Menuitem_Type is new Boolean_Control_Type with private;
type Checkbox_Type is new Boolean_Control_Type with private;
type Radiobutton_Type is new Boolean_Control_Type with private;
----------------------------------------------------------------------------
--
-- M E N U I T E M S
--
-- Menu items can only be attached to menus. When a menu is clicked, a
-- pull-down menu appears which can consist of menu items (which generate
-- a command when clicked) or further menus.
--
-- Each menu and menu item has a text label in which the character "&"
-- is treated specially. "&" will not be displayed, but the following
-- character (e.g. 'X') will be underlined to indicate that it can be
-- selected by pressing Alt + 'X' when the menu is visible.
--
-- Menuitem operations:
--
-- Menuitem (Parent, -- create a menu item attached to a parent menu
-- Text, -- with this text label,
-- Command) -- generating this command code when selected
--
-- Separator (Parent) -- create a separator (an inactive horizontal
-- -- bar) attached to a parent menu
--
----------------------------------------------------------------------------
function Menuitem (Parent : Menu_Type'Class;
Text : String;
Command : Command_Type) return Menuitem_Type;
function Separator (Parent : Menu_Type'Class) return Menuitem_Type;
----------------------------------------------------------------------------
-- Menu items behave slightly differently to other controls, so the
-- following operations are overridden:
--
procedure Enable (Control : in Menuitem_Type;
Enabled : in Boolean := True);
function Enabled (Control : Menuitem_Type) return Boolean;
function Get_Length (Control : Menuitem_Type) return Natural;
function Get_Text (Control : Menuitem_Type) return String;
procedure Set_Text (Control : in Menuitem_Type;
Text : in String);
function Get_State (Control : Menuitem_Type) return Boolean;
procedure Set_State (Control : in Menuitem_Type;
State : in Boolean);
----------------------------------------------------------------------------
--
-- C H E C K B O X E S
--
-- A checkbox is a labelled control with a left-aligned box that can be
-- checked or unchecked. Clicking on a checkbox (or pressing Space when
-- it is selected) toggles the checkbox between the checked and unchecked
-- states.
--
-- Checkbox operations:
--
-- Checkbox (Parent, -- create a checkbox in a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- with the specified width
-- Height, -- and the specified height, and
-- Text, -- labelled with the specified text, and
-- Checked, -- set to this initial state (default: False),
-- Font) -- using this font (default: same as Parent).
--
----------------------------------------------------------------------------
function Checkbox (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Text : String;
Checked : Boolean := False;
Font : Font_Type := Parent_Font) return Checkbox_Type;
----------------------------------------------------------------------------
--
-- R A D I O B U T T O N S
--
-- A radiobutton is a Boolean control with a left-aligned box that can be
-- checked or unchecked. Radiobuttons attached to the same container form
-- a group. Clicking on an unchecked radiobutton will set the radiobutton
-- to the checked state and will also uncheck the other radiobuttons which
-- belong to the same group (i.e. which are attached to the same container).
-- Unlike a checkbox, a radiobutton cannot be turned off by clicking on it;
-- you can only uncheck a radiobutton by checking another one in the same
-- group.
--
-- Radiobutton operations:
--
-- Radiobutton (Parent, -- create a radiobutton in a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- with the specified width
-- Height, -- and the specified height, and
-- Text, -- labelled with the specified text, and
-- Checked, -- set to this initial state (default: False),
-- Font) -- using this font (default: Default_Font).
--
----------------------------------------------------------------------------
function Radiobutton (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Text : String;
Checked : Boolean := False;
Font : Font_Type := Parent_Font)
return Radiobutton_Type;
----------------------------------------------------------------------------
--
-- M U L T I L I N E C O N T R O L S
--
-- Multiline controls contain multiple lines of text numbered from 1
-- upwards. Individual lines can be accessed by specifying a line
-- number. The user can select a particular line by clicking on it
-- with the mouse or using the keyboard arrow keys when the control
-- is selected. Specifying the line number to access as 0 will access
-- the currently selected line. If no line is selected, the current
-- line number will be reported as 0 but its contents can still be
-- accessed . A Constraint_Error will be raised if an attempt is made
-- to access a line beyond the last one.
--
-- The following operations are common to all multiline controls, but
-- their precise effects vary slightly according to the actual type of
-- the control (see below):
--
-- Get_Count (Control) -- get the number of lines of text in the control.
-- Get_Line (Control) -- get the number of the currently selected line.
-- Get_Length (Control, -- get the length of the specified line
-- Line) -- (default: current line).
-- Get_Text (Control, -- get the text of the specified line as a string
-- Line) -- of indefinite length (default: current line).
--
-- Get_Text (Control, -- get the text of the control
-- Line, -- from the specified line (default: current line)
-- Text, -- into a fixed-size string variable, together
-- Length) -- with the number of characters transferred.
-- Set_Text (Control, -- set the text of the control
-- Line, -- at the specified line
-- Text) -- to the specified value.
--
-- Select_Line (Control, -- select the line at the specified line number
-- Line) -- (default: 0, meaning deselect).
-- Append_Line (Control, -- append a line to the end of the control, where
-- Text) -- this is the text to append.
-- Insert_Line (Control, -- insert a new line above the specified
-- Line, -- line number, where
-- Text) -- this is the text to insert.
-- Delete_Line (Control, -- delete the specified line.
-- Line)
-- Delete_All (Control) -- delete all lines.
--
----------------------------------------------------------------------------
function Get_Count (Control : Multiline_Type) return Natural is abstract;
function Get_Line (Control : Multiline_Type) return Natural is abstract;
function Get_Length (Control : Multiline_Type;
Line : Natural := 0) return Natural is abstract;
function Get_Text (Control : Multiline_Type;
Line : Natural := 0) return String is abstract;
procedure Get_Text (Control : in Multiline_Type;
Line : in Natural := 0;
Text : out String;
Length : out Natural);
procedure Set_Text (Control : in Multiline_Type;
Text : in String;
Line : in Natural := 0) is abstract;
procedure Select_Line (Control : in Multiline_Type;
Line : in Natural := 0) is abstract;
procedure Append_Line (Control : in Multiline_Type;
Text : in String) is abstract;
procedure Insert_Line (Control : in Multiline_Type;
Text : in String;
Line : in Natural := 0) is abstract;
procedure Delete_Line (Control : in Multiline_Type;
Line : in Natural := 0) is abstract;
procedure Delete_All (Control : in Multiline_Type) is abstract;
----------------------------------------------------------------------------
--
-- The types of multiline controls available are as follows:
--
-- Listbox_Type : a list of text items in a scrollable window
-- Combobox_Type : an editbox in combination with a drop-down list box
-- Memo_Type : a multi-line text editor
--
----------------------------------------------------------------------------
type Listbox_Type is new Multiline_Type with private;
type Combobox_Type is new Multiline_Type with private;
type Memo_Type is new Multiline_Type with private;
----------------------------------------------------------------------------
--
-- L I S T B O X E S
--
-- A listbox is a list of lines of text (initially empty). The lines are
-- sorted into ascending order by default, but can be left unsorted if
-- required. For a sorted list, the position at which a new line is added
-- will be ignored, with the new line being inserted at the appropriate
-- position according to its value. When no line has been selected, the
-- contents of the current line will be reported as an empty string ("").
--
-- Listbox operations:
--
-- Listbox (Parent, -- create a listbox inside a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- the specified width
-- Height, -- and the specified height, using
-- Font) -- this font (default: same as Parent).
--
----------------------------------------------------------------------------
function Listbox (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Font : Font_Type := Parent_Font) return Listbox_Type;
----------------------------------------------------------------------------
--
-- C O M B O B O X E S
--
-- A combobox consists of an edit control together with a drop-down list
-- (effectively a combination of an editbox and a listbox). The currently
-- selected line is displayed in the edit control, and you can specify
-- whether the user is able to manually edit this value. If not, only
-- the values in the drop-down list can be selected.
--
-- If the contents of the edit control match one of the values in the list,
-- the position of the corresponding line in the list is reported as the
-- number of the currently selected line. Otherwise, the number of the
-- current line is reported as 0. Accessing the value of the current line
-- (line 0) will report the current value of the edit control.
--
-- Combobox operations:
--
-- Combobox (Parent, -- create a combobox inside a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- with the specified width, whose value can
-- Editable, -- be manually edited (default: True),
-- Font) -- using this font (default: same as Parent).
--
----------------------------------------------------------------------------
function Combobox (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Editable : Boolean := True;
Font : Font_Type := Parent_Font) return Combobox_Type;
----------------------------------------------------------------------------
--
-- M E M O S
--
-- A memo is a simple multi-line text editor similar to Windows Notepad.
-- There are several memo-specific operations in addition to the standard
-- operations on multi-line controls. The user can select a block of text
-- spanning multiple lines using the mouse (or by moving the cursor with
-- the Shift key held down) and there are operations to fetch, replace
-- and delete the selected text, find the line and column position of
-- the start and end of the selected text, and get its total length (which
-- will include one or more additional end-of-line characters if the text
-- spans more than one line).
--
-- Memo operations:
--
-- Memo (Parent, -- create a memo inside a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- the specified width
-- Height) -- and the specified height
-- Font) -- using this font (default: same as Parent).
--
-- Get_Column (Memo) -- get the column position of the current
-- -- selection.
-- Modified (Memo) -- test if the user has modified the memo.
-- Cut_Selection (Memo) -- cut the current selection to the clipboard.
-- Copy_Selection (Memo) -- copy the current selection to the clipboard.
-- Paste_Selection (Memo) -- paste the clipboard contents to the memo,
-- -- replacing the current selection.
-- Undo_Change (Memo) -- undo the user's last change to the memo.
-- Show_Selection (Memo) -- scroll the memo so that the current position
-- -- is visible on the screen.
--
----------------------------------------------------------------------------
function Memo (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Font : Font_Type := Parent_Font) return Memo_Type;
function Get_Column (Memo : Memo_Type) return Natural;
function Modified (Memo : Memo_Type) return Boolean;
procedure Cut_Selection (Memo : in Memo_Type);
procedure Copy_Selection (Memo : in Memo_Type);
procedure Paste_Selection (Memo : in Memo_Type);
procedure Undo_Change (Memo : in Memo_Type);
procedure Show_Selection (Memo : in Memo_Type);
----------------------------------------------------------------------------
-- Most operations on multiline types are implemented in different ways,
-- so they are overridden here:
--
function Get_Count (Control : Listbox_Type) return Natural;
function Get_Count (Control : Combobox_Type) return Natural;
function Get_Count (Control : Memo_Type) return Natural;
function Get_Line (Control : Listbox_Type) return Natural;
function Get_Line (Control : Combobox_Type) return Natural;
function Get_Line (Control : Memo_Type) return Natural;
function Get_Length (Control : Listbox_Type;
Line : Natural := 0) return Natural;
function Get_Length (Control : Combobox_Type;
Line : Natural := 0) return Natural;
function Get_Length (Control : Memo_Type;
Line : Natural := 0) return Natural;
function Get_Text (Control : Listbox_Type;
Line : Natural := 0) return String;
function Get_Text (Control : Combobox_Type;
Line : Natural := 0) return String;
function Get_Text (Control : Memo_Type;
Line : Natural := 0) return String;
procedure Set_Text (Control : in Listbox_Type;
Text : in String;
Line : in Natural := 0);
procedure Set_Text (Control : in Combobox_Type;
Text : in String;
Line : in Natural := 0);
procedure Set_Text (Control : in Memo_Type;
Text : in String;
Line : in Natural := 0);
procedure Select_Line (Control : in Listbox_Type;
Line : in Natural := 0);
procedure Select_Line (Control : in Combobox_Type;
Line : in Natural := 0);
procedure Select_Line (Control : in Memo_Type;
Line : in Natural := 0);
procedure Append_Line (Control : in Listbox_Type;
Text : in String);
procedure Append_Line (Control : in Combobox_Type;
Text : in String);
procedure Append_Line (Control : in Memo_Type;
Text : in String);
procedure Insert_Line (Control : in Listbox_Type;
Text : in String;
Line : in Natural := 0);
procedure Insert_Line (Control : in Combobox_Type;
Text : in String;
Line : in Natural := 0);
procedure Insert_Line (Control : in Memo_Type;
Text : in String;
Line : in Natural := 0);
procedure Delete_Line (Control : in Listbox_Type;
Line : in Natural := 0);
procedure Delete_Line (Control : in Combobox_Type;
Line : in Natural := 0);
procedure Delete_Line (Control : in Memo_Type;
Line : in Natural:= 0);
procedure Delete_All (Control : in Listbox_Type);
procedure Delete_All (Control : in Combobox_Type);
procedure Delete_All (Control : in Memo_Type);
----------------------------------------------------------------------------
--
-- C A N V A S E S
--
-- A canvas is a blank rectangle for drawing on which can optionally
-- be set to generate a command code when the mouse is clicked on it.
-- A canvas has an associated font (the same as the parent window by
-- default), a background colour (initially white), a pen for drawing
-- lines (initially black, one pixel wide) and a fill colour used to
-- colour closed shapes (initially white).
--
-- The freedom of expression available with canvases make these the
-- most complex component of all, with over 20 available operations.
-- There are operations to draw lines, rectangles (with or without
-- rounded corners), ellipses, circles, line sequences, polygons and
-- text. The font, pen size and colour and fill colour can be changed
-- at any time any will affect all subsequent drawing operations (but
-- everything drawn previously will be unaffected). Rectangles can be
-- given rounded corners by specifying a rounding factor, which gives
-- the X and Y offsets from the corners to the points where the rounded
-- corner begins.
--
-- Anything drawn on a canvas will normally stay there, but the canvas
-- can be erased or the current state of a drawing can be saved and then
-- restored later (which provides a basic "undo" facility). For example,
-- a clock can be drawn by drawing a circle, saving the drawing, and then
-- drawing the hands. To change the position of the hands, restore the
-- saved drawing (thus erasing the hands) and then redraw the hands in
-- the new position. You can only save one copy of the drawing, so if you
-- save it a second time you will lose the previous saved copy.
--
-- A canvas can be set up to generate a command when the mouse button
-- is pressed inside its borders. There are operations to get the
-- position at which the button was pressed, to get the current mouse
-- position, and to test if the mouse button is still down and whether
-- the mouse has been moved. As long as the button is down, the mouse
-- position will be tracked even if the mouse is moved outside the canvas.
-- You can track the mouse visually by saving the drawing when the mouse
-- is first pressed, then restoring the drawing and drawing a new line
-- from the initial mouse position to the current one.
--
-- Canvas operations:
--
-- Canvas (Parent, -- create a canvas inside a container, with
-- Origin, -- top left coordinates relative to Parent,
-- Width, -- the specified width
-- Height, -- and the specified height, using
-- Font) -- this font (default: same as Parent).
--
-- Canvas (Parent, -- create a canvas inside a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- the specified width
-- Height, -- and the specified height,
-- Command, -- which generates this command code, and
-- Font) -- uses this font (default: same as Parent).
--
-- Canvas (Parent, -- create a canvas inside a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- the specified width
-- Height, -- and the specified height,
-- Command, -- which generates this command code, and
-- Keypress, -- this one when a key is pressed, and
-- Font) -- uses this font (default: same as Parent).
--
-- Set_Colour (Canvas, -- set the background colour for a canvas
-- Colour) -- using this colour (default: white)
--
-- Erase (Canvas) -- erase the drawing in a canvas. This will
-- -- also erase any saved drawing.
-- Save (Canvas) -- save the current drawing.
-- Restore (Canvas) -- restore a saved drawing, erasing anything
-- -- drawn since. If the drawing has never been
-- -- saved, or the window has been erased using
-- -- Erase, this will do nothing.
-- Set_Font (Canvas, -- set a new font for all subsequent text
-- Font) -- drawn on the canvas.
-- Set_Pen (Canvas, -- set the pen used to draw lines on the
-- Colour, -- canvas to this colour (default: black)
-- Width) -- and thickness (default: 1 pixel).
-- Set_Fill (Canvas, -- set the colour used to fill subsequent
-- Colour) -- closed shapes drawn on the canvas.
-- Set_Fill (Canvas) -- clear the colour used to fill subsequent
-- -- closed shapes drawn on the canvas.
-- Draw_Text (Canvas, -- draw a text string on the canvas
-- From, -- from this top-left point, where
-- Text) -- this is the text to be drawn.
-- Draw_Text (Canvas, -- draw a text string on the canvas
-- From, -- in a rectangle between this point
-- To, -- and this one, where
-- Text, -- this is the text to be drawn
-- Align) -- with this alignment (default: left).
-- Draw_Text (Canvas, -- draw a text string on the canvas
-- From, -- in a rectangle starting at this point
-- Width, -- with this width
-- Height, -- and this height, where
-- Text, -- this is the text to be drawn
-- Align) -- with this alignment (default: left).
--
-- Draw_Line (Canvas, -- draw a line on the canvas
-- From, -- from this point
-- To) -- to this one.
-- Draw_Line (Canvas, -- draw a line on the canvas
-- From, -- from this point
-- Length, -- for this length
-- Angle) -- at this angle.
-- Draw_Line_List (Canvas, -- draw lines on the canvas connecting
-- Points) -- the points in this list.
--
-- Draw_Rectangle (Canvas, -- draw a rectangle on the canvas
-- From, -- from this corner point
-- To, -- to this diagonally-opposite point
-- Rounding) -- with corners rounded this much
-- -- (default: no rounding).
-- Draw_Rectangle (Canvas, -- draw a rectangle on the canvas
-- From, -- from this top-left point
-- Width, -- with this width
-- Height, -- and this height
-- Rounding) -- with corners rounded this much
-- -- (default: no rounding).
--
-- Draw_Ellipse (Canvas, -- draw an ellipse on the canvas
-- From, -- bounded by a rectangle from this point
-- To) -- to this point.
-- Draw_Ellipse (Canvas, -- draw an ellipse on the canvas
-- From, -- bounded by a rectangle from this point
-- Width, -- with this width.
-- Height) -- and this height
-- Draw_Circle (Canvas, -- draw a circle on the canvas
-- Centre, -- with this centre point
-- Radius) -- and this radius.
--
-- Draw_Polygon (Canvas, -- draw a polygon on the canvas
-- Points) -- with vertices at these points.
--
-- Draw_Image (Canvas, -- draw an image on the canvas
-- From, -- from this point
-- Image) -- using this image object.
-- Draw_Image (Canvas, -- draw an image on the canvas
-- From, -- from this point
-- To, -- to this one (stretching the image to fit)
-- Image) -- using this image object.
-- Draw_Image (Canvas, -- draw an image on the canvas
-- From, -- from this point
-- Width, -- with this width
-- Height, -- and this height
-- Image) -- using this image object.
--
-- Mouse_Down (Canvas) -- test if the left mouse button is down.
-- Mouse_Moved (Canvas) -- test if the mouse has been moved.
-- Start_Point (Canvas) -- get the point where the mouse button
-- -- was first pressed.
-- End_Point (Canvas) -- get the point where the mouse is now
-- -- (or its final position when the left
-- -- button was released).
-- Key_Code (Canvas) -- get the character code for the last
-- -- key pressed.
--
----------------------------------------------------------------------------
function Canvas (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Font : Font_Type := Parent_Font) return Canvas_Type;
function Canvas (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Command : Command_Type;
Font : Font_Type := Parent_Font) return Canvas_Type;
function Canvas (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Command : Command_Type;
Keypress : Command_Type;
Font : Font_Type := Parent_Font) return Canvas_Type;
procedure Set_Colour (Canvas : in Canvas_Type;
Colour : in Colour_Type := White);
procedure Erase (Canvas : in Canvas_Type);
procedure Save (Canvas : in Canvas_Type);
procedure Restore (Canvas : in Canvas_Type);
procedure Set_Font (Canvas : in Canvas_Type;
Font : in Font_Type);
procedure Set_Pen (Canvas : in Canvas_Type;
Colour : in Colour_Type := Black;
Width : in Natural := 1);
procedure Set_Fill (Canvas : in Canvas_Type;
Colour : in Colour_Type);
procedure Set_Fill (Canvas : in Canvas_Type);
procedure Draw_Text (Canvas : in Canvas_Type;
From : in Point_Type;
Text : in String);
procedure Draw_Text (Canvas : in Canvas_Type;
From : in Point_Type;
To : in Point_Type;
Text : in String;
Align : in Alignment_Type := Left);
procedure Draw_Text (Canvas : in Canvas_Type;
From : in Point_Type;
Width : in Integer;
Height : in Integer;
Text : in String;
Align : in Alignment_Type := Left);
procedure Draw_Line (Canvas : in Canvas_Type;
From : in Point_Type;
To : in Point_Type);
procedure Draw_Line (Canvas : in Canvas_Type;
From : in Point_Type;
Length : in Positive;
Angle : in Angle_Type);
procedure Draw_Line_List
(Canvas : in Canvas_Type;
Points : in Point_List);
procedure Draw_Rectangle
(Canvas : in Canvas_Type;
From : in Point_Type;
To : in Point_Type;
Rounding : in Point_Type := (0,0));
procedure Draw_Rectangle
(Canvas : in Canvas_Type;
From : in Point_Type;
Width : in Positive;
Height : in Positive;
Rounding : in Point_Type := (0,0));
procedure Draw_Ellipse
(Canvas : in Canvas_Type;
From : in Point_Type;
To : in Point_Type);
procedure Draw_Ellipse
(Canvas : in Canvas_Type;
From : in Point_Type;
Width : in Positive;
Height : in Positive);
procedure Draw_Circle
(Canvas : in Canvas_Type;
Centre : in Point_Type;
Radius : in Positive);
procedure Draw_Polygon
(Canvas : in Canvas_Type;
Points : in Point_List);
procedure Draw_Image (Canvas : in Canvas_Type;
From : in Point_Type;
Image : in Image_Type);
procedure Draw_Image (Canvas : in Canvas_Type;
From : in Point_Type;
To : in Point_Type;
Image : in Image_Type);
procedure Draw_Image (Canvas : in Canvas_Type;
From : in Point_Type;
Width : in Natural;
Height : in Natural;
Image : in Image_Type);
function Start_Point (Canvas : Canvas_Type) return Point_Type;
function End_Point (Canvas : Canvas_Type) return Point_Type;
function Mouse_Down (Canvas : Canvas_Type) return Boolean;
function Mouse_Moved (Canvas : Canvas_Type) return Boolean;
function Key_Code (Canvas : Canvas_Type) return Character;
----------------------------------------------------------------------------
--
-- C O M M O N D I A L O G S
--
-- Common dialogs are pre-packaged dialog widgets which are not treated
-- as normal windows (although they are made to look similar for ease of
-- use).
--
-- Common dialog operations (common to all dialogs):
--
-- Execute (Dialog) -- execute the dialog and return True if the OK
-- -- button was used to close the dialog and False
-- -- otherwise.
--
----------------------------------------------------------------------------
type Common_Dialog_Type is abstract tagged private;
function Execute (Dialog : Common_Dialog_Type) return Boolean;
----------------------------------------------------------------------------
--
-- C O M M O N D I A L O G S U B C L A S S E S
--
-- The available dialog subclasses are colour, font and file dialogs.
--
-- Colour_Dialog_Type : a dialog to allow the user to select a colour.
-- Font_Dialog_Type : a dialog to allow the user to select a font.
-- File_Dialog_Type : a dialog to allow the user to select a file name.
--
----------------------------------------------------------------------------
type Colour_Dialog_Type is new Common_Dialog_Type with private;
type Font_Dialog_Type is new Common_Dialog_Type with private;
type File_Dialog_Type is abstract new Common_Dialog_Type with private;
----------------------------------------------------------------------------
--
-- C O L O U R D I A L O G S
--
-- Colour dialogs allow the user to select or create a colour.
--
-- Colour dialog operations:
--
-- Colour_Dialog -- create a colour dialog.
-- Set_Colour (Dialog, -- set the initial colour displayed in the
-- Colour) -- dialog to this colour.
-- Get_Colour (Dialog) -- get the colour contained in the dialog.
--
----------------------------------------------------------------------------
function Colour_Dialog return Colour_Dialog_Type;
procedure Set_Colour (Dialog : in Colour_Dialog_Type;
Colour : in Colour_Type);
function Get_Colour (Dialog : in Colour_Dialog_Type) return Colour_Type;
----------------------------------------------------------------------------
--
-- F O N T D I A L O G S
--
-- Font dialogs allow the user to select a font.
--
-- Font dialog operations:
--
-- Font_Dialog -- create a font dialog.
-- Set_Font (Dialog, -- set the initial font displayed in the
-- Font) -- dialog to this font.
-- Get_Font (Dialog) -- get the font contained in the dialog.
--
----------------------------------------------------------------------------
function Font_Dialog return Font_Dialog_Type;
procedure Set_Font (Dialog : in Font_Dialog_Type;
Font : in Font_Type);
function Get_Font (Dialog : in Font_Dialog_Type) return Font_Type;
----------------------------------------------------------------------------
--
-- F I L E D I A L O G S
--
-- File dialogs allow the user to select or enter a file name. This is an
-- abstract type which is further subclassed below.
--
-- File dialog operations (common to all file dialogs):
--
-- Set_Name (Dialog, -- set the initial file name displayed in the
-- Name) -- dialog to this string.
-- Get_Name (Dialog) -- get the file name contained in the dialog.
-- Add_Filter (Dialog, -- add a file type filter to the dialog
-- Text, -- with this description
-- Filter) -- to match this wildcard specification.
-- Set_Directory (Dialog, -- set the initial directory for the dialog
-- Name) -- to this directory.
--
----------------------------------------------------------------------------
procedure Set_Name (Dialog : in File_Dialog_Type;
Name : in String);
function Get_Name (Dialog : in File_Dialog_Type) return String;
procedure Add_Filter (Dialog : in File_Dialog_Type;
Text : in String;
Filter : in String);
procedure Set_Directory (Dialog : in File_Dialog_Type;
Name : in String);
----------------------------------------------------------------------------
--
-- O P E N D I A L O G S
--
-- Open dialogs allow the user to select or enter a file name for use as
-- an input file. The file name selected must be the name of an existing
-- file.
--
-- Open dialog operations:
--
-- Open_Dialog (Title) -- create an open file dialog with this title.
--
----------------------------------------------------------------------------
type Open_Dialog_Type is new File_Dialog_Type with private;
function Open_Dialog (Title : String) return Open_Dialog_Type;
----------------------------------------------------------------------------
--
-- S A V E D I A L O G S
--
-- Save dialogs allow the user to select or enter a file name for use as
-- an output file. If the Create parameter to the constructor function
-- below is True (as it is by default) and an existing file is selected,
-- the user will be asked if the file should be overwritten. If it is
-- False and the file does not exist, the user will be asked if it should
-- be created.
--
-- Save dialog operations:
--
-- Save_Dialog (Title, -- create a save file dialog with this title
-- Create) -- which will prompt the user as described above.
--
----------------------------------------------------------------------------
type Save_Dialog_Type is new File_Dialog_Type with private;
function Save_Dialog (Title : String;
Create : Boolean := True) return Save_Dialog_Type;
----------------------------------------------------------------------------
-- Renamings for our transatlantic cousins, in the hope that some day
-- they'll repay the favour/favor...
----------------------------------------------------------------------------
procedure Set_Color (Canvas : in Canvas_Type;
Colour : in Colour_Type := White) renames Set_Colour;
subtype Color_Dialog_Type is Colour_Dialog_Type;
function Color_Dialog return Colour_Dialog_Type renames Colour_Dialog;
procedure Set_Color (Dialog : in Colour_Dialog_Type;
Colour : in Colour_Type) renames Set_Colour;
function Get_Color (Dialog : in Colour_Dialog_Type) return Colour_Type
renames Get_Colour;
private -- and deliberately uninformative!
type Window_Type is abstract tagged
record
Internals : JEWL.Controlled_Type; -- see package JEWL
end record;
type Container_Type is abstract new Window_Type with null record;
type Control_Type is abstract new Window_Type with null record;
type Frame_Type is new Container_Type with null record;
type Dialog_Type is new Container_Type with null record;
type Panel_Type is new Container_Type with null record;
type Menu_Type is new Container_Type with null record;
type Text_Control_Type is abstract new Control_Type with null record;
type Multiline_Type is abstract new Control_Type with null record;
type Canvas_Type is new Control_Type with null record;
type Button_Type is new Text_Control_Type with null record;
type Label_Type is new Text_Control_Type with null record;
type Editbox_Type is new Text_Control_Type with null record;
type Boolean_Control_Type is abstract new Text_Control_Type with null record;
type Menuitem_Type is new Boolean_Control_Type with null record;
type Checkbox_Type is new Boolean_Control_Type with null record;
type Radiobutton_Type is new Boolean_Control_Type with null record;
type Listbox_Type is new Multiline_Type with null record;
type Combobox_Type is new Multiline_Type with null record;
type Memo_Type is new Multiline_Type with null record;
type Common_Dialog_Type is abstract tagged
record
Internals : JEWL.Controlled_Type; -- see package JEWL
end record;
type Colour_Dialog_Type is new Common_Dialog_Type with null record;
type Font_Dialog_Type is new Common_Dialog_Type with null record;
type File_Dialog_Type is abstract new Common_Dialog_Type with null record;
type Open_Dialog_Type is new File_Dialog_Type with null record;
type Save_Dialog_Type is new File_Dialog_Type with null record;
type Image_Type is
record
Internals : JEWL.Controlled_Type; -- see package JEWL
end record;
end JEWL.Windows;
| true |
------------------------------------------------------------------------------
-- --
-- J E W L . W I N D O W S --
-- --
-- A package for developing GUI-based programs for beginners. --
-- --
-- This is a large package, but splitting it into child packages would --
-- require multiple generic instantiations in order to use it. --
-- --
-- Copyright (C) PI:NAME:<NAME>END_PI 2000. Contact address: PI:EMAIL:<EMAIL>END_PI --
-- This software is released under the terms of the GNU General Public --
-- License and is intended primarily for educational use. Please contact --
-- the author to report bugs, suggestions and modifications. --
-- --
------------------------------------------------------------------------------
-- $Id: jewl-windows.ads 1.7 2007/01/08 17:00:00 JE Exp $
------------------------------------------------------------------------------
--
-- $Log: jewl-windows.ads $
-- Revision 1.7 2007/01/08 17:00:00 JE
-- * Fixed linker options in JEWL.Win32_Interface to accommodate changes to GNAT
-- GPL 2006 compiler (thanks to PI:NAME:<NAME>END_PI for this)
-- * Added delay in message loop to avoid the appearance of hogging 100% of CPU
-- time
--
-- Revision 1.6 2001/11/02 16:00:00 JE
-- * Fixed canvas bug when saving an empty canvas
-- * Restore with no prior save now acts as erase
-- * Removed redundant variable declaration in Image function
--
-- Revision 1.5 2001/08/22 15:00:00 JE
-- * Minor bugfix to Get_Text for combo boxes
-- * Minor changes to documentation (including new example involving dialogs)
--
-- Revision 1.4 2001/01/25 09:00:00 je
-- Changes visible to the user:
--
-- * Added support for drawing bitmaps on canvases (Draw_Image operations
-- and new type Image_Type)
-- * Added Play_Sound
-- * Added several new operations on all windows: Get_Origin, Get_Width,
-- Get_Height, Set_Origin, Set_Size and Focus
-- * Added several functions giving screen and window dimensions: Screen_Width,
-- Screen_Height, Frame_Width, Frame_Height, Dialog_Width, Dialog_Height and
-- Menu_Height
-- * Canvases can now handle keyboard events: new constructor and Key_Code added
-- * Added procedure Play_Sound
-- * Operations "+" and "-" added for Point_Type
-- * Pens can now be zero pixels wide
-- * The absolute origin of a frame can now have be specified when the frame
-- is created
-- * Added new File_Dialog operations Add_Filter and Set_Directory
-- * Added Get_Line renames to JEWL.IO for compatibility with Ada.Text_IO
-- * Added all the Get(File,Item) operations mentioned in documentation but
-- unaccountably missing :-(
-- * Documentation updated to reflect the above changes
-- * HTML versions of public package specifications added with links from
-- main documentation pages
--
-- Other internal changes:
--
-- * Canvas fonts, pens etc. now use JEWL.Reference_Counted_Type rather than
-- reinventing this particular wheel, as do images
-- * Various minor code formatting changes: some code reordered for clarity,
-- some comments added or amended,
-- * Changes introduced in 1.2 to support GNAT 3.10 have been reversed, since
-- GNAT 3.10 still couldn't compile this code correctly... ;-(
--
-- Outstanding issues:
--
-- * Optimisation breaks the code (workaround: don't optimise)
--
-- Revision 1.3 2000/07/07 12:00:00 je
-- * JEWL.Simple_Windows added; JEWL.IO modified to use JEWL.Simple_Windows.
-- * JEWL.IO bug fix: Put_Line to file wrote newline to standard output
-- instead of to the file (thanks to PI:NAME:<NAME>END_PI for pointing this out).
-- * Panels fixed so that mouse clicks are passed on correctly to subwindows.
-- * Memos fixed so that tabs are handled properly.
-- * Password feature added to editboxes.
-- * Minor typos fixed in comments within the package sources.
-- * Documentation corrected and updated following comments from PI:NAME:<NAME>END_PI
-- and PI:NAME:<NAME>END_PI.
--
-- Revision 1.2 2000/04/18 20:00:00 je
-- * Minor code changes to enable compilation by GNAT 3.10
-- * Minor documentation errors corrected
-- * Some redundant "with" clauses removed
--
-- Revision 1.1 2000/04/09 21:00:00 je
-- Initial revision
--
------------------------------------------------------------------------------
generic -- This is a generic package which must be
type Command_Type is (<>); -- instantiated with a list of possible
-- command values to be generated whenever
package JEWL.Windows is -- a window is closed, a button is clicked
-- or a menu item is selected.
----------------------------------------------------------------------------
-- Miscellaneous operations
----------------------------------------------------------------------------
procedure Show_Error (Text : in String; -- an error message
Title : in String := "Error");
function Show_Query (Text : in String; -- a yes/no query
Title : in String := "Query")
return Boolean;
procedure Show_Message (Text : in String; -- an information message
Title : in String := "Message");
procedure Play_Sound (Sound : in String); -- play a sound file
function Screen_Width return Natural; -- width of display screen
function Screen_Height return Natural; -- height of display screen
----------------------------------------------------------------------------
--
-- S U P P O R T T Y P E S
--
-- Except for Alignment_Type, these types are defined in the top-level
-- package JEWL and are renamed here for convenience:
--
-- Alignment_Type : used to specify text alignment with a window.
-- Angle_Type : an angle specified as an integral number of
-- degrees (0 to 359)
-- Colour_Type : a colour specified as an RGB value.
-- Font_Type : a font specified by a name, point size and bold
-- and italic style options.
-- Point_Type : a pair of (X,Y) coordinates within a window.
-- Point_List : an array of (X,Y) coordinate pairs.
--
----------------------------------------------------------------------------
type Alignment_Type is (Left, Centre, Right);
subtype Angle_Type is JEWL.Angle_Type;
subtype Colour_Range is JEWL.Colour_Range;
subtype Colour_Type is JEWL.Colour_Type;
subtype Font_Type is JEWL.Font_Type;
type Image_Type is private;
subtype Point_Type is JEWL.Point_Type;
subtype Point_List is JEWL.Point_List;
----------------------------------------------------------------------------
-- Renamings for our transatlantic cousins, in the hope that some day
-- they'll repay the favour/favor... ;-)
----------------------------------------------------------------------------
subtype Color_Range is Colour_Range;
subtype Color_Type is Colour_Type;
function Center return Alignment_Type renames Centre;
----------------------------------------------------------------------------
--
-- O P E R A T I O N S O N S U P P O R T T Y P E S
--
-- These are renamings of the operations defined in the parent package
-- provided for convenience.
--
-- Colour operations:
-- Light : Generate a lightened version of a colour, e.g. Light(Red).
-- Dark : Generate a darkened version of a colour, e.g. Dark(Green).
--
-- Font operations:
-- Font : Generate a font with the specified properties.
-- Name : Get the name of the font typeface.
-- Size : Get the font size in points.
-- Bold : Test if the font is bold.
-- Italic : Test if the font is italic.
--
-- Image operations:
-- Image : Load an image from a bitmap file.
-- Valid : Test if an image is valid.
-- Width : Get the width of an image.
-- Height : Get the height of an image.
--
-- Point operations:
-- Endpoint : Calculate the endpoint of a line from a starting point,
-- length and angle
-- Inside : Test if a specified point is inside a specified rectangle
-- (defined by the coordinates of two diagonally opposite
-- corners).
-- P1 + P2 : Add two points (P1.X+P2.X, P1.Y+P2.Y).
-- P1 - P2 : Subtract two points (P1.X-P2.X, P1.Y-P2.Y).
--
----------------------------------------------------------------------------
function Light (Colour : JEWL.Colour_Type) return JEWL.Colour_Type
renames JEWL.Light;
function Dark (Colour : JEWL.Colour_Type) return JEWL.Colour_Type
renames JEWL.Dark;
function Font (Name : String;
Size : Positive;
Bold : Boolean := False;
Italic : Boolean := False) return JEWL.Font_Type
renames JEWL.Font;
function Name (Font : Font_Type) return String
renames JEWL.Name;
function Size (Font : Font_Type) return Natural
renames JEWL.Size;
function Bold (Font : Font_Type) return Boolean
renames JEWL.Bold;
function Italic (Font : Font_Type) return Boolean
renames JEWL.Italic;
function Image (Name : String) return Image_Type;
function Valid (Image : Image_Type) return Boolean;
function Width (Image : Image_Type) return Natural;
function Height (Image : Image_Type) return Natural;
function Endpoint (From : JEWL.Point_Type;
Length : Positive;
Angle : JEWL.Angle_Type) return JEWL.Point_Type
renames JEWL.Endpoint;
function Inside (Point : JEWL.Point_Type;
From : JEWL.Point_Type;
To : JEWL.Point_Type) return Boolean
renames JEWL.Inside;
function "+" (P1, P2 : Point_Type) return Point_Type
renames JEWL."+";
function "-" (P1, P2 : Point_Type) return Point_Type
renames JEWL."-";
----------------------------------------------------------------------------
--
-- S U P P O R T T Y P E C O N S T A N T S
--
-- Angles : North, South, East and West
-- Colours : Black, White, Red, Green, Blue, etc.
-- Fonts : Default_Font (the default font for top-level windows) and
-- Parent_Font (the same font as a window's parent uses)
--
----------------------------------------------------------------------------
North : constant Angle_Type := 0;
South : constant Angle_Type := 180;
East : constant Angle_Type := 90;
West : constant Angle_Type := 270;
Black : constant Colour_Type := ( 0, 0, 0);
White : constant Colour_Type := (255,255,255);
Red : constant Colour_Type := (255, 0, 0);
Green : constant Colour_Type := ( 0,255, 0);
Blue : constant Colour_Type := ( 0, 0,255);
Gray : constant Colour_Type := (128,128,128);
Yellow : constant Colour_Type := (255,255, 0);
Cyan : constant Colour_Type := ( 0,255,255);
Magenta : constant Colour_Type := (255, 0,255);
Default_Font : constant Font_Type := Font("Arial",9);
Parent_Font : constant Font_Type := Font("",1);
----------------------------------------------------------------------------
--
-- W I N D O W _ T Y P E
--
-- An abstract class providing basic behaviour which all windows share.
--
----------------------------------------------------------------------------
type Window_Type is abstract tagged private;
Invalid_Window : exception; -- raised if an attempt is made to use an
-- invalid (non-open) window
----------------------------------------------------------------------------
--
-- Window operations (common to all windows):
--
-- Show (Window, -- make the window visible or invisible depending
-- Visible) -- on the value of Visible (default: True).
-- Hide (Window) -- make the window invisible.
-- Focus (Window) -- give the window the input focus.
-- Visible (Window) -- return True if the window is visible.
-- Get_Origin (Window) -- get the origin (top left point) of the
-- -- specified window.
-- Get_Width (Window) -- get the width of the specified window.
-- Get_Height (Window) -- get the height of the specified window.
-- Set_Origin (Window, -- set the origin (top left point) of the
-- Origin) -- specified window to this value.
-- Set_Size (Window, -- set the size of the specified window
-- Width, -- to this width (optional)
-- Height) -- and this height (optional).
-- Get_Font (Window) -- get the font for the specified window.
-- Set_Font (Window, -- set the font for the specified window
-- Font) -- to this one.
--
----------------------------------------------------------------------------
procedure Show (Window : in Window_Type;
Visible : in Boolean := True);
procedure Hide (Window : in Window_Type);
procedure Focus (Window : in Window_Type);
function Visible (Window : Window_Type) return Boolean;
function Get_Origin (Window : Window_Type) return Point_Type;
function Get_Width (Window : Window_Type) return Natural;
function Get_Height (Window : Window_Type) return Natural;
procedure Set_Origin (Window : in Window_Type;
Origin : in Point_Type);
procedure Set_Size (Window : in Window_Type;
Width : in Natural := 0;
Height : in Natural := 0);
function Get_Font (Window : Window_Type) return Font_Type;
procedure Set_Font (Window : in Window_Type;
Font : in Font_Type);
----------------------------------------------------------------------------
--
-- W I N D O W S U B C L A S S E S
--
-- The primary window subclasses are containers and controls. They
-- share the behaviour common to all windows (above) and provide extra
-- behaviour as well.
--
-- Container_Type : the abstract base type for all containers.
-- Control_Type : the abstract base type for all controls.
--
----------------------------------------------------------------------------
type Container_Type is abstract new Window_Type with private;
type Control_Type is abstract new Window_Type with private;
----------------------------------------------------------------------------
--
-- C O N T A I N E R S
--
-- Containers are windows which can contain other windows. All windows
-- except frames and dialogs (see below) must be contained within some
-- other container window. There are some restrictions on the types of
-- container that a window can be attached to (for example, a menu item
-- must be attached to a menu).
--
-- Most windows specify an origin, a width and a height whose coordinates
-- are taken relative to the enclosing container. Positive widths and
-- heights are absolute values, but zero and negative widths and heights
-- are interpreted as being relative to the width and height of the
-- enclosing container (so a width of 0 means the width of the enclosing
-- container, a height of -10 means 10 pixels less than the height of the
-- enclosing container).
--
-- The types of container windows available are as follows:
--
-- Frame_Type : a main window with a title bar, system menu, minimise
-- and maximise buttons, and a close button.
-- Dialog_Type : a top level window which is used for modal interaction,
-- disabling other windows while the interaction takes
-- place.
-- Panel_Type : a plain window which is used as a container for other
-- subwindows.
-- Menu_Type : a menu which can contain menu items and submenus.
--
----------------------------------------------------------------------------
type Frame_Type is new Container_Type with private;
type Dialog_Type is new Container_Type with private;
type Panel_Type is new Container_Type with private;
type Menu_Type is new Container_Type with private;
----------------------------------------------------------------------------
--
-- F R A M E S
--
-- A frame is a top level window with a title bar, system menu, minimise
-- and maximise buttons, and a close button. Closing a frame generates a
-- command. Frames are normally visible, but can be hidden if required.
-- A frame should be used as the main window for an application.
--
-- Frame operations:
--
-- Frame (Origin, -- create a frame at the specified position
-- Width, -- with the specified width
-- Height, -- and height in pixels,
-- Title, -- with the specified title in the title bar,
-- Command, -- generating this command when it is closed,
-- Font) -- using this font (default: Default_Font).
-- Frame (Width, -- create a frame with the specified width
-- Height, -- and height in pixels, placed randomly,
-- Title, -- with the specified title in the title bar,
-- Command, -- generating this command when it is closed,
-- Font) -- using this font (default: Default_Font).
--
-- Close (Frame) -- close the frame.
-- Valid (Frame) -- true until the frame is closed.
--
-- Frame_Width -- return the width of the frame border.
-- Frame_Height -- return the height of the frame border.
--
-- Next_Command -- return the next command generated by any
-- -- control in any existing frame.
-- Command_Ready -- test if there is a command pending
--
----------------------------------------------------------------------------
function Frame (Origin : Point_Type;
Width : Positive;
Height : Positive;
Title : String;
Command : Command_Type;
Font : Font_Type := Default_Font) return Frame_Type;
function Frame (Width : Positive;
Height : Positive;
Title : String;
Command : Command_Type;
Font : Font_Type := Default_Font) return Frame_Type;
procedure Close (Frame : in Frame_Type);
function Valid (Frame : Frame_Type) return Boolean;
function Frame_Width return Natural;
function Frame_Height return Natural;
function Next_Command return Command_Type;
function Command_Ready return Boolean;
----------------------------------------------------------------------------
--
-- D I A L O G S
--
-- A dialog is a top level window like a frame, but it only has a close
-- button on its title bar. Dialogs are intended for user interaction.
-- When a dialog is executed it becomes visible and all other windows
-- are disabled. Execution of a dialog continues until a command is
-- generated by closing the dialog window or by clicking on a button
-- attached to the dialog. Dialog windows do not have a menu bar.
--
-- Dialog operations:
--
-- Dialog (Width, -- create a dialog with the given width and
-- Height, -- and height in pixels,
-- Title, -- with the specified title in the title bar,
-- Command, -- generating this command when it is closed,
-- Font) -- using this font (default: Default_Font).
--
-- Execute (Dialog) -- execute a dialog and return the command code
-- -- used to exit from it.
--
-- Dialog_Width -- return the width of the dialog border.
-- Dialog_Height -- return the height of the dialog border.
--
----------------------------------------------------------------------------
function Dialog (Width : Positive;
Height : Positive;
Title : String;
Command : Command_Type;
Font : Font_Type := Default_Font) return Dialog_Type;
function Execute (Dialog : in Dialog_Type) return Command_Type;
function Dialog_Width return Natural;
function Dialog_Height return Natural;
----------------------------------------------------------------------------
--
-- P A N E L S
--
--
-- Panel operations:
--
-- Panel (Parent, -- create a panel inside a parent container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- with the specified width
-- Height, -- and the specified height, and
-- Title, -- with this title on the border (default: none)
-- Font) -- using this font (default: same as Parent).
--
----------------------------------------------------------------------------
function Panel (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Title : String := "";
Font : Font_Type := Parent_Font) return Panel_Type;
----------------------------------------------------------------------------
--
-- M E N U S
--
-- A menu is a pull-down list of items attached to a frame's menu bar.
-- The items on a menu are either menuitems (which generate a command
-- when they are selected, submenus (which display another menu when
-- selected) or separators (horizontal bars used to separate a menu
-- into subsections.
--
-- If the text label for a menu contains the character "&", the character
-- which follows is underlined and the menu can be activated by pressing
-- Alt + that character. The character "&" is not displayed.
--
-- Menu operations:
--
-- Menu (Parent, -- create a menu attached to a frame or a menu
-- Text) -- with the specified text label.
--
-- Menu_Height -- return the height of a menu bar.
--
----------------------------------------------------------------------------
function Menu (Parent : Frame_Type'Class;
Text : String) return Menu_Type;
function Menu (Parent : Menu_Type'Class;
Text : String) return Menu_Type;
function Menu_Height return Natural;
----------------------------------------------------------------------------
--
-- C O N T R O L S
--
-- Controls are windows for user interaction. They hold values (e.g. a
-- text string) which can normally be set by the user, as well as being
-- accessed and altered by the program itself. Some controls (e.g. menu
-- items) generate command values which can be used to trigger actions
-- in the program. The following operations are common to all controls:
--
-- Enable (Control, -- enable or disable the control depending on
-- Enabled) -- the value of Enabled (default: True).
-- Disable (Control) -- disable the control.
-- Enabled (Control) -- test if the control is enabled.
--
----------------------------------------------------------------------------
procedure Enable (Control : in Control_Type;
Enabled : in Boolean := True);
procedure Disable (Control : in Control_Type);
function Enabled (Control : Control_Type) return Boolean;
----------------------------------------------------------------------------
--
-- The types of control available are as follows:
--
-- Menuitem_Type : controls which can appear on pull-down menus
-- Text_Control_Type : controls containing with a single-line text string
-- Multiline_Type : controls containing multiple text strings
-- Canvas_Type : a plain window for drawing arbitrary shapes on
--
----------------------------------------------------------------------------
type Text_Control_Type is abstract new Control_Type with private;
type Multiline_Type is abstract new Control_Type with private;
type Canvas_Type is new Control_Type with private;
----------------------------------------------------------------------------
--
-- T E X T C O N T R O L S
--
-- Text controls include a single-line text string. The following
-- operations are common to all text controls:
--
-- Get_Length (Control) -- get the length of the text associated with the
-- -- control.
-- Get_Text (Control) -- get the text associated with the control as a
-- -- string of indefinite size.
-- Get_Text (Control, -- get the text associated with the control into
-- Text, -- this fixed-size string variable
-- Length) -- and set this integer variable to the actual
-- -- number of characters copied.
-- Set_Text (Control, -- set the text associated with the control.
-- Text) -- to the specified new text value.
--
----------------------------------------------------------------------------
function Get_Length (Control : Text_Control_Type) return Natural;
function Get_Text (Control : Text_Control_Type) return String;
procedure Get_Text (Control : in Text_Control_Type;
Text : out String;
Length : out Natural);
procedure Set_Text (Control : in Text_Control_Type;
Text : in String);
----------------------------------------------------------------------------
--
-- The types of text control available are as follows:
--
-- Button_Type : a pushbutton which generates a command code.
-- Label_Type : a static non-interactive label.
-- Editbox_Type : a single-line edit control for text input.
--
-- There is a further subclass of text control, as follows:
--
-- Boolean_Control_Type : a text control with an associated Boolean state
--
----------------------------------------------------------------------------
type Button_Type is new Text_Control_Type with private;
type Label_Type is new Text_Control_Type with private;
type Editbox_Type is new Text_Control_Type with private;
type Boolean_Control_Type is abstract new Text_Control_Type with private;
----------------------------------------------------------------------------
--
-- B U T T O N S
--
-- Buttons are rectangular labelled controls which generate a command
-- code when pressed. "Default" buttons are displayed with a heavier
-- border and respond when the Enter key is pressed.
--
-- Button operations:
--
-- Button (Parent, -- create a button in a parent container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- with the specified width
-- Height, -- and the specified height,
-- Text, -- labelled with the specified text,
-- Command, -- generating this command when it is pressed,
-- Default, -- set up as a "default" button (default: False),
-- Font) -- using this font (default: same as Parent).
--
----------------------------------------------------------------------------
function Button (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Text : String;
Command : Command_Type;
Default : Boolean := False;
Font : Font_Type := Parent_Font) return Button_Type;
----------------------------------------------------------------------------
--
-- L A B E L S
--
-- A label is a static text control that can be used to label other
-- controls. Labels do not respond to user interaction, but their
-- values can be read and altered by the program in the same way as
-- any other text control.
--
-- Label operations:
--
-- Label (Parent, -- create a label inside a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- with the specified width
-- Height, -- and the specified height, and
-- Text, -- labelled with the specified text
-- Align, -- aligned left, right or centre (default: Left),
-- Font) -- using this font (default: same as Parent).
--
----------------------------------------------------------------------------
function Label (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Text : String;
Align : Alignment_Type := Left;
Font : Font_Type := Parent_Font) return Label_Type;
----------------------------------------------------------------------------
--
-- E D I T B O X E S
--
-- An editbox is a text control containing a single line of text whose
-- value can be edited by the user.
--
-- Editbox operations:
--
-- Editbox (Parent, -- create an editbox inside a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- with the specified width
-- Height, -- and the specified height, and
-- Text, -- initialised with the specified text,
-- Password, -- optionally set up as a password editbox,
-- Font) -- using this font (default: same as Parent).
--
-- Modified (Editbox) -- test if the editbox has been modified by the
-- -- user.
--
----------------------------------------------------------------------------
function Editbox (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Text : String := "";
Password : Boolean := False;
Font : Font_Type := Parent_Font) return Editbox_Type;
function Modified (Editbox : Editbox_Type) return Boolean;
----------------------------------------------------------------------------
--
-- B O O L E A N C O N T R O L S
--
-- Boolean controls are text controls which can be toggled between two
-- states (checked or unchecked). The following operations are common
-- to all Boolean controls:
--
-- Get_State (Control) -- get the current state of the control
-- Set_State (Control, -- set the current state of the control
-- State) -- to the specified value
--
----------------------------------------------------------------------------
function Get_State (Control : Boolean_Control_Type) return Boolean;
procedure Set_State (Control : in Boolean_Control_Type;
State : in Boolean);
----------------------------------------------------------------------------
--
-- The types of Boolean controls available are as follows:
--
-- Checkbox_Type : a checkbox which can be checked or unchecked.
-- Radiobutton_Type : a radio button which can be checked or unchecked.
--
----------------------------------------------------------------------------
type Menuitem_Type is new Boolean_Control_Type with private;
type Checkbox_Type is new Boolean_Control_Type with private;
type Radiobutton_Type is new Boolean_Control_Type with private;
----------------------------------------------------------------------------
--
-- M E N U I T E M S
--
-- Menu items can only be attached to menus. When a menu is clicked, a
-- pull-down menu appears which can consist of menu items (which generate
-- a command when clicked) or further menus.
--
-- Each menu and menu item has a text label in which the character "&"
-- is treated specially. "&" will not be displayed, but the following
-- character (e.g. 'X') will be underlined to indicate that it can be
-- selected by pressing Alt + 'X' when the menu is visible.
--
-- Menuitem operations:
--
-- Menuitem (Parent, -- create a menu item attached to a parent menu
-- Text, -- with this text label,
-- Command) -- generating this command code when selected
--
-- Separator (Parent) -- create a separator (an inactive horizontal
-- -- bar) attached to a parent menu
--
----------------------------------------------------------------------------
function Menuitem (Parent : Menu_Type'Class;
Text : String;
Command : Command_Type) return Menuitem_Type;
function Separator (Parent : Menu_Type'Class) return Menuitem_Type;
----------------------------------------------------------------------------
-- Menu items behave slightly differently to other controls, so the
-- following operations are overridden:
--
procedure Enable (Control : in Menuitem_Type;
Enabled : in Boolean := True);
function Enabled (Control : Menuitem_Type) return Boolean;
function Get_Length (Control : Menuitem_Type) return Natural;
function Get_Text (Control : Menuitem_Type) return String;
procedure Set_Text (Control : in Menuitem_Type;
Text : in String);
function Get_State (Control : Menuitem_Type) return Boolean;
procedure Set_State (Control : in Menuitem_Type;
State : in Boolean);
----------------------------------------------------------------------------
--
-- C H E C K B O X E S
--
-- A checkbox is a labelled control with a left-aligned box that can be
-- checked or unchecked. Clicking on a checkbox (or pressing Space when
-- it is selected) toggles the checkbox between the checked and unchecked
-- states.
--
-- Checkbox operations:
--
-- Checkbox (Parent, -- create a checkbox in a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- with the specified width
-- Height, -- and the specified height, and
-- Text, -- labelled with the specified text, and
-- Checked, -- set to this initial state (default: False),
-- Font) -- using this font (default: same as Parent).
--
----------------------------------------------------------------------------
function Checkbox (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Text : String;
Checked : Boolean := False;
Font : Font_Type := Parent_Font) return Checkbox_Type;
----------------------------------------------------------------------------
--
-- R A D I O B U T T O N S
--
-- A radiobutton is a Boolean control with a left-aligned box that can be
-- checked or unchecked. Radiobuttons attached to the same container form
-- a group. Clicking on an unchecked radiobutton will set the radiobutton
-- to the checked state and will also uncheck the other radiobuttons which
-- belong to the same group (i.e. which are attached to the same container).
-- Unlike a checkbox, a radiobutton cannot be turned off by clicking on it;
-- you can only uncheck a radiobutton by checking another one in the same
-- group.
--
-- Radiobutton operations:
--
-- Radiobutton (Parent, -- create a radiobutton in a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- with the specified width
-- Height, -- and the specified height, and
-- Text, -- labelled with the specified text, and
-- Checked, -- set to this initial state (default: False),
-- Font) -- using this font (default: Default_Font).
--
----------------------------------------------------------------------------
function Radiobutton (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Text : String;
Checked : Boolean := False;
Font : Font_Type := Parent_Font)
return Radiobutton_Type;
----------------------------------------------------------------------------
--
-- M U L T I L I N E C O N T R O L S
--
-- Multiline controls contain multiple lines of text numbered from 1
-- upwards. Individual lines can be accessed by specifying a line
-- number. The user can select a particular line by clicking on it
-- with the mouse or using the keyboard arrow keys when the control
-- is selected. Specifying the line number to access as 0 will access
-- the currently selected line. If no line is selected, the current
-- line number will be reported as 0 but its contents can still be
-- accessed . A Constraint_Error will be raised if an attempt is made
-- to access a line beyond the last one.
--
-- The following operations are common to all multiline controls, but
-- their precise effects vary slightly according to the actual type of
-- the control (see below):
--
-- Get_Count (Control) -- get the number of lines of text in the control.
-- Get_Line (Control) -- get the number of the currently selected line.
-- Get_Length (Control, -- get the length of the specified line
-- Line) -- (default: current line).
-- Get_Text (Control, -- get the text of the specified line as a string
-- Line) -- of indefinite length (default: current line).
--
-- Get_Text (Control, -- get the text of the control
-- Line, -- from the specified line (default: current line)
-- Text, -- into a fixed-size string variable, together
-- Length) -- with the number of characters transferred.
-- Set_Text (Control, -- set the text of the control
-- Line, -- at the specified line
-- Text) -- to the specified value.
--
-- Select_Line (Control, -- select the line at the specified line number
-- Line) -- (default: 0, meaning deselect).
-- Append_Line (Control, -- append a line to the end of the control, where
-- Text) -- this is the text to append.
-- Insert_Line (Control, -- insert a new line above the specified
-- Line, -- line number, where
-- Text) -- this is the text to insert.
-- Delete_Line (Control, -- delete the specified line.
-- Line)
-- Delete_All (Control) -- delete all lines.
--
----------------------------------------------------------------------------
function Get_Count (Control : Multiline_Type) return Natural is abstract;
function Get_Line (Control : Multiline_Type) return Natural is abstract;
function Get_Length (Control : Multiline_Type;
Line : Natural := 0) return Natural is abstract;
function Get_Text (Control : Multiline_Type;
Line : Natural := 0) return String is abstract;
procedure Get_Text (Control : in Multiline_Type;
Line : in Natural := 0;
Text : out String;
Length : out Natural);
procedure Set_Text (Control : in Multiline_Type;
Text : in String;
Line : in Natural := 0) is abstract;
procedure Select_Line (Control : in Multiline_Type;
Line : in Natural := 0) is abstract;
procedure Append_Line (Control : in Multiline_Type;
Text : in String) is abstract;
procedure Insert_Line (Control : in Multiline_Type;
Text : in String;
Line : in Natural := 0) is abstract;
procedure Delete_Line (Control : in Multiline_Type;
Line : in Natural := 0) is abstract;
procedure Delete_All (Control : in Multiline_Type) is abstract;
----------------------------------------------------------------------------
--
-- The types of multiline controls available are as follows:
--
-- Listbox_Type : a list of text items in a scrollable window
-- Combobox_Type : an editbox in combination with a drop-down list box
-- Memo_Type : a multi-line text editor
--
----------------------------------------------------------------------------
type Listbox_Type is new Multiline_Type with private;
type Combobox_Type is new Multiline_Type with private;
type Memo_Type is new Multiline_Type with private;
----------------------------------------------------------------------------
--
-- L I S T B O X E S
--
-- A listbox is a list of lines of text (initially empty). The lines are
-- sorted into ascending order by default, but can be left unsorted if
-- required. For a sorted list, the position at which a new line is added
-- will be ignored, with the new line being inserted at the appropriate
-- position according to its value. When no line has been selected, the
-- contents of the current line will be reported as an empty string ("").
--
-- Listbox operations:
--
-- Listbox (Parent, -- create a listbox inside a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- the specified width
-- Height, -- and the specified height, using
-- Font) -- this font (default: same as Parent).
--
----------------------------------------------------------------------------
function Listbox (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Font : Font_Type := Parent_Font) return Listbox_Type;
----------------------------------------------------------------------------
--
-- C O M B O B O X E S
--
-- A combobox consists of an edit control together with a drop-down list
-- (effectively a combination of an editbox and a listbox). The currently
-- selected line is displayed in the edit control, and you can specify
-- whether the user is able to manually edit this value. If not, only
-- the values in the drop-down list can be selected.
--
-- If the contents of the edit control match one of the values in the list,
-- the position of the corresponding line in the list is reported as the
-- number of the currently selected line. Otherwise, the number of the
-- current line is reported as 0. Accessing the value of the current line
-- (line 0) will report the current value of the edit control.
--
-- Combobox operations:
--
-- Combobox (Parent, -- create a combobox inside a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- with the specified width, whose value can
-- Editable, -- be manually edited (default: True),
-- Font) -- using this font (default: same as Parent).
--
----------------------------------------------------------------------------
function Combobox (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Editable : Boolean := True;
Font : Font_Type := Parent_Font) return Combobox_Type;
----------------------------------------------------------------------------
--
-- M E M O S
--
-- A memo is a simple multi-line text editor similar to Windows Notepad.
-- There are several memo-specific operations in addition to the standard
-- operations on multi-line controls. The user can select a block of text
-- spanning multiple lines using the mouse (or by moving the cursor with
-- the Shift key held down) and there are operations to fetch, replace
-- and delete the selected text, find the line and column position of
-- the start and end of the selected text, and get its total length (which
-- will include one or more additional end-of-line characters if the text
-- spans more than one line).
--
-- Memo operations:
--
-- Memo (Parent, -- create a memo inside a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- the specified width
-- Height) -- and the specified height
-- Font) -- using this font (default: same as Parent).
--
-- Get_Column (Memo) -- get the column position of the current
-- -- selection.
-- Modified (Memo) -- test if the user has modified the memo.
-- Cut_Selection (Memo) -- cut the current selection to the clipboard.
-- Copy_Selection (Memo) -- copy the current selection to the clipboard.
-- Paste_Selection (Memo) -- paste the clipboard contents to the memo,
-- -- replacing the current selection.
-- Undo_Change (Memo) -- undo the user's last change to the memo.
-- Show_Selection (Memo) -- scroll the memo so that the current position
-- -- is visible on the screen.
--
----------------------------------------------------------------------------
function Memo (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Font : Font_Type := Parent_Font) return Memo_Type;
function Get_Column (Memo : Memo_Type) return Natural;
function Modified (Memo : Memo_Type) return Boolean;
procedure Cut_Selection (Memo : in Memo_Type);
procedure Copy_Selection (Memo : in Memo_Type);
procedure Paste_Selection (Memo : in Memo_Type);
procedure Undo_Change (Memo : in Memo_Type);
procedure Show_Selection (Memo : in Memo_Type);
----------------------------------------------------------------------------
-- Most operations on multiline types are implemented in different ways,
-- so they are overridden here:
--
function Get_Count (Control : Listbox_Type) return Natural;
function Get_Count (Control : Combobox_Type) return Natural;
function Get_Count (Control : Memo_Type) return Natural;
function Get_Line (Control : Listbox_Type) return Natural;
function Get_Line (Control : Combobox_Type) return Natural;
function Get_Line (Control : Memo_Type) return Natural;
function Get_Length (Control : Listbox_Type;
Line : Natural := 0) return Natural;
function Get_Length (Control : Combobox_Type;
Line : Natural := 0) return Natural;
function Get_Length (Control : Memo_Type;
Line : Natural := 0) return Natural;
function Get_Text (Control : Listbox_Type;
Line : Natural := 0) return String;
function Get_Text (Control : Combobox_Type;
Line : Natural := 0) return String;
function Get_Text (Control : Memo_Type;
Line : Natural := 0) return String;
procedure Set_Text (Control : in Listbox_Type;
Text : in String;
Line : in Natural := 0);
procedure Set_Text (Control : in Combobox_Type;
Text : in String;
Line : in Natural := 0);
procedure Set_Text (Control : in Memo_Type;
Text : in String;
Line : in Natural := 0);
procedure Select_Line (Control : in Listbox_Type;
Line : in Natural := 0);
procedure Select_Line (Control : in Combobox_Type;
Line : in Natural := 0);
procedure Select_Line (Control : in Memo_Type;
Line : in Natural := 0);
procedure Append_Line (Control : in Listbox_Type;
Text : in String);
procedure Append_Line (Control : in Combobox_Type;
Text : in String);
procedure Append_Line (Control : in Memo_Type;
Text : in String);
procedure Insert_Line (Control : in Listbox_Type;
Text : in String;
Line : in Natural := 0);
procedure Insert_Line (Control : in Combobox_Type;
Text : in String;
Line : in Natural := 0);
procedure Insert_Line (Control : in Memo_Type;
Text : in String;
Line : in Natural := 0);
procedure Delete_Line (Control : in Listbox_Type;
Line : in Natural := 0);
procedure Delete_Line (Control : in Combobox_Type;
Line : in Natural := 0);
procedure Delete_Line (Control : in Memo_Type;
Line : in Natural:= 0);
procedure Delete_All (Control : in Listbox_Type);
procedure Delete_All (Control : in Combobox_Type);
procedure Delete_All (Control : in Memo_Type);
----------------------------------------------------------------------------
--
-- C A N V A S E S
--
-- A canvas is a blank rectangle for drawing on which can optionally
-- be set to generate a command code when the mouse is clicked on it.
-- A canvas has an associated font (the same as the parent window by
-- default), a background colour (initially white), a pen for drawing
-- lines (initially black, one pixel wide) and a fill colour used to
-- colour closed shapes (initially white).
--
-- The freedom of expression available with canvases make these the
-- most complex component of all, with over 20 available operations.
-- There are operations to draw lines, rectangles (with or without
-- rounded corners), ellipses, circles, line sequences, polygons and
-- text. The font, pen size and colour and fill colour can be changed
-- at any time any will affect all subsequent drawing operations (but
-- everything drawn previously will be unaffected). Rectangles can be
-- given rounded corners by specifying a rounding factor, which gives
-- the X and Y offsets from the corners to the points where the rounded
-- corner begins.
--
-- Anything drawn on a canvas will normally stay there, but the canvas
-- can be erased or the current state of a drawing can be saved and then
-- restored later (which provides a basic "undo" facility). For example,
-- a clock can be drawn by drawing a circle, saving the drawing, and then
-- drawing the hands. To change the position of the hands, restore the
-- saved drawing (thus erasing the hands) and then redraw the hands in
-- the new position. You can only save one copy of the drawing, so if you
-- save it a second time you will lose the previous saved copy.
--
-- A canvas can be set up to generate a command when the mouse button
-- is pressed inside its borders. There are operations to get the
-- position at which the button was pressed, to get the current mouse
-- position, and to test if the mouse button is still down and whether
-- the mouse has been moved. As long as the button is down, the mouse
-- position will be tracked even if the mouse is moved outside the canvas.
-- You can track the mouse visually by saving the drawing when the mouse
-- is first pressed, then restoring the drawing and drawing a new line
-- from the initial mouse position to the current one.
--
-- Canvas operations:
--
-- Canvas (Parent, -- create a canvas inside a container, with
-- Origin, -- top left coordinates relative to Parent,
-- Width, -- the specified width
-- Height, -- and the specified height, using
-- Font) -- this font (default: same as Parent).
--
-- Canvas (Parent, -- create a canvas inside a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- the specified width
-- Height, -- and the specified height,
-- Command, -- which generates this command code, and
-- Font) -- uses this font (default: same as Parent).
--
-- Canvas (Parent, -- create a canvas inside a container, with
-- Origin, -- top left coordinates relative to the parent,
-- Width, -- the specified width
-- Height, -- and the specified height,
-- Command, -- which generates this command code, and
-- Keypress, -- this one when a key is pressed, and
-- Font) -- uses this font (default: same as Parent).
--
-- Set_Colour (Canvas, -- set the background colour for a canvas
-- Colour) -- using this colour (default: white)
--
-- Erase (Canvas) -- erase the drawing in a canvas. This will
-- -- also erase any saved drawing.
-- Save (Canvas) -- save the current drawing.
-- Restore (Canvas) -- restore a saved drawing, erasing anything
-- -- drawn since. If the drawing has never been
-- -- saved, or the window has been erased using
-- -- Erase, this will do nothing.
-- Set_Font (Canvas, -- set a new font for all subsequent text
-- Font) -- drawn on the canvas.
-- Set_Pen (Canvas, -- set the pen used to draw lines on the
-- Colour, -- canvas to this colour (default: black)
-- Width) -- and thickness (default: 1 pixel).
-- Set_Fill (Canvas, -- set the colour used to fill subsequent
-- Colour) -- closed shapes drawn on the canvas.
-- Set_Fill (Canvas) -- clear the colour used to fill subsequent
-- -- closed shapes drawn on the canvas.
-- Draw_Text (Canvas, -- draw a text string on the canvas
-- From, -- from this top-left point, where
-- Text) -- this is the text to be drawn.
-- Draw_Text (Canvas, -- draw a text string on the canvas
-- From, -- in a rectangle between this point
-- To, -- and this one, where
-- Text, -- this is the text to be drawn
-- Align) -- with this alignment (default: left).
-- Draw_Text (Canvas, -- draw a text string on the canvas
-- From, -- in a rectangle starting at this point
-- Width, -- with this width
-- Height, -- and this height, where
-- Text, -- this is the text to be drawn
-- Align) -- with this alignment (default: left).
--
-- Draw_Line (Canvas, -- draw a line on the canvas
-- From, -- from this point
-- To) -- to this one.
-- Draw_Line (Canvas, -- draw a line on the canvas
-- From, -- from this point
-- Length, -- for this length
-- Angle) -- at this angle.
-- Draw_Line_List (Canvas, -- draw lines on the canvas connecting
-- Points) -- the points in this list.
--
-- Draw_Rectangle (Canvas, -- draw a rectangle on the canvas
-- From, -- from this corner point
-- To, -- to this diagonally-opposite point
-- Rounding) -- with corners rounded this much
-- -- (default: no rounding).
-- Draw_Rectangle (Canvas, -- draw a rectangle on the canvas
-- From, -- from this top-left point
-- Width, -- with this width
-- Height, -- and this height
-- Rounding) -- with corners rounded this much
-- -- (default: no rounding).
--
-- Draw_Ellipse (Canvas, -- draw an ellipse on the canvas
-- From, -- bounded by a rectangle from this point
-- To) -- to this point.
-- Draw_Ellipse (Canvas, -- draw an ellipse on the canvas
-- From, -- bounded by a rectangle from this point
-- Width, -- with this width.
-- Height) -- and this height
-- Draw_Circle (Canvas, -- draw a circle on the canvas
-- Centre, -- with this centre point
-- Radius) -- and this radius.
--
-- Draw_Polygon (Canvas, -- draw a polygon on the canvas
-- Points) -- with vertices at these points.
--
-- Draw_Image (Canvas, -- draw an image on the canvas
-- From, -- from this point
-- Image) -- using this image object.
-- Draw_Image (Canvas, -- draw an image on the canvas
-- From, -- from this point
-- To, -- to this one (stretching the image to fit)
-- Image) -- using this image object.
-- Draw_Image (Canvas, -- draw an image on the canvas
-- From, -- from this point
-- Width, -- with this width
-- Height, -- and this height
-- Image) -- using this image object.
--
-- Mouse_Down (Canvas) -- test if the left mouse button is down.
-- Mouse_Moved (Canvas) -- test if the mouse has been moved.
-- Start_Point (Canvas) -- get the point where the mouse button
-- -- was first pressed.
-- End_Point (Canvas) -- get the point where the mouse is now
-- -- (or its final position when the left
-- -- button was released).
-- Key_Code (Canvas) -- get the character code for the last
-- -- key pressed.
--
----------------------------------------------------------------------------
function Canvas (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Font : Font_Type := Parent_Font) return Canvas_Type;
function Canvas (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Command : Command_Type;
Font : Font_Type := Parent_Font) return Canvas_Type;
function Canvas (Parent : Container_Type'Class;
Origin : Point_Type;
Width : Integer;
Height : Integer;
Command : Command_Type;
Keypress : Command_Type;
Font : Font_Type := Parent_Font) return Canvas_Type;
procedure Set_Colour (Canvas : in Canvas_Type;
Colour : in Colour_Type := White);
procedure Erase (Canvas : in Canvas_Type);
procedure Save (Canvas : in Canvas_Type);
procedure Restore (Canvas : in Canvas_Type);
procedure Set_Font (Canvas : in Canvas_Type;
Font : in Font_Type);
procedure Set_Pen (Canvas : in Canvas_Type;
Colour : in Colour_Type := Black;
Width : in Natural := 1);
procedure Set_Fill (Canvas : in Canvas_Type;
Colour : in Colour_Type);
procedure Set_Fill (Canvas : in Canvas_Type);
procedure Draw_Text (Canvas : in Canvas_Type;
From : in Point_Type;
Text : in String);
procedure Draw_Text (Canvas : in Canvas_Type;
From : in Point_Type;
To : in Point_Type;
Text : in String;
Align : in Alignment_Type := Left);
procedure Draw_Text (Canvas : in Canvas_Type;
From : in Point_Type;
Width : in Integer;
Height : in Integer;
Text : in String;
Align : in Alignment_Type := Left);
procedure Draw_Line (Canvas : in Canvas_Type;
From : in Point_Type;
To : in Point_Type);
procedure Draw_Line (Canvas : in Canvas_Type;
From : in Point_Type;
Length : in Positive;
Angle : in Angle_Type);
procedure Draw_Line_List
(Canvas : in Canvas_Type;
Points : in Point_List);
procedure Draw_Rectangle
(Canvas : in Canvas_Type;
From : in Point_Type;
To : in Point_Type;
Rounding : in Point_Type := (0,0));
procedure Draw_Rectangle
(Canvas : in Canvas_Type;
From : in Point_Type;
Width : in Positive;
Height : in Positive;
Rounding : in Point_Type := (0,0));
procedure Draw_Ellipse
(Canvas : in Canvas_Type;
From : in Point_Type;
To : in Point_Type);
procedure Draw_Ellipse
(Canvas : in Canvas_Type;
From : in Point_Type;
Width : in Positive;
Height : in Positive);
procedure Draw_Circle
(Canvas : in Canvas_Type;
Centre : in Point_Type;
Radius : in Positive);
procedure Draw_Polygon
(Canvas : in Canvas_Type;
Points : in Point_List);
procedure Draw_Image (Canvas : in Canvas_Type;
From : in Point_Type;
Image : in Image_Type);
procedure Draw_Image (Canvas : in Canvas_Type;
From : in Point_Type;
To : in Point_Type;
Image : in Image_Type);
procedure Draw_Image (Canvas : in Canvas_Type;
From : in Point_Type;
Width : in Natural;
Height : in Natural;
Image : in Image_Type);
function Start_Point (Canvas : Canvas_Type) return Point_Type;
function End_Point (Canvas : Canvas_Type) return Point_Type;
function Mouse_Down (Canvas : Canvas_Type) return Boolean;
function Mouse_Moved (Canvas : Canvas_Type) return Boolean;
function Key_Code (Canvas : Canvas_Type) return Character;
----------------------------------------------------------------------------
--
-- C O M M O N D I A L O G S
--
-- Common dialogs are pre-packaged dialog widgets which are not treated
-- as normal windows (although they are made to look similar for ease of
-- use).
--
-- Common dialog operations (common to all dialogs):
--
-- Execute (Dialog) -- execute the dialog and return True if the OK
-- -- button was used to close the dialog and False
-- -- otherwise.
--
----------------------------------------------------------------------------
type Common_Dialog_Type is abstract tagged private;
function Execute (Dialog : Common_Dialog_Type) return Boolean;
----------------------------------------------------------------------------
--
-- C O M M O N D I A L O G S U B C L A S S E S
--
-- The available dialog subclasses are colour, font and file dialogs.
--
-- Colour_Dialog_Type : a dialog to allow the user to select a colour.
-- Font_Dialog_Type : a dialog to allow the user to select a font.
-- File_Dialog_Type : a dialog to allow the user to select a file name.
--
----------------------------------------------------------------------------
type Colour_Dialog_Type is new Common_Dialog_Type with private;
type Font_Dialog_Type is new Common_Dialog_Type with private;
type File_Dialog_Type is abstract new Common_Dialog_Type with private;
----------------------------------------------------------------------------
--
-- C O L O U R D I A L O G S
--
-- Colour dialogs allow the user to select or create a colour.
--
-- Colour dialog operations:
--
-- Colour_Dialog -- create a colour dialog.
-- Set_Colour (Dialog, -- set the initial colour displayed in the
-- Colour) -- dialog to this colour.
-- Get_Colour (Dialog) -- get the colour contained in the dialog.
--
----------------------------------------------------------------------------
function Colour_Dialog return Colour_Dialog_Type;
procedure Set_Colour (Dialog : in Colour_Dialog_Type;
Colour : in Colour_Type);
function Get_Colour (Dialog : in Colour_Dialog_Type) return Colour_Type;
----------------------------------------------------------------------------
--
-- F O N T D I A L O G S
--
-- Font dialogs allow the user to select a font.
--
-- Font dialog operations:
--
-- Font_Dialog -- create a font dialog.
-- Set_Font (Dialog, -- set the initial font displayed in the
-- Font) -- dialog to this font.
-- Get_Font (Dialog) -- get the font contained in the dialog.
--
----------------------------------------------------------------------------
function Font_Dialog return Font_Dialog_Type;
procedure Set_Font (Dialog : in Font_Dialog_Type;
Font : in Font_Type);
function Get_Font (Dialog : in Font_Dialog_Type) return Font_Type;
----------------------------------------------------------------------------
--
-- F I L E D I A L O G S
--
-- File dialogs allow the user to select or enter a file name. This is an
-- abstract type which is further subclassed below.
--
-- File dialog operations (common to all file dialogs):
--
-- Set_Name (Dialog, -- set the initial file name displayed in the
-- Name) -- dialog to this string.
-- Get_Name (Dialog) -- get the file name contained in the dialog.
-- Add_Filter (Dialog, -- add a file type filter to the dialog
-- Text, -- with this description
-- Filter) -- to match this wildcard specification.
-- Set_Directory (Dialog, -- set the initial directory for the dialog
-- Name) -- to this directory.
--
----------------------------------------------------------------------------
procedure Set_Name (Dialog : in File_Dialog_Type;
Name : in String);
function Get_Name (Dialog : in File_Dialog_Type) return String;
procedure Add_Filter (Dialog : in File_Dialog_Type;
Text : in String;
Filter : in String);
procedure Set_Directory (Dialog : in File_Dialog_Type;
Name : in String);
----------------------------------------------------------------------------
--
-- O P E N D I A L O G S
--
-- Open dialogs allow the user to select or enter a file name for use as
-- an input file. The file name selected must be the name of an existing
-- file.
--
-- Open dialog operations:
--
-- Open_Dialog (Title) -- create an open file dialog with this title.
--
----------------------------------------------------------------------------
type Open_Dialog_Type is new File_Dialog_Type with private;
function Open_Dialog (Title : String) return Open_Dialog_Type;
----------------------------------------------------------------------------
--
-- S A V E D I A L O G S
--
-- Save dialogs allow the user to select or enter a file name for use as
-- an output file. If the Create parameter to the constructor function
-- below is True (as it is by default) and an existing file is selected,
-- the user will be asked if the file should be overwritten. If it is
-- False and the file does not exist, the user will be asked if it should
-- be created.
--
-- Save dialog operations:
--
-- Save_Dialog (Title, -- create a save file dialog with this title
-- Create) -- which will prompt the user as described above.
--
----------------------------------------------------------------------------
type Save_Dialog_Type is new File_Dialog_Type with private;
function Save_Dialog (Title : String;
Create : Boolean := True) return Save_Dialog_Type;
----------------------------------------------------------------------------
-- Renamings for our transatlantic cousins, in the hope that some day
-- they'll repay the favour/favor...
----------------------------------------------------------------------------
procedure Set_Color (Canvas : in Canvas_Type;
Colour : in Colour_Type := White) renames Set_Colour;
subtype Color_Dialog_Type is Colour_Dialog_Type;
function Color_Dialog return Colour_Dialog_Type renames Colour_Dialog;
procedure Set_Color (Dialog : in Colour_Dialog_Type;
Colour : in Colour_Type) renames Set_Colour;
function Get_Color (Dialog : in Colour_Dialog_Type) return Colour_Type
renames Get_Colour;
private -- and deliberately uninformative!
type Window_Type is abstract tagged
record
Internals : JEWL.Controlled_Type; -- see package JEWL
end record;
type Container_Type is abstract new Window_Type with null record;
type Control_Type is abstract new Window_Type with null record;
type Frame_Type is new Container_Type with null record;
type Dialog_Type is new Container_Type with null record;
type Panel_Type is new Container_Type with null record;
type Menu_Type is new Container_Type with null record;
type Text_Control_Type is abstract new Control_Type with null record;
type Multiline_Type is abstract new Control_Type with null record;
type Canvas_Type is new Control_Type with null record;
type Button_Type is new Text_Control_Type with null record;
type Label_Type is new Text_Control_Type with null record;
type Editbox_Type is new Text_Control_Type with null record;
type Boolean_Control_Type is abstract new Text_Control_Type with null record;
type Menuitem_Type is new Boolean_Control_Type with null record;
type Checkbox_Type is new Boolean_Control_Type with null record;
type Radiobutton_Type is new Boolean_Control_Type with null record;
type Listbox_Type is new Multiline_Type with null record;
type Combobox_Type is new Multiline_Type with null record;
type Memo_Type is new Multiline_Type with null record;
type Common_Dialog_Type is abstract tagged
record
Internals : JEWL.Controlled_Type; -- see package JEWL
end record;
type Colour_Dialog_Type is new Common_Dialog_Type with null record;
type Font_Dialog_Type is new Common_Dialog_Type with null record;
type File_Dialog_Type is abstract new Common_Dialog_Type with null record;
type Open_Dialog_Type is new File_Dialog_Type with null record;
type Save_Dialog_Type is new File_Dialog_Type with null record;
type Image_Type is
record
Internals : JEWL.Controlled_Type; -- see package JEWL
end record;
end JEWL.Windows;
|
[
{
"context": " --\n-- Copyright © 2012-2013, Vadim Godunko <[email protected]> --\n-- All rig",
"end": 829,
"score": 0.9998860359191895,
"start": 816,
"tag": "NAME",
"value": "Vadim Godunko"
},
{
"context": " --\n-- Copyright © 2012-2013, Vadim Godunko <[email protected]> --\n-- All rights reserved. ",
"end": 849,
"score": 0.9999315738677979,
"start": 831,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
testsuite/soap/soapconf-driver.adb
|
svn2github/matreshka
| 24 |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Testsuite Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2013, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Ada.Wide_Wide_Text_IO;
with League.Stream_Element_Vectors;
with League.Strings;
with League.Text_Codecs;
with Web_Services.SOAP.Dispatcher;
with Web_Services.SOAP.Reply_Streams;
with SOAPConf.Reply_Streams;
with SOAPConf.Testcases.Test_T24;
with SOAPConf.Testcases.Test_T25;
with SOAPConf.Testcases.Test_T26;
with SOAPConf.Testcases.Test_T28;
with SOAPConf.Testcases.Test_T29;
with SOAPConf.Testcases.Test_T34;
with SOAPConf.Testcases.Test_T37;
with SOAPConf.Testcases.Test_T40;
with SOAPConf.Decoders;
pragma Unreferenced (SOAPConf.Decoders);
with SOAPConf.Encoders;
pragma Unreferenced (SOAPConf.Encoders);
with SOAPConf.Handlers;
pragma Unreferenced (SOAPConf.Handlers);
procedure SOAPConf.Driver is
use type League.Strings.Universal_String;
Codec : constant League.Text_Codecs.Text_Codec
:= League.Text_Codecs.Codec
(League.Strings.To_Universal_String ("utf-8"));
procedure Do_Simple_Test
(Source : League.Strings.Universal_String;
Expected : League.Strings.Universal_String);
--------------------
-- Do_Simple_Test --
--------------------
procedure Do_Simple_Test
(Source : League.Strings.Universal_String;
Expected : League.Strings.Universal_String)
is
Reply : aliased SOAPConf.Reply_Streams.Reply_Stream;
begin
Web_Services.SOAP.Dispatcher.Dispatch
(Codec.Encode (Source).To_Stream_Element_Array,
League.Strings.Empty_Universal_String,
Reply'Unchecked_Access);
if Codec.Decode (Reply.Output_Data) /= Expected then
Ada.Wide_Wide_Text_IO.Put_Line
(''' & Expected.To_Wide_Wide_String & ''');
Ada.Wide_Wide_Text_IO.Put_Line
(''' & Codec.Decode (Reply.Output_Data).To_Wide_Wide_String & ''');
raise Program_Error;
end if;
end Do_Simple_Test;
begin
Do_Simple_Test
(SOAPConf.Testcases.Test_T24.Scenario.Message_A,
SOAPConf.Testcases.Test_T24.Scenario.Message_C);
Do_Simple_Test
(SOAPConf.Testcases.Test_T25.Scenario.Message_A,
SOAPConf.Testcases.Test_T25.Scenario.Message_C);
Do_Simple_Test
(SOAPConf.Testcases.Test_T26.Scenario.Message_A,
SOAPConf.Testcases.Test_T26.Scenario.Message_C);
Do_Simple_Test
(SOAPConf.Testcases.Test_T28.Scenario.Message_A,
SOAPConf.Testcases.Test_T28.Scenario.Message_C);
Do_Simple_Test
(SOAPConf.Testcases.Test_T29.Scenario.Message_A,
SOAPConf.Testcases.Test_T29.Scenario.Message_C);
Do_Simple_Test
(SOAPConf.Testcases.Test_T34.Scenario.Message_A,
SOAPConf.Testcases.Test_T34.Scenario.Message_C);
Do_Simple_Test
(SOAPConf.Testcases.Test_T37.Scenario.Message_A,
SOAPConf.Testcases.Test_T37.Scenario.Message_C);
Do_Simple_Test
(SOAPConf.Testcases.Test_T40.Scenario.Message_A,
SOAPConf.Testcases.Test_T40.Scenario.Message_C);
end SOAPConf.Driver;
|
20090
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Testsuite Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2013, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Ada.Wide_Wide_Text_IO;
with League.Stream_Element_Vectors;
with League.Strings;
with League.Text_Codecs;
with Web_Services.SOAP.Dispatcher;
with Web_Services.SOAP.Reply_Streams;
with SOAPConf.Reply_Streams;
with SOAPConf.Testcases.Test_T24;
with SOAPConf.Testcases.Test_T25;
with SOAPConf.Testcases.Test_T26;
with SOAPConf.Testcases.Test_T28;
with SOAPConf.Testcases.Test_T29;
with SOAPConf.Testcases.Test_T34;
with SOAPConf.Testcases.Test_T37;
with SOAPConf.Testcases.Test_T40;
with SOAPConf.Decoders;
pragma Unreferenced (SOAPConf.Decoders);
with SOAPConf.Encoders;
pragma Unreferenced (SOAPConf.Encoders);
with SOAPConf.Handlers;
pragma Unreferenced (SOAPConf.Handlers);
procedure SOAPConf.Driver is
use type League.Strings.Universal_String;
Codec : constant League.Text_Codecs.Text_Codec
:= League.Text_Codecs.Codec
(League.Strings.To_Universal_String ("utf-8"));
procedure Do_Simple_Test
(Source : League.Strings.Universal_String;
Expected : League.Strings.Universal_String);
--------------------
-- Do_Simple_Test --
--------------------
procedure Do_Simple_Test
(Source : League.Strings.Universal_String;
Expected : League.Strings.Universal_String)
is
Reply : aliased SOAPConf.Reply_Streams.Reply_Stream;
begin
Web_Services.SOAP.Dispatcher.Dispatch
(Codec.Encode (Source).To_Stream_Element_Array,
League.Strings.Empty_Universal_String,
Reply'Unchecked_Access);
if Codec.Decode (Reply.Output_Data) /= Expected then
Ada.Wide_Wide_Text_IO.Put_Line
(''' & Expected.To_Wide_Wide_String & ''');
Ada.Wide_Wide_Text_IO.Put_Line
(''' & Codec.Decode (Reply.Output_Data).To_Wide_Wide_String & ''');
raise Program_Error;
end if;
end Do_Simple_Test;
begin
Do_Simple_Test
(SOAPConf.Testcases.Test_T24.Scenario.Message_A,
SOAPConf.Testcases.Test_T24.Scenario.Message_C);
Do_Simple_Test
(SOAPConf.Testcases.Test_T25.Scenario.Message_A,
SOAPConf.Testcases.Test_T25.Scenario.Message_C);
Do_Simple_Test
(SOAPConf.Testcases.Test_T26.Scenario.Message_A,
SOAPConf.Testcases.Test_T26.Scenario.Message_C);
Do_Simple_Test
(SOAPConf.Testcases.Test_T28.Scenario.Message_A,
SOAPConf.Testcases.Test_T28.Scenario.Message_C);
Do_Simple_Test
(SOAPConf.Testcases.Test_T29.Scenario.Message_A,
SOAPConf.Testcases.Test_T29.Scenario.Message_C);
Do_Simple_Test
(SOAPConf.Testcases.Test_T34.Scenario.Message_A,
SOAPConf.Testcases.Test_T34.Scenario.Message_C);
Do_Simple_Test
(SOAPConf.Testcases.Test_T37.Scenario.Message_A,
SOAPConf.Testcases.Test_T37.Scenario.Message_C);
Do_Simple_Test
(SOAPConf.Testcases.Test_T40.Scenario.Message_A,
SOAPConf.Testcases.Test_T40.Scenario.Message_C);
end SOAPConf.Driver;
| true |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Testsuite Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2013, PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Ada.Wide_Wide_Text_IO;
with League.Stream_Element_Vectors;
with League.Strings;
with League.Text_Codecs;
with Web_Services.SOAP.Dispatcher;
with Web_Services.SOAP.Reply_Streams;
with SOAPConf.Reply_Streams;
with SOAPConf.Testcases.Test_T24;
with SOAPConf.Testcases.Test_T25;
with SOAPConf.Testcases.Test_T26;
with SOAPConf.Testcases.Test_T28;
with SOAPConf.Testcases.Test_T29;
with SOAPConf.Testcases.Test_T34;
with SOAPConf.Testcases.Test_T37;
with SOAPConf.Testcases.Test_T40;
with SOAPConf.Decoders;
pragma Unreferenced (SOAPConf.Decoders);
with SOAPConf.Encoders;
pragma Unreferenced (SOAPConf.Encoders);
with SOAPConf.Handlers;
pragma Unreferenced (SOAPConf.Handlers);
procedure SOAPConf.Driver is
use type League.Strings.Universal_String;
Codec : constant League.Text_Codecs.Text_Codec
:= League.Text_Codecs.Codec
(League.Strings.To_Universal_String ("utf-8"));
procedure Do_Simple_Test
(Source : League.Strings.Universal_String;
Expected : League.Strings.Universal_String);
--------------------
-- Do_Simple_Test --
--------------------
procedure Do_Simple_Test
(Source : League.Strings.Universal_String;
Expected : League.Strings.Universal_String)
is
Reply : aliased SOAPConf.Reply_Streams.Reply_Stream;
begin
Web_Services.SOAP.Dispatcher.Dispatch
(Codec.Encode (Source).To_Stream_Element_Array,
League.Strings.Empty_Universal_String,
Reply'Unchecked_Access);
if Codec.Decode (Reply.Output_Data) /= Expected then
Ada.Wide_Wide_Text_IO.Put_Line
(''' & Expected.To_Wide_Wide_String & ''');
Ada.Wide_Wide_Text_IO.Put_Line
(''' & Codec.Decode (Reply.Output_Data).To_Wide_Wide_String & ''');
raise Program_Error;
end if;
end Do_Simple_Test;
begin
Do_Simple_Test
(SOAPConf.Testcases.Test_T24.Scenario.Message_A,
SOAPConf.Testcases.Test_T24.Scenario.Message_C);
Do_Simple_Test
(SOAPConf.Testcases.Test_T25.Scenario.Message_A,
SOAPConf.Testcases.Test_T25.Scenario.Message_C);
Do_Simple_Test
(SOAPConf.Testcases.Test_T26.Scenario.Message_A,
SOAPConf.Testcases.Test_T26.Scenario.Message_C);
Do_Simple_Test
(SOAPConf.Testcases.Test_T28.Scenario.Message_A,
SOAPConf.Testcases.Test_T28.Scenario.Message_C);
Do_Simple_Test
(SOAPConf.Testcases.Test_T29.Scenario.Message_A,
SOAPConf.Testcases.Test_T29.Scenario.Message_C);
Do_Simple_Test
(SOAPConf.Testcases.Test_T34.Scenario.Message_A,
SOAPConf.Testcases.Test_T34.Scenario.Message_C);
Do_Simple_Test
(SOAPConf.Testcases.Test_T37.Scenario.Message_A,
SOAPConf.Testcases.Test_T37.Scenario.Message_C);
Do_Simple_Test
(SOAPConf.Testcases.Test_T40.Scenario.Message_A,
SOAPConf.Testcases.Test_T40.Scenario.Message_C);
end SOAPConf.Driver;
|
[
{
"context": " --\n-- Copyright © 2012, Vadim Godunko <[email protected]> --\n-- Al",
"end": 824,
"score": 0.9998896718025208,
"start": 811,
"tag": "NAME",
"value": "Vadim Godunko"
},
{
"context": " --\n-- Copyright © 2012, Vadim Godunko <[email protected]> --\n-- All rights reserved. ",
"end": 844,
"score": 0.9999309182167053,
"start": 826,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
source/amf/mofext/amf-internals-tables-mof_metamodel.adb
|
svn2github/matreshka
| 24 |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
package body AMF.Internals.Tables.MOF_Metamodel is
----------------
-- MM_MOF_MOF --
----------------
function MM_MOF_MOF return AMF.Internals.CMOF_Element is
begin
return Base + 8;
end MM_MOF_MOF;
----------------
-- MC_MOF_Tag --
----------------
function MC_MOF_Tag return AMF.Internals.CMOF_Element is
begin
return Base + 1;
end MC_MOF_Tag;
------------------------------
-- MP_MOF_Tag_Element_A_Tag --
------------------------------
function MP_MOF_Tag_Element_A_Tag return AMF.Internals.CMOF_Element is
begin
return Base + 2;
end MP_MOF_Tag_Element_A_Tag;
---------------------
-- MP_MOF_Tag_Name --
---------------------
function MP_MOF_Tag_Name return AMF.Internals.CMOF_Element is
begin
return Base + 3;
end MP_MOF_Tag_Name;
--------------------------------------
-- MP_MOF_Tag_Tag_Owner_A_Owned_Tag --
--------------------------------------
function MP_MOF_Tag_Tag_Owner_A_Owned_Tag return AMF.Internals.CMOF_Element is
begin
return Base + 4;
end MP_MOF_Tag_Tag_Owner_A_Owned_Tag;
----------------------
-- MP_MOF_Tag_Value --
----------------------
function MP_MOF_Tag_Value return AMF.Internals.CMOF_Element is
begin
return Base + 5;
end MP_MOF_Tag_Value;
------------------------------
-- MP_MOF_A_Tag_Tag_Element --
------------------------------
function MP_MOF_A_Tag_Tag_Element return AMF.Internals.CMOF_Element is
begin
return Base + 9;
end MP_MOF_A_Tag_Tag_Element;
--------------------------------------
-- MP_MOF_A_Owned_Tag_Tag_Tag_Owner --
--------------------------------------
function MP_MOF_A_Owned_Tag_Tag_Tag_Owner return AMF.Internals.CMOF_Element is
begin
return Base + 10;
end MP_MOF_A_Owned_Tag_Tag_Tag_Owner;
----------------------------
-- MA_MOF_Tag_Element_Tag --
----------------------------
function MA_MOF_Tag_Element_Tag return AMF.Internals.CMOF_Element is
begin
return Base + 6;
end MA_MOF_Tag_Element_Tag;
------------------------------------
-- MA_MOF_Tag_Tag_Owner_Owned_Tag --
------------------------------------
function MA_MOF_Tag_Tag_Owner_Owned_Tag return AMF.Internals.CMOF_Element is
begin
return Base + 7;
end MA_MOF_Tag_Tag_Owner_Owned_Tag;
------------
-- MB_MOF --
------------
function MB_MOF return AMF.Internals.AMF_Element is
begin
return Base;
end MB_MOF;
------------
-- MB_MOF --
------------
function ML_MOF return AMF.Internals.AMF_Element is
begin
return Base + 11;
end ML_MOF;
end AMF.Internals.Tables.MOF_Metamodel;
|
22790
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
package body AMF.Internals.Tables.MOF_Metamodel is
----------------
-- MM_MOF_MOF --
----------------
function MM_MOF_MOF return AMF.Internals.CMOF_Element is
begin
return Base + 8;
end MM_MOF_MOF;
----------------
-- MC_MOF_Tag --
----------------
function MC_MOF_Tag return AMF.Internals.CMOF_Element is
begin
return Base + 1;
end MC_MOF_Tag;
------------------------------
-- MP_MOF_Tag_Element_A_Tag --
------------------------------
function MP_MOF_Tag_Element_A_Tag return AMF.Internals.CMOF_Element is
begin
return Base + 2;
end MP_MOF_Tag_Element_A_Tag;
---------------------
-- MP_MOF_Tag_Name --
---------------------
function MP_MOF_Tag_Name return AMF.Internals.CMOF_Element is
begin
return Base + 3;
end MP_MOF_Tag_Name;
--------------------------------------
-- MP_MOF_Tag_Tag_Owner_A_Owned_Tag --
--------------------------------------
function MP_MOF_Tag_Tag_Owner_A_Owned_Tag return AMF.Internals.CMOF_Element is
begin
return Base + 4;
end MP_MOF_Tag_Tag_Owner_A_Owned_Tag;
----------------------
-- MP_MOF_Tag_Value --
----------------------
function MP_MOF_Tag_Value return AMF.Internals.CMOF_Element is
begin
return Base + 5;
end MP_MOF_Tag_Value;
------------------------------
-- MP_MOF_A_Tag_Tag_Element --
------------------------------
function MP_MOF_A_Tag_Tag_Element return AMF.Internals.CMOF_Element is
begin
return Base + 9;
end MP_MOF_A_Tag_Tag_Element;
--------------------------------------
-- MP_MOF_A_Owned_Tag_Tag_Tag_Owner --
--------------------------------------
function MP_MOF_A_Owned_Tag_Tag_Tag_Owner return AMF.Internals.CMOF_Element is
begin
return Base + 10;
end MP_MOF_A_Owned_Tag_Tag_Tag_Owner;
----------------------------
-- MA_MOF_Tag_Element_Tag --
----------------------------
function MA_MOF_Tag_Element_Tag return AMF.Internals.CMOF_Element is
begin
return Base + 6;
end MA_MOF_Tag_Element_Tag;
------------------------------------
-- MA_MOF_Tag_Tag_Owner_Owned_Tag --
------------------------------------
function MA_MOF_Tag_Tag_Owner_Owned_Tag return AMF.Internals.CMOF_Element is
begin
return Base + 7;
end MA_MOF_Tag_Tag_Owner_Owned_Tag;
------------
-- MB_MOF --
------------
function MB_MOF return AMF.Internals.AMF_Element is
begin
return Base;
end MB_MOF;
------------
-- MB_MOF --
------------
function ML_MOF return AMF.Internals.AMF_Element is
begin
return Base + 11;
end ML_MOF;
end AMF.Internals.Tables.MOF_Metamodel;
| true |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
package body AMF.Internals.Tables.MOF_Metamodel is
----------------
-- MM_MOF_MOF --
----------------
function MM_MOF_MOF return AMF.Internals.CMOF_Element is
begin
return Base + 8;
end MM_MOF_MOF;
----------------
-- MC_MOF_Tag --
----------------
function MC_MOF_Tag return AMF.Internals.CMOF_Element is
begin
return Base + 1;
end MC_MOF_Tag;
------------------------------
-- MP_MOF_Tag_Element_A_Tag --
------------------------------
function MP_MOF_Tag_Element_A_Tag return AMF.Internals.CMOF_Element is
begin
return Base + 2;
end MP_MOF_Tag_Element_A_Tag;
---------------------
-- MP_MOF_Tag_Name --
---------------------
function MP_MOF_Tag_Name return AMF.Internals.CMOF_Element is
begin
return Base + 3;
end MP_MOF_Tag_Name;
--------------------------------------
-- MP_MOF_Tag_Tag_Owner_A_Owned_Tag --
--------------------------------------
function MP_MOF_Tag_Tag_Owner_A_Owned_Tag return AMF.Internals.CMOF_Element is
begin
return Base + 4;
end MP_MOF_Tag_Tag_Owner_A_Owned_Tag;
----------------------
-- MP_MOF_Tag_Value --
----------------------
function MP_MOF_Tag_Value return AMF.Internals.CMOF_Element is
begin
return Base + 5;
end MP_MOF_Tag_Value;
------------------------------
-- MP_MOF_A_Tag_Tag_Element --
------------------------------
function MP_MOF_A_Tag_Tag_Element return AMF.Internals.CMOF_Element is
begin
return Base + 9;
end MP_MOF_A_Tag_Tag_Element;
--------------------------------------
-- MP_MOF_A_Owned_Tag_Tag_Tag_Owner --
--------------------------------------
function MP_MOF_A_Owned_Tag_Tag_Tag_Owner return AMF.Internals.CMOF_Element is
begin
return Base + 10;
end MP_MOF_A_Owned_Tag_Tag_Tag_Owner;
----------------------------
-- MA_MOF_Tag_Element_Tag --
----------------------------
function MA_MOF_Tag_Element_Tag return AMF.Internals.CMOF_Element is
begin
return Base + 6;
end MA_MOF_Tag_Element_Tag;
------------------------------------
-- MA_MOF_Tag_Tag_Owner_Owned_Tag --
------------------------------------
function MA_MOF_Tag_Tag_Owner_Owned_Tag return AMF.Internals.CMOF_Element is
begin
return Base + 7;
end MA_MOF_Tag_Tag_Owner_Owned_Tag;
------------
-- MB_MOF --
------------
function MB_MOF return AMF.Internals.AMF_Element is
begin
return Base;
end MB_MOF;
------------
-- MB_MOF --
------------
function ML_MOF return AMF.Internals.AMF_Element is
begin
return Base + 11;
end ML_MOF;
end AMF.Internals.Tables.MOF_Metamodel;
|
[
{
"context": "-- SPDX-FileCopyrightText: 2019 Max Reznik <[email protected]>\n--\n-- SPDX-License-Identifi",
"end": 43,
"score": 0.9998627305030823,
"start": 33,
"tag": "NAME",
"value": "Max Reznik"
},
{
"context": "-- SPDX-FileCopyrightText: 2019 Max Reznik <[email protected]>\n--\n-- SPDX-License-Identifier: MIT\n------------",
"end": 63,
"score": 0.9999310970306396,
"start": 45,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
source/nodes/program-nodes-abort_statements.ads
|
reznikmm/gela
| 0 |
-- SPDX-FileCopyrightText: 2019 Max Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Program.Lexical_Elements;
with Program.Elements.Expressions;
with Program.Elements.Abort_Statements;
with Program.Element_Visitors;
package Program.Nodes.Abort_Statements is
pragma Preelaborate;
type Abort_Statement is
new Program.Nodes.Node
and Program.Elements.Abort_Statements.Abort_Statement
and Program.Elements.Abort_Statements.Abort_Statement_Text
with private;
function Create
(Abort_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Aborted_Tasks : not null Program.Elements.Expressions
.Expression_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return Abort_Statement;
type Implicit_Abort_Statement is
new Program.Nodes.Node
and Program.Elements.Abort_Statements.Abort_Statement
with private;
function Create
(Aborted_Tasks : not null Program.Elements.Expressions
.Expression_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Abort_Statement
with Pre =>
Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance;
private
type Base_Abort_Statement is
abstract new Program.Nodes.Node
and Program.Elements.Abort_Statements.Abort_Statement
with record
Aborted_Tasks : not null Program.Elements.Expressions
.Expression_Vector_Access;
end record;
procedure Initialize (Self : in out Base_Abort_Statement'Class);
overriding procedure Visit
(Self : not null access Base_Abort_Statement;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class);
overriding function Aborted_Tasks
(Self : Base_Abort_Statement)
return not null Program.Elements.Expressions.Expression_Vector_Access;
overriding function Is_Abort_Statement
(Self : Base_Abort_Statement)
return Boolean;
overriding function Is_Statement
(Self : Base_Abort_Statement)
return Boolean;
type Abort_Statement is
new Base_Abort_Statement
and Program.Elements.Abort_Statements.Abort_Statement_Text
with record
Abort_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
end record;
overriding function To_Abort_Statement_Text
(Self : in out Abort_Statement)
return Program.Elements.Abort_Statements.Abort_Statement_Text_Access;
overriding function Abort_Token
(Self : Abort_Statement)
return not null Program.Lexical_Elements.Lexical_Element_Access;
overriding function Semicolon_Token
(Self : Abort_Statement)
return not null Program.Lexical_Elements.Lexical_Element_Access;
type Implicit_Abort_Statement is
new Base_Abort_Statement
with record
Is_Part_Of_Implicit : Boolean;
Is_Part_Of_Inherited : Boolean;
Is_Part_Of_Instance : Boolean;
end record;
overriding function To_Abort_Statement_Text
(Self : in out Implicit_Abort_Statement)
return Program.Elements.Abort_Statements.Abort_Statement_Text_Access;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Abort_Statement)
return Boolean;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Abort_Statement)
return Boolean;
overriding function Is_Part_Of_Instance
(Self : Implicit_Abort_Statement)
return Boolean;
end Program.Nodes.Abort_Statements;
|
23447
|
-- SPDX-FileCopyrightText: 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Program.Lexical_Elements;
with Program.Elements.Expressions;
with Program.Elements.Abort_Statements;
with Program.Element_Visitors;
package Program.Nodes.Abort_Statements is
pragma Preelaborate;
type Abort_Statement is
new Program.Nodes.Node
and Program.Elements.Abort_Statements.Abort_Statement
and Program.Elements.Abort_Statements.Abort_Statement_Text
with private;
function Create
(Abort_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Aborted_Tasks : not null Program.Elements.Expressions
.Expression_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return Abort_Statement;
type Implicit_Abort_Statement is
new Program.Nodes.Node
and Program.Elements.Abort_Statements.Abort_Statement
with private;
function Create
(Aborted_Tasks : not null Program.Elements.Expressions
.Expression_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Abort_Statement
with Pre =>
Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance;
private
type Base_Abort_Statement is
abstract new Program.Nodes.Node
and Program.Elements.Abort_Statements.Abort_Statement
with record
Aborted_Tasks : not null Program.Elements.Expressions
.Expression_Vector_Access;
end record;
procedure Initialize (Self : in out Base_Abort_Statement'Class);
overriding procedure Visit
(Self : not null access Base_Abort_Statement;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class);
overriding function Aborted_Tasks
(Self : Base_Abort_Statement)
return not null Program.Elements.Expressions.Expression_Vector_Access;
overriding function Is_Abort_Statement
(Self : Base_Abort_Statement)
return Boolean;
overriding function Is_Statement
(Self : Base_Abort_Statement)
return Boolean;
type Abort_Statement is
new Base_Abort_Statement
and Program.Elements.Abort_Statements.Abort_Statement_Text
with record
Abort_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
end record;
overriding function To_Abort_Statement_Text
(Self : in out Abort_Statement)
return Program.Elements.Abort_Statements.Abort_Statement_Text_Access;
overriding function Abort_Token
(Self : Abort_Statement)
return not null Program.Lexical_Elements.Lexical_Element_Access;
overriding function Semicolon_Token
(Self : Abort_Statement)
return not null Program.Lexical_Elements.Lexical_Element_Access;
type Implicit_Abort_Statement is
new Base_Abort_Statement
with record
Is_Part_Of_Implicit : Boolean;
Is_Part_Of_Inherited : Boolean;
Is_Part_Of_Instance : Boolean;
end record;
overriding function To_Abort_Statement_Text
(Self : in out Implicit_Abort_Statement)
return Program.Elements.Abort_Statements.Abort_Statement_Text_Access;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Abort_Statement)
return Boolean;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Abort_Statement)
return Boolean;
overriding function Is_Part_Of_Instance
(Self : Implicit_Abort_Statement)
return Boolean;
end Program.Nodes.Abort_Statements;
| true |
-- SPDX-FileCopyrightText: 2019 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Program.Lexical_Elements;
with Program.Elements.Expressions;
with Program.Elements.Abort_Statements;
with Program.Element_Visitors;
package Program.Nodes.Abort_Statements is
pragma Preelaborate;
type Abort_Statement is
new Program.Nodes.Node
and Program.Elements.Abort_Statements.Abort_Statement
and Program.Elements.Abort_Statements.Abort_Statement_Text
with private;
function Create
(Abort_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Aborted_Tasks : not null Program.Elements.Expressions
.Expression_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return Abort_Statement;
type Implicit_Abort_Statement is
new Program.Nodes.Node
and Program.Elements.Abort_Statements.Abort_Statement
with private;
function Create
(Aborted_Tasks : not null Program.Elements.Expressions
.Expression_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Abort_Statement
with Pre =>
Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance;
private
type Base_Abort_Statement is
abstract new Program.Nodes.Node
and Program.Elements.Abort_Statements.Abort_Statement
with record
Aborted_Tasks : not null Program.Elements.Expressions
.Expression_Vector_Access;
end record;
procedure Initialize (Self : in out Base_Abort_Statement'Class);
overriding procedure Visit
(Self : not null access Base_Abort_Statement;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class);
overriding function Aborted_Tasks
(Self : Base_Abort_Statement)
return not null Program.Elements.Expressions.Expression_Vector_Access;
overriding function Is_Abort_Statement
(Self : Base_Abort_Statement)
return Boolean;
overriding function Is_Statement
(Self : Base_Abort_Statement)
return Boolean;
type Abort_Statement is
new Base_Abort_Statement
and Program.Elements.Abort_Statements.Abort_Statement_Text
with record
Abort_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
end record;
overriding function To_Abort_Statement_Text
(Self : in out Abort_Statement)
return Program.Elements.Abort_Statements.Abort_Statement_Text_Access;
overriding function Abort_Token
(Self : Abort_Statement)
return not null Program.Lexical_Elements.Lexical_Element_Access;
overriding function Semicolon_Token
(Self : Abort_Statement)
return not null Program.Lexical_Elements.Lexical_Element_Access;
type Implicit_Abort_Statement is
new Base_Abort_Statement
with record
Is_Part_Of_Implicit : Boolean;
Is_Part_Of_Inherited : Boolean;
Is_Part_Of_Instance : Boolean;
end record;
overriding function To_Abort_Statement_Text
(Self : in out Implicit_Abort_Statement)
return Program.Elements.Abort_Statements.Abort_Statement_Text_Access;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Abort_Statement)
return Boolean;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Abort_Statement)
return Boolean;
overriding function Is_Part_Of_Instance
(Self : Implicit_Abort_Statement)
return Boolean;
end Program.Nodes.Abort_Statements;
|
[
{
"context": "-- Copyright (c) 2019 Maxim Reznik <[email protected]>\n--\n-- SPDX-License-Identifi",
"end": 35,
"score": 0.999858558177948,
"start": 23,
"tag": "NAME",
"value": "Maxim Reznik"
},
{
"context": "-- Copyright (c) 2019 Maxim Reznik <[email protected]>\n--\n-- SPDX-License-Identifier: MIT\n-- License-",
"end": 55,
"score": 0.9999310374259949,
"start": 37,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
source/oasis/program-elements-access_types.ads
|
optikos/oasis
| 0 |
-- Copyright (c) 2019 Maxim Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Elements.Type_Definitions;
package Program.Elements.Access_Types is
pragma Pure (Program.Elements.Access_Types);
type Access_Type is
limited interface and Program.Elements.Type_Definitions.Type_Definition;
type Access_Type_Access is access all Access_Type'Class
with Storage_Size => 0;
end Program.Elements.Access_Types;
|
9495
|
-- Copyright (c) 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Elements.Type_Definitions;
package Program.Elements.Access_Types is
pragma Pure (Program.Elements.Access_Types);
type Access_Type is
limited interface and Program.Elements.Type_Definitions.Type_Definition;
type Access_Type_Access is access all Access_Type'Class
with Storage_Size => 0;
end Program.Elements.Access_Types;
| true |
-- Copyright (c) 2019 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Elements.Type_Definitions;
package Program.Elements.Access_Types is
pragma Pure (Program.Elements.Access_Types);
type Access_Type is
limited interface and Program.Elements.Type_Definitions.Type_Definition;
type Access_Type_Access is access all Access_Type'Class
with Storage_Size => 0;
end Program.Elements.Access_Types;
|
[
{
"context": "des\n-- Copyright (C) 2009, 2010, 2011, 2012, 2013 Stephane Carrez\n-- Written by Stephane Carrez (Stephane.Carrez@g",
"end": 163,
"score": 0.9998771548271179,
"start": 148,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "0, 2011, 2012, 2013 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under",
"end": 194,
"score": 0.999886155128479,
"start": 179,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "3 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under the Apache License, Versio",
"end": 221,
"score": 0.9999288320541382,
"start": 196,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
src/asf-views-nodes-core.ads
|
Letractively/ada-asf
| 0 |
-----------------------------------------------------------------------
-- nodes-core -- Core nodes
-- Copyright (C) 2009, 2010, 2011, 2012, 2013 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
-- The <b>ASF.Views.Nodes.Core</b> package defines some pre-defined
-- core tag nodes which are mapped in the following namespaces:
--
-- xmlns:c="http://java.sun.com/jstl/core"
-- xmlns:ui="http://java.sun.com/jsf/facelets"
-- xmlns:fn="http://java.sun.com/jsp/jstl/functions"
--
-- The following JSTL core elements are defined:
-- <c:set var="name" value="#{expr}"/>
-- <c:if test="#{expr}"> ...</c:if>
-- <c:choose><c:when test="#{expr}"></c:when><c:otherwise/</c:choose>
--
--
with ASF.Factory;
with EL.Functions;
package ASF.Views.Nodes.Core is
FN_URI : constant String := "http://java.sun.com/jsp/jstl/functions";
-- Tag factory for nodes defined in this package.
function Definition return ASF.Factory.Factory_Bindings_Access;
-- Register a set of functions in the namespace
-- xmlns:fn="http://java.sun.com/jsp/jstl/functions"
-- Functions:
-- capitalize, toUpperCase, toLowerCase
procedure Set_Functions (Mapper : in out EL.Functions.Function_Mapper'Class);
-- ------------------------------
-- Set Tag
-- ------------------------------
-- The <c:set var="name" value="#{expr}"/> variable creation.
-- The variable is created in the faces context.
type Set_Tag_Node is new Tag_Node with private;
type Set_Tag_Node_Access is access all Set_Tag_Node'Class;
-- Create the Set Tag
function Create_Set_Tag_Node (Binding : in Binding_Access;
Line : in Line_Info;
Parent : in Tag_Node_Access;
Attributes : in Tag_Attribute_Array_Access)
return Tag_Node_Access;
-- Build the component tree from the tag node and attach it as
-- the last child of the given parent. Calls recursively the
-- method to create children.
overriding
procedure Build_Components (Node : access Set_Tag_Node;
Parent : in UIComponent_Access;
Context : in out Facelet_Context'Class);
-- ------------------------------
-- If Tag
-- ------------------------------
-- The <c:if test="#{expr}"> ...</c:if> condition.
-- If the condition evaluates to true when the component tree is built,
-- the children of this node are evaluated. Otherwise the entire
-- sub-tree is not present in the component tree.
type If_Tag_Node is new Tag_Node with private;
type If_Tag_Node_Access is access all If_Tag_Node'Class;
-- Create the If Tag
function Create_If_Tag_Node (Binding : in Binding_Access;
Line : in Line_Info;
Parent : in Tag_Node_Access;
Attributes : in Tag_Attribute_Array_Access)
return Tag_Node_Access;
-- Build the component tree from the tag node and attach it as
-- the last child of the given parent. Calls recursively the
-- method to create children.
overriding
procedure Build_Components (Node : access If_Tag_Node;
Parent : in UIComponent_Access;
Context : in out Facelet_Context'Class);
-- ------------------------------
-- Choose Tag
-- ------------------------------
-- The <c:choose> ...</c:choose> choice.
-- Evaluate a set of choices (<c:when>) until one of them is found.
-- When no choice is found, evaluate the <c:otherwise> node.
type Choose_Tag_Node is new Tag_Node with private;
type Choose_Tag_Node_Access is access all Choose_Tag_Node'Class;
-- Freeze the tag node tree and perform any initialization steps
-- necessary to build the components efficiently.
-- Prepare the evaluation of choices by identifying the <c:when> and
-- <c:otherwise> conditions.
overriding
procedure Freeze (Node : access Choose_Tag_Node);
-- Build the component tree from the tag node and attach it as
-- the last child of the given parent. Calls recursively the
-- method to create children.
overriding
procedure Build_Components (Node : access Choose_Tag_Node;
Parent : in UIComponent_Access;
Context : in out Facelet_Context'Class);
-- Create the <c:choose> tag node
function Create_Choose_Tag_Node (Binding : in Binding_Access;
Line : in Line_Info;
Parent : in Tag_Node_Access;
Attributes : in Tag_Attribute_Array_Access)
return Tag_Node_Access;
-- ------------------------------
-- When Tag
-- ------------------------------
-- The <c:when test="#{expr}"> ...</c:when> choice.
-- If the condition evaluates to true when the component tree is built,
-- the children of this node are evaluated. Otherwise the entire
-- sub-tree is not present in the component tree.
type When_Tag_Node is new If_Tag_Node with private;
type When_Tag_Node_Access is access all When_Tag_Node'Class;
-- Check whether the node condition is selected.
function Is_Selected (Node : When_Tag_Node;
Context : Facelet_Context'Class) return Boolean;
-- Create the When Tag
function Create_When_Tag_Node (Binding : in Binding_Access;
Line : in Line_Info;
Parent : in Tag_Node_Access;
Attributes : in Tag_Attribute_Array_Access)
return Tag_Node_Access;
-- ------------------------------
-- Otherwise Tag
-- ------------------------------
-- The <c:otherwise> ...</c:otherwise> choice.
-- When all the choice conditions were false, the component tree is built,
-- the children of this node are evaluated.
type Otherwise_Tag_Node is new Tag_Node with null record;
type Otherwise_Tag_Node_Access is access all Otherwise_Tag_Node'Class;
-- Create the Otherwise Tag
function Create_Otherwise_Tag_Node (Binding : in Binding_Access;
Line : in Line_Info;
Parent : in Tag_Node_Access;
Attributes : in Tag_Attribute_Array_Access)
return Tag_Node_Access;
-- Java Facelet provides a <c:repeat> tag. It must not be implemented
-- because it was proven this was not a good method for iterating over a list.
private
type Set_Tag_Node is new Tag_Node with record
Var : Tag_Attribute_Access;
Value : Tag_Attribute_Access;
end record;
type If_Tag_Node is new Tag_Node with record
Condition : Tag_Attribute_Access;
Var : Tag_Attribute_Access;
end record;
type When_Tag_Node is new If_Tag_Node with record
Next_Choice : When_Tag_Node_Access;
end record;
type Choose_Tag_Node is new Tag_Node with record
Choices : When_Tag_Node_Access;
Otherwise : Tag_Node_Access;
end record;
end ASF.Views.Nodes.Core;
|
27710
|
-----------------------------------------------------------------------
-- nodes-core -- Core nodes
-- Copyright (C) 2009, 2010, 2011, 2012, 2013 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
-- The <b>ASF.Views.Nodes.Core</b> package defines some pre-defined
-- core tag nodes which are mapped in the following namespaces:
--
-- xmlns:c="http://java.sun.com/jstl/core"
-- xmlns:ui="http://java.sun.com/jsf/facelets"
-- xmlns:fn="http://java.sun.com/jsp/jstl/functions"
--
-- The following JSTL core elements are defined:
-- <c:set var="name" value="#{expr}"/>
-- <c:if test="#{expr}"> ...</c:if>
-- <c:choose><c:when test="#{expr}"></c:when><c:otherwise/</c:choose>
--
--
with ASF.Factory;
with EL.Functions;
package ASF.Views.Nodes.Core is
FN_URI : constant String := "http://java.sun.com/jsp/jstl/functions";
-- Tag factory for nodes defined in this package.
function Definition return ASF.Factory.Factory_Bindings_Access;
-- Register a set of functions in the namespace
-- xmlns:fn="http://java.sun.com/jsp/jstl/functions"
-- Functions:
-- capitalize, toUpperCase, toLowerCase
procedure Set_Functions (Mapper : in out EL.Functions.Function_Mapper'Class);
-- ------------------------------
-- Set Tag
-- ------------------------------
-- The <c:set var="name" value="#{expr}"/> variable creation.
-- The variable is created in the faces context.
type Set_Tag_Node is new Tag_Node with private;
type Set_Tag_Node_Access is access all Set_Tag_Node'Class;
-- Create the Set Tag
function Create_Set_Tag_Node (Binding : in Binding_Access;
Line : in Line_Info;
Parent : in Tag_Node_Access;
Attributes : in Tag_Attribute_Array_Access)
return Tag_Node_Access;
-- Build the component tree from the tag node and attach it as
-- the last child of the given parent. Calls recursively the
-- method to create children.
overriding
procedure Build_Components (Node : access Set_Tag_Node;
Parent : in UIComponent_Access;
Context : in out Facelet_Context'Class);
-- ------------------------------
-- If Tag
-- ------------------------------
-- The <c:if test="#{expr}"> ...</c:if> condition.
-- If the condition evaluates to true when the component tree is built,
-- the children of this node are evaluated. Otherwise the entire
-- sub-tree is not present in the component tree.
type If_Tag_Node is new Tag_Node with private;
type If_Tag_Node_Access is access all If_Tag_Node'Class;
-- Create the If Tag
function Create_If_Tag_Node (Binding : in Binding_Access;
Line : in Line_Info;
Parent : in Tag_Node_Access;
Attributes : in Tag_Attribute_Array_Access)
return Tag_Node_Access;
-- Build the component tree from the tag node and attach it as
-- the last child of the given parent. Calls recursively the
-- method to create children.
overriding
procedure Build_Components (Node : access If_Tag_Node;
Parent : in UIComponent_Access;
Context : in out Facelet_Context'Class);
-- ------------------------------
-- Choose Tag
-- ------------------------------
-- The <c:choose> ...</c:choose> choice.
-- Evaluate a set of choices (<c:when>) until one of them is found.
-- When no choice is found, evaluate the <c:otherwise> node.
type Choose_Tag_Node is new Tag_Node with private;
type Choose_Tag_Node_Access is access all Choose_Tag_Node'Class;
-- Freeze the tag node tree and perform any initialization steps
-- necessary to build the components efficiently.
-- Prepare the evaluation of choices by identifying the <c:when> and
-- <c:otherwise> conditions.
overriding
procedure Freeze (Node : access Choose_Tag_Node);
-- Build the component tree from the tag node and attach it as
-- the last child of the given parent. Calls recursively the
-- method to create children.
overriding
procedure Build_Components (Node : access Choose_Tag_Node;
Parent : in UIComponent_Access;
Context : in out Facelet_Context'Class);
-- Create the <c:choose> tag node
function Create_Choose_Tag_Node (Binding : in Binding_Access;
Line : in Line_Info;
Parent : in Tag_Node_Access;
Attributes : in Tag_Attribute_Array_Access)
return Tag_Node_Access;
-- ------------------------------
-- When Tag
-- ------------------------------
-- The <c:when test="#{expr}"> ...</c:when> choice.
-- If the condition evaluates to true when the component tree is built,
-- the children of this node are evaluated. Otherwise the entire
-- sub-tree is not present in the component tree.
type When_Tag_Node is new If_Tag_Node with private;
type When_Tag_Node_Access is access all When_Tag_Node'Class;
-- Check whether the node condition is selected.
function Is_Selected (Node : When_Tag_Node;
Context : Facelet_Context'Class) return Boolean;
-- Create the When Tag
function Create_When_Tag_Node (Binding : in Binding_Access;
Line : in Line_Info;
Parent : in Tag_Node_Access;
Attributes : in Tag_Attribute_Array_Access)
return Tag_Node_Access;
-- ------------------------------
-- Otherwise Tag
-- ------------------------------
-- The <c:otherwise> ...</c:otherwise> choice.
-- When all the choice conditions were false, the component tree is built,
-- the children of this node are evaluated.
type Otherwise_Tag_Node is new Tag_Node with null record;
type Otherwise_Tag_Node_Access is access all Otherwise_Tag_Node'Class;
-- Create the Otherwise Tag
function Create_Otherwise_Tag_Node (Binding : in Binding_Access;
Line : in Line_Info;
Parent : in Tag_Node_Access;
Attributes : in Tag_Attribute_Array_Access)
return Tag_Node_Access;
-- Java Facelet provides a <c:repeat> tag. It must not be implemented
-- because it was proven this was not a good method for iterating over a list.
private
type Set_Tag_Node is new Tag_Node with record
Var : Tag_Attribute_Access;
Value : Tag_Attribute_Access;
end record;
type If_Tag_Node is new Tag_Node with record
Condition : Tag_Attribute_Access;
Var : Tag_Attribute_Access;
end record;
type When_Tag_Node is new If_Tag_Node with record
Next_Choice : When_Tag_Node_Access;
end record;
type Choose_Tag_Node is new Tag_Node with record
Choices : When_Tag_Node_Access;
Otherwise : Tag_Node_Access;
end record;
end ASF.Views.Nodes.Core;
| true |
-----------------------------------------------------------------------
-- nodes-core -- Core nodes
-- Copyright (C) 2009, 2010, 2011, 2012, 2013 PI:NAME:<NAME>END_PI
-- Written by PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
-- The <b>ASF.Views.Nodes.Core</b> package defines some pre-defined
-- core tag nodes which are mapped in the following namespaces:
--
-- xmlns:c="http://java.sun.com/jstl/core"
-- xmlns:ui="http://java.sun.com/jsf/facelets"
-- xmlns:fn="http://java.sun.com/jsp/jstl/functions"
--
-- The following JSTL core elements are defined:
-- <c:set var="name" value="#{expr}"/>
-- <c:if test="#{expr}"> ...</c:if>
-- <c:choose><c:when test="#{expr}"></c:when><c:otherwise/</c:choose>
--
--
with ASF.Factory;
with EL.Functions;
package ASF.Views.Nodes.Core is
FN_URI : constant String := "http://java.sun.com/jsp/jstl/functions";
-- Tag factory for nodes defined in this package.
function Definition return ASF.Factory.Factory_Bindings_Access;
-- Register a set of functions in the namespace
-- xmlns:fn="http://java.sun.com/jsp/jstl/functions"
-- Functions:
-- capitalize, toUpperCase, toLowerCase
procedure Set_Functions (Mapper : in out EL.Functions.Function_Mapper'Class);
-- ------------------------------
-- Set Tag
-- ------------------------------
-- The <c:set var="name" value="#{expr}"/> variable creation.
-- The variable is created in the faces context.
type Set_Tag_Node is new Tag_Node with private;
type Set_Tag_Node_Access is access all Set_Tag_Node'Class;
-- Create the Set Tag
function Create_Set_Tag_Node (Binding : in Binding_Access;
Line : in Line_Info;
Parent : in Tag_Node_Access;
Attributes : in Tag_Attribute_Array_Access)
return Tag_Node_Access;
-- Build the component tree from the tag node and attach it as
-- the last child of the given parent. Calls recursively the
-- method to create children.
overriding
procedure Build_Components (Node : access Set_Tag_Node;
Parent : in UIComponent_Access;
Context : in out Facelet_Context'Class);
-- ------------------------------
-- If Tag
-- ------------------------------
-- The <c:if test="#{expr}"> ...</c:if> condition.
-- If the condition evaluates to true when the component tree is built,
-- the children of this node are evaluated. Otherwise the entire
-- sub-tree is not present in the component tree.
type If_Tag_Node is new Tag_Node with private;
type If_Tag_Node_Access is access all If_Tag_Node'Class;
-- Create the If Tag
function Create_If_Tag_Node (Binding : in Binding_Access;
Line : in Line_Info;
Parent : in Tag_Node_Access;
Attributes : in Tag_Attribute_Array_Access)
return Tag_Node_Access;
-- Build the component tree from the tag node and attach it as
-- the last child of the given parent. Calls recursively the
-- method to create children.
overriding
procedure Build_Components (Node : access If_Tag_Node;
Parent : in UIComponent_Access;
Context : in out Facelet_Context'Class);
-- ------------------------------
-- Choose Tag
-- ------------------------------
-- The <c:choose> ...</c:choose> choice.
-- Evaluate a set of choices (<c:when>) until one of them is found.
-- When no choice is found, evaluate the <c:otherwise> node.
type Choose_Tag_Node is new Tag_Node with private;
type Choose_Tag_Node_Access is access all Choose_Tag_Node'Class;
-- Freeze the tag node tree and perform any initialization steps
-- necessary to build the components efficiently.
-- Prepare the evaluation of choices by identifying the <c:when> and
-- <c:otherwise> conditions.
overriding
procedure Freeze (Node : access Choose_Tag_Node);
-- Build the component tree from the tag node and attach it as
-- the last child of the given parent. Calls recursively the
-- method to create children.
overriding
procedure Build_Components (Node : access Choose_Tag_Node;
Parent : in UIComponent_Access;
Context : in out Facelet_Context'Class);
-- Create the <c:choose> tag node
function Create_Choose_Tag_Node (Binding : in Binding_Access;
Line : in Line_Info;
Parent : in Tag_Node_Access;
Attributes : in Tag_Attribute_Array_Access)
return Tag_Node_Access;
-- ------------------------------
-- When Tag
-- ------------------------------
-- The <c:when test="#{expr}"> ...</c:when> choice.
-- If the condition evaluates to true when the component tree is built,
-- the children of this node are evaluated. Otherwise the entire
-- sub-tree is not present in the component tree.
type When_Tag_Node is new If_Tag_Node with private;
type When_Tag_Node_Access is access all When_Tag_Node'Class;
-- Check whether the node condition is selected.
function Is_Selected (Node : When_Tag_Node;
Context : Facelet_Context'Class) return Boolean;
-- Create the When Tag
function Create_When_Tag_Node (Binding : in Binding_Access;
Line : in Line_Info;
Parent : in Tag_Node_Access;
Attributes : in Tag_Attribute_Array_Access)
return Tag_Node_Access;
-- ------------------------------
-- Otherwise Tag
-- ------------------------------
-- The <c:otherwise> ...</c:otherwise> choice.
-- When all the choice conditions were false, the component tree is built,
-- the children of this node are evaluated.
type Otherwise_Tag_Node is new Tag_Node with null record;
type Otherwise_Tag_Node_Access is access all Otherwise_Tag_Node'Class;
-- Create the Otherwise Tag
function Create_Otherwise_Tag_Node (Binding : in Binding_Access;
Line : in Line_Info;
Parent : in Tag_Node_Access;
Attributes : in Tag_Attribute_Array_Access)
return Tag_Node_Access;
-- Java Facelet provides a <c:repeat> tag. It must not be implemented
-- because it was proven this was not a good method for iterating over a list.
private
type Set_Tag_Node is new Tag_Node with record
Var : Tag_Attribute_Access;
Value : Tag_Attribute_Access;
end record;
type If_Tag_Node is new Tag_Node with record
Condition : Tag_Attribute_Access;
Var : Tag_Attribute_Access;
end record;
type When_Tag_Node is new If_Tag_Node with record
Next_Choice : When_Tag_Node_Access;
end record;
type Choose_Tag_Node is new Tag_Node with record
Choices : When_Tag_Node_Access;
Otherwise : Tag_Node_Access;
end record;
end ASF.Views.Nodes.Core;
|
[
{
"context": " of the OpenAPI document: 3.5.0_pre.0\n-- Contact: [email protected]\n--\n-- NOTE: This package is auto generated by Op",
"end": 220,
"score": 0.9999228715896606,
"start": 191,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
clients/ada/generated/src/model/-models.adb
|
shinesolutions/swagger-aem
| 39 |
-- Adobe Experience Manager (AEM) API
-- Swagger AEM is an OpenAPI specification for Adobe Experience Manager (AEM) API
--
-- The version of the OpenAPI document: 3.5.0_pre.0
-- Contact: [email protected]
--
-- NOTE: This package is auto generated by OpenAPI-Generator 5.2.1.
-- https://openapi-generator.tech
-- Do not edit the class manually.
package body .Models is
pragma Style_Checks ("-mr");
pragma Warnings (Off, "*use clause for package*");
use Swagger.Streams;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in InstallStatusStatus_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("finished", Value.Finished);
Into.Write_Entity ("itemCount", Value.Item_Count);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in InstallStatusStatus_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out InstallStatusStatus_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "finished", Value.Finished);
Swagger.Streams.Deserialize (Object, "itemCount", Value.Item_Count);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out InstallStatusStatus_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : InstallStatusStatus_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in InstallStatus_Type) is
begin
Into.Start_Entity (Name);
Serialize (Into, "status", Value.Status);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in InstallStatus_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out InstallStatus_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Deserialize (Object, "status", Value.Status);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out InstallStatus_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : InstallStatus_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsString_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("name", Value.Name);
Into.Write_Entity ("optional", Value.Optional);
Into.Write_Entity ("is_set", Value.Is_Set);
Into.Write_Entity ("type", Value.P_Type);
Into.Write_Entity ("value", Value.Value);
Into.Write_Entity ("description", Value.Description);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsString_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsString_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
Swagger.Streams.Deserialize (Object, "optional", Value.Optional);
Swagger.Streams.Deserialize (Object, "is_set", Value.Is_Set);
Swagger.Streams.Deserialize (Object, "type", Value.P_Type);
Swagger.Streams.Deserialize (Object, "value", Value.Value);
Swagger.Streams.Deserialize (Object, "description", Value.Description);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsString_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SamlConfigurationPropertyItemsString_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsBoolean_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("name", Value.Name);
Into.Write_Entity ("optional", Value.Optional);
Into.Write_Entity ("is_set", Value.Is_Set);
Into.Write_Entity ("type", Value.P_Type);
Into.Write_Entity ("value", Value.Value);
Into.Write_Entity ("description", Value.Description);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsBoolean_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsBoolean_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
Swagger.Streams.Deserialize (Object, "optional", Value.Optional);
Swagger.Streams.Deserialize (Object, "is_set", Value.Is_Set);
Swagger.Streams.Deserialize (Object, "type", Value.P_Type);
Swagger.Streams.Deserialize (Object, "value", Value.Value);
Swagger.Streams.Deserialize (Object, "description", Value.Description);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsBoolean_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SamlConfigurationPropertyItemsBoolean_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in TruststoreItems_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("alias", Value.Alias);
Into.Write_Entity ("entryType", Value.Entry_Type);
Into.Write_Entity ("subject", Value.Subject);
Into.Write_Entity ("issuer", Value.Issuer);
Into.Write_Entity ("notBefore", Value.Not_Before);
Into.Write_Entity ("notAfter", Value.Not_After);
Into.Write_Entity ("serialNumber", Value.Serial_Number);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in TruststoreItems_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out TruststoreItems_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "alias", Value.Alias);
Swagger.Streams.Deserialize (Object, "entryType", Value.Entry_Type);
Swagger.Streams.Deserialize (Object, "subject", Value.Subject);
Swagger.Streams.Deserialize (Object, "issuer", Value.Issuer);
Swagger.Streams.Deserialize (Object, "notBefore", Value.Not_Before);
Swagger.Streams.Deserialize (Object, "notAfter", Value.Not_After);
Swagger.Streams.Deserialize (Object, "serialNumber", Value.Serial_Number);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out TruststoreItems_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : TruststoreItems_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in TruststoreInfo_Type) is
begin
Into.Start_Entity (Name);
Serialize (Into, "aliases", Value.Aliases);
Into.Write_Entity ("exists", Value.Exists);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in TruststoreInfo_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out TruststoreInfo_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Deserialize (Object, "aliases", Value.Aliases);
Swagger.Streams.Deserialize (Object, "exists", Value.Exists);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out TruststoreInfo_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : TruststoreInfo_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in KeystoreChainItems_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("subject", Value.Subject);
Into.Write_Entity ("issuer", Value.Issuer);
Into.Write_Entity ("notBefore", Value.Not_Before);
Into.Write_Entity ("notAfter", Value.Not_After);
Into.Write_Entity ("serialNumber", Value.Serial_Number);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in KeystoreChainItems_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out KeystoreChainItems_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "subject", Value.Subject);
Swagger.Streams.Deserialize (Object, "issuer", Value.Issuer);
Swagger.Streams.Deserialize (Object, "notBefore", Value.Not_Before);
Swagger.Streams.Deserialize (Object, "notAfter", Value.Not_After);
Swagger.Streams.Deserialize (Object, "serialNumber", Value.Serial_Number);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out KeystoreChainItems_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : KeystoreChainItems_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in KeystoreItems_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("alias", Value.Alias);
Into.Write_Entity ("entryType", Value.Entry_Type);
Into.Write_Entity ("algorithm", Value.Algorithm);
Into.Write_Entity ("format", Value.Format);
Serialize (Into, "chain", Value.Chain);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in KeystoreItems_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out KeystoreItems_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "alias", Value.Alias);
Swagger.Streams.Deserialize (Object, "entryType", Value.Entry_Type);
Swagger.Streams.Deserialize (Object, "algorithm", Value.Algorithm);
Swagger.Streams.Deserialize (Object, "format", Value.Format);
Deserialize (Object, "chain", Value.Chain);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out KeystoreItems_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : KeystoreItems_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in KeystoreInfo_Type) is
begin
Into.Start_Entity (Name);
Serialize (Into, "aliases", Value.Aliases);
Into.Write_Entity ("exists", Value.Exists);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in KeystoreInfo_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out KeystoreInfo_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Deserialize (Object, "aliases", Value.Aliases);
Swagger.Streams.Deserialize (Object, "exists", Value.Exists);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out KeystoreInfo_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : KeystoreInfo_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsArray_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("name", Value.Name);
Into.Write_Entity ("optional", Value.Optional);
Into.Write_Entity ("is_set", Value.Is_Set);
Into.Write_Entity ("type", Value.P_Type);
Serialize (Into, "values", Value.Values);
Into.Write_Entity ("description", Value.Description);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsArray_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsArray_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
Swagger.Streams.Deserialize (Object, "optional", Value.Optional);
Swagger.Streams.Deserialize (Object, "is_set", Value.Is_Set);
Swagger.Streams.Deserialize (Object, "type", Value.P_Type);
Swagger.Streams.Deserialize (Object, "values", Value.Values);
Swagger.Streams.Deserialize (Object, "description", Value.Description);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsArray_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SamlConfigurationPropertyItemsArray_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsLong_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("name", Value.Name);
Into.Write_Entity ("optional", Value.Optional);
Into.Write_Entity ("is_set", Value.Is_Set);
Into.Write_Entity ("type", Value.P_Type);
Into.Write_Entity ("value", Value.Value);
Into.Write_Entity ("description", Value.Description);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsLong_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsLong_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
Swagger.Streams.Deserialize (Object, "optional", Value.Optional);
Swagger.Streams.Deserialize (Object, "is_set", Value.Is_Set);
Swagger.Streams.Deserialize (Object, "type", Value.P_Type);
Swagger.Streams.Deserialize (Object, "value", Value.Value);
Swagger.Streams.Deserialize (Object, "description", Value.Description);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsLong_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SamlConfigurationPropertyItemsLong_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationProperties_Type) is
begin
Into.Start_Entity (Name);
Serialize (Into, "path", Value.Path);
Serialize (Into, "service.ranking", Value.Service_Ranking);
Serialize (Into, "idpUrl", Value.Idp_Url);
Serialize (Into, "idpCertAlias", Value.Idp_Cert_Alias);
Serialize (Into, "idpHttpRedirect", Value.Idp_Http_Redirect);
Serialize (Into, "serviceProviderEntityId", Value.Service_Provider_Entity_Id);
Serialize (Into, "assertionConsumerServiceURL", Value.Assertion_Consumer_Service_URL);
Serialize (Into, "spPrivateKeyAlias", Value.Sp_Private_Key_Alias);
Serialize (Into, "keyStorePassword", Value.Key_Store_Password);
Serialize (Into, "defaultRedirectUrl", Value.Default_Redirect_Url);
Serialize (Into, "userIDAttribute", Value.User_IDAttribute);
Serialize (Into, "useEncryption", Value.Use_Encryption);
Serialize (Into, "createUser", Value.Create_User);
Serialize (Into, "addGroupMemberships", Value.Add_Group_Memberships);
Serialize (Into, "groupMembershipAttribute", Value.Group_Membership_Attribute);
Serialize (Into, "defaultGroups", Value.Default_Groups);
Serialize (Into, "nameIdFormat", Value.Name_Id_Format);
Serialize (Into, "synchronizeAttributes", Value.Synchronize_Attributes);
Serialize (Into, "handleLogout", Value.Handle_Logout);
Serialize (Into, "logoutUrl", Value.Logout_Url);
Serialize (Into, "clockTolerance", Value.Clock_Tolerance);
Serialize (Into, "digestMethod", Value.Digest_Method);
Serialize (Into, "signatureMethod", Value.Signature_Method);
Serialize (Into, "userIntermediatePath", Value.User_Intermediate_Path);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationProperties_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationProperties_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Deserialize (Object, "path", Value.Path);
Deserialize (Object, "service.ranking", Value.Service_Ranking);
Deserialize (Object, "idpUrl", Value.Idp_Url);
Deserialize (Object, "idpCertAlias", Value.Idp_Cert_Alias);
Deserialize (Object, "idpHttpRedirect", Value.Idp_Http_Redirect);
Deserialize (Object, "serviceProviderEntityId", Value.Service_Provider_Entity_Id);
Deserialize (Object, "assertionConsumerServiceURL", Value.Assertion_Consumer_Service_URL);
Deserialize (Object, "spPrivateKeyAlias", Value.Sp_Private_Key_Alias);
Deserialize (Object, "keyStorePassword", Value.Key_Store_Password);
Deserialize (Object, "defaultRedirectUrl", Value.Default_Redirect_Url);
Deserialize (Object, "userIDAttribute", Value.User_IDAttribute);
Deserialize (Object, "useEncryption", Value.Use_Encryption);
Deserialize (Object, "createUser", Value.Create_User);
Deserialize (Object, "addGroupMemberships", Value.Add_Group_Memberships);
Deserialize (Object, "groupMembershipAttribute", Value.Group_Membership_Attribute);
Deserialize (Object, "defaultGroups", Value.Default_Groups);
Deserialize (Object, "nameIdFormat", Value.Name_Id_Format);
Deserialize (Object, "synchronizeAttributes", Value.Synchronize_Attributes);
Deserialize (Object, "handleLogout", Value.Handle_Logout);
Deserialize (Object, "logoutUrl", Value.Logout_Url);
Deserialize (Object, "clockTolerance", Value.Clock_Tolerance);
Deserialize (Object, "digestMethod", Value.Digest_Method);
Deserialize (Object, "signatureMethod", Value.Signature_Method);
Deserialize (Object, "userIntermediatePath", Value.User_Intermediate_Path);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationProperties_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SamlConfigurationProperties_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationInfo_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("pid", Value.Pid);
Into.Write_Entity ("title", Value.Title);
Into.Write_Entity ("description", Value.Description);
Into.Write_Entity ("bundle_location", Value.Bundle_Location);
Into.Write_Entity ("service_location", Value.Service_Location);
Serialize (Into, "properties", Value.Properties);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationInfo_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationInfo_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "pid", Value.Pid);
Swagger.Streams.Deserialize (Object, "title", Value.Title);
Swagger.Streams.Deserialize (Object, "description", Value.Description);
Swagger.Streams.Deserialize (Object, "bundle_location", Value.Bundle_Location);
Swagger.Streams.Deserialize (Object, "service_location", Value.Service_Location);
Deserialize (Object, "properties", Value.Properties);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationInfo_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SamlConfigurationInfo_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BundleDataProp_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("key", Value.Key);
Into.Write_Entity ("value", Value.Value);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BundleDataProp_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BundleDataProp_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "key", Value.Key);
Swagger.Streams.Deserialize (Object, "value", Value.Value);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BundleDataProp_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : BundleDataProp_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BundleData_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("id", Value.Id);
Into.Write_Entity ("name", Value.Name);
Into.Write_Entity ("fragment", Value.Fragment);
Into.Write_Entity ("stateRaw", Value.State_Raw);
Into.Write_Entity ("state", Value.State);
Into.Write_Entity ("version", Value.Version);
Into.Write_Entity ("symbolicName", Value.Symbolic_Name);
Into.Write_Entity ("category", Value.Category);
Serialize (Into, "props", Value.Props);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BundleData_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BundleData_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "id", Value.Id);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
Swagger.Streams.Deserialize (Object, "fragment", Value.Fragment);
Swagger.Streams.Deserialize (Object, "stateRaw", Value.State_Raw);
Swagger.Streams.Deserialize (Object, "state", Value.State);
Swagger.Streams.Deserialize (Object, "version", Value.Version);
Swagger.Streams.Deserialize (Object, "symbolicName", Value.Symbolic_Name);
Swagger.Streams.Deserialize (Object, "category", Value.Category);
Deserialize (Object, "props", Value.Props);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BundleData_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : BundleData_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BundleInfo_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("status", Value.Status);
Serialize (Into, "s", Value.S);
Serialize (Into, "data", Value.Data);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BundleInfo_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BundleInfo_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "status", Value.Status);
Swagger.Streams.Deserialize (Object, "s", Value.S);
Deserialize (Object, "data", Value.Data);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BundleInfo_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : BundleInfo_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
end .Models;
|
1043
|
-- Adobe Experience Manager (AEM) API
-- Swagger AEM is an OpenAPI specification for Adobe Experience Manager (AEM) API
--
-- The version of the OpenAPI document: 3.5.0_pre.0
-- Contact: <EMAIL>
--
-- NOTE: This package is auto generated by OpenAPI-Generator 5.2.1.
-- https://openapi-generator.tech
-- Do not edit the class manually.
package body .Models is
pragma Style_Checks ("-mr");
pragma Warnings (Off, "*use clause for package*");
use Swagger.Streams;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in InstallStatusStatus_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("finished", Value.Finished);
Into.Write_Entity ("itemCount", Value.Item_Count);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in InstallStatusStatus_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out InstallStatusStatus_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "finished", Value.Finished);
Swagger.Streams.Deserialize (Object, "itemCount", Value.Item_Count);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out InstallStatusStatus_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : InstallStatusStatus_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in InstallStatus_Type) is
begin
Into.Start_Entity (Name);
Serialize (Into, "status", Value.Status);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in InstallStatus_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out InstallStatus_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Deserialize (Object, "status", Value.Status);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out InstallStatus_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : InstallStatus_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsString_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("name", Value.Name);
Into.Write_Entity ("optional", Value.Optional);
Into.Write_Entity ("is_set", Value.Is_Set);
Into.Write_Entity ("type", Value.P_Type);
Into.Write_Entity ("value", Value.Value);
Into.Write_Entity ("description", Value.Description);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsString_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsString_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
Swagger.Streams.Deserialize (Object, "optional", Value.Optional);
Swagger.Streams.Deserialize (Object, "is_set", Value.Is_Set);
Swagger.Streams.Deserialize (Object, "type", Value.P_Type);
Swagger.Streams.Deserialize (Object, "value", Value.Value);
Swagger.Streams.Deserialize (Object, "description", Value.Description);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsString_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SamlConfigurationPropertyItemsString_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsBoolean_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("name", Value.Name);
Into.Write_Entity ("optional", Value.Optional);
Into.Write_Entity ("is_set", Value.Is_Set);
Into.Write_Entity ("type", Value.P_Type);
Into.Write_Entity ("value", Value.Value);
Into.Write_Entity ("description", Value.Description);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsBoolean_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsBoolean_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
Swagger.Streams.Deserialize (Object, "optional", Value.Optional);
Swagger.Streams.Deserialize (Object, "is_set", Value.Is_Set);
Swagger.Streams.Deserialize (Object, "type", Value.P_Type);
Swagger.Streams.Deserialize (Object, "value", Value.Value);
Swagger.Streams.Deserialize (Object, "description", Value.Description);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsBoolean_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SamlConfigurationPropertyItemsBoolean_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in TruststoreItems_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("alias", Value.Alias);
Into.Write_Entity ("entryType", Value.Entry_Type);
Into.Write_Entity ("subject", Value.Subject);
Into.Write_Entity ("issuer", Value.Issuer);
Into.Write_Entity ("notBefore", Value.Not_Before);
Into.Write_Entity ("notAfter", Value.Not_After);
Into.Write_Entity ("serialNumber", Value.Serial_Number);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in TruststoreItems_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out TruststoreItems_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "alias", Value.Alias);
Swagger.Streams.Deserialize (Object, "entryType", Value.Entry_Type);
Swagger.Streams.Deserialize (Object, "subject", Value.Subject);
Swagger.Streams.Deserialize (Object, "issuer", Value.Issuer);
Swagger.Streams.Deserialize (Object, "notBefore", Value.Not_Before);
Swagger.Streams.Deserialize (Object, "notAfter", Value.Not_After);
Swagger.Streams.Deserialize (Object, "serialNumber", Value.Serial_Number);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out TruststoreItems_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : TruststoreItems_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in TruststoreInfo_Type) is
begin
Into.Start_Entity (Name);
Serialize (Into, "aliases", Value.Aliases);
Into.Write_Entity ("exists", Value.Exists);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in TruststoreInfo_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out TruststoreInfo_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Deserialize (Object, "aliases", Value.Aliases);
Swagger.Streams.Deserialize (Object, "exists", Value.Exists);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out TruststoreInfo_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : TruststoreInfo_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in KeystoreChainItems_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("subject", Value.Subject);
Into.Write_Entity ("issuer", Value.Issuer);
Into.Write_Entity ("notBefore", Value.Not_Before);
Into.Write_Entity ("notAfter", Value.Not_After);
Into.Write_Entity ("serialNumber", Value.Serial_Number);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in KeystoreChainItems_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out KeystoreChainItems_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "subject", Value.Subject);
Swagger.Streams.Deserialize (Object, "issuer", Value.Issuer);
Swagger.Streams.Deserialize (Object, "notBefore", Value.Not_Before);
Swagger.Streams.Deserialize (Object, "notAfter", Value.Not_After);
Swagger.Streams.Deserialize (Object, "serialNumber", Value.Serial_Number);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out KeystoreChainItems_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : KeystoreChainItems_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in KeystoreItems_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("alias", Value.Alias);
Into.Write_Entity ("entryType", Value.Entry_Type);
Into.Write_Entity ("algorithm", Value.Algorithm);
Into.Write_Entity ("format", Value.Format);
Serialize (Into, "chain", Value.Chain);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in KeystoreItems_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out KeystoreItems_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "alias", Value.Alias);
Swagger.Streams.Deserialize (Object, "entryType", Value.Entry_Type);
Swagger.Streams.Deserialize (Object, "algorithm", Value.Algorithm);
Swagger.Streams.Deserialize (Object, "format", Value.Format);
Deserialize (Object, "chain", Value.Chain);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out KeystoreItems_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : KeystoreItems_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in KeystoreInfo_Type) is
begin
Into.Start_Entity (Name);
Serialize (Into, "aliases", Value.Aliases);
Into.Write_Entity ("exists", Value.Exists);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in KeystoreInfo_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out KeystoreInfo_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Deserialize (Object, "aliases", Value.Aliases);
Swagger.Streams.Deserialize (Object, "exists", Value.Exists);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out KeystoreInfo_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : KeystoreInfo_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsArray_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("name", Value.Name);
Into.Write_Entity ("optional", Value.Optional);
Into.Write_Entity ("is_set", Value.Is_Set);
Into.Write_Entity ("type", Value.P_Type);
Serialize (Into, "values", Value.Values);
Into.Write_Entity ("description", Value.Description);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsArray_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsArray_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
Swagger.Streams.Deserialize (Object, "optional", Value.Optional);
Swagger.Streams.Deserialize (Object, "is_set", Value.Is_Set);
Swagger.Streams.Deserialize (Object, "type", Value.P_Type);
Swagger.Streams.Deserialize (Object, "values", Value.Values);
Swagger.Streams.Deserialize (Object, "description", Value.Description);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsArray_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SamlConfigurationPropertyItemsArray_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsLong_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("name", Value.Name);
Into.Write_Entity ("optional", Value.Optional);
Into.Write_Entity ("is_set", Value.Is_Set);
Into.Write_Entity ("type", Value.P_Type);
Into.Write_Entity ("value", Value.Value);
Into.Write_Entity ("description", Value.Description);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsLong_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsLong_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
Swagger.Streams.Deserialize (Object, "optional", Value.Optional);
Swagger.Streams.Deserialize (Object, "is_set", Value.Is_Set);
Swagger.Streams.Deserialize (Object, "type", Value.P_Type);
Swagger.Streams.Deserialize (Object, "value", Value.Value);
Swagger.Streams.Deserialize (Object, "description", Value.Description);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsLong_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SamlConfigurationPropertyItemsLong_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationProperties_Type) is
begin
Into.Start_Entity (Name);
Serialize (Into, "path", Value.Path);
Serialize (Into, "service.ranking", Value.Service_Ranking);
Serialize (Into, "idpUrl", Value.Idp_Url);
Serialize (Into, "idpCertAlias", Value.Idp_Cert_Alias);
Serialize (Into, "idpHttpRedirect", Value.Idp_Http_Redirect);
Serialize (Into, "serviceProviderEntityId", Value.Service_Provider_Entity_Id);
Serialize (Into, "assertionConsumerServiceURL", Value.Assertion_Consumer_Service_URL);
Serialize (Into, "spPrivateKeyAlias", Value.Sp_Private_Key_Alias);
Serialize (Into, "keyStorePassword", Value.Key_Store_Password);
Serialize (Into, "defaultRedirectUrl", Value.Default_Redirect_Url);
Serialize (Into, "userIDAttribute", Value.User_IDAttribute);
Serialize (Into, "useEncryption", Value.Use_Encryption);
Serialize (Into, "createUser", Value.Create_User);
Serialize (Into, "addGroupMemberships", Value.Add_Group_Memberships);
Serialize (Into, "groupMembershipAttribute", Value.Group_Membership_Attribute);
Serialize (Into, "defaultGroups", Value.Default_Groups);
Serialize (Into, "nameIdFormat", Value.Name_Id_Format);
Serialize (Into, "synchronizeAttributes", Value.Synchronize_Attributes);
Serialize (Into, "handleLogout", Value.Handle_Logout);
Serialize (Into, "logoutUrl", Value.Logout_Url);
Serialize (Into, "clockTolerance", Value.Clock_Tolerance);
Serialize (Into, "digestMethod", Value.Digest_Method);
Serialize (Into, "signatureMethod", Value.Signature_Method);
Serialize (Into, "userIntermediatePath", Value.User_Intermediate_Path);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationProperties_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationProperties_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Deserialize (Object, "path", Value.Path);
Deserialize (Object, "service.ranking", Value.Service_Ranking);
Deserialize (Object, "idpUrl", Value.Idp_Url);
Deserialize (Object, "idpCertAlias", Value.Idp_Cert_Alias);
Deserialize (Object, "idpHttpRedirect", Value.Idp_Http_Redirect);
Deserialize (Object, "serviceProviderEntityId", Value.Service_Provider_Entity_Id);
Deserialize (Object, "assertionConsumerServiceURL", Value.Assertion_Consumer_Service_URL);
Deserialize (Object, "spPrivateKeyAlias", Value.Sp_Private_Key_Alias);
Deserialize (Object, "keyStorePassword", Value.Key_Store_Password);
Deserialize (Object, "defaultRedirectUrl", Value.Default_Redirect_Url);
Deserialize (Object, "userIDAttribute", Value.User_IDAttribute);
Deserialize (Object, "useEncryption", Value.Use_Encryption);
Deserialize (Object, "createUser", Value.Create_User);
Deserialize (Object, "addGroupMemberships", Value.Add_Group_Memberships);
Deserialize (Object, "groupMembershipAttribute", Value.Group_Membership_Attribute);
Deserialize (Object, "defaultGroups", Value.Default_Groups);
Deserialize (Object, "nameIdFormat", Value.Name_Id_Format);
Deserialize (Object, "synchronizeAttributes", Value.Synchronize_Attributes);
Deserialize (Object, "handleLogout", Value.Handle_Logout);
Deserialize (Object, "logoutUrl", Value.Logout_Url);
Deserialize (Object, "clockTolerance", Value.Clock_Tolerance);
Deserialize (Object, "digestMethod", Value.Digest_Method);
Deserialize (Object, "signatureMethod", Value.Signature_Method);
Deserialize (Object, "userIntermediatePath", Value.User_Intermediate_Path);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationProperties_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SamlConfigurationProperties_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationInfo_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("pid", Value.Pid);
Into.Write_Entity ("title", Value.Title);
Into.Write_Entity ("description", Value.Description);
Into.Write_Entity ("bundle_location", Value.Bundle_Location);
Into.Write_Entity ("service_location", Value.Service_Location);
Serialize (Into, "properties", Value.Properties);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationInfo_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationInfo_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "pid", Value.Pid);
Swagger.Streams.Deserialize (Object, "title", Value.Title);
Swagger.Streams.Deserialize (Object, "description", Value.Description);
Swagger.Streams.Deserialize (Object, "bundle_location", Value.Bundle_Location);
Swagger.Streams.Deserialize (Object, "service_location", Value.Service_Location);
Deserialize (Object, "properties", Value.Properties);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationInfo_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SamlConfigurationInfo_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BundleDataProp_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("key", Value.Key);
Into.Write_Entity ("value", Value.Value);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BundleDataProp_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BundleDataProp_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "key", Value.Key);
Swagger.Streams.Deserialize (Object, "value", Value.Value);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BundleDataProp_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : BundleDataProp_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BundleData_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("id", Value.Id);
Into.Write_Entity ("name", Value.Name);
Into.Write_Entity ("fragment", Value.Fragment);
Into.Write_Entity ("stateRaw", Value.State_Raw);
Into.Write_Entity ("state", Value.State);
Into.Write_Entity ("version", Value.Version);
Into.Write_Entity ("symbolicName", Value.Symbolic_Name);
Into.Write_Entity ("category", Value.Category);
Serialize (Into, "props", Value.Props);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BundleData_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BundleData_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "id", Value.Id);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
Swagger.Streams.Deserialize (Object, "fragment", Value.Fragment);
Swagger.Streams.Deserialize (Object, "stateRaw", Value.State_Raw);
Swagger.Streams.Deserialize (Object, "state", Value.State);
Swagger.Streams.Deserialize (Object, "version", Value.Version);
Swagger.Streams.Deserialize (Object, "symbolicName", Value.Symbolic_Name);
Swagger.Streams.Deserialize (Object, "category", Value.Category);
Deserialize (Object, "props", Value.Props);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BundleData_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : BundleData_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BundleInfo_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("status", Value.Status);
Serialize (Into, "s", Value.S);
Serialize (Into, "data", Value.Data);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BundleInfo_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BundleInfo_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "status", Value.Status);
Swagger.Streams.Deserialize (Object, "s", Value.S);
Deserialize (Object, "data", Value.Data);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BundleInfo_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : BundleInfo_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
end .Models;
| true |
-- Adobe Experience Manager (AEM) API
-- Swagger AEM is an OpenAPI specification for Adobe Experience Manager (AEM) API
--
-- The version of the OpenAPI document: 3.5.0_pre.0
-- Contact: PI:EMAIL:<EMAIL>END_PI
--
-- NOTE: This package is auto generated by OpenAPI-Generator 5.2.1.
-- https://openapi-generator.tech
-- Do not edit the class manually.
package body .Models is
pragma Style_Checks ("-mr");
pragma Warnings (Off, "*use clause for package*");
use Swagger.Streams;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in InstallStatusStatus_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("finished", Value.Finished);
Into.Write_Entity ("itemCount", Value.Item_Count);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in InstallStatusStatus_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out InstallStatusStatus_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "finished", Value.Finished);
Swagger.Streams.Deserialize (Object, "itemCount", Value.Item_Count);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out InstallStatusStatus_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : InstallStatusStatus_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in InstallStatus_Type) is
begin
Into.Start_Entity (Name);
Serialize (Into, "status", Value.Status);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in InstallStatus_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out InstallStatus_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Deserialize (Object, "status", Value.Status);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out InstallStatus_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : InstallStatus_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsString_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("name", Value.Name);
Into.Write_Entity ("optional", Value.Optional);
Into.Write_Entity ("is_set", Value.Is_Set);
Into.Write_Entity ("type", Value.P_Type);
Into.Write_Entity ("value", Value.Value);
Into.Write_Entity ("description", Value.Description);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsString_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsString_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
Swagger.Streams.Deserialize (Object, "optional", Value.Optional);
Swagger.Streams.Deserialize (Object, "is_set", Value.Is_Set);
Swagger.Streams.Deserialize (Object, "type", Value.P_Type);
Swagger.Streams.Deserialize (Object, "value", Value.Value);
Swagger.Streams.Deserialize (Object, "description", Value.Description);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsString_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SamlConfigurationPropertyItemsString_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsBoolean_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("name", Value.Name);
Into.Write_Entity ("optional", Value.Optional);
Into.Write_Entity ("is_set", Value.Is_Set);
Into.Write_Entity ("type", Value.P_Type);
Into.Write_Entity ("value", Value.Value);
Into.Write_Entity ("description", Value.Description);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsBoolean_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsBoolean_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
Swagger.Streams.Deserialize (Object, "optional", Value.Optional);
Swagger.Streams.Deserialize (Object, "is_set", Value.Is_Set);
Swagger.Streams.Deserialize (Object, "type", Value.P_Type);
Swagger.Streams.Deserialize (Object, "value", Value.Value);
Swagger.Streams.Deserialize (Object, "description", Value.Description);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsBoolean_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SamlConfigurationPropertyItemsBoolean_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in TruststoreItems_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("alias", Value.Alias);
Into.Write_Entity ("entryType", Value.Entry_Type);
Into.Write_Entity ("subject", Value.Subject);
Into.Write_Entity ("issuer", Value.Issuer);
Into.Write_Entity ("notBefore", Value.Not_Before);
Into.Write_Entity ("notAfter", Value.Not_After);
Into.Write_Entity ("serialNumber", Value.Serial_Number);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in TruststoreItems_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out TruststoreItems_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "alias", Value.Alias);
Swagger.Streams.Deserialize (Object, "entryType", Value.Entry_Type);
Swagger.Streams.Deserialize (Object, "subject", Value.Subject);
Swagger.Streams.Deserialize (Object, "issuer", Value.Issuer);
Swagger.Streams.Deserialize (Object, "notBefore", Value.Not_Before);
Swagger.Streams.Deserialize (Object, "notAfter", Value.Not_After);
Swagger.Streams.Deserialize (Object, "serialNumber", Value.Serial_Number);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out TruststoreItems_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : TruststoreItems_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in TruststoreInfo_Type) is
begin
Into.Start_Entity (Name);
Serialize (Into, "aliases", Value.Aliases);
Into.Write_Entity ("exists", Value.Exists);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in TruststoreInfo_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out TruststoreInfo_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Deserialize (Object, "aliases", Value.Aliases);
Swagger.Streams.Deserialize (Object, "exists", Value.Exists);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out TruststoreInfo_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : TruststoreInfo_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in KeystoreChainItems_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("subject", Value.Subject);
Into.Write_Entity ("issuer", Value.Issuer);
Into.Write_Entity ("notBefore", Value.Not_Before);
Into.Write_Entity ("notAfter", Value.Not_After);
Into.Write_Entity ("serialNumber", Value.Serial_Number);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in KeystoreChainItems_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out KeystoreChainItems_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "subject", Value.Subject);
Swagger.Streams.Deserialize (Object, "issuer", Value.Issuer);
Swagger.Streams.Deserialize (Object, "notBefore", Value.Not_Before);
Swagger.Streams.Deserialize (Object, "notAfter", Value.Not_After);
Swagger.Streams.Deserialize (Object, "serialNumber", Value.Serial_Number);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out KeystoreChainItems_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : KeystoreChainItems_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in KeystoreItems_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("alias", Value.Alias);
Into.Write_Entity ("entryType", Value.Entry_Type);
Into.Write_Entity ("algorithm", Value.Algorithm);
Into.Write_Entity ("format", Value.Format);
Serialize (Into, "chain", Value.Chain);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in KeystoreItems_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out KeystoreItems_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "alias", Value.Alias);
Swagger.Streams.Deserialize (Object, "entryType", Value.Entry_Type);
Swagger.Streams.Deserialize (Object, "algorithm", Value.Algorithm);
Swagger.Streams.Deserialize (Object, "format", Value.Format);
Deserialize (Object, "chain", Value.Chain);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out KeystoreItems_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : KeystoreItems_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in KeystoreInfo_Type) is
begin
Into.Start_Entity (Name);
Serialize (Into, "aliases", Value.Aliases);
Into.Write_Entity ("exists", Value.Exists);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in KeystoreInfo_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out KeystoreInfo_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Deserialize (Object, "aliases", Value.Aliases);
Swagger.Streams.Deserialize (Object, "exists", Value.Exists);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out KeystoreInfo_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : KeystoreInfo_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsArray_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("name", Value.Name);
Into.Write_Entity ("optional", Value.Optional);
Into.Write_Entity ("is_set", Value.Is_Set);
Into.Write_Entity ("type", Value.P_Type);
Serialize (Into, "values", Value.Values);
Into.Write_Entity ("description", Value.Description);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsArray_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsArray_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
Swagger.Streams.Deserialize (Object, "optional", Value.Optional);
Swagger.Streams.Deserialize (Object, "is_set", Value.Is_Set);
Swagger.Streams.Deserialize (Object, "type", Value.P_Type);
Swagger.Streams.Deserialize (Object, "values", Value.Values);
Swagger.Streams.Deserialize (Object, "description", Value.Description);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsArray_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SamlConfigurationPropertyItemsArray_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsLong_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("name", Value.Name);
Into.Write_Entity ("optional", Value.Optional);
Into.Write_Entity ("is_set", Value.Is_Set);
Into.Write_Entity ("type", Value.P_Type);
Into.Write_Entity ("value", Value.Value);
Into.Write_Entity ("description", Value.Description);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsLong_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsLong_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
Swagger.Streams.Deserialize (Object, "optional", Value.Optional);
Swagger.Streams.Deserialize (Object, "is_set", Value.Is_Set);
Swagger.Streams.Deserialize (Object, "type", Value.P_Type);
Swagger.Streams.Deserialize (Object, "value", Value.Value);
Swagger.Streams.Deserialize (Object, "description", Value.Description);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsLong_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SamlConfigurationPropertyItemsLong_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationProperties_Type) is
begin
Into.Start_Entity (Name);
Serialize (Into, "path", Value.Path);
Serialize (Into, "service.ranking", Value.Service_Ranking);
Serialize (Into, "idpUrl", Value.Idp_Url);
Serialize (Into, "idpCertAlias", Value.Idp_Cert_Alias);
Serialize (Into, "idpHttpRedirect", Value.Idp_Http_Redirect);
Serialize (Into, "serviceProviderEntityId", Value.Service_Provider_Entity_Id);
Serialize (Into, "assertionConsumerServiceURL", Value.Assertion_Consumer_Service_URL);
Serialize (Into, "spPrivateKeyAlias", Value.Sp_Private_Key_Alias);
Serialize (Into, "keyStorePassword", Value.Key_Store_Password);
Serialize (Into, "defaultRedirectUrl", Value.Default_Redirect_Url);
Serialize (Into, "userIDAttribute", Value.User_IDAttribute);
Serialize (Into, "useEncryption", Value.Use_Encryption);
Serialize (Into, "createUser", Value.Create_User);
Serialize (Into, "addGroupMemberships", Value.Add_Group_Memberships);
Serialize (Into, "groupMembershipAttribute", Value.Group_Membership_Attribute);
Serialize (Into, "defaultGroups", Value.Default_Groups);
Serialize (Into, "nameIdFormat", Value.Name_Id_Format);
Serialize (Into, "synchronizeAttributes", Value.Synchronize_Attributes);
Serialize (Into, "handleLogout", Value.Handle_Logout);
Serialize (Into, "logoutUrl", Value.Logout_Url);
Serialize (Into, "clockTolerance", Value.Clock_Tolerance);
Serialize (Into, "digestMethod", Value.Digest_Method);
Serialize (Into, "signatureMethod", Value.Signature_Method);
Serialize (Into, "userIntermediatePath", Value.User_Intermediate_Path);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationProperties_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationProperties_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Deserialize (Object, "path", Value.Path);
Deserialize (Object, "service.ranking", Value.Service_Ranking);
Deserialize (Object, "idpUrl", Value.Idp_Url);
Deserialize (Object, "idpCertAlias", Value.Idp_Cert_Alias);
Deserialize (Object, "idpHttpRedirect", Value.Idp_Http_Redirect);
Deserialize (Object, "serviceProviderEntityId", Value.Service_Provider_Entity_Id);
Deserialize (Object, "assertionConsumerServiceURL", Value.Assertion_Consumer_Service_URL);
Deserialize (Object, "spPrivateKeyAlias", Value.Sp_Private_Key_Alias);
Deserialize (Object, "keyStorePassword", Value.Key_Store_Password);
Deserialize (Object, "defaultRedirectUrl", Value.Default_Redirect_Url);
Deserialize (Object, "userIDAttribute", Value.User_IDAttribute);
Deserialize (Object, "useEncryption", Value.Use_Encryption);
Deserialize (Object, "createUser", Value.Create_User);
Deserialize (Object, "addGroupMemberships", Value.Add_Group_Memberships);
Deserialize (Object, "groupMembershipAttribute", Value.Group_Membership_Attribute);
Deserialize (Object, "defaultGroups", Value.Default_Groups);
Deserialize (Object, "nameIdFormat", Value.Name_Id_Format);
Deserialize (Object, "synchronizeAttributes", Value.Synchronize_Attributes);
Deserialize (Object, "handleLogout", Value.Handle_Logout);
Deserialize (Object, "logoutUrl", Value.Logout_Url);
Deserialize (Object, "clockTolerance", Value.Clock_Tolerance);
Deserialize (Object, "digestMethod", Value.Digest_Method);
Deserialize (Object, "signatureMethod", Value.Signature_Method);
Deserialize (Object, "userIntermediatePath", Value.User_Intermediate_Path);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationProperties_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SamlConfigurationProperties_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationInfo_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("pid", Value.Pid);
Into.Write_Entity ("title", Value.Title);
Into.Write_Entity ("description", Value.Description);
Into.Write_Entity ("bundle_location", Value.Bundle_Location);
Into.Write_Entity ("service_location", Value.Service_Location);
Serialize (Into, "properties", Value.Properties);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationInfo_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationInfo_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "pid", Value.Pid);
Swagger.Streams.Deserialize (Object, "title", Value.Title);
Swagger.Streams.Deserialize (Object, "description", Value.Description);
Swagger.Streams.Deserialize (Object, "bundle_location", Value.Bundle_Location);
Swagger.Streams.Deserialize (Object, "service_location", Value.Service_Location);
Deserialize (Object, "properties", Value.Properties);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationInfo_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SamlConfigurationInfo_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BundleDataProp_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("key", Value.Key);
Into.Write_Entity ("value", Value.Value);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BundleDataProp_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BundleDataProp_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "key", Value.Key);
Swagger.Streams.Deserialize (Object, "value", Value.Value);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BundleDataProp_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : BundleDataProp_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BundleData_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("id", Value.Id);
Into.Write_Entity ("name", Value.Name);
Into.Write_Entity ("fragment", Value.Fragment);
Into.Write_Entity ("stateRaw", Value.State_Raw);
Into.Write_Entity ("state", Value.State);
Into.Write_Entity ("version", Value.Version);
Into.Write_Entity ("symbolicName", Value.Symbolic_Name);
Into.Write_Entity ("category", Value.Category);
Serialize (Into, "props", Value.Props);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BundleData_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BundleData_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "id", Value.Id);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
Swagger.Streams.Deserialize (Object, "fragment", Value.Fragment);
Swagger.Streams.Deserialize (Object, "stateRaw", Value.State_Raw);
Swagger.Streams.Deserialize (Object, "state", Value.State);
Swagger.Streams.Deserialize (Object, "version", Value.Version);
Swagger.Streams.Deserialize (Object, "symbolicName", Value.Symbolic_Name);
Swagger.Streams.Deserialize (Object, "category", Value.Category);
Deserialize (Object, "props", Value.Props);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BundleData_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : BundleData_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BundleInfo_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("status", Value.Status);
Serialize (Into, "s", Value.S);
Serialize (Into, "data", Value.Data);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BundleInfo_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BundleInfo_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "status", Value.Status);
Swagger.Streams.Deserialize (Object, "s", Value.S);
Deserialize (Object, "data", Value.Data);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BundleInfo_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : BundleInfo_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
end .Models;
|
[
{
"context": "ies\n-- Copyright (C) 2011, 2012, 2014, 2015, 2018 Stephane Carrez\n-- Written by Stephane Carrez (Stephane.Carrez@g",
"end": 171,
"score": 0.9998661875724792,
"start": 156,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "2, 2014, 2015, 2018 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under",
"end": 202,
"score": 0.9998862147331238,
"start": 187,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "8 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under the Apache License, Versio",
"end": 229,
"score": 0.9999251365661621,
"start": 204,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
src/gpr/gen-utils-gnat.adb
|
My-Colaborations/dynamo
| 15 |
-----------------------------------------------------------------------
-- gen-utils-gnat -- GNAT utilities
-- Copyright (C) 2011, 2012, 2014, 2015, 2018 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Log.Loggers;
with Gen.Configs;
with GPR.Snames;
with GPR.Names;
with GPR.Part;
with GPR.Tree;
with GPR.Env;
with GPR.Util;
with GPR.Proc;
with Gpr_Build_Util;
with GPR.Output;
with GPR.Sdefault;
with GNAT.OS_Lib; use GNAT.OS_Lib;
package body Gen.Utils.GNAT is
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Gen.Utils.GNAT");
Project_Node_Tree : GPR.Tree.Project_Node_Tree_Ref;
Main_Project : GPR.Project_Id;
Project_Node : GPR.Project_Node_Id;
Project_Tree : constant GPR.Project_Tree_Ref :=
new GPR.Project_Tree_Data (Is_Root_Tree => True);
-- ------------------------------
-- Initialize the GNAT project runtime for reading the GNAT project tree.
-- Configure it according to the dynamo configuration properties.
-- ------------------------------
procedure Initialize (Config : in Util.Properties.Manager'Class) is
Project_Dirs : constant String := Config.Get (Gen.Configs.GEN_GNAT_PROJECT_DIRS,
DEFAULT_GNAT_PROJECT_DIR);
begin
Log.Info ("Initializing GNAT runtime to read projects from: {0}", Project_Dirs);
Project_Node_Tree := new GPR.Project_Node_Tree_Data;
GPR.Tree.Initialize (Project_Node_Tree);
GPR.Output.Set_Standard_Error;
GPR.Snames.Initialize;
GPR.Initialize (Project_Tree);
GPR.Env.Initialize_Default_Project_Path (Gpr_Build_Util.Root_Environment.Project_Path,
GPR.Sdefault.Hostname);
GPR.Env.Add_Directories (Gpr_Build_Util.Root_Environment.Project_Path, Project_Dirs);
Log.Info ("Added directories {0}", GPR.Util.Executable_Prefix_Path);
end Initialize;
-- ------------------------------
-- Read the GNAT project file identified by <b>Project_File_Name</b> and get
-- in <b>Project_List</b> an ordered list of absolute project paths used by
-- the root project.
-- ------------------------------
procedure Read_GNAT_Project_List (Project_File_Name : in String;
Project_List : out Project_Info_Vectors.Vector) is
procedure Recursive_Add (Proj : in GPR.Project_Id;
Tree : in GPR.Project_Tree_Ref;
Dummy : in out Boolean);
function Get_Variable_Value (Proj : in GPR.Project_Id;
Name : in String) return String;
function Get_Project_Name (Proj : in GPR.Project_Id) return String;
-- Get the variable value represented by the name <b>Name</b>.
-- ??? There are probably other efficient ways to get this but I couldn't find them.
function Get_Variable_Value (Proj : in GPR.Project_Id;
Name : in String) return String is
use type GPR.Variable_Id;
Current : GPR.Variable_Id;
The_Variable : GPR.Variable;
begin
Current := Proj.Decl.Variables;
while Current /= GPR.No_Variable loop
The_Variable := Project_Tree.Shared.Variable_Elements.Table (Current);
if GPR.Names.Get_Name_String (The_Variable.Name) = Name then
return GPR.Util.Value_Of (The_Variable.Value, "");
end if;
Current := The_Variable.Next;
end loop;
return "";
end Get_Variable_Value;
-- ------------------------------
-- Get the project name from the GNAT project name or from the "name" project variable.
-- ------------------------------
function Get_Project_Name (Proj : in GPR.Project_Id) return String is
Name : constant String := Get_Variable_Value (Proj, "name");
begin
if Name'Length > 0 then
return Name;
else
return GPR.Names.Get_Name_String (Proj.Name);
end if;
end Get_Project_Name;
-- ------------------------------
-- Add the full path of the GNAT project in the project list.
-- ------------------------------
procedure Recursive_Add (Proj : in GPR.Project_Id;
Tree : in GPR.Project_Tree_Ref;
Dummy : in out Boolean) is
pragma Unreferenced (Tree, Dummy);
use type GPR.Project_Qualifier;
Path : constant String := GPR.Names.Get_Name_String (Proj.Path.Name);
Name : constant String := Get_Project_Name (Proj);
Project : Project_Info;
begin
Log.Info ("Using GNAT project: {0} - {1}", Path, Name);
Project.Path := To_Unbounded_String (Path);
Project.Name := To_Unbounded_String (Name);
Project.Is_Abstract := Proj.Qualifier = GPR.Abstract_Project;
Project_List.Append (Project);
end Recursive_Add;
procedure For_All_Projects is
new GPR.For_Every_Project_Imported (Boolean, Recursive_Add);
begin
Log.Info ("Reading GNAT project {0}", Project_File_Name);
-- Parse the GNAT project files and build the tree.
GPR.Part.Parse (Project => Project_Node,
In_Tree => Project_Node_Tree,
Project_File_Name => Project_File_Name,
Packages_To_Check => null,
Is_Config_File => False,
Env => Gpr_Build_Util.Root_Environment);
if not GPR.Tree.No (Project_Node) then
declare
Dummy : Boolean := False;
Success : Boolean;
begin
GPR.Proc.Process_Project_Tree_Phase_1 (In_Tree => Project_Tree,
Project => Main_Project,
Packages_To_Check => null,
From_Project_Node => Project_Node,
From_Project_Node_Tree => Project_Node_Tree,
Env => Gpr_Build_Util.Root_Environment,
Reset_Tree => True,
Success => Success,
On_New_Tree_Loaded => null);
-- Scan the tree to get the list of projects (in dependency order).
For_All_Projects (Main_Project, Project_Tree,
Imported_First => True, With_State => Dummy);
end;
end if;
end Read_GNAT_Project_List;
end Gen.Utils.GNAT;
|
6717
|
-----------------------------------------------------------------------
-- gen-utils-gnat -- GNAT utilities
-- Copyright (C) 2011, 2012, 2014, 2015, 2018 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Log.Loggers;
with Gen.Configs;
with GPR.Snames;
with GPR.Names;
with GPR.Part;
with GPR.Tree;
with GPR.Env;
with GPR.Util;
with GPR.Proc;
with Gpr_Build_Util;
with GPR.Output;
with GPR.Sdefault;
with GNAT.OS_Lib; use GNAT.OS_Lib;
package body Gen.Utils.GNAT is
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Gen.Utils.GNAT");
Project_Node_Tree : GPR.Tree.Project_Node_Tree_Ref;
Main_Project : GPR.Project_Id;
Project_Node : GPR.Project_Node_Id;
Project_Tree : constant GPR.Project_Tree_Ref :=
new GPR.Project_Tree_Data (Is_Root_Tree => True);
-- ------------------------------
-- Initialize the GNAT project runtime for reading the GNAT project tree.
-- Configure it according to the dynamo configuration properties.
-- ------------------------------
procedure Initialize (Config : in Util.Properties.Manager'Class) is
Project_Dirs : constant String := Config.Get (Gen.Configs.GEN_GNAT_PROJECT_DIRS,
DEFAULT_GNAT_PROJECT_DIR);
begin
Log.Info ("Initializing GNAT runtime to read projects from: {0}", Project_Dirs);
Project_Node_Tree := new GPR.Project_Node_Tree_Data;
GPR.Tree.Initialize (Project_Node_Tree);
GPR.Output.Set_Standard_Error;
GPR.Snames.Initialize;
GPR.Initialize (Project_Tree);
GPR.Env.Initialize_Default_Project_Path (Gpr_Build_Util.Root_Environment.Project_Path,
GPR.Sdefault.Hostname);
GPR.Env.Add_Directories (Gpr_Build_Util.Root_Environment.Project_Path, Project_Dirs);
Log.Info ("Added directories {0}", GPR.Util.Executable_Prefix_Path);
end Initialize;
-- ------------------------------
-- Read the GNAT project file identified by <b>Project_File_Name</b> and get
-- in <b>Project_List</b> an ordered list of absolute project paths used by
-- the root project.
-- ------------------------------
procedure Read_GNAT_Project_List (Project_File_Name : in String;
Project_List : out Project_Info_Vectors.Vector) is
procedure Recursive_Add (Proj : in GPR.Project_Id;
Tree : in GPR.Project_Tree_Ref;
Dummy : in out Boolean);
function Get_Variable_Value (Proj : in GPR.Project_Id;
Name : in String) return String;
function Get_Project_Name (Proj : in GPR.Project_Id) return String;
-- Get the variable value represented by the name <b>Name</b>.
-- ??? There are probably other efficient ways to get this but I couldn't find them.
function Get_Variable_Value (Proj : in GPR.Project_Id;
Name : in String) return String is
use type GPR.Variable_Id;
Current : GPR.Variable_Id;
The_Variable : GPR.Variable;
begin
Current := Proj.Decl.Variables;
while Current /= GPR.No_Variable loop
The_Variable := Project_Tree.Shared.Variable_Elements.Table (Current);
if GPR.Names.Get_Name_String (The_Variable.Name) = Name then
return GPR.Util.Value_Of (The_Variable.Value, "");
end if;
Current := The_Variable.Next;
end loop;
return "";
end Get_Variable_Value;
-- ------------------------------
-- Get the project name from the GNAT project name or from the "name" project variable.
-- ------------------------------
function Get_Project_Name (Proj : in GPR.Project_Id) return String is
Name : constant String := Get_Variable_Value (Proj, "name");
begin
if Name'Length > 0 then
return Name;
else
return GPR.Names.Get_Name_String (Proj.Name);
end if;
end Get_Project_Name;
-- ------------------------------
-- Add the full path of the GNAT project in the project list.
-- ------------------------------
procedure Recursive_Add (Proj : in GPR.Project_Id;
Tree : in GPR.Project_Tree_Ref;
Dummy : in out Boolean) is
pragma Unreferenced (Tree, Dummy);
use type GPR.Project_Qualifier;
Path : constant String := GPR.Names.Get_Name_String (Proj.Path.Name);
Name : constant String := Get_Project_Name (Proj);
Project : Project_Info;
begin
Log.Info ("Using GNAT project: {0} - {1}", Path, Name);
Project.Path := To_Unbounded_String (Path);
Project.Name := To_Unbounded_String (Name);
Project.Is_Abstract := Proj.Qualifier = GPR.Abstract_Project;
Project_List.Append (Project);
end Recursive_Add;
procedure For_All_Projects is
new GPR.For_Every_Project_Imported (Boolean, Recursive_Add);
begin
Log.Info ("Reading GNAT project {0}", Project_File_Name);
-- Parse the GNAT project files and build the tree.
GPR.Part.Parse (Project => Project_Node,
In_Tree => Project_Node_Tree,
Project_File_Name => Project_File_Name,
Packages_To_Check => null,
Is_Config_File => False,
Env => Gpr_Build_Util.Root_Environment);
if not GPR.Tree.No (Project_Node) then
declare
Dummy : Boolean := False;
Success : Boolean;
begin
GPR.Proc.Process_Project_Tree_Phase_1 (In_Tree => Project_Tree,
Project => Main_Project,
Packages_To_Check => null,
From_Project_Node => Project_Node,
From_Project_Node_Tree => Project_Node_Tree,
Env => Gpr_Build_Util.Root_Environment,
Reset_Tree => True,
Success => Success,
On_New_Tree_Loaded => null);
-- Scan the tree to get the list of projects (in dependency order).
For_All_Projects (Main_Project, Project_Tree,
Imported_First => True, With_State => Dummy);
end;
end if;
end Read_GNAT_Project_List;
end Gen.Utils.GNAT;
| true |
-----------------------------------------------------------------------
-- gen-utils-gnat -- GNAT utilities
-- Copyright (C) 2011, 2012, 2014, 2015, 2018 PI:NAME:<NAME>END_PI
-- Written by PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Log.Loggers;
with Gen.Configs;
with GPR.Snames;
with GPR.Names;
with GPR.Part;
with GPR.Tree;
with GPR.Env;
with GPR.Util;
with GPR.Proc;
with Gpr_Build_Util;
with GPR.Output;
with GPR.Sdefault;
with GNAT.OS_Lib; use GNAT.OS_Lib;
package body Gen.Utils.GNAT is
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Gen.Utils.GNAT");
Project_Node_Tree : GPR.Tree.Project_Node_Tree_Ref;
Main_Project : GPR.Project_Id;
Project_Node : GPR.Project_Node_Id;
Project_Tree : constant GPR.Project_Tree_Ref :=
new GPR.Project_Tree_Data (Is_Root_Tree => True);
-- ------------------------------
-- Initialize the GNAT project runtime for reading the GNAT project tree.
-- Configure it according to the dynamo configuration properties.
-- ------------------------------
procedure Initialize (Config : in Util.Properties.Manager'Class) is
Project_Dirs : constant String := Config.Get (Gen.Configs.GEN_GNAT_PROJECT_DIRS,
DEFAULT_GNAT_PROJECT_DIR);
begin
Log.Info ("Initializing GNAT runtime to read projects from: {0}", Project_Dirs);
Project_Node_Tree := new GPR.Project_Node_Tree_Data;
GPR.Tree.Initialize (Project_Node_Tree);
GPR.Output.Set_Standard_Error;
GPR.Snames.Initialize;
GPR.Initialize (Project_Tree);
GPR.Env.Initialize_Default_Project_Path (Gpr_Build_Util.Root_Environment.Project_Path,
GPR.Sdefault.Hostname);
GPR.Env.Add_Directories (Gpr_Build_Util.Root_Environment.Project_Path, Project_Dirs);
Log.Info ("Added directories {0}", GPR.Util.Executable_Prefix_Path);
end Initialize;
-- ------------------------------
-- Read the GNAT project file identified by <b>Project_File_Name</b> and get
-- in <b>Project_List</b> an ordered list of absolute project paths used by
-- the root project.
-- ------------------------------
procedure Read_GNAT_Project_List (Project_File_Name : in String;
Project_List : out Project_Info_Vectors.Vector) is
procedure Recursive_Add (Proj : in GPR.Project_Id;
Tree : in GPR.Project_Tree_Ref;
Dummy : in out Boolean);
function Get_Variable_Value (Proj : in GPR.Project_Id;
Name : in String) return String;
function Get_Project_Name (Proj : in GPR.Project_Id) return String;
-- Get the variable value represented by the name <b>Name</b>.
-- ??? There are probably other efficient ways to get this but I couldn't find them.
function Get_Variable_Value (Proj : in GPR.Project_Id;
Name : in String) return String is
use type GPR.Variable_Id;
Current : GPR.Variable_Id;
The_Variable : GPR.Variable;
begin
Current := Proj.Decl.Variables;
while Current /= GPR.No_Variable loop
The_Variable := Project_Tree.Shared.Variable_Elements.Table (Current);
if GPR.Names.Get_Name_String (The_Variable.Name) = Name then
return GPR.Util.Value_Of (The_Variable.Value, "");
end if;
Current := The_Variable.Next;
end loop;
return "";
end Get_Variable_Value;
-- ------------------------------
-- Get the project name from the GNAT project name or from the "name" project variable.
-- ------------------------------
function Get_Project_Name (Proj : in GPR.Project_Id) return String is
Name : constant String := Get_Variable_Value (Proj, "name");
begin
if Name'Length > 0 then
return Name;
else
return GPR.Names.Get_Name_String (Proj.Name);
end if;
end Get_Project_Name;
-- ------------------------------
-- Add the full path of the GNAT project in the project list.
-- ------------------------------
procedure Recursive_Add (Proj : in GPR.Project_Id;
Tree : in GPR.Project_Tree_Ref;
Dummy : in out Boolean) is
pragma Unreferenced (Tree, Dummy);
use type GPR.Project_Qualifier;
Path : constant String := GPR.Names.Get_Name_String (Proj.Path.Name);
Name : constant String := Get_Project_Name (Proj);
Project : Project_Info;
begin
Log.Info ("Using GNAT project: {0} - {1}", Path, Name);
Project.Path := To_Unbounded_String (Path);
Project.Name := To_Unbounded_String (Name);
Project.Is_Abstract := Proj.Qualifier = GPR.Abstract_Project;
Project_List.Append (Project);
end Recursive_Add;
procedure For_All_Projects is
new GPR.For_Every_Project_Imported (Boolean, Recursive_Add);
begin
Log.Info ("Reading GNAT project {0}", Project_File_Name);
-- Parse the GNAT project files and build the tree.
GPR.Part.Parse (Project => Project_Node,
In_Tree => Project_Node_Tree,
Project_File_Name => Project_File_Name,
Packages_To_Check => null,
Is_Config_File => False,
Env => Gpr_Build_Util.Root_Environment);
if not GPR.Tree.No (Project_Node) then
declare
Dummy : Boolean := False;
Success : Boolean;
begin
GPR.Proc.Process_Project_Tree_Phase_1 (In_Tree => Project_Tree,
Project => Main_Project,
Packages_To_Check => null,
From_Project_Node => Project_Node,
From_Project_Node_Tree => Project_Node_Tree,
Env => Gpr_Build_Util.Root_Environment,
Reset_Tree => True,
Success => Success,
On_New_Tree_Loaded => null);
-- Scan the tree to get the list of projects (in dependency order).
For_All_Projects (Main_Project, Project_Tree,
Imported_First => True, With_State => Dummy);
end;
end if;
end Read_GNAT_Project_List;
end Gen.Utils.GNAT;
|
[
{
"context": " --\n-- Copyright © 2015, Vadim Godunko <[email protected]> --\n-- Al",
"end": 824,
"score": 0.9998853802680969,
"start": 811,
"tag": "NAME",
"value": "Vadim Godunko"
},
{
"context": " --\n-- Copyright © 2015, Vadim Godunko <[email protected]> --\n-- All rights reserved. ",
"end": 844,
"score": 0.9999324679374695,
"start": 826,
"tag": "EMAIL",
"value": "[email protected]"
},
{
"context": " --\n-- * Neither the name of the Vadim Godunko, IE nor the names of its --\n-- contribu",
"end": 1939,
"score": 0.9177170395851135,
"start": 1926,
"tag": "NAME",
"value": "Vadim Godunko"
}
] |
source/web/tools/a2js/engines-contexts.ads
|
svn2github/matreshka
| 24 |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Tools Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2015, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Ada.Containers.Hashed_Maps;
with Asis.Elements;
with League.Strings;
with Engines.Generic_Engines;
package Engines.Contexts is
type Context;
package Text_Engines is new Generic_Engines
(Propert_Name => Text_Property,
Property_Type => League.Strings.Universal_String,
Abstract_Context => Context);
package Boolean_Engines is new Generic_Engines
(Propert_Name => Boolean_Property,
Property_Type => Boolean,
Abstract_Context => Context);
package Integer_Engines is new Generic_Engines
(Propert_Name => Integer_Property,
Property_Type => Integer,
Abstract_Context => Context);
package Call_Convention_Engines is new Generic_Engines
(Propert_Name => Convention_Property,
Property_Type => Convention_Kind,
Abstract_Context => Context);
package Uniques is
type Unique_Map is tagged private;
function Get
(Self : access Unique_Map;
Element : Asis.Element;
Prefix : Wide_Wide_String := "")
return League.Strings.Universal_String;
private
function Hash (Item : Asis.Element) return Ada.Containers.Hash_Type;
package Maps is new Ada.Containers.Hashed_Maps
(Key_Type => Asis.Element,
Element_Type => Positive,
Hash => Hash,
Equivalent_Keys => Asis.Elements.Is_Equal,
"=" => "=");
type Unique_Map is new Maps.Map with null record;
end Uniques;
type Context is tagged limited record
Text : aliased Text_Engines.Engine (Context'Unchecked_Access);
Boolean : aliased Boolean_Engines.Engine
(Context'Unchecked_Access);
Integer : aliased Integer_Engines.Engine
(Context'Unchecked_Access);
Call_Convention : aliased Call_Convention_Engines.Engine
(Context'Unchecked_Access);
Unique : aliased Uniques.Unique_Map;
end record;
end Engines.Contexts;
|
2730
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Tools Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2015, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the <NAME>, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Ada.Containers.Hashed_Maps;
with Asis.Elements;
with League.Strings;
with Engines.Generic_Engines;
package Engines.Contexts is
type Context;
package Text_Engines is new Generic_Engines
(Propert_Name => Text_Property,
Property_Type => League.Strings.Universal_String,
Abstract_Context => Context);
package Boolean_Engines is new Generic_Engines
(Propert_Name => Boolean_Property,
Property_Type => Boolean,
Abstract_Context => Context);
package Integer_Engines is new Generic_Engines
(Propert_Name => Integer_Property,
Property_Type => Integer,
Abstract_Context => Context);
package Call_Convention_Engines is new Generic_Engines
(Propert_Name => Convention_Property,
Property_Type => Convention_Kind,
Abstract_Context => Context);
package Uniques is
type Unique_Map is tagged private;
function Get
(Self : access Unique_Map;
Element : Asis.Element;
Prefix : Wide_Wide_String := "")
return League.Strings.Universal_String;
private
function Hash (Item : Asis.Element) return Ada.Containers.Hash_Type;
package Maps is new Ada.Containers.Hashed_Maps
(Key_Type => Asis.Element,
Element_Type => Positive,
Hash => Hash,
Equivalent_Keys => Asis.Elements.Is_Equal,
"=" => "=");
type Unique_Map is new Maps.Map with null record;
end Uniques;
type Context is tagged limited record
Text : aliased Text_Engines.Engine (Context'Unchecked_Access);
Boolean : aliased Boolean_Engines.Engine
(Context'Unchecked_Access);
Integer : aliased Integer_Engines.Engine
(Context'Unchecked_Access);
Call_Convention : aliased Call_Convention_Engines.Engine
(Context'Unchecked_Access);
Unique : aliased Uniques.Unique_Map;
end record;
end Engines.Contexts;
| true |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Tools Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2015, PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the PI:NAME:<NAME>END_PI, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Ada.Containers.Hashed_Maps;
with Asis.Elements;
with League.Strings;
with Engines.Generic_Engines;
package Engines.Contexts is
type Context;
package Text_Engines is new Generic_Engines
(Propert_Name => Text_Property,
Property_Type => League.Strings.Universal_String,
Abstract_Context => Context);
package Boolean_Engines is new Generic_Engines
(Propert_Name => Boolean_Property,
Property_Type => Boolean,
Abstract_Context => Context);
package Integer_Engines is new Generic_Engines
(Propert_Name => Integer_Property,
Property_Type => Integer,
Abstract_Context => Context);
package Call_Convention_Engines is new Generic_Engines
(Propert_Name => Convention_Property,
Property_Type => Convention_Kind,
Abstract_Context => Context);
package Uniques is
type Unique_Map is tagged private;
function Get
(Self : access Unique_Map;
Element : Asis.Element;
Prefix : Wide_Wide_String := "")
return League.Strings.Universal_String;
private
function Hash (Item : Asis.Element) return Ada.Containers.Hash_Type;
package Maps is new Ada.Containers.Hashed_Maps
(Key_Type => Asis.Element,
Element_Type => Positive,
Hash => Hash,
Equivalent_Keys => Asis.Elements.Is_Equal,
"=" => "=");
type Unique_Map is new Maps.Map with null record;
end Uniques;
type Context is tagged limited record
Text : aliased Text_Engines.Engine (Context'Unchecked_Access);
Boolean : aliased Boolean_Engines.Engine
(Context'Unchecked_Access);
Integer : aliased Integer_Engines.Engine
(Context'Unchecked_Access);
Call_Convention : aliased Call_Convention_Engines.Engine
(Context'Unchecked_Access);
Unique : aliased Uniques.Unique_Map;
end record;
end Engines.Contexts;
|
[
{
"context": " --\n-- Copyright (C) 2019, Fabien Chouteau --\n-- ",
"end": 214,
"score": 0.9997484683990479,
"start": 199,
"tag": "NAME",
"value": "Fabien Chouteau"
}
] |
src/libriscv.ads
|
Fabien-Chouteau/libriscv
| 0 |
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2019, Fabien Chouteau --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with ESF;
package LibRISCV is
XLEN : constant := 32;
type Byte is mod 2 ** 8
with Size => 8;
type Halfword is mod 2 ** 16
with Size => 16;
type Word is mod 2 ** 32
with Size => 32;
type Dword is mod 2 ** 64
with Size => 64;
type U_Register is mod 2 ** XLEN
with Size => XLEN;
-- Unsigned representation of an XLEN register
type S_Register is range -(2 ** (XLEN - 1)) .. (2 ** (XLEN - 1)) - 1
with Size => XLEN;
-- Signed representation of an XLEN register
type Register (Signed : Boolean := False) is record
case Signed is
when True => S : S_Register;
when False => U : U_Register;
end case;
end record
with
Pack, Size => XLEN,
Unchecked_Union;
subtype Address is U_Register;
type GPR_Id is mod 2 ** 5
with Size => 5;
function Img (Id : GPR_Id) return String;
function Sign_Extend (Value : Byte) return U_Register;
function Sign_Extend (Value : Halfword) return U_Register;
function Sign_Extend (Value : Word) return U_Register;
function Shift_Right (Value : Byte; Amount : Natural) return Byte;
function Shift_Right (Value : Halfword; Amount : Natural) return Halfword;
function Shift_Right (Value : Word; Amount : Natural) return Word;
function Shift_Right (Value : U_Register; Amount : Natural)
return U_Register;
function Shift_Right_Arithmetic (Value : U_Register; Amount : Natural)
return U_Register;
function Shift_Left (Value : Byte; Amount : Natural) return Byte;
function Shift_Left (Value : Halfword; Amount : Natural) return Halfword;
function Shift_Left (Value : Word; Amount : Natural) return Word;
function Shift_Left (Value : U_Register; Amount : Natural)
return U_Register;
pragma Import (Intrinsic, Shift_Right);
pragma Import (Intrinsic, Shift_Right_Arithmetic);
pragma Import (Intrinsic, Shift_Left);
function Hex is new ESF.Hex_Image (Byte);
function Hex is new ESF.Hex_Image (Halfword);
function Hex is new ESF.Hex_Image (Word);
function Hex is new ESF.Hex_Image (U_Register);
end LibRISCV;
|
16443
|
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2019, <NAME> --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with ESF;
package LibRISCV is
XLEN : constant := 32;
type Byte is mod 2 ** 8
with Size => 8;
type Halfword is mod 2 ** 16
with Size => 16;
type Word is mod 2 ** 32
with Size => 32;
type Dword is mod 2 ** 64
with Size => 64;
type U_Register is mod 2 ** XLEN
with Size => XLEN;
-- Unsigned representation of an XLEN register
type S_Register is range -(2 ** (XLEN - 1)) .. (2 ** (XLEN - 1)) - 1
with Size => XLEN;
-- Signed representation of an XLEN register
type Register (Signed : Boolean := False) is record
case Signed is
when True => S : S_Register;
when False => U : U_Register;
end case;
end record
with
Pack, Size => XLEN,
Unchecked_Union;
subtype Address is U_Register;
type GPR_Id is mod 2 ** 5
with Size => 5;
function Img (Id : GPR_Id) return String;
function Sign_Extend (Value : Byte) return U_Register;
function Sign_Extend (Value : Halfword) return U_Register;
function Sign_Extend (Value : Word) return U_Register;
function Shift_Right (Value : Byte; Amount : Natural) return Byte;
function Shift_Right (Value : Halfword; Amount : Natural) return Halfword;
function Shift_Right (Value : Word; Amount : Natural) return Word;
function Shift_Right (Value : U_Register; Amount : Natural)
return U_Register;
function Shift_Right_Arithmetic (Value : U_Register; Amount : Natural)
return U_Register;
function Shift_Left (Value : Byte; Amount : Natural) return Byte;
function Shift_Left (Value : Halfword; Amount : Natural) return Halfword;
function Shift_Left (Value : Word; Amount : Natural) return Word;
function Shift_Left (Value : U_Register; Amount : Natural)
return U_Register;
pragma Import (Intrinsic, Shift_Right);
pragma Import (Intrinsic, Shift_Right_Arithmetic);
pragma Import (Intrinsic, Shift_Left);
function Hex is new ESF.Hex_Image (Byte);
function Hex is new ESF.Hex_Image (Halfword);
function Hex is new ESF.Hex_Image (Word);
function Hex is new ESF.Hex_Image (U_Register);
end LibRISCV;
| true |
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2019, PI:NAME:<NAME>END_PI --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with ESF;
package LibRISCV is
XLEN : constant := 32;
type Byte is mod 2 ** 8
with Size => 8;
type Halfword is mod 2 ** 16
with Size => 16;
type Word is mod 2 ** 32
with Size => 32;
type Dword is mod 2 ** 64
with Size => 64;
type U_Register is mod 2 ** XLEN
with Size => XLEN;
-- Unsigned representation of an XLEN register
type S_Register is range -(2 ** (XLEN - 1)) .. (2 ** (XLEN - 1)) - 1
with Size => XLEN;
-- Signed representation of an XLEN register
type Register (Signed : Boolean := False) is record
case Signed is
when True => S : S_Register;
when False => U : U_Register;
end case;
end record
with
Pack, Size => XLEN,
Unchecked_Union;
subtype Address is U_Register;
type GPR_Id is mod 2 ** 5
with Size => 5;
function Img (Id : GPR_Id) return String;
function Sign_Extend (Value : Byte) return U_Register;
function Sign_Extend (Value : Halfword) return U_Register;
function Sign_Extend (Value : Word) return U_Register;
function Shift_Right (Value : Byte; Amount : Natural) return Byte;
function Shift_Right (Value : Halfword; Amount : Natural) return Halfword;
function Shift_Right (Value : Word; Amount : Natural) return Word;
function Shift_Right (Value : U_Register; Amount : Natural)
return U_Register;
function Shift_Right_Arithmetic (Value : U_Register; Amount : Natural)
return U_Register;
function Shift_Left (Value : Byte; Amount : Natural) return Byte;
function Shift_Left (Value : Halfword; Amount : Natural) return Halfword;
function Shift_Left (Value : Word; Amount : Natural) return Word;
function Shift_Left (Value : U_Register; Amount : Natural)
return U_Register;
pragma Import (Intrinsic, Shift_Right);
pragma Import (Intrinsic, Shift_Right_Arithmetic);
pragma Import (Intrinsic, Shift_Left);
function Hex is new ESF.Hex_Image (Byte);
function Hex is new ESF.Hex_Image (Halfword);
function Hex is new ESF.Hex_Image (Word);
function Hex is new ESF.Hex_Image (U_Register);
end LibRISCV;
|
[
{
"context": "right (C) 2009, 2010, 2011, 2012, 2013, 2015, 2018 Stephane Carrez\n-- Written by Stephane Carrez (Stephane.Carrez@g",
"end": 214,
"score": 0.9998871088027954,
"start": 199,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "2, 2013, 2015, 2018 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under",
"end": 245,
"score": 0.9998928904533386,
"start": 230,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "8 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under the Apache License, Versio",
"end": 272,
"score": 0.9999319314956665,
"start": 247,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
src/gen-model-queries.adb
|
My-Colaborations/dynamo
| 0 |
-----------------------------------------------------------------------
-- gen-model-queries -- XML Mapped Database queries representation
-- Copyright (C) 2009, 2010, 2011, 2012, 2013, 2015, 2018 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
package body Gen.Model.Queries is
-- ------------------------------
-- Get the value identified by the name.
-- If the name cannot be found, the method should return the Null object.
-- ------------------------------
overriding
function Get_Value (From : in Sort_Definition;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "name" then
return Util.Beans.Objects.To_Object (From.Name);
elsif Name = "sql" then
return Util.Beans.Objects.To_Object (From.Sql);
else
return Definition (From).Get_Value (Name);
end if;
end Get_Value;
-- ------------------------------
-- Get the value identified by the name.
-- If the name cannot be found, the method should return the Null object.
-- ------------------------------
overriding
function Get_Value (From : Query_Definition;
Name : String) return Util.Beans.Objects.Object is
begin
if Name = "sorts" then
return From.Sorts_Bean;
elsif Name = "isBean" then
return Util.Beans.Objects.To_Object (True);
else
return Tables.Table_Definition (From).Get_Value (Name);
end if;
end Get_Value;
-- ------------------------------
-- Prepare the generation of the model.
-- ------------------------------
overriding
procedure Prepare (O : in out Query_Definition) is
begin
Tables.Table_Definition (O).Prepare;
end Prepare;
-- ------------------------------
-- Add a new sort mode for the query definition.
-- ------------------------------
procedure Add_Sort (Into : in out Query_Definition;
Name : in Unbounded_String;
Sql : in Unbounded_String) is
Item : constant Sort_Definition_Access := new Sort_Definition;
begin
Item.Set_Name (Name);
Item.Sql := Sql;
Into.Sorts.Append (Item);
end Add_Sort;
-- ------------------------------
-- Initialize the table definition instance.
-- ------------------------------
overriding
procedure Initialize (O : in out Query_Definition) is
begin
O.Sorts_Bean := Util.Beans.Objects.To_Object (O.Sorts'Unchecked_Access,
Util.Beans.Objects.STATIC);
Tables.Table_Definition (O).Initialize;
end Initialize;
-- Get the value identified by the name.
-- If the name cannot be found, the method should return the Null object.
overriding
function Get_Value (From : in Query_File_Definition;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "queries" then
return From.Queries_Bean;
elsif Name = "path" then
return Util.Beans.Objects.To_Object (From.File_Name);
elsif Name = "sha1" then
return Util.Beans.Objects.To_Object (From.Sha1);
else
return Query_Definition (From).Get_Value (Name);
end if;
end Get_Value;
-- Prepare the generation of the model.
overriding
procedure Prepare (O : in out Query_File_Definition) is
begin
Tables.Table_Definition (O).Prepare;
end Prepare;
-- ------------------------------
-- Add a new query to the definition.
-- ------------------------------
procedure Add_Query (Into : in out Query_File_Definition;
Name : in Unbounded_String;
Query : out Query_Definition_Access) is
begin
Query := new Query_Definition;
Query.Set_Name (Name);
Into.Queries.Append (Query.all'Access);
-- Query.Number := Into.Queries.Get_Count;
end Add_Query;
-- ------------------------------
-- Initialize the table definition instance.
-- ------------------------------
overriding
procedure Initialize (O : in out Query_File_Definition) is
begin
O.Queries_Bean := Util.Beans.Objects.To_Object (O.Queries'Unchecked_Access,
Util.Beans.Objects.STATIC);
Tables.Table_Definition (O).Initialize;
end Initialize;
end Gen.Model.Queries;
|
10868
|
-----------------------------------------------------------------------
-- gen-model-queries -- XML Mapped Database queries representation
-- Copyright (C) 2009, 2010, 2011, 2012, 2013, 2015, 2018 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
package body Gen.Model.Queries is
-- ------------------------------
-- Get the value identified by the name.
-- If the name cannot be found, the method should return the Null object.
-- ------------------------------
overriding
function Get_Value (From : in Sort_Definition;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "name" then
return Util.Beans.Objects.To_Object (From.Name);
elsif Name = "sql" then
return Util.Beans.Objects.To_Object (From.Sql);
else
return Definition (From).Get_Value (Name);
end if;
end Get_Value;
-- ------------------------------
-- Get the value identified by the name.
-- If the name cannot be found, the method should return the Null object.
-- ------------------------------
overriding
function Get_Value (From : Query_Definition;
Name : String) return Util.Beans.Objects.Object is
begin
if Name = "sorts" then
return From.Sorts_Bean;
elsif Name = "isBean" then
return Util.Beans.Objects.To_Object (True);
else
return Tables.Table_Definition (From).Get_Value (Name);
end if;
end Get_Value;
-- ------------------------------
-- Prepare the generation of the model.
-- ------------------------------
overriding
procedure Prepare (O : in out Query_Definition) is
begin
Tables.Table_Definition (O).Prepare;
end Prepare;
-- ------------------------------
-- Add a new sort mode for the query definition.
-- ------------------------------
procedure Add_Sort (Into : in out Query_Definition;
Name : in Unbounded_String;
Sql : in Unbounded_String) is
Item : constant Sort_Definition_Access := new Sort_Definition;
begin
Item.Set_Name (Name);
Item.Sql := Sql;
Into.Sorts.Append (Item);
end Add_Sort;
-- ------------------------------
-- Initialize the table definition instance.
-- ------------------------------
overriding
procedure Initialize (O : in out Query_Definition) is
begin
O.Sorts_Bean := Util.Beans.Objects.To_Object (O.Sorts'Unchecked_Access,
Util.Beans.Objects.STATIC);
Tables.Table_Definition (O).Initialize;
end Initialize;
-- Get the value identified by the name.
-- If the name cannot be found, the method should return the Null object.
overriding
function Get_Value (From : in Query_File_Definition;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "queries" then
return From.Queries_Bean;
elsif Name = "path" then
return Util.Beans.Objects.To_Object (From.File_Name);
elsif Name = "sha1" then
return Util.Beans.Objects.To_Object (From.Sha1);
else
return Query_Definition (From).Get_Value (Name);
end if;
end Get_Value;
-- Prepare the generation of the model.
overriding
procedure Prepare (O : in out Query_File_Definition) is
begin
Tables.Table_Definition (O).Prepare;
end Prepare;
-- ------------------------------
-- Add a new query to the definition.
-- ------------------------------
procedure Add_Query (Into : in out Query_File_Definition;
Name : in Unbounded_String;
Query : out Query_Definition_Access) is
begin
Query := new Query_Definition;
Query.Set_Name (Name);
Into.Queries.Append (Query.all'Access);
-- Query.Number := Into.Queries.Get_Count;
end Add_Query;
-- ------------------------------
-- Initialize the table definition instance.
-- ------------------------------
overriding
procedure Initialize (O : in out Query_File_Definition) is
begin
O.Queries_Bean := Util.Beans.Objects.To_Object (O.Queries'Unchecked_Access,
Util.Beans.Objects.STATIC);
Tables.Table_Definition (O).Initialize;
end Initialize;
end Gen.Model.Queries;
| true |
-----------------------------------------------------------------------
-- gen-model-queries -- XML Mapped Database queries representation
-- Copyright (C) 2009, 2010, 2011, 2012, 2013, 2015, 2018 PI:NAME:<NAME>END_PI
-- Written by PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
package body Gen.Model.Queries is
-- ------------------------------
-- Get the value identified by the name.
-- If the name cannot be found, the method should return the Null object.
-- ------------------------------
overriding
function Get_Value (From : in Sort_Definition;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "name" then
return Util.Beans.Objects.To_Object (From.Name);
elsif Name = "sql" then
return Util.Beans.Objects.To_Object (From.Sql);
else
return Definition (From).Get_Value (Name);
end if;
end Get_Value;
-- ------------------------------
-- Get the value identified by the name.
-- If the name cannot be found, the method should return the Null object.
-- ------------------------------
overriding
function Get_Value (From : Query_Definition;
Name : String) return Util.Beans.Objects.Object is
begin
if Name = "sorts" then
return From.Sorts_Bean;
elsif Name = "isBean" then
return Util.Beans.Objects.To_Object (True);
else
return Tables.Table_Definition (From).Get_Value (Name);
end if;
end Get_Value;
-- ------------------------------
-- Prepare the generation of the model.
-- ------------------------------
overriding
procedure Prepare (O : in out Query_Definition) is
begin
Tables.Table_Definition (O).Prepare;
end Prepare;
-- ------------------------------
-- Add a new sort mode for the query definition.
-- ------------------------------
procedure Add_Sort (Into : in out Query_Definition;
Name : in Unbounded_String;
Sql : in Unbounded_String) is
Item : constant Sort_Definition_Access := new Sort_Definition;
begin
Item.Set_Name (Name);
Item.Sql := Sql;
Into.Sorts.Append (Item);
end Add_Sort;
-- ------------------------------
-- Initialize the table definition instance.
-- ------------------------------
overriding
procedure Initialize (O : in out Query_Definition) is
begin
O.Sorts_Bean := Util.Beans.Objects.To_Object (O.Sorts'Unchecked_Access,
Util.Beans.Objects.STATIC);
Tables.Table_Definition (O).Initialize;
end Initialize;
-- Get the value identified by the name.
-- If the name cannot be found, the method should return the Null object.
overriding
function Get_Value (From : in Query_File_Definition;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "queries" then
return From.Queries_Bean;
elsif Name = "path" then
return Util.Beans.Objects.To_Object (From.File_Name);
elsif Name = "sha1" then
return Util.Beans.Objects.To_Object (From.Sha1);
else
return Query_Definition (From).Get_Value (Name);
end if;
end Get_Value;
-- Prepare the generation of the model.
overriding
procedure Prepare (O : in out Query_File_Definition) is
begin
Tables.Table_Definition (O).Prepare;
end Prepare;
-- ------------------------------
-- Add a new query to the definition.
-- ------------------------------
procedure Add_Query (Into : in out Query_File_Definition;
Name : in Unbounded_String;
Query : out Query_Definition_Access) is
begin
Query := new Query_Definition;
Query.Set_Name (Name);
Into.Queries.Append (Query.all'Access);
-- Query.Number := Into.Queries.Get_Count;
end Add_Query;
-- ------------------------------
-- Initialize the table definition instance.
-- ------------------------------
overriding
procedure Initialize (O : in out Query_File_Definition) is
begin
O.Queries_Bean := Util.Beans.Objects.To_Object (O.Queries'Unchecked_Access,
Util.Beans.Objects.STATIC);
Tables.Table_Definition (O).Initialize;
end Initialize;
end Gen.Model.Queries;
|
[
{
"context": "---------------------\n-- Copyright (c) 2013-2020, Luke A. Guest\n--\n-- This software is provided 'as-is', without",
"end": 159,
"score": 0.9997588396072388,
"start": 146,
"tag": "NAME",
"value": "Luke A. Guest"
}
] |
src/sdl-rwops-streams.ads
|
treggit/sdlada
| 89 |
--------------------------------------------------------------------------------------------------------------------
-- Copyright (c) 2013-2020, Luke A. Guest
--
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
--
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
--
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
--
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
--
-- 3. This notice may not be removed or altered from any source
-- distribution.
--------------------------------------------------------------------------------------------------------------------
-- SDL.RWops.Streams
--
-- Ada stream interface to SDL's Read/Write operations.
--------------------------------------------------------------------------------------------------------------------
with Ada.Streams;
package SDL.RWops.Streams is
pragma Preelaborate;
type RWops_Stream is new Ada.Streams.Root_Stream_Type with private;
function Open (Op : in RWops) return RWops_Stream;
procedure Open (Op : in RWops; Stream : out RWops_Stream);
procedure Close (Stream : in RWops_Stream);
overriding
procedure Read (Stream : in out RWops_Stream;
Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset);
overriding
procedure Write (Stream : in out RWops_Stream; Item : Ada.Streams.Stream_Element_Array);
private
type RWops_Stream is new Ada.Streams.Root_Stream_Type with
record
Context : RWops;
end record;
end SDL.RWops.Streams;
|
4205
|
--------------------------------------------------------------------------------------------------------------------
-- Copyright (c) 2013-2020, <NAME>
--
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
--
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
--
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
--
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
--
-- 3. This notice may not be removed or altered from any source
-- distribution.
--------------------------------------------------------------------------------------------------------------------
-- SDL.RWops.Streams
--
-- Ada stream interface to SDL's Read/Write operations.
--------------------------------------------------------------------------------------------------------------------
with Ada.Streams;
package SDL.RWops.Streams is
pragma Preelaborate;
type RWops_Stream is new Ada.Streams.Root_Stream_Type with private;
function Open (Op : in RWops) return RWops_Stream;
procedure Open (Op : in RWops; Stream : out RWops_Stream);
procedure Close (Stream : in RWops_Stream);
overriding
procedure Read (Stream : in out RWops_Stream;
Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset);
overriding
procedure Write (Stream : in out RWops_Stream; Item : Ada.Streams.Stream_Element_Array);
private
type RWops_Stream is new Ada.Streams.Root_Stream_Type with
record
Context : RWops;
end record;
end SDL.RWops.Streams;
| true |
--------------------------------------------------------------------------------------------------------------------
-- Copyright (c) 2013-2020, PI:NAME:<NAME>END_PI
--
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
--
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
--
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
--
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
--
-- 3. This notice may not be removed or altered from any source
-- distribution.
--------------------------------------------------------------------------------------------------------------------
-- SDL.RWops.Streams
--
-- Ada stream interface to SDL's Read/Write operations.
--------------------------------------------------------------------------------------------------------------------
with Ada.Streams;
package SDL.RWops.Streams is
pragma Preelaborate;
type RWops_Stream is new Ada.Streams.Root_Stream_Type with private;
function Open (Op : in RWops) return RWops_Stream;
procedure Open (Op : in RWops; Stream : out RWops_Stream);
procedure Close (Stream : in RWops_Stream);
overriding
procedure Read (Stream : in out RWops_Stream;
Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset);
overriding
procedure Write (Stream : in out RWops_Stream; Item : Ada.Streams.Stream_Element_Array);
private
type RWops_Stream is new Ada.Streams.Root_Stream_Type with
record
Context : RWops;
end record;
end SDL.RWops.Streams;
|
[
{
"context": "----------------------\n-- Copyright (c) 2015-2019, Natacha Porté --\n-- ",
"end": 120,
"score": 0.9998422265052795,
"start": 107,
"tag": "NAME",
"value": "Natacha Porté"
}
] |
src/natools-s_expressions-enumeration_io.adb
|
faelys/natools
| 0 |
------------------------------------------------------------------------------
-- Copyright (c) 2015-2019, Natacha Porté --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
with Ada.Characters.Handling;
with Ada.Strings.Fixed;
package body Natools.S_Expressions.Enumeration_IO is
function To_Atom (Enumeration_Image : in String) return Atom is
Result : Atom := S_Expressions.To_Atom (Ada.Strings.Fixed.Translate
(Enumeration_Image,
Ada.Characters.Handling.To_Lower'Access));
begin
for I in Result'Range loop
if Result (I) = Character'Pos ('_') then
Result (I) := Character'Pos ('-');
end if;
end loop;
return Result;
end To_Atom;
function To_Image (Data : in Atom) return String is
Result : String := Ada.Strings.Fixed.Translate
(To_String (Data),
Ada.Characters.Handling.To_Upper'Access);
begin
for I in Result'Range loop
if Result (I) = '-' then
Result (I) := '_';
end if;
end loop;
return Result;
end To_Image;
package body Typed_IO is
function Image (T : Enum) return Atom is
begin
return To_Atom (Enum'Image (T));
end Image;
function Value (Data : Atom) return Enum is
begin
return Enum'Value (To_Image (Data));
end Value;
function Value (Data : Atom; Fallback : Enum) return Enum is
Img : constant String := To_Image (Data);
begin
return Enum'Value (Img);
exception
when Constraint_Error =>
return Fallback;
end Value;
end Typed_IO;
end Natools.S_Expressions.Enumeration_IO;
|
27194
|
------------------------------------------------------------------------------
-- Copyright (c) 2015-2019, <NAME> --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
with Ada.Characters.Handling;
with Ada.Strings.Fixed;
package body Natools.S_Expressions.Enumeration_IO is
function To_Atom (Enumeration_Image : in String) return Atom is
Result : Atom := S_Expressions.To_Atom (Ada.Strings.Fixed.Translate
(Enumeration_Image,
Ada.Characters.Handling.To_Lower'Access));
begin
for I in Result'Range loop
if Result (I) = Character'Pos ('_') then
Result (I) := Character'Pos ('-');
end if;
end loop;
return Result;
end To_Atom;
function To_Image (Data : in Atom) return String is
Result : String := Ada.Strings.Fixed.Translate
(To_String (Data),
Ada.Characters.Handling.To_Upper'Access);
begin
for I in Result'Range loop
if Result (I) = '-' then
Result (I) := '_';
end if;
end loop;
return Result;
end To_Image;
package body Typed_IO is
function Image (T : Enum) return Atom is
begin
return To_Atom (Enum'Image (T));
end Image;
function Value (Data : Atom) return Enum is
begin
return Enum'Value (To_Image (Data));
end Value;
function Value (Data : Atom; Fallback : Enum) return Enum is
Img : constant String := To_Image (Data);
begin
return Enum'Value (Img);
exception
when Constraint_Error =>
return Fallback;
end Value;
end Typed_IO;
end Natools.S_Expressions.Enumeration_IO;
| true |
------------------------------------------------------------------------------
-- Copyright (c) 2015-2019, PI:NAME:<NAME>END_PI --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
with Ada.Characters.Handling;
with Ada.Strings.Fixed;
package body Natools.S_Expressions.Enumeration_IO is
function To_Atom (Enumeration_Image : in String) return Atom is
Result : Atom := S_Expressions.To_Atom (Ada.Strings.Fixed.Translate
(Enumeration_Image,
Ada.Characters.Handling.To_Lower'Access));
begin
for I in Result'Range loop
if Result (I) = Character'Pos ('_') then
Result (I) := Character'Pos ('-');
end if;
end loop;
return Result;
end To_Atom;
function To_Image (Data : in Atom) return String is
Result : String := Ada.Strings.Fixed.Translate
(To_String (Data),
Ada.Characters.Handling.To_Upper'Access);
begin
for I in Result'Range loop
if Result (I) = '-' then
Result (I) := '_';
end if;
end loop;
return Result;
end To_Image;
package body Typed_IO is
function Image (T : Enum) return Atom is
begin
return To_Atom (Enum'Image (T));
end Image;
function Value (Data : Atom) return Enum is
begin
return Enum'Value (To_Image (Data));
end Value;
function Value (Data : Atom; Fallback : Enum) return Enum is
Img : constant String := To_Image (Data);
begin
return Enum'Value (Img);
exception
when Constraint_Error =>
return Fallback;
end Value;
end Typed_IO;
end Natools.S_Expressions.Enumeration_IO;
|
[
{
"context": "-- Copyright (c) 2020 Maxim Reznik <[email protected]>\n--\n-- SPDX-License-Identifi",
"end": 35,
"score": 0.9998568296432495,
"start": 23,
"tag": "NAME",
"value": "Maxim Reznik"
},
{
"context": "-- Copyright (c) 2020 Maxim Reznik <[email protected]>\n--\n-- SPDX-License-Identifier: MIT\n-- License-",
"end": 55,
"score": 0.9999310970306396,
"start": 37,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
sources/skynet.ads
|
reznikmm/ada-skynet
| 0 |
-- Copyright (c) 2020 Maxim Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with League.Strings;
package Skynet is
function "+"
(Text : Wide_Wide_String) return League.Strings.Universal_String
renames League.Strings.To_Universal_String;
URI_Skynet_Prefix : constant Wide_Wide_String := "sia://";
type Portal_Upload_Options is record
URL : League.Strings.Universal_String := +"https://siasky.net";
Upload_Path : League.Strings.Universal_String := +"skynet/skyfile";
File_Fieldname : League.Strings.Universal_String := +"file";
Directory_File_Fieldname : League.Strings.Universal_String := +"files[]";
end record;
type Upload_Options is record
Portal : Portal_Upload_Options;
Custom_Filename : League.Strings.Universal_String;
end record;
procedure Upload_File
(Path : League.Strings.Universal_String;
Skylink : out League.Strings.Universal_String;
Options : Upload_Options := (others => <>))
with Post => Skylink.Starts_With (URI_Skynet_Prefix);
procedure Download_File
(Path : League.Strings.Universal_String;
Skylink : League.Strings.Universal_String;
Portal_URL : League.Strings.Universal_String := +"https://siasky.net")
with Pre => Skylink.Starts_With (URI_Skynet_Prefix);
end Skynet;
|
6307
|
-- Copyright (c) 2020 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with League.Strings;
package Skynet is
function "+"
(Text : Wide_Wide_String) return League.Strings.Universal_String
renames League.Strings.To_Universal_String;
URI_Skynet_Prefix : constant Wide_Wide_String := "sia://";
type Portal_Upload_Options is record
URL : League.Strings.Universal_String := +"https://siasky.net";
Upload_Path : League.Strings.Universal_String := +"skynet/skyfile";
File_Fieldname : League.Strings.Universal_String := +"file";
Directory_File_Fieldname : League.Strings.Universal_String := +"files[]";
end record;
type Upload_Options is record
Portal : Portal_Upload_Options;
Custom_Filename : League.Strings.Universal_String;
end record;
procedure Upload_File
(Path : League.Strings.Universal_String;
Skylink : out League.Strings.Universal_String;
Options : Upload_Options := (others => <>))
with Post => Skylink.Starts_With (URI_Skynet_Prefix);
procedure Download_File
(Path : League.Strings.Universal_String;
Skylink : League.Strings.Universal_String;
Portal_URL : League.Strings.Universal_String := +"https://siasky.net")
with Pre => Skylink.Starts_With (URI_Skynet_Prefix);
end Skynet;
| true |
-- Copyright (c) 2020 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with League.Strings;
package Skynet is
function "+"
(Text : Wide_Wide_String) return League.Strings.Universal_String
renames League.Strings.To_Universal_String;
URI_Skynet_Prefix : constant Wide_Wide_String := "sia://";
type Portal_Upload_Options is record
URL : League.Strings.Universal_String := +"https://siasky.net";
Upload_Path : League.Strings.Universal_String := +"skynet/skyfile";
File_Fieldname : League.Strings.Universal_String := +"file";
Directory_File_Fieldname : League.Strings.Universal_String := +"files[]";
end record;
type Upload_Options is record
Portal : Portal_Upload_Options;
Custom_Filename : League.Strings.Universal_String;
end record;
procedure Upload_File
(Path : League.Strings.Universal_String;
Skylink : out League.Strings.Universal_String;
Options : Upload_Options := (others => <>))
with Post => Skylink.Starts_With (URI_Skynet_Prefix);
procedure Download_File
(Path : League.Strings.Universal_String;
Skylink : League.Strings.Universal_String;
Portal_URL : League.Strings.Universal_String := +"https://siasky.net")
with Pre => Skylink.Starts_With (URI_Skynet_Prefix);
end Skynet;
|
[
{
"context": "e-Identifier: Apache-2.0\n--\n-- Copyright (c) 2021 onox <[email protected]>\n--\n-- Licensed under the A",
"end": 70,
"score": 0.9994559288024902,
"start": 66,
"tag": "USERNAME",
"value": "onox"
},
{
"context": "ifier: Apache-2.0\n--\n-- Copyright (c) 2021 onox <[email protected]>\n--\n-- Licensed under the Apache License, Versio",
"end": 91,
"score": 0.9999221563339233,
"start": 72,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
orka_simd/src/x86/generic/orka-simd-sse4_1-integers-logical.adb
|
onox/orka
| 52 |
-- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2021 onox <[email protected]>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with Ada.Unchecked_Conversion;
package body Orka.SIMD.SSE4_1.Integers.Logical is
type m128l is array (Index_2D) of Integer_64
with Alignment => 16;
pragma Machine_Attribute (m128l, "vector_type");
function Test_All_Zero (Elements, Mask : m128l) return Integer
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_ptestz128";
function Test_All_Ones (Elements, Mask : m128l) return Integer
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_ptestc128";
function Test_Mix_Ones_Zeros (Elements, Mask : m128l) return Integer
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_ptestnzc128";
----------------------------------------------------------------------------
function Convert is new Ada.Unchecked_Conversion (m128i, m128l);
function Test_All_Zero (Elements, Mask : m128i) return Integer is
(Test_All_Zero (Convert (Elements), Convert (Mask)));
function Test_All_Ones (Elements, Mask : m128i) return Integer is
(Test_All_Ones (Convert (Elements), Convert (Mask)));
function Test_Mix_Ones_Zeros (Elements, Mask : m128i) return Integer is
(Test_Mix_Ones_Zeros (Convert (Elements), Convert (Mask)));
end Orka.SIMD.SSE4_1.Integers.Logical;
|
21874
|
-- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2021 onox <<EMAIL>>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with Ada.Unchecked_Conversion;
package body Orka.SIMD.SSE4_1.Integers.Logical is
type m128l is array (Index_2D) of Integer_64
with Alignment => 16;
pragma Machine_Attribute (m128l, "vector_type");
function Test_All_Zero (Elements, Mask : m128l) return Integer
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_ptestz128";
function Test_All_Ones (Elements, Mask : m128l) return Integer
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_ptestc128";
function Test_Mix_Ones_Zeros (Elements, Mask : m128l) return Integer
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_ptestnzc128";
----------------------------------------------------------------------------
function Convert is new Ada.Unchecked_Conversion (m128i, m128l);
function Test_All_Zero (Elements, Mask : m128i) return Integer is
(Test_All_Zero (Convert (Elements), Convert (Mask)));
function Test_All_Ones (Elements, Mask : m128i) return Integer is
(Test_All_Ones (Convert (Elements), Convert (Mask)));
function Test_Mix_Ones_Zeros (Elements, Mask : m128i) return Integer is
(Test_Mix_Ones_Zeros (Convert (Elements), Convert (Mask)));
end Orka.SIMD.SSE4_1.Integers.Logical;
| true |
-- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2021 onox <PI:EMAIL:<EMAIL>END_PI>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with Ada.Unchecked_Conversion;
package body Orka.SIMD.SSE4_1.Integers.Logical is
type m128l is array (Index_2D) of Integer_64
with Alignment => 16;
pragma Machine_Attribute (m128l, "vector_type");
function Test_All_Zero (Elements, Mask : m128l) return Integer
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_ptestz128";
function Test_All_Ones (Elements, Mask : m128l) return Integer
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_ptestc128";
function Test_Mix_Ones_Zeros (Elements, Mask : m128l) return Integer
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_ptestnzc128";
----------------------------------------------------------------------------
function Convert is new Ada.Unchecked_Conversion (m128i, m128l);
function Test_All_Zero (Elements, Mask : m128i) return Integer is
(Test_All_Zero (Convert (Elements), Convert (Mask)));
function Test_All_Ones (Elements, Mask : m128i) return Integer is
(Test_All_Ones (Convert (Elements), Convert (Mask)));
function Test_Mix_Ones_Zeros (Elements, Mask : m128i) return Integer is
(Test_Mix_Ones_Zeros (Convert (Elements), Convert (Mask)));
end Orka.SIMD.SSE4_1.Integers.Logical;
|
[
{
"context": "e-Identifier: Apache-2.0\n--\n-- Copyright (c) 2019 onox <[email protected]>\n--\n-- Licensed under the A",
"end": 70,
"score": 0.9988460540771484,
"start": 66,
"tag": "USERNAME",
"value": "onox"
},
{
"context": "ifier: Apache-2.0\n--\n-- Copyright (c) 2019 onox <[email protected]>\n--\n-- Licensed under the Apache License, Versio",
"end": 91,
"score": 0.9999233484268188,
"start": 72,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
orka/src/orka/implementation/orka-inputs-joysticks-sequences.adb
|
onox/orka
| 52 |
-- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2019 onox <[email protected]>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with Orka.OS;
package body Orka.Inputs.Joysticks.Sequences is
function Create_Sequence
(Buttons : Button_Index_Array;
Max_Time : Duration) return Sequence is
begin
return
(Button_Count => Buttons'Length,
Buttons => Buttons,
Index => Buttons'First,
Max_Time => Max_Time,
Start_Press => Orka.OS.Monotonic_Clock - Max_Time);
end Create_Sequence;
function Detect_Activation
(Object : in out Sequence;
Joystick : Joystick_Input'Class) return Boolean
is
Current_Time : constant Time := Orka.OS.Monotonic_Clock;
On_Time : constant Boolean := Current_Time - Object.Start_Press < Object.Max_Time;
Pressed_Buttons : constant Boolean_Button_States := Joystick.Just_Pressed;
Expected_Button : Boolean_Button_States := (others => False);
begin
Expected_Button (Object.Buttons (Object.Index)) := True;
declare
Unexpected_Buttons : constant Boolean_Button_States :=
Pressed_Buttons and not Expected_Button;
begin
-- If the user presses a wrong button, it might actually be
-- the correct button of the start of the sequence. Therefore,
-- do not stop, but just reset the sequence
if (for some Button of Unexpected_Buttons => Button) then
Object.Index := 1;
end if;
if Pressed_Buttons (Object.Buttons (Object.Index)) then
if Object.Index = 1 then
Object.Start_Press := Current_Time;
Object.Index := Object.Index + 1;
elsif On_Time then
if Object.Index = Object.Button_Count then
Object.Index := 1;
return True;
else
Object.Index := Object.Index + 1;
end if;
else
Object.Index := 1;
end if;
end if;
end;
return False;
end Detect_Activation;
end Orka.Inputs.Joysticks.Sequences;
|
13294
|
-- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2019 onox <<EMAIL>>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with Orka.OS;
package body Orka.Inputs.Joysticks.Sequences is
function Create_Sequence
(Buttons : Button_Index_Array;
Max_Time : Duration) return Sequence is
begin
return
(Button_Count => Buttons'Length,
Buttons => Buttons,
Index => Buttons'First,
Max_Time => Max_Time,
Start_Press => Orka.OS.Monotonic_Clock - Max_Time);
end Create_Sequence;
function Detect_Activation
(Object : in out Sequence;
Joystick : Joystick_Input'Class) return Boolean
is
Current_Time : constant Time := Orka.OS.Monotonic_Clock;
On_Time : constant Boolean := Current_Time - Object.Start_Press < Object.Max_Time;
Pressed_Buttons : constant Boolean_Button_States := Joystick.Just_Pressed;
Expected_Button : Boolean_Button_States := (others => False);
begin
Expected_Button (Object.Buttons (Object.Index)) := True;
declare
Unexpected_Buttons : constant Boolean_Button_States :=
Pressed_Buttons and not Expected_Button;
begin
-- If the user presses a wrong button, it might actually be
-- the correct button of the start of the sequence. Therefore,
-- do not stop, but just reset the sequence
if (for some Button of Unexpected_Buttons => Button) then
Object.Index := 1;
end if;
if Pressed_Buttons (Object.Buttons (Object.Index)) then
if Object.Index = 1 then
Object.Start_Press := Current_Time;
Object.Index := Object.Index + 1;
elsif On_Time then
if Object.Index = Object.Button_Count then
Object.Index := 1;
return True;
else
Object.Index := Object.Index + 1;
end if;
else
Object.Index := 1;
end if;
end if;
end;
return False;
end Detect_Activation;
end Orka.Inputs.Joysticks.Sequences;
| true |
-- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2019 onox <PI:EMAIL:<EMAIL>END_PI>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with Orka.OS;
package body Orka.Inputs.Joysticks.Sequences is
function Create_Sequence
(Buttons : Button_Index_Array;
Max_Time : Duration) return Sequence is
begin
return
(Button_Count => Buttons'Length,
Buttons => Buttons,
Index => Buttons'First,
Max_Time => Max_Time,
Start_Press => Orka.OS.Monotonic_Clock - Max_Time);
end Create_Sequence;
function Detect_Activation
(Object : in out Sequence;
Joystick : Joystick_Input'Class) return Boolean
is
Current_Time : constant Time := Orka.OS.Monotonic_Clock;
On_Time : constant Boolean := Current_Time - Object.Start_Press < Object.Max_Time;
Pressed_Buttons : constant Boolean_Button_States := Joystick.Just_Pressed;
Expected_Button : Boolean_Button_States := (others => False);
begin
Expected_Button (Object.Buttons (Object.Index)) := True;
declare
Unexpected_Buttons : constant Boolean_Button_States :=
Pressed_Buttons and not Expected_Button;
begin
-- If the user presses a wrong button, it might actually be
-- the correct button of the start of the sequence. Therefore,
-- do not stop, but just reset the sequence
if (for some Button of Unexpected_Buttons => Button) then
Object.Index := 1;
end if;
if Pressed_Buttons (Object.Buttons (Object.Index)) then
if Object.Index = 1 then
Object.Start_Press := Current_Time;
Object.Index := Object.Index + 1;
elsif On_Time then
if Object.Index = Object.Button_Count then
Object.Index := 1;
return True;
else
Object.Index := Object.Index + 1;
end if;
else
Object.Index := 1;
end if;
end if;
end;
return False;
end Detect_Activation;
end Orka.Inputs.Joysticks.Sequences;
|
[
{
"context": " --\n-- * Richard Wai (ANNEXI-STRAYLINE) ",
"end": 886,
"score": 0.9998152852058411,
"start": 875,
"tag": "NAME",
"value": "Richard Wai"
}
] |
repositories-cache-validate_local_or_system.adb
|
annexi-strayline/AURA
| 13 |
------------------------------------------------------------------------------
-- --
-- Ada User Repository Annex (AURA) --
-- Reference Implementation --
-- --
-- ------------------------------------------------------------------------ --
-- --
-- Copyright (C) 2020, ANNEXI-STRAYLINE Trans-Human Ltd. --
-- All rights reserved. --
-- --
-- Original Contributors: --
-- * Richard Wai (ANNEXI-STRAYLINE) --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- --
-- * Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A --
-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with Ada.Assertions;
with Ada.Directories;
with Ada.Unchecked_Deallocation;
with Ada.Containers.Vectors;
with Ada.Streams.Stream_IO;
with Unit_Names;
with User_Queries;
with Stream_Hashing.Collective;
with Registrar.Library_Units;
with Registrar.Queries;
separate (Repositories.Cache)
package body Validate_Local_Or_System is
type Hash_Queue_Access is
access Stream_Hashing.Collective.Hash_Queues.Queue;
--
-- Hash_File_Order
--
type Hash_File_Order is new Workers.Work_Order with
record
Path : UBS.Unbounded_String;
Hashes: Hash_Queue_Access;
-- The following is along for the ride - it will be used to
-- fill-out a Validate_Local_Or_System_Order in the Phase_Trigger
Index : Repository_Index;
end record;
overriding procedure Execute (Order: in out Hash_File_Order);
overriding procedure Phase_Trigger (Order: in out Hash_File_Order);
overriding function Image (Order: Hash_File_Order) return String;
--
-- Validate_Local_Or_System_Order
--
-- This order is actually called from the last Hash_File_Order, and
-- generates the collective hash, and then updates/validates the repo
type Validate_Local_Or_System_Order is new Workers.Work_Order with
record
Index : Repository_Index;
Hashes: Hash_Queue_Access;
end record;
overriding procedure Execute (Order: in out Validate_Local_Or_System_Order);
overriding function Image (Order: Validate_Local_Or_System_Order)
return String;
--
-- Hash_File_Order
--
-----------
-- Image --
-----------
function Image (Order: Hash_File_Order) return String
is ( "[Hash_File_Order] (Repositories.Cache.Validate_Local_Or_System)"
& New_Line
& " Path: " & UBS.To_String (Order.Path) & New_Line
& " (For validation/generation of Repository No."
& Repository_Index'Image (Order.Index) & ')');
-------------
-- Execute --
-------------
procedure Execute (Order: in out Hash_File_Order) is
use Ada.Streams.Stream_IO;
File: File_Type;
begin
Open (File => File,
Mode => In_File,
Name => UBS.To_String (Order.Path));
Order.Hashes.Enqueue
(Stream_Hashing.Digest_Stream (Stream (File)));
Close (File);
exception
when others =>
if Is_Open (File) then
Close (File);
end if;
raise;
end Execute;
-------------------
-- Phase_Trigger --
-------------------
-- This is executred one, when all Hash_Orders have been completed. We can
-- safely deallocate the dynamic tracker, and then submit a
-- Validate_Local_Or_System_Order, which handles the rest
procedure Phase_Trigger (Order: in out Hash_File_Order) is
procedure Free is new Ada.Unchecked_Deallocation
(Object => Progress.Progress_Tracker,
Name => Progress.Progress_Tracker_Access);
Next_Phase: Validate_Local_Or_System_Order
:= (Tracker => Caching_Progress'Access,
-- Note that Total_Items was incremented on the call to
-- Dispatch that got the whole proverbial ball rolling
Index => Order.Index,
Hashes => Order.Hashes);
begin
Free (Order.Tracker);
Workers.Enqueue_Order (Next_Phase);
end Phase_Trigger;
--
-- Validate_Local_Or_System_Order
--
-----------
-- Image --
-----------
function Image (Order: Validate_Local_Or_System_Order) return String
is ( "[Validate_Local_Or_System_Order] "
& "(Repositories.Cache.Validate_Local_Or_System)"
& New_Line
& " Repository No."
& Repository_Index'Image (Order.Index));
-------------
-- Execute --
-------------
procedure Execute (Order: in out Validate_Local_Or_System_Order) is
use Stream_Hashing;
use Stream_Hashing.Collective;
procedure Free is new Ada.Unchecked_Deallocation
(Object => Hash_Queues.Queue,
Name => Hash_Queue_Access);
Repo: Repository := Extract_Repository (Order.Index);
Collect_Hash: Hash_Type;
Hash_String : UBS.Unbounded_String;
begin
pragma Assert (Repo.Format in System | Local);
pragma Assert (Repo.Cache_State = Requested);
Compute_Collective_Hash (Hash_Queue => Order.Hashes.all,
Collective_Hash => Collect_Hash);
-- Release the queue
Free (Order.Hashes);
UBS.Set_Unbounded_String (Target => Hash_String,
Source => Collect_Hash.To_String);
if UBS.Length (Repo.Snapshot) = 0 then
-- New repo
Repo.Snapshot := Hash_String;
Repo.Cache_State := Available;
Repo.Cache_Path := Repo.Location;
Update_Repository (Index => Order.Index,
Updated => Repo);
Generate_Repo_Spec (Order.Index);
return;
else
-- Verify the hash
if Collect_Hash.To_String /= UBS.To_String (Repo.Snapshot) then
-- Mismatch. Ask the user if they want to proceed (use the new
-- hash), or abort
declare
use User_Queries;
Response: String (1..1);
Last: Natural;
begin
Query_Manager.Start_Query;
loop
Query_Manager.Post_Query
(Prompt => "Repository"
& Repository_Index'Image (Order.Index)
& '(' & UBS.To_String (Repo.Location) & ')'
& " has been modified. Accept changes? (Y/[N]): ",
Default => "N",
Response_Size => Response'Length);
Query_Manager.Wait_Response (Response => Response,
Last => Last);
if Last < Response'First then
-- Default (N)
Response := "N";
end if;
exit when Response in "Y" | "y" | "N" | "n";
end loop;
Query_Manager.End_Query;
if Response in "Y" | "y" then
-- Update with new hash
Repo.Snapshot := Hash_String;
Repo.Cache_State := Available;
Repo.Cache_Path := Repo.Location;
Update_Repository (Index => Order.Index,
Updated => Repo);
Generate_Repo_Spec (Order.Index);
else
-- Abort
raise Ada.Assertions.Assertion_Error with
"Repository hash mismatch. User rejected changes.";
end if;
end;
else
-- Hash ok
Repo.Cache_State := Available;
Repo.Cache_Path := Repo.Location;
Update_Repository (Index => Order.Index,
Updated => Repo);
end if;
end if;
end Execute;
--------------
-- Dispatch --
--------------
procedure Dispatch (Repo: in Repository; Index: in Repository_Index) is
use Ada.Directories;
use type Ada.Containers.Count_Type;
package Path_Vectors is new Ada.Containers.Vectors
(Index_Type => Positive,
Element_Type => UBS.Unbounded_String,
"=" => UBS."=");
Path_Vector: Path_Vectors.Vector;
Group_Tracker: Progress.Progress_Tracker_Access
:= new Progress.Progress_Tracker;
New_Order: Hash_File_Order
:= (Tracker => Group_Tracker,
Hashes => new Stream_Hashing.Collective.Hash_Queues.Queue,
Index => Index,
others => <>);
Filter: constant Filter_Type := (Directory => True,
Ordinary_File => True,
Special_File => False);
procedure Recursive_Add (E: in Directory_Entry_Type);
procedure Recursive_Add (E: in Directory_Entry_Type) is
S_Name: constant String := Simple_Name (E);
begin
-- Don't process hidden files
if S_Name(S_Name'First) = '.' then
return;
end if;
if Kind (E) = Directory then
Search (Directory => Full_Name (E),
Pattern => "*",
Filter => Filter,
Process => Recursive_Add'Access);
else
Path_Vector.Append (UBS.To_Unbounded_String (Full_Name (E)));
end if;
end Recursive_Add;
begin
-- For System repositories, we want to make sure the AURA spec matches
if Repo.Format = System then
declare
use Ada.Streams.Stream_IO;
use Stream_Hashing;
AURA_Unit: constant Registrar.Library_Units.Library_Unit
:= Registrar.Queries.Lookup_Unit
(Unit_Names.Set_Name ("aura"));
Repo_AURA_Spec: File_Type;
Repo_AURA_Hash: Hash_Type;
begin
Open (File => Repo_AURA_Spec,
Mode => In_File,
Name => UBS.To_String (Repo.Cache_Path) & "/aura.ads");
Repo_AURA_Hash := Digest_Stream (Stream (Repo_AURA_Spec));
Ada.Assertions.Assert
(Check => Repo_AURA_Hash = AURA_Unit.Spec_File.Hash,
Message => "System repository's AURA package does not match "
& "the local AURA package");
end;
end if;
-- Start with the location of the repository, which shall be a directory
Search (Directory => UBS.To_String (Repo.Location),
Pattern => "*",
Filter => Filter,
Process => Recursive_Add'Access);
Ada.Assertions.Assert (Check => Path_Vector.Length > 0,
Message => "Location path is invalid");
-- Set up the group tracker and dispatch
Group_Tracker.Set_Total_Items (Natural (Path_Vector.Length));
-- Dispatch
for Path of Path_Vector loop
New_Order.Path := Path;
Workers.Enqueue_Order (New_Order);
end loop;
end Dispatch;
end Validate_Local_Or_System;
|
11806
|
------------------------------------------------------------------------------
-- --
-- Ada User Repository Annex (AURA) --
-- Reference Implementation --
-- --
-- ------------------------------------------------------------------------ --
-- --
-- Copyright (C) 2020, ANNEXI-STRAYLINE Trans-Human Ltd. --
-- All rights reserved. --
-- --
-- Original Contributors: --
-- * <NAME> (ANNEXI-STRAYLINE) --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- --
-- * Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A --
-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with Ada.Assertions;
with Ada.Directories;
with Ada.Unchecked_Deallocation;
with Ada.Containers.Vectors;
with Ada.Streams.Stream_IO;
with Unit_Names;
with User_Queries;
with Stream_Hashing.Collective;
with Registrar.Library_Units;
with Registrar.Queries;
separate (Repositories.Cache)
package body Validate_Local_Or_System is
type Hash_Queue_Access is
access Stream_Hashing.Collective.Hash_Queues.Queue;
--
-- Hash_File_Order
--
type Hash_File_Order is new Workers.Work_Order with
record
Path : UBS.Unbounded_String;
Hashes: Hash_Queue_Access;
-- The following is along for the ride - it will be used to
-- fill-out a Validate_Local_Or_System_Order in the Phase_Trigger
Index : Repository_Index;
end record;
overriding procedure Execute (Order: in out Hash_File_Order);
overriding procedure Phase_Trigger (Order: in out Hash_File_Order);
overriding function Image (Order: Hash_File_Order) return String;
--
-- Validate_Local_Or_System_Order
--
-- This order is actually called from the last Hash_File_Order, and
-- generates the collective hash, and then updates/validates the repo
type Validate_Local_Or_System_Order is new Workers.Work_Order with
record
Index : Repository_Index;
Hashes: Hash_Queue_Access;
end record;
overriding procedure Execute (Order: in out Validate_Local_Or_System_Order);
overriding function Image (Order: Validate_Local_Or_System_Order)
return String;
--
-- Hash_File_Order
--
-----------
-- Image --
-----------
function Image (Order: Hash_File_Order) return String
is ( "[Hash_File_Order] (Repositories.Cache.Validate_Local_Or_System)"
& New_Line
& " Path: " & UBS.To_String (Order.Path) & New_Line
& " (For validation/generation of Repository No."
& Repository_Index'Image (Order.Index) & ')');
-------------
-- Execute --
-------------
procedure Execute (Order: in out Hash_File_Order) is
use Ada.Streams.Stream_IO;
File: File_Type;
begin
Open (File => File,
Mode => In_File,
Name => UBS.To_String (Order.Path));
Order.Hashes.Enqueue
(Stream_Hashing.Digest_Stream (Stream (File)));
Close (File);
exception
when others =>
if Is_Open (File) then
Close (File);
end if;
raise;
end Execute;
-------------------
-- Phase_Trigger --
-------------------
-- This is executred one, when all Hash_Orders have been completed. We can
-- safely deallocate the dynamic tracker, and then submit a
-- Validate_Local_Or_System_Order, which handles the rest
procedure Phase_Trigger (Order: in out Hash_File_Order) is
procedure Free is new Ada.Unchecked_Deallocation
(Object => Progress.Progress_Tracker,
Name => Progress.Progress_Tracker_Access);
Next_Phase: Validate_Local_Or_System_Order
:= (Tracker => Caching_Progress'Access,
-- Note that Total_Items was incremented on the call to
-- Dispatch that got the whole proverbial ball rolling
Index => Order.Index,
Hashes => Order.Hashes);
begin
Free (Order.Tracker);
Workers.Enqueue_Order (Next_Phase);
end Phase_Trigger;
--
-- Validate_Local_Or_System_Order
--
-----------
-- Image --
-----------
function Image (Order: Validate_Local_Or_System_Order) return String
is ( "[Validate_Local_Or_System_Order] "
& "(Repositories.Cache.Validate_Local_Or_System)"
& New_Line
& " Repository No."
& Repository_Index'Image (Order.Index));
-------------
-- Execute --
-------------
procedure Execute (Order: in out Validate_Local_Or_System_Order) is
use Stream_Hashing;
use Stream_Hashing.Collective;
procedure Free is new Ada.Unchecked_Deallocation
(Object => Hash_Queues.Queue,
Name => Hash_Queue_Access);
Repo: Repository := Extract_Repository (Order.Index);
Collect_Hash: Hash_Type;
Hash_String : UBS.Unbounded_String;
begin
pragma Assert (Repo.Format in System | Local);
pragma Assert (Repo.Cache_State = Requested);
Compute_Collective_Hash (Hash_Queue => Order.Hashes.all,
Collective_Hash => Collect_Hash);
-- Release the queue
Free (Order.Hashes);
UBS.Set_Unbounded_String (Target => Hash_String,
Source => Collect_Hash.To_String);
if UBS.Length (Repo.Snapshot) = 0 then
-- New repo
Repo.Snapshot := Hash_String;
Repo.Cache_State := Available;
Repo.Cache_Path := Repo.Location;
Update_Repository (Index => Order.Index,
Updated => Repo);
Generate_Repo_Spec (Order.Index);
return;
else
-- Verify the hash
if Collect_Hash.To_String /= UBS.To_String (Repo.Snapshot) then
-- Mismatch. Ask the user if they want to proceed (use the new
-- hash), or abort
declare
use User_Queries;
Response: String (1..1);
Last: Natural;
begin
Query_Manager.Start_Query;
loop
Query_Manager.Post_Query
(Prompt => "Repository"
& Repository_Index'Image (Order.Index)
& '(' & UBS.To_String (Repo.Location) & ')'
& " has been modified. Accept changes? (Y/[N]): ",
Default => "N",
Response_Size => Response'Length);
Query_Manager.Wait_Response (Response => Response,
Last => Last);
if Last < Response'First then
-- Default (N)
Response := "N";
end if;
exit when Response in "Y" | "y" | "N" | "n";
end loop;
Query_Manager.End_Query;
if Response in "Y" | "y" then
-- Update with new hash
Repo.Snapshot := Hash_String;
Repo.Cache_State := Available;
Repo.Cache_Path := Repo.Location;
Update_Repository (Index => Order.Index,
Updated => Repo);
Generate_Repo_Spec (Order.Index);
else
-- Abort
raise Ada.Assertions.Assertion_Error with
"Repository hash mismatch. User rejected changes.";
end if;
end;
else
-- Hash ok
Repo.Cache_State := Available;
Repo.Cache_Path := Repo.Location;
Update_Repository (Index => Order.Index,
Updated => Repo);
end if;
end if;
end Execute;
--------------
-- Dispatch --
--------------
procedure Dispatch (Repo: in Repository; Index: in Repository_Index) is
use Ada.Directories;
use type Ada.Containers.Count_Type;
package Path_Vectors is new Ada.Containers.Vectors
(Index_Type => Positive,
Element_Type => UBS.Unbounded_String,
"=" => UBS."=");
Path_Vector: Path_Vectors.Vector;
Group_Tracker: Progress.Progress_Tracker_Access
:= new Progress.Progress_Tracker;
New_Order: Hash_File_Order
:= (Tracker => Group_Tracker,
Hashes => new Stream_Hashing.Collective.Hash_Queues.Queue,
Index => Index,
others => <>);
Filter: constant Filter_Type := (Directory => True,
Ordinary_File => True,
Special_File => False);
procedure Recursive_Add (E: in Directory_Entry_Type);
procedure Recursive_Add (E: in Directory_Entry_Type) is
S_Name: constant String := Simple_Name (E);
begin
-- Don't process hidden files
if S_Name(S_Name'First) = '.' then
return;
end if;
if Kind (E) = Directory then
Search (Directory => Full_Name (E),
Pattern => "*",
Filter => Filter,
Process => Recursive_Add'Access);
else
Path_Vector.Append (UBS.To_Unbounded_String (Full_Name (E)));
end if;
end Recursive_Add;
begin
-- For System repositories, we want to make sure the AURA spec matches
if Repo.Format = System then
declare
use Ada.Streams.Stream_IO;
use Stream_Hashing;
AURA_Unit: constant Registrar.Library_Units.Library_Unit
:= Registrar.Queries.Lookup_Unit
(Unit_Names.Set_Name ("aura"));
Repo_AURA_Spec: File_Type;
Repo_AURA_Hash: Hash_Type;
begin
Open (File => Repo_AURA_Spec,
Mode => In_File,
Name => UBS.To_String (Repo.Cache_Path) & "/aura.ads");
Repo_AURA_Hash := Digest_Stream (Stream (Repo_AURA_Spec));
Ada.Assertions.Assert
(Check => Repo_AURA_Hash = AURA_Unit.Spec_File.Hash,
Message => "System repository's AURA package does not match "
& "the local AURA package");
end;
end if;
-- Start with the location of the repository, which shall be a directory
Search (Directory => UBS.To_String (Repo.Location),
Pattern => "*",
Filter => Filter,
Process => Recursive_Add'Access);
Ada.Assertions.Assert (Check => Path_Vector.Length > 0,
Message => "Location path is invalid");
-- Set up the group tracker and dispatch
Group_Tracker.Set_Total_Items (Natural (Path_Vector.Length));
-- Dispatch
for Path of Path_Vector loop
New_Order.Path := Path;
Workers.Enqueue_Order (New_Order);
end loop;
end Dispatch;
end Validate_Local_Or_System;
| true |
------------------------------------------------------------------------------
-- --
-- Ada User Repository Annex (AURA) --
-- Reference Implementation --
-- --
-- ------------------------------------------------------------------------ --
-- --
-- Copyright (C) 2020, ANNEXI-STRAYLINE Trans-Human Ltd. --
-- All rights reserved. --
-- --
-- Original Contributors: --
-- * PI:NAME:<NAME>END_PI (ANNEXI-STRAYLINE) --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- --
-- * Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A --
-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with Ada.Assertions;
with Ada.Directories;
with Ada.Unchecked_Deallocation;
with Ada.Containers.Vectors;
with Ada.Streams.Stream_IO;
with Unit_Names;
with User_Queries;
with Stream_Hashing.Collective;
with Registrar.Library_Units;
with Registrar.Queries;
separate (Repositories.Cache)
package body Validate_Local_Or_System is
type Hash_Queue_Access is
access Stream_Hashing.Collective.Hash_Queues.Queue;
--
-- Hash_File_Order
--
type Hash_File_Order is new Workers.Work_Order with
record
Path : UBS.Unbounded_String;
Hashes: Hash_Queue_Access;
-- The following is along for the ride - it will be used to
-- fill-out a Validate_Local_Or_System_Order in the Phase_Trigger
Index : Repository_Index;
end record;
overriding procedure Execute (Order: in out Hash_File_Order);
overriding procedure Phase_Trigger (Order: in out Hash_File_Order);
overriding function Image (Order: Hash_File_Order) return String;
--
-- Validate_Local_Or_System_Order
--
-- This order is actually called from the last Hash_File_Order, and
-- generates the collective hash, and then updates/validates the repo
type Validate_Local_Or_System_Order is new Workers.Work_Order with
record
Index : Repository_Index;
Hashes: Hash_Queue_Access;
end record;
overriding procedure Execute (Order: in out Validate_Local_Or_System_Order);
overriding function Image (Order: Validate_Local_Or_System_Order)
return String;
--
-- Hash_File_Order
--
-----------
-- Image --
-----------
function Image (Order: Hash_File_Order) return String
is ( "[Hash_File_Order] (Repositories.Cache.Validate_Local_Or_System)"
& New_Line
& " Path: " & UBS.To_String (Order.Path) & New_Line
& " (For validation/generation of Repository No."
& Repository_Index'Image (Order.Index) & ')');
-------------
-- Execute --
-------------
procedure Execute (Order: in out Hash_File_Order) is
use Ada.Streams.Stream_IO;
File: File_Type;
begin
Open (File => File,
Mode => In_File,
Name => UBS.To_String (Order.Path));
Order.Hashes.Enqueue
(Stream_Hashing.Digest_Stream (Stream (File)));
Close (File);
exception
when others =>
if Is_Open (File) then
Close (File);
end if;
raise;
end Execute;
-------------------
-- Phase_Trigger --
-------------------
-- This is executred one, when all Hash_Orders have been completed. We can
-- safely deallocate the dynamic tracker, and then submit a
-- Validate_Local_Or_System_Order, which handles the rest
procedure Phase_Trigger (Order: in out Hash_File_Order) is
procedure Free is new Ada.Unchecked_Deallocation
(Object => Progress.Progress_Tracker,
Name => Progress.Progress_Tracker_Access);
Next_Phase: Validate_Local_Or_System_Order
:= (Tracker => Caching_Progress'Access,
-- Note that Total_Items was incremented on the call to
-- Dispatch that got the whole proverbial ball rolling
Index => Order.Index,
Hashes => Order.Hashes);
begin
Free (Order.Tracker);
Workers.Enqueue_Order (Next_Phase);
end Phase_Trigger;
--
-- Validate_Local_Or_System_Order
--
-----------
-- Image --
-----------
function Image (Order: Validate_Local_Or_System_Order) return String
is ( "[Validate_Local_Or_System_Order] "
& "(Repositories.Cache.Validate_Local_Or_System)"
& New_Line
& " Repository No."
& Repository_Index'Image (Order.Index));
-------------
-- Execute --
-------------
procedure Execute (Order: in out Validate_Local_Or_System_Order) is
use Stream_Hashing;
use Stream_Hashing.Collective;
procedure Free is new Ada.Unchecked_Deallocation
(Object => Hash_Queues.Queue,
Name => Hash_Queue_Access);
Repo: Repository := Extract_Repository (Order.Index);
Collect_Hash: Hash_Type;
Hash_String : UBS.Unbounded_String;
begin
pragma Assert (Repo.Format in System | Local);
pragma Assert (Repo.Cache_State = Requested);
Compute_Collective_Hash (Hash_Queue => Order.Hashes.all,
Collective_Hash => Collect_Hash);
-- Release the queue
Free (Order.Hashes);
UBS.Set_Unbounded_String (Target => Hash_String,
Source => Collect_Hash.To_String);
if UBS.Length (Repo.Snapshot) = 0 then
-- New repo
Repo.Snapshot := Hash_String;
Repo.Cache_State := Available;
Repo.Cache_Path := Repo.Location;
Update_Repository (Index => Order.Index,
Updated => Repo);
Generate_Repo_Spec (Order.Index);
return;
else
-- Verify the hash
if Collect_Hash.To_String /= UBS.To_String (Repo.Snapshot) then
-- Mismatch. Ask the user if they want to proceed (use the new
-- hash), or abort
declare
use User_Queries;
Response: String (1..1);
Last: Natural;
begin
Query_Manager.Start_Query;
loop
Query_Manager.Post_Query
(Prompt => "Repository"
& Repository_Index'Image (Order.Index)
& '(' & UBS.To_String (Repo.Location) & ')'
& " has been modified. Accept changes? (Y/[N]): ",
Default => "N",
Response_Size => Response'Length);
Query_Manager.Wait_Response (Response => Response,
Last => Last);
if Last < Response'First then
-- Default (N)
Response := "N";
end if;
exit when Response in "Y" | "y" | "N" | "n";
end loop;
Query_Manager.End_Query;
if Response in "Y" | "y" then
-- Update with new hash
Repo.Snapshot := Hash_String;
Repo.Cache_State := Available;
Repo.Cache_Path := Repo.Location;
Update_Repository (Index => Order.Index,
Updated => Repo);
Generate_Repo_Spec (Order.Index);
else
-- Abort
raise Ada.Assertions.Assertion_Error with
"Repository hash mismatch. User rejected changes.";
end if;
end;
else
-- Hash ok
Repo.Cache_State := Available;
Repo.Cache_Path := Repo.Location;
Update_Repository (Index => Order.Index,
Updated => Repo);
end if;
end if;
end Execute;
--------------
-- Dispatch --
--------------
procedure Dispatch (Repo: in Repository; Index: in Repository_Index) is
use Ada.Directories;
use type Ada.Containers.Count_Type;
package Path_Vectors is new Ada.Containers.Vectors
(Index_Type => Positive,
Element_Type => UBS.Unbounded_String,
"=" => UBS."=");
Path_Vector: Path_Vectors.Vector;
Group_Tracker: Progress.Progress_Tracker_Access
:= new Progress.Progress_Tracker;
New_Order: Hash_File_Order
:= (Tracker => Group_Tracker,
Hashes => new Stream_Hashing.Collective.Hash_Queues.Queue,
Index => Index,
others => <>);
Filter: constant Filter_Type := (Directory => True,
Ordinary_File => True,
Special_File => False);
procedure Recursive_Add (E: in Directory_Entry_Type);
procedure Recursive_Add (E: in Directory_Entry_Type) is
S_Name: constant String := Simple_Name (E);
begin
-- Don't process hidden files
if S_Name(S_Name'First) = '.' then
return;
end if;
if Kind (E) = Directory then
Search (Directory => Full_Name (E),
Pattern => "*",
Filter => Filter,
Process => Recursive_Add'Access);
else
Path_Vector.Append (UBS.To_Unbounded_String (Full_Name (E)));
end if;
end Recursive_Add;
begin
-- For System repositories, we want to make sure the AURA spec matches
if Repo.Format = System then
declare
use Ada.Streams.Stream_IO;
use Stream_Hashing;
AURA_Unit: constant Registrar.Library_Units.Library_Unit
:= Registrar.Queries.Lookup_Unit
(Unit_Names.Set_Name ("aura"));
Repo_AURA_Spec: File_Type;
Repo_AURA_Hash: Hash_Type;
begin
Open (File => Repo_AURA_Spec,
Mode => In_File,
Name => UBS.To_String (Repo.Cache_Path) & "/aura.ads");
Repo_AURA_Hash := Digest_Stream (Stream (Repo_AURA_Spec));
Ada.Assertions.Assert
(Check => Repo_AURA_Hash = AURA_Unit.Spec_File.Hash,
Message => "System repository's AURA package does not match "
& "the local AURA package");
end;
end if;
-- Start with the location of the repository, which shall be a directory
Search (Directory => UBS.To_String (Repo.Location),
Pattern => "*",
Filter => Filter,
Process => Recursive_Add'Access);
Ada.Assertions.Assert (Check => Path_Vector.Length > 0,
Message => "Location path is invalid");
-- Set up the group tracker and dispatch
Group_Tracker.Set_Total_Items (Natural (Path_Vector.Length));
-- Dispatch
for Path of Path_Vector loop
New_Order.Path := Path;
Workers.Enqueue_Order (New_Order);
end loop;
end Dispatch;
end Validate_Local_Or_System;
|
[
{
"context": "-- part of AdaYaml, (c) 2017 Felix Krause\n-- released under the terms of the MIT license, ",
"end": 42,
"score": 0.9998404383659363,
"start": 30,
"tag": "NAME",
"value": "Felix Krause"
}
] |
test/src/yaml-loading_tests-suite.ads
|
robdaemon/AdaYaml
| 32 |
-- part of AdaYaml, (c) 2017 Felix Krause
-- released under the terms of the MIT license, see the file "copying.txt"
with AUnit.Test_Suites;
package Yaml.Loading_Tests.Suite is
function Suite return AUnit.Test_Suites.Access_Test_Suite;
end Yaml.Loading_Tests.Suite;
|
21236
|
-- part of AdaYaml, (c) 2017 <NAME>
-- released under the terms of the MIT license, see the file "copying.txt"
with AUnit.Test_Suites;
package Yaml.Loading_Tests.Suite is
function Suite return AUnit.Test_Suites.Access_Test_Suite;
end Yaml.Loading_Tests.Suite;
| true |
-- part of AdaYaml, (c) 2017 PI:NAME:<NAME>END_PI
-- released under the terms of the MIT license, see the file "copying.txt"
with AUnit.Test_Suites;
package Yaml.Loading_Tests.Suite is
function Suite return AUnit.Test_Suites.Access_Test_Suite;
end Yaml.Loading_Tests.Suite;
|
[
{
"context": "-- Copyright (c) 2019 Maxim Reznik <[email protected]>\n--\n-- SPDX-License-Identifi",
"end": 35,
"score": 0.9998459815979004,
"start": 23,
"tag": "NAME",
"value": "Maxim Reznik"
},
{
"context": "-- Copyright (c) 2019 Maxim Reznik <[email protected]>\n--\n-- SPDX-License-Identifier: MIT\n-- License-",
"end": 55,
"score": 0.9999305009841919,
"start": 37,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
source/nodes/program-nodes-identifiers.ads
|
optikos/oasis
| 0 |
-- Copyright (c) 2019 Maxim Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Lexical_Elements;
with Program.Elements.Identifiers;
with Program.Element_Visitors;
package Program.Nodes.Identifiers is
pragma Preelaborate;
type Identifier is
new Program.Nodes.Node and Program.Elements.Identifiers.Identifier
and Program.Elements.Identifiers.Identifier_Text
with private;
function Create
(Identifier_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return Identifier;
type Implicit_Identifier is
new Program.Nodes.Node and Program.Elements.Identifiers.Identifier
with private;
function Create
(Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Identifier
with Pre =>
Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance;
private
type Base_Identifier is
abstract new Program.Nodes.Node
and Program.Elements.Identifiers.Identifier
with null record;
procedure Initialize (Self : aliased in out Base_Identifier'Class);
overriding procedure Visit
(Self : not null access Base_Identifier;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class);
overriding function Is_Identifier_Element
(Self : Base_Identifier)
return Boolean;
overriding function Is_Expression_Element
(Self : Base_Identifier)
return Boolean;
type Identifier is
new Base_Identifier and Program.Elements.Identifiers.Identifier_Text
with record
Identifier_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
end record;
overriding function To_Identifier_Text
(Self : aliased in out Identifier)
return Program.Elements.Identifiers.Identifier_Text_Access;
overriding function Identifier_Token
(Self : Identifier)
return not null Program.Lexical_Elements.Lexical_Element_Access;
overriding function Image (Self : Identifier) return Text;
type Implicit_Identifier is
new Base_Identifier
with record
Is_Part_Of_Implicit : Boolean;
Is_Part_Of_Inherited : Boolean;
Is_Part_Of_Instance : Boolean;
end record;
overriding function To_Identifier_Text
(Self : aliased in out Implicit_Identifier)
return Program.Elements.Identifiers.Identifier_Text_Access;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Identifier)
return Boolean;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Identifier)
return Boolean;
overriding function Is_Part_Of_Instance
(Self : Implicit_Identifier)
return Boolean;
overriding function Image (Self : Implicit_Identifier) return Text;
end Program.Nodes.Identifiers;
|
21040
|
-- Copyright (c) 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Lexical_Elements;
with Program.Elements.Identifiers;
with Program.Element_Visitors;
package Program.Nodes.Identifiers is
pragma Preelaborate;
type Identifier is
new Program.Nodes.Node and Program.Elements.Identifiers.Identifier
and Program.Elements.Identifiers.Identifier_Text
with private;
function Create
(Identifier_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return Identifier;
type Implicit_Identifier is
new Program.Nodes.Node and Program.Elements.Identifiers.Identifier
with private;
function Create
(Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Identifier
with Pre =>
Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance;
private
type Base_Identifier is
abstract new Program.Nodes.Node
and Program.Elements.Identifiers.Identifier
with null record;
procedure Initialize (Self : aliased in out Base_Identifier'Class);
overriding procedure Visit
(Self : not null access Base_Identifier;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class);
overriding function Is_Identifier_Element
(Self : Base_Identifier)
return Boolean;
overriding function Is_Expression_Element
(Self : Base_Identifier)
return Boolean;
type Identifier is
new Base_Identifier and Program.Elements.Identifiers.Identifier_Text
with record
Identifier_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
end record;
overriding function To_Identifier_Text
(Self : aliased in out Identifier)
return Program.Elements.Identifiers.Identifier_Text_Access;
overriding function Identifier_Token
(Self : Identifier)
return not null Program.Lexical_Elements.Lexical_Element_Access;
overriding function Image (Self : Identifier) return Text;
type Implicit_Identifier is
new Base_Identifier
with record
Is_Part_Of_Implicit : Boolean;
Is_Part_Of_Inherited : Boolean;
Is_Part_Of_Instance : Boolean;
end record;
overriding function To_Identifier_Text
(Self : aliased in out Implicit_Identifier)
return Program.Elements.Identifiers.Identifier_Text_Access;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Identifier)
return Boolean;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Identifier)
return Boolean;
overriding function Is_Part_Of_Instance
(Self : Implicit_Identifier)
return Boolean;
overriding function Image (Self : Implicit_Identifier) return Text;
end Program.Nodes.Identifiers;
| true |
-- Copyright (c) 2019 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Lexical_Elements;
with Program.Elements.Identifiers;
with Program.Element_Visitors;
package Program.Nodes.Identifiers is
pragma Preelaborate;
type Identifier is
new Program.Nodes.Node and Program.Elements.Identifiers.Identifier
and Program.Elements.Identifiers.Identifier_Text
with private;
function Create
(Identifier_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return Identifier;
type Implicit_Identifier is
new Program.Nodes.Node and Program.Elements.Identifiers.Identifier
with private;
function Create
(Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Identifier
with Pre =>
Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance;
private
type Base_Identifier is
abstract new Program.Nodes.Node
and Program.Elements.Identifiers.Identifier
with null record;
procedure Initialize (Self : aliased in out Base_Identifier'Class);
overriding procedure Visit
(Self : not null access Base_Identifier;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class);
overriding function Is_Identifier_Element
(Self : Base_Identifier)
return Boolean;
overriding function Is_Expression_Element
(Self : Base_Identifier)
return Boolean;
type Identifier is
new Base_Identifier and Program.Elements.Identifiers.Identifier_Text
with record
Identifier_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
end record;
overriding function To_Identifier_Text
(Self : aliased in out Identifier)
return Program.Elements.Identifiers.Identifier_Text_Access;
overriding function Identifier_Token
(Self : Identifier)
return not null Program.Lexical_Elements.Lexical_Element_Access;
overriding function Image (Self : Identifier) return Text;
type Implicit_Identifier is
new Base_Identifier
with record
Is_Part_Of_Implicit : Boolean;
Is_Part_Of_Inherited : Boolean;
Is_Part_Of_Instance : Boolean;
end record;
overriding function To_Identifier_Text
(Self : aliased in out Implicit_Identifier)
return Program.Elements.Identifiers.Identifier_Text_Access;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Identifier)
return Boolean;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Identifier)
return Boolean;
overriding function Is_Part_Of_Instance
(Self : Implicit_Identifier)
return Boolean;
overriding function Image (Self : Implicit_Identifier) return Text;
end Program.Nodes.Identifiers;
|
[
{
"context": " --\n-- Copyright © 2010, Vadim Godunko <[email protected]> --\n-- Al",
"end": 824,
"score": 0.9998855590820312,
"start": 811,
"tag": "NAME",
"value": "Vadim Godunko"
},
{
"context": " --\n-- Copyright © 2010, Vadim Godunko <[email protected]> --\n-- All rights reserved. ",
"end": 844,
"score": 0.999933123588562,
"start": 826,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
source/league/matreshka-internals-regexps-compiler-optimizer.adb
|
svn2github/matreshka
| 24 |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- Optimizations:
--
-- 1. Remove subtree starting from the repetition node with bounds {0,0}
-- including the repetition node. When the parent node is alternative then
-- it is removed also and replaced by filling other path in its place.
--
-- 2. Two sequencial anchor nodes merged into the one node.
package body Matreshka.Internals.Regexps.Compiler.Optimizer is
procedure Analyze_Node
(Pattern : not null Shared_Pattern_Access;
Node : Natural;
Restart : in out Boolean);
procedure Remove_Subtree
(Pattern : not null Shared_Pattern_Access;
Node : Natural);
procedure Prepend
(Pattern : not null Shared_Pattern_Access;
List : Node_List_Index;
From : Node_List_Index);
------------------
-- Analyze_Node --
------------------
procedure Analyze_Node
(Pattern : not null Shared_Pattern_Access;
Node : Natural;
Restart : in out Boolean)
is
Next : constant Natural := Get_Next_Sibling (Pattern, Node);
-- Current node can be removed from the list, so it is safer
-- to cache next sibling node.
begin
case Pattern.AST (Node).Kind is
when N_Subexpression =>
Analyze_Node (Pattern, Get_Expression (Pattern, Node), Restart);
when N_Character_Class =>
Analyze_Node (Pattern, Get_Members (Pattern, Node), Restart);
when N_Multiplicity =>
if Get_Lower_Bound (Pattern, Node) = 0
and then Get_Upper_Bound (Pattern, Node) = 0
then
-- Subexpression is never looked in the string, reconstruct
-- tree to remove this repetition node and its subtree.
Remove_Subtree (Pattern, Node);
Restart := True;
elsif Get_Lower_Bound (Pattern, Node) = 1
and then Get_Upper_Bound (Pattern, Node) = 1
then
-- Subexpression is looked only once, reconstruct tree to
-- merge subtree of this repetition node instead on this
-- repetition node.
null;
end if;
if not Restart then
Analyze_Node (Pattern, Get_Expression (Pattern, Node), Restart);
end if;
when N_Alternation =>
Analyze_Node (Pattern, Get_Preferred (Pattern, Node), Restart);
if not Restart then
Analyze_Node (Pattern, Get_Fallback (Pattern, Node), Restart);
end if;
when N_Anchor =>
declare
Previous : constant Natural
:= Get_Previous_Sibling (Pattern, Node);
begin
if Previous /= 0
and then Pattern.AST (Previous).Kind = N_Anchor
then
-- Merge two sequencial anchor nodes into one.
Pattern.AST (Previous).Start_Of_Line :=
Pattern.AST (Previous).Start_Of_Line
or Pattern.AST (Node).Start_Of_Line;
Pattern.AST (Previous).End_Of_Line :=
Pattern.AST (Previous).End_Of_Line
or Pattern.AST (Node).End_Of_Line;
Remove_Subtree (Pattern, Node);
end if;
end;
when others =>
null;
end case;
if not Restart and then Next /= 0 then
Analyze_Node (Pattern, Next, Restart);
end if;
end Analyze_Node;
--------------
-- Optimize --
--------------
procedure Optimize (Pattern : not null Shared_Pattern_Access) is
Restart : Boolean;
begin
loop
Restart := False;
Analyze_Node (Pattern, Pattern.List (Pattern.Start).Head, Restart);
exit when not Restart;
end loop;
end Optimize;
-------------
-- Prepend --
-------------
procedure Prepend
(Pattern : not null Shared_Pattern_Access;
List : Node_List_Index;
From : Node_List_Index)
is
Current : Natural := Pattern.List (From).Tail;
Previous : Natural;
begin
while Current /= 0 loop
Previous := Get_Previous_Sibling (Pattern, Current);
Pattern.AST (Current).List := List;
Pattern.AST (Current).Previous := 0;
Pattern.AST (Current).Next := Pattern.List (List).Head;
if Pattern.List (List).Head = 0 then
Pattern.List (List).Tail := Current;
else
Pattern.AST (Pattern.List (List).Head).Previous := Current;
end if;
Pattern.List (List).Head := Current;
Current := Previous;
end loop;
end Prepend;
--------------------
-- Remove_Subtree --
--------------------
procedure Remove_Subtree
(Pattern : not null Shared_Pattern_Access;
Node : Natural)
is
List : constant Node_List_Index := Pattern.AST (Node).List;
Previous : constant Natural := Get_Previous_Sibling (Pattern, Node);
Next : constant Natural := Get_Next_Sibling (Pattern, Node);
Parent : constant Natural := Pattern.List (List).Parent;
begin
if Previous = 0 and then Next = 0 then
case Pattern.AST (Parent).Kind is
when N_Alternation =>
declare
Previous : constant Natural
:= Get_Previous_Sibling (Pattern, Parent);
Next : constant Natural
:= Get_Next_Sibling (Pattern, Parent);
begin
if Previous = 0 and then Next = 0 then
Pattern.List (Pattern.AST (Parent).List).Head := 0;
Pattern.List (Pattern.AST (Parent).List).Tail := 0;
elsif Previous = 0 then
Pattern.List (Pattern.AST (Parent).List).Head := Next;
Pattern.AST (Next).Previous := 0;
elsif Next = 0 then
Pattern.List (Pattern.AST (Parent).List).Tail := Previous;
Pattern.AST (Previous).Next := 0;
else
Pattern.AST (Next).Previous := Previous;
Pattern.AST (Previous).Next := Next;
end if;
end;
if Pattern.AST (Parent).Preferred = List then
Prepend
(Pattern,
Pattern.AST (Parent).List,
Pattern.AST (Parent).Fallback);
else
Prepend
(Pattern,
Pattern.AST (Parent).List,
Pattern.AST (Parent).Preferred);
end if;
Pattern.AST (Parent) := (Kind => N_None);
when N_Multiplicity =>
Remove_Subtree (Pattern, Pattern.List (List).Parent);
when N_Subexpression =>
Remove_Subtree (Pattern, Pattern.List (List).Parent);
when others =>
raise Program_Error;
end case;
elsif Previous = 0 then
Pattern.List (List).Head := Next;
Pattern.AST (Next).Previous := 0;
elsif Next = 0 then
Pattern.List (List).Tail := Previous;
Pattern.AST (Previous).Next := 0;
else
Pattern.AST (Next).Previous := Previous;
Pattern.AST (Previous).Next := Next;
end if;
end Remove_Subtree;
end Matreshka.Internals.Regexps.Compiler.Optimizer;
|
14287
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- Optimizations:
--
-- 1. Remove subtree starting from the repetition node with bounds {0,0}
-- including the repetition node. When the parent node is alternative then
-- it is removed also and replaced by filling other path in its place.
--
-- 2. Two sequencial anchor nodes merged into the one node.
package body Matreshka.Internals.Regexps.Compiler.Optimizer is
procedure Analyze_Node
(Pattern : not null Shared_Pattern_Access;
Node : Natural;
Restart : in out Boolean);
procedure Remove_Subtree
(Pattern : not null Shared_Pattern_Access;
Node : Natural);
procedure Prepend
(Pattern : not null Shared_Pattern_Access;
List : Node_List_Index;
From : Node_List_Index);
------------------
-- Analyze_Node --
------------------
procedure Analyze_Node
(Pattern : not null Shared_Pattern_Access;
Node : Natural;
Restart : in out Boolean)
is
Next : constant Natural := Get_Next_Sibling (Pattern, Node);
-- Current node can be removed from the list, so it is safer
-- to cache next sibling node.
begin
case Pattern.AST (Node).Kind is
when N_Subexpression =>
Analyze_Node (Pattern, Get_Expression (Pattern, Node), Restart);
when N_Character_Class =>
Analyze_Node (Pattern, Get_Members (Pattern, Node), Restart);
when N_Multiplicity =>
if Get_Lower_Bound (Pattern, Node) = 0
and then Get_Upper_Bound (Pattern, Node) = 0
then
-- Subexpression is never looked in the string, reconstruct
-- tree to remove this repetition node and its subtree.
Remove_Subtree (Pattern, Node);
Restart := True;
elsif Get_Lower_Bound (Pattern, Node) = 1
and then Get_Upper_Bound (Pattern, Node) = 1
then
-- Subexpression is looked only once, reconstruct tree to
-- merge subtree of this repetition node instead on this
-- repetition node.
null;
end if;
if not Restart then
Analyze_Node (Pattern, Get_Expression (Pattern, Node), Restart);
end if;
when N_Alternation =>
Analyze_Node (Pattern, Get_Preferred (Pattern, Node), Restart);
if not Restart then
Analyze_Node (Pattern, Get_Fallback (Pattern, Node), Restart);
end if;
when N_Anchor =>
declare
Previous : constant Natural
:= Get_Previous_Sibling (Pattern, Node);
begin
if Previous /= 0
and then Pattern.AST (Previous).Kind = N_Anchor
then
-- Merge two sequencial anchor nodes into one.
Pattern.AST (Previous).Start_Of_Line :=
Pattern.AST (Previous).Start_Of_Line
or Pattern.AST (Node).Start_Of_Line;
Pattern.AST (Previous).End_Of_Line :=
Pattern.AST (Previous).End_Of_Line
or Pattern.AST (Node).End_Of_Line;
Remove_Subtree (Pattern, Node);
end if;
end;
when others =>
null;
end case;
if not Restart and then Next /= 0 then
Analyze_Node (Pattern, Next, Restart);
end if;
end Analyze_Node;
--------------
-- Optimize --
--------------
procedure Optimize (Pattern : not null Shared_Pattern_Access) is
Restart : Boolean;
begin
loop
Restart := False;
Analyze_Node (Pattern, Pattern.List (Pattern.Start).Head, Restart);
exit when not Restart;
end loop;
end Optimize;
-------------
-- Prepend --
-------------
procedure Prepend
(Pattern : not null Shared_Pattern_Access;
List : Node_List_Index;
From : Node_List_Index)
is
Current : Natural := Pattern.List (From).Tail;
Previous : Natural;
begin
while Current /= 0 loop
Previous := Get_Previous_Sibling (Pattern, Current);
Pattern.AST (Current).List := List;
Pattern.AST (Current).Previous := 0;
Pattern.AST (Current).Next := Pattern.List (List).Head;
if Pattern.List (List).Head = 0 then
Pattern.List (List).Tail := Current;
else
Pattern.AST (Pattern.List (List).Head).Previous := Current;
end if;
Pattern.List (List).Head := Current;
Current := Previous;
end loop;
end Prepend;
--------------------
-- Remove_Subtree --
--------------------
procedure Remove_Subtree
(Pattern : not null Shared_Pattern_Access;
Node : Natural)
is
List : constant Node_List_Index := Pattern.AST (Node).List;
Previous : constant Natural := Get_Previous_Sibling (Pattern, Node);
Next : constant Natural := Get_Next_Sibling (Pattern, Node);
Parent : constant Natural := Pattern.List (List).Parent;
begin
if Previous = 0 and then Next = 0 then
case Pattern.AST (Parent).Kind is
when N_Alternation =>
declare
Previous : constant Natural
:= Get_Previous_Sibling (Pattern, Parent);
Next : constant Natural
:= Get_Next_Sibling (Pattern, Parent);
begin
if Previous = 0 and then Next = 0 then
Pattern.List (Pattern.AST (Parent).List).Head := 0;
Pattern.List (Pattern.AST (Parent).List).Tail := 0;
elsif Previous = 0 then
Pattern.List (Pattern.AST (Parent).List).Head := Next;
Pattern.AST (Next).Previous := 0;
elsif Next = 0 then
Pattern.List (Pattern.AST (Parent).List).Tail := Previous;
Pattern.AST (Previous).Next := 0;
else
Pattern.AST (Next).Previous := Previous;
Pattern.AST (Previous).Next := Next;
end if;
end;
if Pattern.AST (Parent).Preferred = List then
Prepend
(Pattern,
Pattern.AST (Parent).List,
Pattern.AST (Parent).Fallback);
else
Prepend
(Pattern,
Pattern.AST (Parent).List,
Pattern.AST (Parent).Preferred);
end if;
Pattern.AST (Parent) := (Kind => N_None);
when N_Multiplicity =>
Remove_Subtree (Pattern, Pattern.List (List).Parent);
when N_Subexpression =>
Remove_Subtree (Pattern, Pattern.List (List).Parent);
when others =>
raise Program_Error;
end case;
elsif Previous = 0 then
Pattern.List (List).Head := Next;
Pattern.AST (Next).Previous := 0;
elsif Next = 0 then
Pattern.List (List).Tail := Previous;
Pattern.AST (Previous).Next := 0;
else
Pattern.AST (Next).Previous := Previous;
Pattern.AST (Previous).Next := Next;
end if;
end Remove_Subtree;
end Matreshka.Internals.Regexps.Compiler.Optimizer;
| true |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010, PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- Optimizations:
--
-- 1. Remove subtree starting from the repetition node with bounds {0,0}
-- including the repetition node. When the parent node is alternative then
-- it is removed also and replaced by filling other path in its place.
--
-- 2. Two sequencial anchor nodes merged into the one node.
package body Matreshka.Internals.Regexps.Compiler.Optimizer is
procedure Analyze_Node
(Pattern : not null Shared_Pattern_Access;
Node : Natural;
Restart : in out Boolean);
procedure Remove_Subtree
(Pattern : not null Shared_Pattern_Access;
Node : Natural);
procedure Prepend
(Pattern : not null Shared_Pattern_Access;
List : Node_List_Index;
From : Node_List_Index);
------------------
-- Analyze_Node --
------------------
procedure Analyze_Node
(Pattern : not null Shared_Pattern_Access;
Node : Natural;
Restart : in out Boolean)
is
Next : constant Natural := Get_Next_Sibling (Pattern, Node);
-- Current node can be removed from the list, so it is safer
-- to cache next sibling node.
begin
case Pattern.AST (Node).Kind is
when N_Subexpression =>
Analyze_Node (Pattern, Get_Expression (Pattern, Node), Restart);
when N_Character_Class =>
Analyze_Node (Pattern, Get_Members (Pattern, Node), Restart);
when N_Multiplicity =>
if Get_Lower_Bound (Pattern, Node) = 0
and then Get_Upper_Bound (Pattern, Node) = 0
then
-- Subexpression is never looked in the string, reconstruct
-- tree to remove this repetition node and its subtree.
Remove_Subtree (Pattern, Node);
Restart := True;
elsif Get_Lower_Bound (Pattern, Node) = 1
and then Get_Upper_Bound (Pattern, Node) = 1
then
-- Subexpression is looked only once, reconstruct tree to
-- merge subtree of this repetition node instead on this
-- repetition node.
null;
end if;
if not Restart then
Analyze_Node (Pattern, Get_Expression (Pattern, Node), Restart);
end if;
when N_Alternation =>
Analyze_Node (Pattern, Get_Preferred (Pattern, Node), Restart);
if not Restart then
Analyze_Node (Pattern, Get_Fallback (Pattern, Node), Restart);
end if;
when N_Anchor =>
declare
Previous : constant Natural
:= Get_Previous_Sibling (Pattern, Node);
begin
if Previous /= 0
and then Pattern.AST (Previous).Kind = N_Anchor
then
-- Merge two sequencial anchor nodes into one.
Pattern.AST (Previous).Start_Of_Line :=
Pattern.AST (Previous).Start_Of_Line
or Pattern.AST (Node).Start_Of_Line;
Pattern.AST (Previous).End_Of_Line :=
Pattern.AST (Previous).End_Of_Line
or Pattern.AST (Node).End_Of_Line;
Remove_Subtree (Pattern, Node);
end if;
end;
when others =>
null;
end case;
if not Restart and then Next /= 0 then
Analyze_Node (Pattern, Next, Restart);
end if;
end Analyze_Node;
--------------
-- Optimize --
--------------
procedure Optimize (Pattern : not null Shared_Pattern_Access) is
Restart : Boolean;
begin
loop
Restart := False;
Analyze_Node (Pattern, Pattern.List (Pattern.Start).Head, Restart);
exit when not Restart;
end loop;
end Optimize;
-------------
-- Prepend --
-------------
procedure Prepend
(Pattern : not null Shared_Pattern_Access;
List : Node_List_Index;
From : Node_List_Index)
is
Current : Natural := Pattern.List (From).Tail;
Previous : Natural;
begin
while Current /= 0 loop
Previous := Get_Previous_Sibling (Pattern, Current);
Pattern.AST (Current).List := List;
Pattern.AST (Current).Previous := 0;
Pattern.AST (Current).Next := Pattern.List (List).Head;
if Pattern.List (List).Head = 0 then
Pattern.List (List).Tail := Current;
else
Pattern.AST (Pattern.List (List).Head).Previous := Current;
end if;
Pattern.List (List).Head := Current;
Current := Previous;
end loop;
end Prepend;
--------------------
-- Remove_Subtree --
--------------------
procedure Remove_Subtree
(Pattern : not null Shared_Pattern_Access;
Node : Natural)
is
List : constant Node_List_Index := Pattern.AST (Node).List;
Previous : constant Natural := Get_Previous_Sibling (Pattern, Node);
Next : constant Natural := Get_Next_Sibling (Pattern, Node);
Parent : constant Natural := Pattern.List (List).Parent;
begin
if Previous = 0 and then Next = 0 then
case Pattern.AST (Parent).Kind is
when N_Alternation =>
declare
Previous : constant Natural
:= Get_Previous_Sibling (Pattern, Parent);
Next : constant Natural
:= Get_Next_Sibling (Pattern, Parent);
begin
if Previous = 0 and then Next = 0 then
Pattern.List (Pattern.AST (Parent).List).Head := 0;
Pattern.List (Pattern.AST (Parent).List).Tail := 0;
elsif Previous = 0 then
Pattern.List (Pattern.AST (Parent).List).Head := Next;
Pattern.AST (Next).Previous := 0;
elsif Next = 0 then
Pattern.List (Pattern.AST (Parent).List).Tail := Previous;
Pattern.AST (Previous).Next := 0;
else
Pattern.AST (Next).Previous := Previous;
Pattern.AST (Previous).Next := Next;
end if;
end;
if Pattern.AST (Parent).Preferred = List then
Prepend
(Pattern,
Pattern.AST (Parent).List,
Pattern.AST (Parent).Fallback);
else
Prepend
(Pattern,
Pattern.AST (Parent).List,
Pattern.AST (Parent).Preferred);
end if;
Pattern.AST (Parent) := (Kind => N_None);
when N_Multiplicity =>
Remove_Subtree (Pattern, Pattern.List (List).Parent);
when N_Subexpression =>
Remove_Subtree (Pattern, Pattern.List (List).Parent);
when others =>
raise Program_Error;
end case;
elsif Previous = 0 then
Pattern.List (List).Head := Next;
Pattern.AST (Next).Previous := 0;
elsif Next = 0 then
Pattern.List (List).Tail := Previous;
Pattern.AST (Previous).Next := 0;
else
Pattern.AST (Next).Previous := Previous;
Pattern.AST (Previous).Next := Next;
end if;
end Remove_Subtree;
end Matreshka.Internals.Regexps.Compiler.Optimizer;
|
[
{
"context": " --\n-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --\n-- All rig",
"end": 829,
"score": 0.9998876452445984,
"start": 816,
"tag": "NAME",
"value": "Vadim Godunko"
},
{
"context": " --\n-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --\n-- All rights reserved. ",
"end": 849,
"score": 0.999933123588562,
"start": 831,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
source/amf/uml/amf-uml-call_behavior_actions.ads
|
svn2github/matreshka
| 24 |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
-- A call behavior action is a call action that invokes a behavior directly
-- rather than invoking a behavioral feature that, in turn, results in the
-- invocation of that behavior. The argument values of the action are
-- available to the execution of the invoked behavior. For synchronous calls
-- the execution of the call behavior action waits until the execution of the
-- invoked behavior completes and a result is returned on its output pin. The
-- action completes immediately without a result, if the call is
-- asynchronous. In particular, the invoked behavior may be an activity.
------------------------------------------------------------------------------
limited with AMF.UML.Behaviors;
with AMF.UML.Call_Actions;
package AMF.UML.Call_Behavior_Actions is
pragma Preelaborate;
type UML_Call_Behavior_Action is limited interface
and AMF.UML.Call_Actions.UML_Call_Action;
type UML_Call_Behavior_Action_Access is
access all UML_Call_Behavior_Action'Class;
for UML_Call_Behavior_Action_Access'Storage_Size use 0;
not overriding function Get_Behavior
(Self : not null access constant UML_Call_Behavior_Action)
return AMF.UML.Behaviors.UML_Behavior_Access is abstract;
-- Getter of CallBehaviorAction::behavior.
--
-- The invoked behavior. It must be capable of accepting and returning
-- control.
not overriding procedure Set_Behavior
(Self : not null access UML_Call_Behavior_Action;
To : AMF.UML.Behaviors.UML_Behavior_Access) is abstract;
-- Setter of CallBehaviorAction::behavior.
--
-- The invoked behavior. It must be capable of accepting and returning
-- control.
end AMF.UML.Call_Behavior_Actions;
|
2733
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
-- A call behavior action is a call action that invokes a behavior directly
-- rather than invoking a behavioral feature that, in turn, results in the
-- invocation of that behavior. The argument values of the action are
-- available to the execution of the invoked behavior. For synchronous calls
-- the execution of the call behavior action waits until the execution of the
-- invoked behavior completes and a result is returned on its output pin. The
-- action completes immediately without a result, if the call is
-- asynchronous. In particular, the invoked behavior may be an activity.
------------------------------------------------------------------------------
limited with AMF.UML.Behaviors;
with AMF.UML.Call_Actions;
package AMF.UML.Call_Behavior_Actions is
pragma Preelaborate;
type UML_Call_Behavior_Action is limited interface
and AMF.UML.Call_Actions.UML_Call_Action;
type UML_Call_Behavior_Action_Access is
access all UML_Call_Behavior_Action'Class;
for UML_Call_Behavior_Action_Access'Storage_Size use 0;
not overriding function Get_Behavior
(Self : not null access constant UML_Call_Behavior_Action)
return AMF.UML.Behaviors.UML_Behavior_Access is abstract;
-- Getter of CallBehaviorAction::behavior.
--
-- The invoked behavior. It must be capable of accepting and returning
-- control.
not overriding procedure Set_Behavior
(Self : not null access UML_Call_Behavior_Action;
To : AMF.UML.Behaviors.UML_Behavior_Access) is abstract;
-- Setter of CallBehaviorAction::behavior.
--
-- The invoked behavior. It must be capable of accepting and returning
-- control.
end AMF.UML.Call_Behavior_Actions;
| true |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
-- A call behavior action is a call action that invokes a behavior directly
-- rather than invoking a behavioral feature that, in turn, results in the
-- invocation of that behavior. The argument values of the action are
-- available to the execution of the invoked behavior. For synchronous calls
-- the execution of the call behavior action waits until the execution of the
-- invoked behavior completes and a result is returned on its output pin. The
-- action completes immediately without a result, if the call is
-- asynchronous. In particular, the invoked behavior may be an activity.
------------------------------------------------------------------------------
limited with AMF.UML.Behaviors;
with AMF.UML.Call_Actions;
package AMF.UML.Call_Behavior_Actions is
pragma Preelaborate;
type UML_Call_Behavior_Action is limited interface
and AMF.UML.Call_Actions.UML_Call_Action;
type UML_Call_Behavior_Action_Access is
access all UML_Call_Behavior_Action'Class;
for UML_Call_Behavior_Action_Access'Storage_Size use 0;
not overriding function Get_Behavior
(Self : not null access constant UML_Call_Behavior_Action)
return AMF.UML.Behaviors.UML_Behavior_Access is abstract;
-- Getter of CallBehaviorAction::behavior.
--
-- The invoked behavior. It must be capable of accepting and returning
-- control.
not overriding procedure Set_Behavior
(Self : not null access UML_Call_Behavior_Action;
To : AMF.UML.Behaviors.UML_Behavior_Access) is abstract;
-- Setter of CallBehaviorAction::behavior.
--
-- The invoked behavior. It must be capable of accepting and returning
-- control.
end AMF.UML.Call_Behavior_Actions;
|
[
{
"context": "-- SPDX-FileCopyrightText: 2020 Max Reznik <[email protected]>\n--\n-- SPDX-License-Identifi",
"end": 43,
"score": 0.9998582601547241,
"start": 33,
"tag": "NAME",
"value": "Max Reznik"
},
{
"context": "-- SPDX-FileCopyrightText: 2020 Max Reznik <[email protected]>\n--\n-- SPDX-License-Identifier: MIT\n------------",
"end": 63,
"score": 0.999929666519165,
"start": 45,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
sources/jupyter/jupyter-start_kernel-io_pubs.adb
|
reznikmm/jupyter
| 4 |
-- SPDX-FileCopyrightText: 2020 Max Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
----------------------------------------------------------------
separate (Jupyter.Start_Kernel)
package body IO_Pubs is
------------
-- Stream --
------------
overriding procedure Stream
(Self : in out IO_Pub;
Name : League.Strings.Universal_String;
Text : League.Strings.Universal_String)
is
Content : League.JSON.Objects.JSON_Object;
begin
Content.Insert
(+"name",
League.JSON.Values.To_JSON_Value (Name));
Content.Insert
(+"text",
League.JSON.Values.To_JSON_Value (Text));
Send_Message
(Self.Up.IOPub,
Self.Up.Msg_Id,
-(+"stream"),
Self.Up.Key,
"stream",
Self.Request,
Content);
end Stream;
overriding procedure Display_Data
(Self : in out IO_Pub;
Data : League.JSON.Objects.JSON_Object;
Metadata : League.JSON.Objects.JSON_Object;
Transient : League.JSON.Objects.JSON_Object) is null;
overriding procedure Update_Display_Data
(Self : in out IO_Pub;
Data : League.JSON.Objects.JSON_Object;
Metadata : League.JSON.Objects.JSON_Object;
Transient : League.JSON.Objects.JSON_Object) is null;
--------------------
-- Execute_Result --
--------------------
overriding procedure Execute_Result
(Self : in out IO_Pub;
Data : League.JSON.Objects.JSON_Object;
Metadata : League.JSON.Objects.JSON_Object;
Transient : League.JSON.Objects.JSON_Object)
is
Content : League.JSON.Objects.JSON_Object;
begin
Content.Insert
(+"execution_count",
League.JSON.Values.To_JSON_Value
(League.Holders.Universal_Integer (Self.Count)));
Content.Insert (+"data", Data.To_JSON_Value);
Content.Insert (+"metadata", Metadata.To_JSON_Value);
Content.Insert (+"transient", Transient.To_JSON_Value);
Send_Message
(Self.Up.IOPub,
Self.Up.Msg_Id,
-(+"execute_result"),
Self.Up.Key,
"execute_result",
Self.Request,
Content);
end Execute_Result;
overriding procedure Execute_Error
(Self : in out IO_Pub;
Value : Jupyter.Kernels.Execution_Error) is null;
overriding procedure Clear_Output
(Self : in out IO_Pub;
Wait : Boolean) is null;
overriding procedure Debug_Event
(Self : in out IO_Pub;
Content : League.JSON.Objects.JSON_Object) is null;
end IO_Pubs;
|
14544
|
-- SPDX-FileCopyrightText: 2020 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
----------------------------------------------------------------
separate (Jupyter.Start_Kernel)
package body IO_Pubs is
------------
-- Stream --
------------
overriding procedure Stream
(Self : in out IO_Pub;
Name : League.Strings.Universal_String;
Text : League.Strings.Universal_String)
is
Content : League.JSON.Objects.JSON_Object;
begin
Content.Insert
(+"name",
League.JSON.Values.To_JSON_Value (Name));
Content.Insert
(+"text",
League.JSON.Values.To_JSON_Value (Text));
Send_Message
(Self.Up.IOPub,
Self.Up.Msg_Id,
-(+"stream"),
Self.Up.Key,
"stream",
Self.Request,
Content);
end Stream;
overriding procedure Display_Data
(Self : in out IO_Pub;
Data : League.JSON.Objects.JSON_Object;
Metadata : League.JSON.Objects.JSON_Object;
Transient : League.JSON.Objects.JSON_Object) is null;
overriding procedure Update_Display_Data
(Self : in out IO_Pub;
Data : League.JSON.Objects.JSON_Object;
Metadata : League.JSON.Objects.JSON_Object;
Transient : League.JSON.Objects.JSON_Object) is null;
--------------------
-- Execute_Result --
--------------------
overriding procedure Execute_Result
(Self : in out IO_Pub;
Data : League.JSON.Objects.JSON_Object;
Metadata : League.JSON.Objects.JSON_Object;
Transient : League.JSON.Objects.JSON_Object)
is
Content : League.JSON.Objects.JSON_Object;
begin
Content.Insert
(+"execution_count",
League.JSON.Values.To_JSON_Value
(League.Holders.Universal_Integer (Self.Count)));
Content.Insert (+"data", Data.To_JSON_Value);
Content.Insert (+"metadata", Metadata.To_JSON_Value);
Content.Insert (+"transient", Transient.To_JSON_Value);
Send_Message
(Self.Up.IOPub,
Self.Up.Msg_Id,
-(+"execute_result"),
Self.Up.Key,
"execute_result",
Self.Request,
Content);
end Execute_Result;
overriding procedure Execute_Error
(Self : in out IO_Pub;
Value : Jupyter.Kernels.Execution_Error) is null;
overriding procedure Clear_Output
(Self : in out IO_Pub;
Wait : Boolean) is null;
overriding procedure Debug_Event
(Self : in out IO_Pub;
Content : League.JSON.Objects.JSON_Object) is null;
end IO_Pubs;
| true |
-- SPDX-FileCopyrightText: 2020 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>
--
-- SPDX-License-Identifier: MIT
----------------------------------------------------------------
separate (Jupyter.Start_Kernel)
package body IO_Pubs is
------------
-- Stream --
------------
overriding procedure Stream
(Self : in out IO_Pub;
Name : League.Strings.Universal_String;
Text : League.Strings.Universal_String)
is
Content : League.JSON.Objects.JSON_Object;
begin
Content.Insert
(+"name",
League.JSON.Values.To_JSON_Value (Name));
Content.Insert
(+"text",
League.JSON.Values.To_JSON_Value (Text));
Send_Message
(Self.Up.IOPub,
Self.Up.Msg_Id,
-(+"stream"),
Self.Up.Key,
"stream",
Self.Request,
Content);
end Stream;
overriding procedure Display_Data
(Self : in out IO_Pub;
Data : League.JSON.Objects.JSON_Object;
Metadata : League.JSON.Objects.JSON_Object;
Transient : League.JSON.Objects.JSON_Object) is null;
overriding procedure Update_Display_Data
(Self : in out IO_Pub;
Data : League.JSON.Objects.JSON_Object;
Metadata : League.JSON.Objects.JSON_Object;
Transient : League.JSON.Objects.JSON_Object) is null;
--------------------
-- Execute_Result --
--------------------
overriding procedure Execute_Result
(Self : in out IO_Pub;
Data : League.JSON.Objects.JSON_Object;
Metadata : League.JSON.Objects.JSON_Object;
Transient : League.JSON.Objects.JSON_Object)
is
Content : League.JSON.Objects.JSON_Object;
begin
Content.Insert
(+"execution_count",
League.JSON.Values.To_JSON_Value
(League.Holders.Universal_Integer (Self.Count)));
Content.Insert (+"data", Data.To_JSON_Value);
Content.Insert (+"metadata", Metadata.To_JSON_Value);
Content.Insert (+"transient", Transient.To_JSON_Value);
Send_Message
(Self.Up.IOPub,
Self.Up.Msg_Id,
-(+"execute_result"),
Self.Up.Key,
"execute_result",
Self.Request,
Content);
end Execute_Result;
overriding procedure Execute_Error
(Self : in out IO_Pub;
Value : Jupyter.Kernels.Execution_Error) is null;
overriding procedure Clear_Output
(Self : in out IO_Pub;
Wait : Boolean) is null;
overriding procedure Debug_Event
(Self : in out IO_Pub;
Content : League.JSON.Objects.JSON_Object) is null;
end IO_Pubs;
|
[
{
"context": "with Ada.Integer_Text_IO;\n\n-- Copyright 2021 Melwyn Francis Carlo\n\nprocedure A001 is\n\n use Ada.Integer_Text_IO;\n\n",
"end": 66,
"score": 0.999847412109375,
"start": 46,
"tag": "NAME",
"value": "Melwyn Francis Carlo"
}
] |
problems/001/a001.adb
|
melwyncarlo/ProjectEuler
| 0 |
with Ada.Integer_Text_IO;
-- Copyright 2021 Melwyn Francis Carlo
procedure A001 is
use Ada.Integer_Text_IO;
Val_1A, Val_1B, Val_2A, Val_2B, Val_3A, Val_3B : Float;
begin
Val_1A := Float'Floor ((1000.0 - 1.0) / 3.0);
Val_1B := 3.0 * ((Val_1A * (Val_1A + 1.0)) / 2.0);
Val_2A := Float'Floor ((1000.0 - 1.0) / 5.0);
Val_2B := 5.0 * ((Val_2A * (Val_2A + 1.0)) / 2.0);
Val_3A := Float'Floor ((1000.0 - 1.0) / 15.0);
Val_3B := 15.0 * ((Val_3A * (Val_3A + 1.0)) / 2.0);
Put (Integer (Val_1B + Val_2B - Val_3B), Width => 0);
end A001;
|
27106
|
with Ada.Integer_Text_IO;
-- Copyright 2021 <NAME>
procedure A001 is
use Ada.Integer_Text_IO;
Val_1A, Val_1B, Val_2A, Val_2B, Val_3A, Val_3B : Float;
begin
Val_1A := Float'Floor ((1000.0 - 1.0) / 3.0);
Val_1B := 3.0 * ((Val_1A * (Val_1A + 1.0)) / 2.0);
Val_2A := Float'Floor ((1000.0 - 1.0) / 5.0);
Val_2B := 5.0 * ((Val_2A * (Val_2A + 1.0)) / 2.0);
Val_3A := Float'Floor ((1000.0 - 1.0) / 15.0);
Val_3B := 15.0 * ((Val_3A * (Val_3A + 1.0)) / 2.0);
Put (Integer (Val_1B + Val_2B - Val_3B), Width => 0);
end A001;
| true |
with Ada.Integer_Text_IO;
-- Copyright 2021 PI:NAME:<NAME>END_PI
procedure A001 is
use Ada.Integer_Text_IO;
Val_1A, Val_1B, Val_2A, Val_2B, Val_3A, Val_3B : Float;
begin
Val_1A := Float'Floor ((1000.0 - 1.0) / 3.0);
Val_1B := 3.0 * ((Val_1A * (Val_1A + 1.0)) / 2.0);
Val_2A := Float'Floor ((1000.0 - 1.0) / 5.0);
Val_2B := 5.0 * ((Val_2A * (Val_2A + 1.0)) / 2.0);
Val_3A := Float'Floor ((1000.0 - 1.0) / 15.0);
Val_3B := 15.0 * ((Val_3A * (Val_3A + 1.0)) / 2.0);
Put (Integer (Val_1B + Val_2B - Val_3B), Width => 0);
end A001;
|
[
{
"context": "ug - 2006; 27 - Aug - 2006\r\n -- Author : G. de Montmollin - public domain code\r\n --------------------------",
"end": 411,
"score": 0.999875545501709,
"start": 395,
"tag": "NAME",
"value": "G. de Montmollin"
}
] |
Sources/Globe_3d/float_portable_binary_transfer.ads
|
ForYouEyesOnly/Space-Convoy
| 1 |
------------------------------------------------------------------------------
-- File : Float_portable_binary_transfer.ads
-- Description : Split & merge floating - point numbers into integers to
-- facilitate a portable transfer, including Input - Output
-- Date / Version : 2 - Sep - 2006; 28 - Aug - 2006; 27 - Aug - 2006
-- Author : G. de Montmollin - public domain code
------------------------------------------------------------------------------
generic
type Num is digits <>;
type Mantissa_type is range <>;
type Exponent_type is range <>;
-- If one is not sure that 'Machine_Mantissa and 'Machine_Radis
-- will be the same on the machine performing Split than on the
-- machine performing Merge, it is better to impose the mantissa scaling
imposed_mantissa : Boolean; -- choice
imposed_scaling : Num; -- factor from fraction to mantissa value
package Float_portable_binary_transfer is
procedure Split (f : in Num; m : out Mantissa_type; e : out Exponent_type);
procedure Merge (m : in Mantissa_type; e : in Exponent_type; f : out Num);
-- Split / Merge in two parts (e.g. for transporting a Long_Float
-- when the compiler has only up to 32 - bit integers. For splitting,
-- the scaling factor is applied once for m1, then a second time for m2.
procedure Split (f : in Num; m1, m2 : out Mantissa_type; e : out Exponent_type);
procedure Merge (m1, m2 : in Mantissa_type; e : in Exponent_type; f : out Num);
end Float_portable_binary_transfer;
|
26089
|
------------------------------------------------------------------------------
-- File : Float_portable_binary_transfer.ads
-- Description : Split & merge floating - point numbers into integers to
-- facilitate a portable transfer, including Input - Output
-- Date / Version : 2 - Sep - 2006; 28 - Aug - 2006; 27 - Aug - 2006
-- Author : <NAME> - public domain code
------------------------------------------------------------------------------
generic
type Num is digits <>;
type Mantissa_type is range <>;
type Exponent_type is range <>;
-- If one is not sure that 'Machine_Mantissa and 'Machine_Radis
-- will be the same on the machine performing Split than on the
-- machine performing Merge, it is better to impose the mantissa scaling
imposed_mantissa : Boolean; -- choice
imposed_scaling : Num; -- factor from fraction to mantissa value
package Float_portable_binary_transfer is
procedure Split (f : in Num; m : out Mantissa_type; e : out Exponent_type);
procedure Merge (m : in Mantissa_type; e : in Exponent_type; f : out Num);
-- Split / Merge in two parts (e.g. for transporting a Long_Float
-- when the compiler has only up to 32 - bit integers. For splitting,
-- the scaling factor is applied once for m1, then a second time for m2.
procedure Split (f : in Num; m1, m2 : out Mantissa_type; e : out Exponent_type);
procedure Merge (m1, m2 : in Mantissa_type; e : in Exponent_type; f : out Num);
end Float_portable_binary_transfer;
| true |
------------------------------------------------------------------------------
-- File : Float_portable_binary_transfer.ads
-- Description : Split & merge floating - point numbers into integers to
-- facilitate a portable transfer, including Input - Output
-- Date / Version : 2 - Sep - 2006; 28 - Aug - 2006; 27 - Aug - 2006
-- Author : PI:NAME:<NAME>END_PI - public domain code
------------------------------------------------------------------------------
generic
type Num is digits <>;
type Mantissa_type is range <>;
type Exponent_type is range <>;
-- If one is not sure that 'Machine_Mantissa and 'Machine_Radis
-- will be the same on the machine performing Split than on the
-- machine performing Merge, it is better to impose the mantissa scaling
imposed_mantissa : Boolean; -- choice
imposed_scaling : Num; -- factor from fraction to mantissa value
package Float_portable_binary_transfer is
procedure Split (f : in Num; m : out Mantissa_type; e : out Exponent_type);
procedure Merge (m : in Mantissa_type; e : in Exponent_type; f : out Num);
-- Split / Merge in two parts (e.g. for transporting a Long_Float
-- when the compiler has only up to 32 - bit integers. For splitting,
-- the scaling factor is applied once for m1, then a second time for m2.
procedure Split (f : in Num; m1, m2 : out Mantissa_type; e : out Exponent_type);
procedure Merge (m1, m2 : in Mantissa_type; e : in Exponent_type; f : out Num);
end Float_portable_binary_transfer;
|
[
{
"context": "hts reserved.\n--\n-- This software was developed by John Self of the Arcadia project\n-- at the University of Ca",
"end": 133,
"score": 0.9998466968536377,
"start": 124,
"tag": "NAME",
"value": "John Self"
},
{
"context": "RPOSE.\n\n-- TITLE command line interface\n-- AUTHOR: John Self (UCI)\n-- DESCRIPTION command line interface body ",
"end": 979,
"score": 0.9998512864112854,
"start": 970,
"tag": "NAME",
"value": "John Self"
}
] |
aflex/src/telesoft/command_lineB.ada
|
irion7/aflex-ayacc-mirror
| 1 |
-- Copyright (c) 1990 Regents of the University of California.
-- All rights reserved.
--
-- This software was developed by John Self of the Arcadia project
-- at the University of California, Irvine.
--
-- Redistribution and use in source and binary forms are permitted
-- provided that the above copyright notice and this paragraph are
-- duplicated in all such forms and that any documentation,
-- advertising materials, and other materials related to such
-- distribution and use acknowledge that the software was developed
-- by the University of California, Irvine. The name of the
-- University may not be used to endorse or promote products derived
-- from this software without specific prior written permission.
-- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-- TITLE command line interface
-- AUTHOR: John Self (UCI)
-- DESCRIPTION command line interface body for use with
-- the Telesoft TeleGen2 Sun Ada 1.3a system.
-- NOTES this file is system dependent
-- $Header: /co/ua/self/arcadia/aflex/ada/src/telesoft/RCS/command_lineB.ada,v 1.1 90/01/12 15:13:59 self Exp Locker: self $
with TSTRING; use TSTRING;
with SYSTEM;
package body COMMAND_LINE_INTERFACE is
procedure INITIALIZE_COMMAND_LINE is
POSITION : INTEGER;
ARG_LEN : INTEGER;
ARGUMENT : STRING(1 .. 1000);
function GET_ARGUMENT(PARAMETER_1 : in INTEGER;
PARAMETER_2 : in SYSTEM.ADDRESS) return INTEGER;
pragma INTERFACE(UNIX, GET_ARGUMENT);
begin
POSITION := 0;
loop
ARG_LEN := GET_ARGUMENT(POSITION, ARGUMENT'ADDRESS);
if (ARG_LEN = 0) then
exit;
end if;
ARGV(POSITION) := VSTR(ARGUMENT(1 .. ARG_LEN));
POSITION := POSITION + 1;
end loop;
ARGC := POSITION;
end INITIALIZE_COMMAND_LINE;
end COMMAND_LINE_INTERFACE;
|
19323
|
-- Copyright (c) 1990 Regents of the University of California.
-- All rights reserved.
--
-- This software was developed by <NAME> of the Arcadia project
-- at the University of California, Irvine.
--
-- Redistribution and use in source and binary forms are permitted
-- provided that the above copyright notice and this paragraph are
-- duplicated in all such forms and that any documentation,
-- advertising materials, and other materials related to such
-- distribution and use acknowledge that the software was developed
-- by the University of California, Irvine. The name of the
-- University may not be used to endorse or promote products derived
-- from this software without specific prior written permission.
-- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-- TITLE command line interface
-- AUTHOR: <NAME> (UCI)
-- DESCRIPTION command line interface body for use with
-- the Telesoft TeleGen2 Sun Ada 1.3a system.
-- NOTES this file is system dependent
-- $Header: /co/ua/self/arcadia/aflex/ada/src/telesoft/RCS/command_lineB.ada,v 1.1 90/01/12 15:13:59 self Exp Locker: self $
with TSTRING; use TSTRING;
with SYSTEM;
package body COMMAND_LINE_INTERFACE is
procedure INITIALIZE_COMMAND_LINE is
POSITION : INTEGER;
ARG_LEN : INTEGER;
ARGUMENT : STRING(1 .. 1000);
function GET_ARGUMENT(PARAMETER_1 : in INTEGER;
PARAMETER_2 : in SYSTEM.ADDRESS) return INTEGER;
pragma INTERFACE(UNIX, GET_ARGUMENT);
begin
POSITION := 0;
loop
ARG_LEN := GET_ARGUMENT(POSITION, ARGUMENT'ADDRESS);
if (ARG_LEN = 0) then
exit;
end if;
ARGV(POSITION) := VSTR(ARGUMENT(1 .. ARG_LEN));
POSITION := POSITION + 1;
end loop;
ARGC := POSITION;
end INITIALIZE_COMMAND_LINE;
end COMMAND_LINE_INTERFACE;
| true |
-- Copyright (c) 1990 Regents of the University of California.
-- All rights reserved.
--
-- This software was developed by PI:NAME:<NAME>END_PI of the Arcadia project
-- at the University of California, Irvine.
--
-- Redistribution and use in source and binary forms are permitted
-- provided that the above copyright notice and this paragraph are
-- duplicated in all such forms and that any documentation,
-- advertising materials, and other materials related to such
-- distribution and use acknowledge that the software was developed
-- by the University of California, Irvine. The name of the
-- University may not be used to endorse or promote products derived
-- from this software without specific prior written permission.
-- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-- TITLE command line interface
-- AUTHOR: PI:NAME:<NAME>END_PI (UCI)
-- DESCRIPTION command line interface body for use with
-- the Telesoft TeleGen2 Sun Ada 1.3a system.
-- NOTES this file is system dependent
-- $Header: /co/ua/self/arcadia/aflex/ada/src/telesoft/RCS/command_lineB.ada,v 1.1 90/01/12 15:13:59 self Exp Locker: self $
with TSTRING; use TSTRING;
with SYSTEM;
package body COMMAND_LINE_INTERFACE is
procedure INITIALIZE_COMMAND_LINE is
POSITION : INTEGER;
ARG_LEN : INTEGER;
ARGUMENT : STRING(1 .. 1000);
function GET_ARGUMENT(PARAMETER_1 : in INTEGER;
PARAMETER_2 : in SYSTEM.ADDRESS) return INTEGER;
pragma INTERFACE(UNIX, GET_ARGUMENT);
begin
POSITION := 0;
loop
ARG_LEN := GET_ARGUMENT(POSITION, ARGUMENT'ADDRESS);
if (ARG_LEN = 0) then
exit;
end if;
ARGV(POSITION) := VSTR(ARGUMENT(1 .. ARG_LEN));
POSITION := POSITION + 1;
end loop;
ARGC := POSITION;
end INITIALIZE_COMMAND_LINE;
end COMMAND_LINE_INTERFACE;
|
[
{
"context": "n Linux/Unix-like systems.\n\n-- Copyright (c) 2015, James Humphry - see LICENSE file for details\n\nwith Ada.Streams,",
"end": 226,
"score": 0.9998712539672852,
"start": 213,
"tag": "NAME",
"value": "James Humphry"
}
] |
src/entropy-urandom/siphash-entropy.adb
|
jhumphry/SPARK_SipHash
| 5 |
-- SipHash.Entropy
-- A child package that attempts to set the key from an entropy source on the
-- system.
-- This implementation loads bytes from /dev/urandom on Linux/Unix-like systems.
-- Copyright (c) 2015, James Humphry - see LICENSE file for details
with Ada.Streams, Ada.Streams.Stream_IO;
use Ada.Streams;
with System.Storage_Elements;
use System.Storage_Elements;
package body SipHash.Entropy
with SPARK_Mode => Off
is
pragma Compile_Time_Error (Storage_Element'Size > Stream_Element'Size,
"Cannot read entropy from /dev/urandom due to "&
"mis-matched Storage_Element'Size and "&
"Stream_Element'Size");
function System_Entropy_Source return Boolean is
(True);
procedure Set_Key_From_System_Entropy is
use Ada.Streams.Stream_IO;
Key : SipHash_Key;
Buffer : Stream_Element_Array(1..16);
Last : Stream_Element_Offset;
Dev_Urandom : File_Type;
begin
begin
Open(File => Dev_Urandom,
Mode => In_File,
Name => "/dev/urandom");
Read(File => Dev_Urandom,
Item => Buffer,
Last => Last);
exception
when others =>
raise Entropy_Unavailable
with "IO error when reading /dev/urandom.";
end;
if Last /= 16 then
raise Entropy_Unavailable
with "Insufficient entropy read from /dev/urandom.";
end if;
for I in Key'Range loop
Key(I) := Storage_Element'Mod(Buffer(Stream_Element_Offset(I)));
end loop;
Set_Key(Key);
end Set_Key_From_System_Entropy;
procedure Set_Key_From_System_Entropy (Success : out Boolean) is
begin
Set_Key_From_System_Entropy;
Success := True;
exception
when Entropy_Unavailable =>
Success := False;
end Set_Key_From_System_Entropy;
end SipHash.Entropy;
|
20994
|
-- SipHash.Entropy
-- A child package that attempts to set the key from an entropy source on the
-- system.
-- This implementation loads bytes from /dev/urandom on Linux/Unix-like systems.
-- Copyright (c) 2015, <NAME> - see LICENSE file for details
with Ada.Streams, Ada.Streams.Stream_IO;
use Ada.Streams;
with System.Storage_Elements;
use System.Storage_Elements;
package body SipHash.Entropy
with SPARK_Mode => Off
is
pragma Compile_Time_Error (Storage_Element'Size > Stream_Element'Size,
"Cannot read entropy from /dev/urandom due to "&
"mis-matched Storage_Element'Size and "&
"Stream_Element'Size");
function System_Entropy_Source return Boolean is
(True);
procedure Set_Key_From_System_Entropy is
use Ada.Streams.Stream_IO;
Key : SipHash_Key;
Buffer : Stream_Element_Array(1..16);
Last : Stream_Element_Offset;
Dev_Urandom : File_Type;
begin
begin
Open(File => Dev_Urandom,
Mode => In_File,
Name => "/dev/urandom");
Read(File => Dev_Urandom,
Item => Buffer,
Last => Last);
exception
when others =>
raise Entropy_Unavailable
with "IO error when reading /dev/urandom.";
end;
if Last /= 16 then
raise Entropy_Unavailable
with "Insufficient entropy read from /dev/urandom.";
end if;
for I in Key'Range loop
Key(I) := Storage_Element'Mod(Buffer(Stream_Element_Offset(I)));
end loop;
Set_Key(Key);
end Set_Key_From_System_Entropy;
procedure Set_Key_From_System_Entropy (Success : out Boolean) is
begin
Set_Key_From_System_Entropy;
Success := True;
exception
when Entropy_Unavailable =>
Success := False;
end Set_Key_From_System_Entropy;
end SipHash.Entropy;
| true |
-- SipHash.Entropy
-- A child package that attempts to set the key from an entropy source on the
-- system.
-- This implementation loads bytes from /dev/urandom on Linux/Unix-like systems.
-- Copyright (c) 2015, PI:NAME:<NAME>END_PI - see LICENSE file for details
with Ada.Streams, Ada.Streams.Stream_IO;
use Ada.Streams;
with System.Storage_Elements;
use System.Storage_Elements;
package body SipHash.Entropy
with SPARK_Mode => Off
is
pragma Compile_Time_Error (Storage_Element'Size > Stream_Element'Size,
"Cannot read entropy from /dev/urandom due to "&
"mis-matched Storage_Element'Size and "&
"Stream_Element'Size");
function System_Entropy_Source return Boolean is
(True);
procedure Set_Key_From_System_Entropy is
use Ada.Streams.Stream_IO;
Key : SipHash_Key;
Buffer : Stream_Element_Array(1..16);
Last : Stream_Element_Offset;
Dev_Urandom : File_Type;
begin
begin
Open(File => Dev_Urandom,
Mode => In_File,
Name => "/dev/urandom");
Read(File => Dev_Urandom,
Item => Buffer,
Last => Last);
exception
when others =>
raise Entropy_Unavailable
with "IO error when reading /dev/urandom.";
end;
if Last /= 16 then
raise Entropy_Unavailable
with "Insufficient entropy read from /dev/urandom.";
end if;
for I in Key'Range loop
Key(I) := Storage_Element'Mod(Buffer(Stream_Element_Offset(I)));
end loop;
Set_Key(Key);
end Set_Key_From_System_Entropy;
procedure Set_Key_From_System_Entropy (Success : out Boolean) is
begin
Set_Key_From_System_Entropy;
Success := True;
exception
when Entropy_Unavailable =>
Success := False;
end Set_Key_From_System_Entropy;
end SipHash.Entropy;
|
[
{
"context": "t -- REST API support\n-- Copyright (C) 2012, 2013 Stephane Carrez\n-- Written by Stephane Carrez (Stephane.Carrez@g",
"end": 155,
"score": 0.9998771548271179,
"start": 140,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "ight (C) 2012, 2013 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under",
"end": 186,
"score": 0.9998816251754761,
"start": 171,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "3 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under the Apache License, Versio",
"end": 213,
"score": 0.9999243021011353,
"start": 188,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
src/http/util-http-rest-rest_get_vector.adb
|
Letractively/ada-util
| 0 |
-----------------------------------------------------------------------
-- util-http-rest -- REST API support
-- Copyright (C) 2012, 2013 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Serialize.IO.JSON;
-- -----------------------
-- Execute an HTTP GET operation on the given <b>URI</b> and parse the JSON response
-- into the target object refered to by <b>Into</b> by using the mapping described
-- in <b>Mapping</b>.
-- -----------------------
procedure Util.Http.Rest.Rest_Get_Vector (URI : in String;
Mapping : in Util.Serialize.Mappers.Mapper_Access;
Path : in String := "";
Into : in Vector_Mapper.Vector_Type_Access) is
Http : Util.Http.Rest.Client;
Reader : Util.Serialize.IO.JSON.Parser;
begin
Reader.Add_Mapping (Path, Mapping.all'Access);
Vector_Mapper.Set_Context (Reader, Into);
Http.Get (URI, Reader);
end Util.Http.Rest.Rest_Get_Vector;
|
4697
|
-----------------------------------------------------------------------
-- util-http-rest -- REST API support
-- Copyright (C) 2012, 2013 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Serialize.IO.JSON;
-- -----------------------
-- Execute an HTTP GET operation on the given <b>URI</b> and parse the JSON response
-- into the target object refered to by <b>Into</b> by using the mapping described
-- in <b>Mapping</b>.
-- -----------------------
procedure Util.Http.Rest.Rest_Get_Vector (URI : in String;
Mapping : in Util.Serialize.Mappers.Mapper_Access;
Path : in String := "";
Into : in Vector_Mapper.Vector_Type_Access) is
Http : Util.Http.Rest.Client;
Reader : Util.Serialize.IO.JSON.Parser;
begin
Reader.Add_Mapping (Path, Mapping.all'Access);
Vector_Mapper.Set_Context (Reader, Into);
Http.Get (URI, Reader);
end Util.Http.Rest.Rest_Get_Vector;
| true |
-----------------------------------------------------------------------
-- util-http-rest -- REST API support
-- Copyright (C) 2012, 2013 PI:NAME:<NAME>END_PI
-- Written by PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Serialize.IO.JSON;
-- -----------------------
-- Execute an HTTP GET operation on the given <b>URI</b> and parse the JSON response
-- into the target object refered to by <b>Into</b> by using the mapping described
-- in <b>Mapping</b>.
-- -----------------------
procedure Util.Http.Rest.Rest_Get_Vector (URI : in String;
Mapping : in Util.Serialize.Mappers.Mapper_Access;
Path : in String := "";
Into : in Vector_Mapper.Vector_Type_Access) is
Http : Util.Http.Rest.Client;
Reader : Util.Serialize.IO.JSON.Parser;
begin
Reader.Add_Mapping (Path, Mapping.all'Access);
Vector_Mapper.Set_Context (Reader, Into);
Http.Get (URI, Reader);
end Util.Http.Rest.Rest_Get_Vector;
|
[
{
"context": "-- part of OpenGLAda, (c) 2017 Felix Krause\n-- released under the terms of the MIT license, ",
"end": 44,
"score": 0.9998384714126587,
"start": 32,
"tag": "NAME",
"value": "Felix Krause"
}
] |
src/gl/implementation/gl-objects-shaders.adb
|
Roldak/OpenGLAda
| 79 |
-- part of OpenGLAda, (c) 2017 Felix Krause
-- released under the terms of the MIT license, see the file "COPYING"
with GL.API;
with GL.Enums;
package body GL.Objects.Shaders is
procedure Set_Source (Subject : Shader; Source : String) is
C_Source : C.char_array := C.To_C (Source);
begin
API.Shader_Source (Subject.Reference.GL_Id, 1,
(1 => C_Source (0)'Unchecked_Access),
(1 => Source'Length));
Raise_Exception_On_OpenGL_Error;
end Set_Source;
function Source (Subject : Shader) return String is
Source_Length : Size := 0;
begin
API.Get_Shader_Param (Subject.Reference.GL_Id,
Enums.Shader_Source_Length, Source_Length);
Raise_Exception_On_OpenGL_Error;
if Source_Length = 0 then
return "";
else
declare
Shader_Source : String (1 .. Integer (Source_Length));
begin
API.Get_Shader_Source (Subject.Reference.GL_Id, Source_Length,
Source_Length, Shader_Source);
Raise_Exception_On_OpenGL_Error;
return Shader_Source (1 .. Integer (Source_Length));
end;
end if;
end Source;
procedure Compile (Subject : Shader) is
begin
API.Compile_Shader (Subject.Reference.GL_Id);
Raise_Exception_On_OpenGL_Error;
end Compile;
procedure Release_Shader_Compiler is
begin
API.Release_Shader_Compiler.all;
end Release_Shader_Compiler;
function Compile_Status (Subject : Shader) return Boolean is
Value : Int := 0;
begin
API.Get_Shader_Param (Subject.Reference.GL_Id, Enums.Compile_Status,
Value);
Raise_Exception_On_OpenGL_Error;
return Value /= 0;
end Compile_Status;
function Info_Log (Subject : Shader) return String is
Log_Length : Size := 0;
begin
API.Get_Shader_Param (Subject.Reference.GL_Id,
Enums.Info_Log_Length, Log_Length);
Raise_Exception_On_OpenGL_Error;
if Log_Length = 0 then
return "";
else
declare
Info_Log : String (1 .. Integer (Log_Length));
begin
API.Get_Shader_Info_Log (Subject.Reference.GL_Id, Log_Length,
Log_Length, Info_Log);
Raise_Exception_On_OpenGL_Error;
return Info_Log (1 .. Integer (Log_Length));
end;
end if;
end Info_Log;
overriding
procedure Internal_Create_Id (Object : Shader; Id : out UInt) is
begin
Id := API.Create_Shader (Object.Kind);
Raise_Exception_On_OpenGL_Error;
end Internal_Create_Id;
overriding
procedure Internal_Release_Id (Object : Shader; Id : UInt) is
pragma Unreferenced (Object);
begin
API.Delete_Shader (Id);
Raise_Exception_On_OpenGL_Error;
end Internal_Release_Id;
function Create_From_Id (Id : UInt) return Shader is
Kind : Shader_Type := Shader_Type'First;
begin
API.Get_Shader_Type (Id, Enums.Shader_Type, Kind);
Raise_Exception_On_OpenGL_Error;
return Object : Shader (Kind) do
Object.Set_Raw_Id (Id, False);
end return;
end Create_From_Id;
end GL.Objects.Shaders;
|
20709
|
-- part of OpenGLAda, (c) 2017 <NAME>
-- released under the terms of the MIT license, see the file "COPYING"
with GL.API;
with GL.Enums;
package body GL.Objects.Shaders is
procedure Set_Source (Subject : Shader; Source : String) is
C_Source : C.char_array := C.To_C (Source);
begin
API.Shader_Source (Subject.Reference.GL_Id, 1,
(1 => C_Source (0)'Unchecked_Access),
(1 => Source'Length));
Raise_Exception_On_OpenGL_Error;
end Set_Source;
function Source (Subject : Shader) return String is
Source_Length : Size := 0;
begin
API.Get_Shader_Param (Subject.Reference.GL_Id,
Enums.Shader_Source_Length, Source_Length);
Raise_Exception_On_OpenGL_Error;
if Source_Length = 0 then
return "";
else
declare
Shader_Source : String (1 .. Integer (Source_Length));
begin
API.Get_Shader_Source (Subject.Reference.GL_Id, Source_Length,
Source_Length, Shader_Source);
Raise_Exception_On_OpenGL_Error;
return Shader_Source (1 .. Integer (Source_Length));
end;
end if;
end Source;
procedure Compile (Subject : Shader) is
begin
API.Compile_Shader (Subject.Reference.GL_Id);
Raise_Exception_On_OpenGL_Error;
end Compile;
procedure Release_Shader_Compiler is
begin
API.Release_Shader_Compiler.all;
end Release_Shader_Compiler;
function Compile_Status (Subject : Shader) return Boolean is
Value : Int := 0;
begin
API.Get_Shader_Param (Subject.Reference.GL_Id, Enums.Compile_Status,
Value);
Raise_Exception_On_OpenGL_Error;
return Value /= 0;
end Compile_Status;
function Info_Log (Subject : Shader) return String is
Log_Length : Size := 0;
begin
API.Get_Shader_Param (Subject.Reference.GL_Id,
Enums.Info_Log_Length, Log_Length);
Raise_Exception_On_OpenGL_Error;
if Log_Length = 0 then
return "";
else
declare
Info_Log : String (1 .. Integer (Log_Length));
begin
API.Get_Shader_Info_Log (Subject.Reference.GL_Id, Log_Length,
Log_Length, Info_Log);
Raise_Exception_On_OpenGL_Error;
return Info_Log (1 .. Integer (Log_Length));
end;
end if;
end Info_Log;
overriding
procedure Internal_Create_Id (Object : Shader; Id : out UInt) is
begin
Id := API.Create_Shader (Object.Kind);
Raise_Exception_On_OpenGL_Error;
end Internal_Create_Id;
overriding
procedure Internal_Release_Id (Object : Shader; Id : UInt) is
pragma Unreferenced (Object);
begin
API.Delete_Shader (Id);
Raise_Exception_On_OpenGL_Error;
end Internal_Release_Id;
function Create_From_Id (Id : UInt) return Shader is
Kind : Shader_Type := Shader_Type'First;
begin
API.Get_Shader_Type (Id, Enums.Shader_Type, Kind);
Raise_Exception_On_OpenGL_Error;
return Object : Shader (Kind) do
Object.Set_Raw_Id (Id, False);
end return;
end Create_From_Id;
end GL.Objects.Shaders;
| true |
-- part of OpenGLAda, (c) 2017 PI:NAME:<NAME>END_PI
-- released under the terms of the MIT license, see the file "COPYING"
with GL.API;
with GL.Enums;
package body GL.Objects.Shaders is
procedure Set_Source (Subject : Shader; Source : String) is
C_Source : C.char_array := C.To_C (Source);
begin
API.Shader_Source (Subject.Reference.GL_Id, 1,
(1 => C_Source (0)'Unchecked_Access),
(1 => Source'Length));
Raise_Exception_On_OpenGL_Error;
end Set_Source;
function Source (Subject : Shader) return String is
Source_Length : Size := 0;
begin
API.Get_Shader_Param (Subject.Reference.GL_Id,
Enums.Shader_Source_Length, Source_Length);
Raise_Exception_On_OpenGL_Error;
if Source_Length = 0 then
return "";
else
declare
Shader_Source : String (1 .. Integer (Source_Length));
begin
API.Get_Shader_Source (Subject.Reference.GL_Id, Source_Length,
Source_Length, Shader_Source);
Raise_Exception_On_OpenGL_Error;
return Shader_Source (1 .. Integer (Source_Length));
end;
end if;
end Source;
procedure Compile (Subject : Shader) is
begin
API.Compile_Shader (Subject.Reference.GL_Id);
Raise_Exception_On_OpenGL_Error;
end Compile;
procedure Release_Shader_Compiler is
begin
API.Release_Shader_Compiler.all;
end Release_Shader_Compiler;
function Compile_Status (Subject : Shader) return Boolean is
Value : Int := 0;
begin
API.Get_Shader_Param (Subject.Reference.GL_Id, Enums.Compile_Status,
Value);
Raise_Exception_On_OpenGL_Error;
return Value /= 0;
end Compile_Status;
function Info_Log (Subject : Shader) return String is
Log_Length : Size := 0;
begin
API.Get_Shader_Param (Subject.Reference.GL_Id,
Enums.Info_Log_Length, Log_Length);
Raise_Exception_On_OpenGL_Error;
if Log_Length = 0 then
return "";
else
declare
Info_Log : String (1 .. Integer (Log_Length));
begin
API.Get_Shader_Info_Log (Subject.Reference.GL_Id, Log_Length,
Log_Length, Info_Log);
Raise_Exception_On_OpenGL_Error;
return Info_Log (1 .. Integer (Log_Length));
end;
end if;
end Info_Log;
overriding
procedure Internal_Create_Id (Object : Shader; Id : out UInt) is
begin
Id := API.Create_Shader (Object.Kind);
Raise_Exception_On_OpenGL_Error;
end Internal_Create_Id;
overriding
procedure Internal_Release_Id (Object : Shader; Id : UInt) is
pragma Unreferenced (Object);
begin
API.Delete_Shader (Id);
Raise_Exception_On_OpenGL_Error;
end Internal_Release_Id;
function Create_From_Id (Id : UInt) return Shader is
Kind : Shader_Type := Shader_Type'First;
begin
API.Get_Shader_Type (Id, Enums.Shader_Type, Kind);
Raise_Exception_On_OpenGL_Error;
return Object : Shader (Kind) do
Object.Set_Raw_Id (Id, False);
end return;
end Create_From_Id;
end GL.Objects.Shaders;
|
[
{
"context": ": agar.gui.surface.surface_access_t;\n key : c.int;\n modkey : c.int;\n func : agar.core.eve",
"end": 8365,
"score": 0.9123015403747559,
"start": 8360,
"tag": "KEY",
"value": "c.int"
},
{
"context": "ce_access_t;\n key : c.int;\n modkey : c.int;\n func : agar.core.event.callback_t) return",
"end": 8386,
"score": 0.7034136056900024,
"start": 8383,
"tag": "KEY",
"value": "int"
},
{
"context": ": agar.gui.surface.surface_access_t;\n key : c.int;\n modkey : c.int;\n func : agar.core.eve",
"end": 9432,
"score": 0.9378244876861572,
"start": 9427,
"tag": "KEY",
"value": "c.int"
},
{
"context": "ce_access_t;\n key : c.int;\n modkey : c.int;\n func : agar.core.event.callback_t) return",
"end": 9453,
"score": 0.8678973317146301,
"start": 9450,
"tag": "KEY",
"value": "int"
},
{
"context": "gar.gui.surface.surface_access_t;\n key : c.int;\n modkey : c.int;\n func : agar.core.e",
"end": 10081,
"score": 0.6269998550415039,
"start": 10078,
"tag": "KEY",
"value": "int"
},
{
"context": "_access_t;\n key : c.int;\n modkey : c.int;\n func : agar.core.event.callback_t) retur",
"end": 10103,
"score": 0.6623427867889404,
"start": 10100,
"tag": "KEY",
"value": "int"
}
] |
ada/original_2008/ada-gui/agar-gui-widget-menu.adb
|
auzkok/libagar
| 286 |
package body agar.gui.widget.menu is
use type c.int;
package cbinds is
procedure expand
(menu : menu_access_t;
item : item_access_t;
x : c.int;
y : c.int);
pragma import (c, expand, "AG_MenuExpand");
procedure set_padding
(menu : menu_access_t;
left : c.int;
right : c.int;
top : c.int;
bottom : c.int);
pragma import (c, set_padding, "AG_MenuSetPadding");
procedure set_label_padding
(menu : menu_access_t;
left : c.int;
right : c.int;
top : c.int;
bottom : c.int);
pragma import (c, set_label_padding, "AG_MenuSetLabelPadding");
function node
(parent : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t) return item_access_t;
pragma import (c, node, "AG_MenuNode");
function action
(parent : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
func : agar.core.event.callback_t;
fmt : agar.core.types.void_ptr_t) return item_access_t;
pragma import (c, action, "AG_MenuAction");
function action_keyboard
(parent : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
key : c.int;
modkey : c.int;
func : agar.core.event.callback_t;
fmt : agar.core.types.void_ptr_t) return item_access_t;
pragma import (c, action_keyboard, "AG_MenuActionKb");
function dynamic_item
(parent : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
func : agar.core.event.callback_t;
fmt : agar.core.types.void_ptr_t) return item_access_t;
pragma import (c, dynamic_item, "AG_MenuDynamicItem");
function dynamic_item_keyboard
(parent : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
key : c.int;
modkey : c.int;
func : agar.core.event.callback_t;
fmt : agar.core.types.void_ptr_t) return item_access_t;
pragma import (c, dynamic_item_keyboard, "AG_MenuDynamicItemKb");
function toolbar_item
(parent : item_access_t;
toolbar : agar.gui.widget.toolbar.toolbar_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
key : c.int;
modkey : c.int;
func : agar.core.event.callback_t;
fmt : agar.core.types.void_ptr_t) return item_access_t;
pragma import (c, toolbar_item, "AG_MenuTool");
procedure set_label
(item : item_access_t;
label : cs.chars_ptr);
pragma import (c, set_label, "AG_MenuSetLabelS");
procedure set_poll_function
(item : item_access_t;
func : agar.core.event.callback_t;
fmt : agar.core.types.void_ptr_t);
pragma import (c, set_poll_function, "AG_MenuSetPollFn");
function bind_bool
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access c.int;
invert : c.int) return item_access_t;
pragma import (c, bind_bool, "agar_gui_widget_menu_bool");
function bind_bool_with_mutex
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access c.int;
invert : c.int;
mutex : agar.core.threads.mutex_t) return item_access_t;
pragma import (c, bind_bool_with_mutex, "AG_MenuIntBoolMp");
function bind_flags
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access mask_t;
flags : mask_t;
invert : c.int) return item_access_t;
pragma import (c, bind_flags, "agar_gui_widget_menu_int_flags");
function bind_flags_with_mutex
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access mask_t;
flags : mask_t;
invert : c.int;
mutex : agar.core.threads.mutex_t) return item_access_t;
pragma import (c, bind_flags_with_mutex, "AG_MenuIntFlagsMp");
function bind_flags8
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access mask8_t;
flags : mask8_t;
invert : c.int) return item_access_t;
pragma import (c, bind_flags8, "agar_gui_widget_menu_int_flags8");
function bind_flags8_with_mutex
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access mask8_t;
flags : mask8_t;
invert : c.int;
mutex : agar.core.threads.mutex_t) return item_access_t;
pragma import (c, bind_flags8_with_mutex, "AG_MenuInt8FlagsMp");
function bind_flags16
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access mask16_t;
flags : mask16_t;
invert : c.int) return item_access_t;
pragma import (c, bind_flags16, "agar_gui_widget_menu_int_flags16");
function bind_flags16_with_mutex
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access mask16_t;
flags : mask16_t;
invert : c.int;
mutex : agar.core.threads.mutex_t) return item_access_t;
pragma import (c, bind_flags16_with_mutex, "AG_MenuInt16FlagsMp");
function bind_flags32
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access mask32_t;
flags : mask32_t;
invert : c.int) return item_access_t;
pragma import (c, bind_flags32, "agar_gui_widget_menu_int_flags32");
function bind_flags32_with_mutex
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access mask32_t;
flags : mask32_t;
invert : c.int;
mutex : agar.core.threads.mutex_t) return item_access_t;
pragma import (c, bind_flags32_with_mutex, "AG_MenuInt32FlagsMp");
procedure section
(item : item_access_t;
text : cs.chars_ptr);
pragma import (c, section, "AG_MenuSectionS");
end cbinds;
procedure expand
(menu : menu_access_t;
item : item_access_t;
x : natural;
y : natural) is
begin
cbinds.expand
(menu => menu,
item => item,
x => c.int (x),
y => c.int (y));
end expand;
procedure set_padding
(menu : menu_access_t;
left : natural;
right : natural;
top : natural;
bottom : natural) is
begin
cbinds.set_padding
(menu => menu,
left => c.int (left),
right => c.int (right),
top => c.int (top),
bottom => c.int (bottom));
end set_padding;
procedure set_label_padding
(menu : menu_access_t;
left : natural;
right : natural;
top : natural;
bottom : natural) is
begin
cbinds.set_label_padding
(menu => menu,
left => c.int (left),
right => c.int (right),
top => c.int (top),
bottom => c.int (bottom));
end set_label_padding;
function node
(parent : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
begin
return cbinds.node
(parent => parent,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon);
end node;
function action
(parent : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
func : agar.core.event.callback_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
begin
return cbinds.action
(parent => parent,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
func => func,
fmt => agar.core.types.null_ptr);
end action;
function action_keyboard
(parent : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
key : c.int;
modkey : c.int;
func : agar.core.event.callback_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
begin
return cbinds.action_keyboard
(parent => parent,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
key => key,
modkey => modkey,
func => func,
fmt => agar.core.types.null_ptr);
end action_keyboard;
function dynamic_item
(parent : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
func : agar.core.event.callback_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
begin
return cbinds.dynamic_item
(parent => parent,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
func => func,
fmt => agar.core.types.null_ptr);
end dynamic_item;
function dynamic_item_keyboard
(parent : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
key : c.int;
modkey : c.int;
func : agar.core.event.callback_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
begin
return cbinds.dynamic_item_keyboard
(parent => parent,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
key => key,
modkey => modkey,
func => func,
fmt => agar.core.types.null_ptr);
end dynamic_item_keyboard;
function toolbar_item
(parent : item_access_t;
toolbar : agar.gui.widget.toolbar.toolbar_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
key : c.int;
modkey : c.int;
func : agar.core.event.callback_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
begin
return cbinds.toolbar_item
(parent => parent,
toolbar => toolbar,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
key => key,
modkey => modkey,
func => func,
fmt => agar.core.types.null_ptr);
end toolbar_item;
procedure set_label
(item : item_access_t;
label : string)
is
ca_label : aliased c.char_array := c.to_c (label);
begin
cbinds.set_label
(item => item,
label => cs.to_chars_ptr (ca_label'unchecked_access));
end set_label;
procedure set_poll_function
(item : item_access_t;
func : agar.core.event.callback_t) is
begin
cbinds.set_poll_function
(item => item,
func => func,
fmt => agar.core.types.null_ptr);
end set_poll_function;
function bind_bool
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access boolean;
invert : boolean) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
c_value : aliased c.int;
item_acc : item_access_t;
begin
if invert then c_invert := 1; end if;
item_acc := cbinds.bind_bool
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => c_value'unchecked_access,
invert => c_invert);
value.all := c_value = 1;
return item_acc;
end bind_bool;
function bind_bool_with_mutex
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access boolean;
invert : boolean;
mutex : agar.core.threads.mutex_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
c_value : aliased c.int;
item_acc : item_access_t;
begin
if invert then c_invert := 1; end if;
item_acc := cbinds.bind_bool_with_mutex
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => c_value'unchecked_access,
invert => c_invert,
mutex => mutex);
value.all := c_value = 1;
return item_acc;
end bind_bool_with_mutex;
function bind_flags
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access mask_t;
flags : mask_t;
invert : boolean) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
begin
if invert then c_invert := 1; end if;
return cbinds.bind_flags
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => value,
flags => flags,
invert => c_invert);
end bind_flags;
function bind_flags_with_mutex
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access mask_t;
flags : mask_t;
invert : boolean;
mutex : agar.core.threads.mutex_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
begin
if invert then c_invert := 1; end if;
return cbinds.bind_flags_with_mutex
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => value,
flags => flags,
invert => c_invert,
mutex => mutex);
end bind_flags_with_mutex;
function bind_flags8
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access mask8_t;
flags : mask8_t;
invert : boolean) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
begin
if invert then c_invert := 1; end if;
return cbinds.bind_flags8
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => value,
flags => flags,
invert => c_invert);
end bind_flags8;
function bind_flags8_with_mutex
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access mask8_t;
flags : mask8_t;
invert : boolean;
mutex : agar.core.threads.mutex_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
begin
if invert then c_invert := 1; end if;
return cbinds.bind_flags8_with_mutex
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => value,
flags => flags,
invert => c_invert,
mutex => mutex);
end bind_flags8_with_mutex;
function bind_flags16
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access mask16_t;
flags : mask16_t;
invert : boolean) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
begin
if invert then c_invert := 1; end if;
return cbinds.bind_flags16
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => value,
flags => flags,
invert => c_invert);
end bind_flags16;
function bind_flags16_with_mutex
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access mask16_t;
flags : mask16_t;
invert : boolean;
mutex : agar.core.threads.mutex_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
begin
if invert then c_invert := 1; end if;
return cbinds.bind_flags16_with_mutex
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => value,
flags => flags,
invert => c_invert,
mutex => mutex);
end bind_flags16_with_mutex;
function bind_flags32
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access mask32_t;
flags : mask32_t;
invert : boolean) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
begin
if invert then c_invert := 1; end if;
return cbinds.bind_flags32
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => value,
flags => flags,
invert => c_invert);
end bind_flags32;
function bind_flags32_with_mutex
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access mask32_t;
flags : mask32_t;
invert : boolean;
mutex : agar.core.threads.mutex_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
begin
if invert then c_invert := 1; end if;
return cbinds.bind_flags32_with_mutex
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => value,
flags => flags,
invert => c_invert,
mutex => mutex);
end bind_flags32_with_mutex;
procedure section
(item : item_access_t;
text : string)
is
ca_text : aliased c.char_array := c.to_c (text);
begin
cbinds.section
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access));
end section;
-- popup menus
package body popup is
package cbinds is
procedure show_at
(menu : popup_menu_access_t;
x : c.int;
y : c.int);
pragma import (c, show_at, "AG_PopupShowAt");
end cbinds;
procedure show_at
(menu : popup_menu_access_t;
x : natural;
y : natural) is
begin
cbinds.show_at
(menu => menu,
x => c.int (x),
y => c.int (y));
end show_at;
end popup;
function widget (menu : menu_access_t) return widget_access_t is
begin
return menu.widget'access;
end widget;
function widget (view : view_access_t) return widget_access_t is
begin
return view.widget'access;
end widget;
end agar.gui.widget.menu;
|
19187
|
package body agar.gui.widget.menu is
use type c.int;
package cbinds is
procedure expand
(menu : menu_access_t;
item : item_access_t;
x : c.int;
y : c.int);
pragma import (c, expand, "AG_MenuExpand");
procedure set_padding
(menu : menu_access_t;
left : c.int;
right : c.int;
top : c.int;
bottom : c.int);
pragma import (c, set_padding, "AG_MenuSetPadding");
procedure set_label_padding
(menu : menu_access_t;
left : c.int;
right : c.int;
top : c.int;
bottom : c.int);
pragma import (c, set_label_padding, "AG_MenuSetLabelPadding");
function node
(parent : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t) return item_access_t;
pragma import (c, node, "AG_MenuNode");
function action
(parent : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
func : agar.core.event.callback_t;
fmt : agar.core.types.void_ptr_t) return item_access_t;
pragma import (c, action, "AG_MenuAction");
function action_keyboard
(parent : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
key : c.int;
modkey : c.int;
func : agar.core.event.callback_t;
fmt : agar.core.types.void_ptr_t) return item_access_t;
pragma import (c, action_keyboard, "AG_MenuActionKb");
function dynamic_item
(parent : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
func : agar.core.event.callback_t;
fmt : agar.core.types.void_ptr_t) return item_access_t;
pragma import (c, dynamic_item, "AG_MenuDynamicItem");
function dynamic_item_keyboard
(parent : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
key : c.int;
modkey : c.int;
func : agar.core.event.callback_t;
fmt : agar.core.types.void_ptr_t) return item_access_t;
pragma import (c, dynamic_item_keyboard, "AG_MenuDynamicItemKb");
function toolbar_item
(parent : item_access_t;
toolbar : agar.gui.widget.toolbar.toolbar_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
key : c.int;
modkey : c.int;
func : agar.core.event.callback_t;
fmt : agar.core.types.void_ptr_t) return item_access_t;
pragma import (c, toolbar_item, "AG_MenuTool");
procedure set_label
(item : item_access_t;
label : cs.chars_ptr);
pragma import (c, set_label, "AG_MenuSetLabelS");
procedure set_poll_function
(item : item_access_t;
func : agar.core.event.callback_t;
fmt : agar.core.types.void_ptr_t);
pragma import (c, set_poll_function, "AG_MenuSetPollFn");
function bind_bool
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access c.int;
invert : c.int) return item_access_t;
pragma import (c, bind_bool, "agar_gui_widget_menu_bool");
function bind_bool_with_mutex
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access c.int;
invert : c.int;
mutex : agar.core.threads.mutex_t) return item_access_t;
pragma import (c, bind_bool_with_mutex, "AG_MenuIntBoolMp");
function bind_flags
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access mask_t;
flags : mask_t;
invert : c.int) return item_access_t;
pragma import (c, bind_flags, "agar_gui_widget_menu_int_flags");
function bind_flags_with_mutex
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access mask_t;
flags : mask_t;
invert : c.int;
mutex : agar.core.threads.mutex_t) return item_access_t;
pragma import (c, bind_flags_with_mutex, "AG_MenuIntFlagsMp");
function bind_flags8
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access mask8_t;
flags : mask8_t;
invert : c.int) return item_access_t;
pragma import (c, bind_flags8, "agar_gui_widget_menu_int_flags8");
function bind_flags8_with_mutex
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access mask8_t;
flags : mask8_t;
invert : c.int;
mutex : agar.core.threads.mutex_t) return item_access_t;
pragma import (c, bind_flags8_with_mutex, "AG_MenuInt8FlagsMp");
function bind_flags16
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access mask16_t;
flags : mask16_t;
invert : c.int) return item_access_t;
pragma import (c, bind_flags16, "agar_gui_widget_menu_int_flags16");
function bind_flags16_with_mutex
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access mask16_t;
flags : mask16_t;
invert : c.int;
mutex : agar.core.threads.mutex_t) return item_access_t;
pragma import (c, bind_flags16_with_mutex, "AG_MenuInt16FlagsMp");
function bind_flags32
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access mask32_t;
flags : mask32_t;
invert : c.int) return item_access_t;
pragma import (c, bind_flags32, "agar_gui_widget_menu_int_flags32");
function bind_flags32_with_mutex
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access mask32_t;
flags : mask32_t;
invert : c.int;
mutex : agar.core.threads.mutex_t) return item_access_t;
pragma import (c, bind_flags32_with_mutex, "AG_MenuInt32FlagsMp");
procedure section
(item : item_access_t;
text : cs.chars_ptr);
pragma import (c, section, "AG_MenuSectionS");
end cbinds;
procedure expand
(menu : menu_access_t;
item : item_access_t;
x : natural;
y : natural) is
begin
cbinds.expand
(menu => menu,
item => item,
x => c.int (x),
y => c.int (y));
end expand;
procedure set_padding
(menu : menu_access_t;
left : natural;
right : natural;
top : natural;
bottom : natural) is
begin
cbinds.set_padding
(menu => menu,
left => c.int (left),
right => c.int (right),
top => c.int (top),
bottom => c.int (bottom));
end set_padding;
procedure set_label_padding
(menu : menu_access_t;
left : natural;
right : natural;
top : natural;
bottom : natural) is
begin
cbinds.set_label_padding
(menu => menu,
left => c.int (left),
right => c.int (right),
top => c.int (top),
bottom => c.int (bottom));
end set_label_padding;
function node
(parent : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
begin
return cbinds.node
(parent => parent,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon);
end node;
function action
(parent : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
func : agar.core.event.callback_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
begin
return cbinds.action
(parent => parent,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
func => func,
fmt => agar.core.types.null_ptr);
end action;
function action_keyboard
(parent : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
key : <KEY>;
modkey : c.<KEY>;
func : agar.core.event.callback_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
begin
return cbinds.action_keyboard
(parent => parent,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
key => key,
modkey => modkey,
func => func,
fmt => agar.core.types.null_ptr);
end action_keyboard;
function dynamic_item
(parent : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
func : agar.core.event.callback_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
begin
return cbinds.dynamic_item
(parent => parent,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
func => func,
fmt => agar.core.types.null_ptr);
end dynamic_item;
function dynamic_item_keyboard
(parent : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
key : <KEY>;
modkey : c.<KEY>;
func : agar.core.event.callback_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
begin
return cbinds.dynamic_item_keyboard
(parent => parent,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
key => key,
modkey => modkey,
func => func,
fmt => agar.core.types.null_ptr);
end dynamic_item_keyboard;
function toolbar_item
(parent : item_access_t;
toolbar : agar.gui.widget.toolbar.toolbar_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
key : c.<KEY>;
modkey : c.<KEY>;
func : agar.core.event.callback_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
begin
return cbinds.toolbar_item
(parent => parent,
toolbar => toolbar,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
key => key,
modkey => modkey,
func => func,
fmt => agar.core.types.null_ptr);
end toolbar_item;
procedure set_label
(item : item_access_t;
label : string)
is
ca_label : aliased c.char_array := c.to_c (label);
begin
cbinds.set_label
(item => item,
label => cs.to_chars_ptr (ca_label'unchecked_access));
end set_label;
procedure set_poll_function
(item : item_access_t;
func : agar.core.event.callback_t) is
begin
cbinds.set_poll_function
(item => item,
func => func,
fmt => agar.core.types.null_ptr);
end set_poll_function;
function bind_bool
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access boolean;
invert : boolean) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
c_value : aliased c.int;
item_acc : item_access_t;
begin
if invert then c_invert := 1; end if;
item_acc := cbinds.bind_bool
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => c_value'unchecked_access,
invert => c_invert);
value.all := c_value = 1;
return item_acc;
end bind_bool;
function bind_bool_with_mutex
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access boolean;
invert : boolean;
mutex : agar.core.threads.mutex_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
c_value : aliased c.int;
item_acc : item_access_t;
begin
if invert then c_invert := 1; end if;
item_acc := cbinds.bind_bool_with_mutex
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => c_value'unchecked_access,
invert => c_invert,
mutex => mutex);
value.all := c_value = 1;
return item_acc;
end bind_bool_with_mutex;
function bind_flags
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access mask_t;
flags : mask_t;
invert : boolean) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
begin
if invert then c_invert := 1; end if;
return cbinds.bind_flags
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => value,
flags => flags,
invert => c_invert);
end bind_flags;
function bind_flags_with_mutex
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access mask_t;
flags : mask_t;
invert : boolean;
mutex : agar.core.threads.mutex_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
begin
if invert then c_invert := 1; end if;
return cbinds.bind_flags_with_mutex
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => value,
flags => flags,
invert => c_invert,
mutex => mutex);
end bind_flags_with_mutex;
function bind_flags8
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access mask8_t;
flags : mask8_t;
invert : boolean) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
begin
if invert then c_invert := 1; end if;
return cbinds.bind_flags8
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => value,
flags => flags,
invert => c_invert);
end bind_flags8;
function bind_flags8_with_mutex
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access mask8_t;
flags : mask8_t;
invert : boolean;
mutex : agar.core.threads.mutex_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
begin
if invert then c_invert := 1; end if;
return cbinds.bind_flags8_with_mutex
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => value,
flags => flags,
invert => c_invert,
mutex => mutex);
end bind_flags8_with_mutex;
function bind_flags16
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access mask16_t;
flags : mask16_t;
invert : boolean) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
begin
if invert then c_invert := 1; end if;
return cbinds.bind_flags16
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => value,
flags => flags,
invert => c_invert);
end bind_flags16;
function bind_flags16_with_mutex
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access mask16_t;
flags : mask16_t;
invert : boolean;
mutex : agar.core.threads.mutex_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
begin
if invert then c_invert := 1; end if;
return cbinds.bind_flags16_with_mutex
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => value,
flags => flags,
invert => c_invert,
mutex => mutex);
end bind_flags16_with_mutex;
function bind_flags32
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access mask32_t;
flags : mask32_t;
invert : boolean) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
begin
if invert then c_invert := 1; end if;
return cbinds.bind_flags32
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => value,
flags => flags,
invert => c_invert);
end bind_flags32;
function bind_flags32_with_mutex
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access mask32_t;
flags : mask32_t;
invert : boolean;
mutex : agar.core.threads.mutex_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
begin
if invert then c_invert := 1; end if;
return cbinds.bind_flags32_with_mutex
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => value,
flags => flags,
invert => c_invert,
mutex => mutex);
end bind_flags32_with_mutex;
procedure section
(item : item_access_t;
text : string)
is
ca_text : aliased c.char_array := c.to_c (text);
begin
cbinds.section
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access));
end section;
-- popup menus
package body popup is
package cbinds is
procedure show_at
(menu : popup_menu_access_t;
x : c.int;
y : c.int);
pragma import (c, show_at, "AG_PopupShowAt");
end cbinds;
procedure show_at
(menu : popup_menu_access_t;
x : natural;
y : natural) is
begin
cbinds.show_at
(menu => menu,
x => c.int (x),
y => c.int (y));
end show_at;
end popup;
function widget (menu : menu_access_t) return widget_access_t is
begin
return menu.widget'access;
end widget;
function widget (view : view_access_t) return widget_access_t is
begin
return view.widget'access;
end widget;
end agar.gui.widget.menu;
| true |
package body agar.gui.widget.menu is
use type c.int;
package cbinds is
procedure expand
(menu : menu_access_t;
item : item_access_t;
x : c.int;
y : c.int);
pragma import (c, expand, "AG_MenuExpand");
procedure set_padding
(menu : menu_access_t;
left : c.int;
right : c.int;
top : c.int;
bottom : c.int);
pragma import (c, set_padding, "AG_MenuSetPadding");
procedure set_label_padding
(menu : menu_access_t;
left : c.int;
right : c.int;
top : c.int;
bottom : c.int);
pragma import (c, set_label_padding, "AG_MenuSetLabelPadding");
function node
(parent : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t) return item_access_t;
pragma import (c, node, "AG_MenuNode");
function action
(parent : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
func : agar.core.event.callback_t;
fmt : agar.core.types.void_ptr_t) return item_access_t;
pragma import (c, action, "AG_MenuAction");
function action_keyboard
(parent : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
key : c.int;
modkey : c.int;
func : agar.core.event.callback_t;
fmt : agar.core.types.void_ptr_t) return item_access_t;
pragma import (c, action_keyboard, "AG_MenuActionKb");
function dynamic_item
(parent : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
func : agar.core.event.callback_t;
fmt : agar.core.types.void_ptr_t) return item_access_t;
pragma import (c, dynamic_item, "AG_MenuDynamicItem");
function dynamic_item_keyboard
(parent : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
key : c.int;
modkey : c.int;
func : agar.core.event.callback_t;
fmt : agar.core.types.void_ptr_t) return item_access_t;
pragma import (c, dynamic_item_keyboard, "AG_MenuDynamicItemKb");
function toolbar_item
(parent : item_access_t;
toolbar : agar.gui.widget.toolbar.toolbar_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
key : c.int;
modkey : c.int;
func : agar.core.event.callback_t;
fmt : agar.core.types.void_ptr_t) return item_access_t;
pragma import (c, toolbar_item, "AG_MenuTool");
procedure set_label
(item : item_access_t;
label : cs.chars_ptr);
pragma import (c, set_label, "AG_MenuSetLabelS");
procedure set_poll_function
(item : item_access_t;
func : agar.core.event.callback_t;
fmt : agar.core.types.void_ptr_t);
pragma import (c, set_poll_function, "AG_MenuSetPollFn");
function bind_bool
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access c.int;
invert : c.int) return item_access_t;
pragma import (c, bind_bool, "agar_gui_widget_menu_bool");
function bind_bool_with_mutex
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access c.int;
invert : c.int;
mutex : agar.core.threads.mutex_t) return item_access_t;
pragma import (c, bind_bool_with_mutex, "AG_MenuIntBoolMp");
function bind_flags
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access mask_t;
flags : mask_t;
invert : c.int) return item_access_t;
pragma import (c, bind_flags, "agar_gui_widget_menu_int_flags");
function bind_flags_with_mutex
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access mask_t;
flags : mask_t;
invert : c.int;
mutex : agar.core.threads.mutex_t) return item_access_t;
pragma import (c, bind_flags_with_mutex, "AG_MenuIntFlagsMp");
function bind_flags8
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access mask8_t;
flags : mask8_t;
invert : c.int) return item_access_t;
pragma import (c, bind_flags8, "agar_gui_widget_menu_int_flags8");
function bind_flags8_with_mutex
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access mask8_t;
flags : mask8_t;
invert : c.int;
mutex : agar.core.threads.mutex_t) return item_access_t;
pragma import (c, bind_flags8_with_mutex, "AG_MenuInt8FlagsMp");
function bind_flags16
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access mask16_t;
flags : mask16_t;
invert : c.int) return item_access_t;
pragma import (c, bind_flags16, "agar_gui_widget_menu_int_flags16");
function bind_flags16_with_mutex
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access mask16_t;
flags : mask16_t;
invert : c.int;
mutex : agar.core.threads.mutex_t) return item_access_t;
pragma import (c, bind_flags16_with_mutex, "AG_MenuInt16FlagsMp");
function bind_flags32
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access mask32_t;
flags : mask32_t;
invert : c.int) return item_access_t;
pragma import (c, bind_flags32, "agar_gui_widget_menu_int_flags32");
function bind_flags32_with_mutex
(item : item_access_t;
text : cs.chars_ptr;
icon : agar.gui.surface.surface_access_t;
value : access mask32_t;
flags : mask32_t;
invert : c.int;
mutex : agar.core.threads.mutex_t) return item_access_t;
pragma import (c, bind_flags32_with_mutex, "AG_MenuInt32FlagsMp");
procedure section
(item : item_access_t;
text : cs.chars_ptr);
pragma import (c, section, "AG_MenuSectionS");
end cbinds;
procedure expand
(menu : menu_access_t;
item : item_access_t;
x : natural;
y : natural) is
begin
cbinds.expand
(menu => menu,
item => item,
x => c.int (x),
y => c.int (y));
end expand;
procedure set_padding
(menu : menu_access_t;
left : natural;
right : natural;
top : natural;
bottom : natural) is
begin
cbinds.set_padding
(menu => menu,
left => c.int (left),
right => c.int (right),
top => c.int (top),
bottom => c.int (bottom));
end set_padding;
procedure set_label_padding
(menu : menu_access_t;
left : natural;
right : natural;
top : natural;
bottom : natural) is
begin
cbinds.set_label_padding
(menu => menu,
left => c.int (left),
right => c.int (right),
top => c.int (top),
bottom => c.int (bottom));
end set_label_padding;
function node
(parent : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
begin
return cbinds.node
(parent => parent,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon);
end node;
function action
(parent : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
func : agar.core.event.callback_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
begin
return cbinds.action
(parent => parent,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
func => func,
fmt => agar.core.types.null_ptr);
end action;
function action_keyboard
(parent : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
key : PI:KEY:<KEY>END_PI;
modkey : c.PI:KEY:<KEY>END_PI;
func : agar.core.event.callback_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
begin
return cbinds.action_keyboard
(parent => parent,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
key => key,
modkey => modkey,
func => func,
fmt => agar.core.types.null_ptr);
end action_keyboard;
function dynamic_item
(parent : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
func : agar.core.event.callback_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
begin
return cbinds.dynamic_item
(parent => parent,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
func => func,
fmt => agar.core.types.null_ptr);
end dynamic_item;
function dynamic_item_keyboard
(parent : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
key : PI:KEY:<KEY>END_PI;
modkey : c.PI:KEY:<KEY>END_PI;
func : agar.core.event.callback_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
begin
return cbinds.dynamic_item_keyboard
(parent => parent,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
key => key,
modkey => modkey,
func => func,
fmt => agar.core.types.null_ptr);
end dynamic_item_keyboard;
function toolbar_item
(parent : item_access_t;
toolbar : agar.gui.widget.toolbar.toolbar_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
key : c.PI:KEY:<KEY>END_PI;
modkey : c.PI:KEY:<KEY>END_PI;
func : agar.core.event.callback_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
begin
return cbinds.toolbar_item
(parent => parent,
toolbar => toolbar,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
key => key,
modkey => modkey,
func => func,
fmt => agar.core.types.null_ptr);
end toolbar_item;
procedure set_label
(item : item_access_t;
label : string)
is
ca_label : aliased c.char_array := c.to_c (label);
begin
cbinds.set_label
(item => item,
label => cs.to_chars_ptr (ca_label'unchecked_access));
end set_label;
procedure set_poll_function
(item : item_access_t;
func : agar.core.event.callback_t) is
begin
cbinds.set_poll_function
(item => item,
func => func,
fmt => agar.core.types.null_ptr);
end set_poll_function;
function bind_bool
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access boolean;
invert : boolean) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
c_value : aliased c.int;
item_acc : item_access_t;
begin
if invert then c_invert := 1; end if;
item_acc := cbinds.bind_bool
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => c_value'unchecked_access,
invert => c_invert);
value.all := c_value = 1;
return item_acc;
end bind_bool;
function bind_bool_with_mutex
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access boolean;
invert : boolean;
mutex : agar.core.threads.mutex_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
c_value : aliased c.int;
item_acc : item_access_t;
begin
if invert then c_invert := 1; end if;
item_acc := cbinds.bind_bool_with_mutex
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => c_value'unchecked_access,
invert => c_invert,
mutex => mutex);
value.all := c_value = 1;
return item_acc;
end bind_bool_with_mutex;
function bind_flags
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access mask_t;
flags : mask_t;
invert : boolean) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
begin
if invert then c_invert := 1; end if;
return cbinds.bind_flags
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => value,
flags => flags,
invert => c_invert);
end bind_flags;
function bind_flags_with_mutex
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access mask_t;
flags : mask_t;
invert : boolean;
mutex : agar.core.threads.mutex_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
begin
if invert then c_invert := 1; end if;
return cbinds.bind_flags_with_mutex
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => value,
flags => flags,
invert => c_invert,
mutex => mutex);
end bind_flags_with_mutex;
function bind_flags8
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access mask8_t;
flags : mask8_t;
invert : boolean) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
begin
if invert then c_invert := 1; end if;
return cbinds.bind_flags8
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => value,
flags => flags,
invert => c_invert);
end bind_flags8;
function bind_flags8_with_mutex
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access mask8_t;
flags : mask8_t;
invert : boolean;
mutex : agar.core.threads.mutex_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
begin
if invert then c_invert := 1; end if;
return cbinds.bind_flags8_with_mutex
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => value,
flags => flags,
invert => c_invert,
mutex => mutex);
end bind_flags8_with_mutex;
function bind_flags16
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access mask16_t;
flags : mask16_t;
invert : boolean) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
begin
if invert then c_invert := 1; end if;
return cbinds.bind_flags16
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => value,
flags => flags,
invert => c_invert);
end bind_flags16;
function bind_flags16_with_mutex
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access mask16_t;
flags : mask16_t;
invert : boolean;
mutex : agar.core.threads.mutex_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
begin
if invert then c_invert := 1; end if;
return cbinds.bind_flags16_with_mutex
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => value,
flags => flags,
invert => c_invert,
mutex => mutex);
end bind_flags16_with_mutex;
function bind_flags32
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access mask32_t;
flags : mask32_t;
invert : boolean) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
begin
if invert then c_invert := 1; end if;
return cbinds.bind_flags32
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => value,
flags => flags,
invert => c_invert);
end bind_flags32;
function bind_flags32_with_mutex
(item : item_access_t;
text : string;
icon : agar.gui.surface.surface_access_t;
value : access mask32_t;
flags : mask32_t;
invert : boolean;
mutex : agar.core.threads.mutex_t) return item_access_t
is
ca_text : aliased c.char_array := c.to_c (text);
c_invert : c.int := 0;
begin
if invert then c_invert := 1; end if;
return cbinds.bind_flags32_with_mutex
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access),
icon => icon,
value => value,
flags => flags,
invert => c_invert,
mutex => mutex);
end bind_flags32_with_mutex;
procedure section
(item : item_access_t;
text : string)
is
ca_text : aliased c.char_array := c.to_c (text);
begin
cbinds.section
(item => item,
text => cs.to_chars_ptr (ca_text'unchecked_access));
end section;
-- popup menus
package body popup is
package cbinds is
procedure show_at
(menu : popup_menu_access_t;
x : c.int;
y : c.int);
pragma import (c, show_at, "AG_PopupShowAt");
end cbinds;
procedure show_at
(menu : popup_menu_access_t;
x : natural;
y : natural) is
begin
cbinds.show_at
(menu => menu,
x => c.int (x),
y => c.int (y));
end show_at;
end popup;
function widget (menu : menu_access_t) return widget_access_t is
begin
return menu.widget'access;
end widget;
function widget (view : view_access_t) return widget_access_t is
begin
return view.widget'access;
end widget;
end agar.gui.widget.menu;
|
[
{
"context": "da2012 -- Generator for Ada\n-- Copyright (C) 2021 Stephane Carrez\n-- Written by Stephane Carrez (Stephane.Carrez@g",
"end": 157,
"score": 0.9998693466186523,
"start": 142,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": " Copyright (C) 2021 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under",
"end": 188,
"score": 0.9998769760131836,
"start": 173,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "1 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under the Apache License, Versio",
"end": 215,
"score": 0.9999262690544128,
"start": 190,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
src/are-generator-ada2012.ads
|
stcarrez/resource-embedder
| 7 |
-----------------------------------------------------------------------
-- are-generator-ada2012 -- Generator for Ada
-- Copyright (C) 2021 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
private with Ada.Text_IO;
private with Util.Strings.Vectors;
-- == Ada Generator ==
-- The Ada code generator produces for each resource description an Ada
-- package with the name of that resource. Sometimes, the Ada package
-- specification is enough and it contains all necessary definitions including
-- the content of files. In other cases, an Ada package body is also generated
-- and it contains the generated files with a function that allows to query
-- and retrieve the file content. The Ada code generator is driven by the
-- resource description and also by the tool options.
--
-- The code generator supports several data format to access the file content.
--
-- | Format | Ada type |
-- |--------|--------------------------------------------------|
-- | binary | access constant Ada.Streams.Stream_Element_Array |
-- | string | access constant String |
-- | lines | array of access constant String |
--
-- When the `--content-only` option is used, the code generator uses the
-- following type to describe a file content in the `binary` format:
--
-- type Content_Access is
-- access constant Ada.Streams.Stream_Element_Array;
--
-- for the `string` format it defines:
--
-- type Content_Access is access constant String;
--
-- and for the `lines` format it defines:
--
-- type Content_Array is
-- array (Natural range <>) of access constant String;
-- type Content_Access is access constant Content_Array;
--
-- These type definitions give access to a readonly binary or string content
-- and provides enough information to also indicate the size of that content.
-- Then when the `--name-access` option is passed, the code generator declares
-- and implements the following function:
--
-- function Get_Content (Name : String) return Content_Access;
--
-- That function will return either a content access or null if it was not found.
--
-- By default, when the `--content-only` option is not passed, the code generator
-- provides more information about the embedded content such as the file name,
-- the modification time of the file and the target file format.
-- In that case, the following Ada record is declared in the Ada specification:
--
-- type Name_Access is access constant String;
-- type Format_Type is (FILE_RAW, FILE_GZIP);
-- type Content_Type is record
-- Name : Name_Access;
-- Content : Content_Access;
-- Modtime : Interfaces.C.long = 0;
-- Format : Format_Type := FILE_RAW;
-- end record;
--
-- The generated `Get_Content` function will return a `Content_Type`. You must
-- compare the result with the `Null_Content` constant to check if the embedded
-- file was found.
--
-- When the `--list-access` option is passed, the code generator emits a code
-- that gives access to the list of file names embedded in the resource.
-- The list of names is a simple Ada constant array. The array is sorted
-- on the name. It is declared as follows:
--
-- type Name_Array is array (Natural range <>) of Name_Access;
-- Names : constant Name_Array;
--
private package Are.Generator.Ada2012 is
type Generator_Type is new Are.Generator.Generator_Type with private;
-- Generate the Ada code for the resources that have been collected.
overriding
procedure Generate (Generator : in out Generator_Type;
Resources : in Resource_List;
Context : in out Are.Context_Type'Class);
-- Setup the command line configuration to accept specific generation options.
overriding
procedure Setup (Generator : in out Generator_Type;
Config : in out GC.Command_Line_Configuration);
private
type Generator_Type is new Are.Generator.Generator_Type with record
Pragma_Preelaborate : aliased Boolean := False;
Content_Only : aliased Boolean := False;
Names : Util.Strings.Vectors.Vector;
end record;
-- Generate the package specification.
procedure Generate_Specs (Generator : in out Generator_Type;
Resource : in Are.Resource_Type;
Context : in out Are.Context_Type'Class);
-- Generate the package body.
procedure Generate_Body (Generator : in out Generator_Type;
Resource : in Are.Resource_Type;
Context : in out Are.Context_Type'Class);
-- Generate the perfect hash implementation used by the name indexer.
procedure Generate_Perfect_Hash (Generator : in out Generator_Type;
Resource : in Are.Resource_Type;
Context : in out Are.Context_Type'Class);
-- Generate the keyword table.
procedure Generate_Keyword_Table (Generator : in out Generator_Type;
Into : in out Ada.Text_IO.File_Type);
function To_File_Name (Name : in String) return String;
function To_Ada_Name (Prefix : in String;
Name : in String) return String;
end Are.Generator.Ada2012;
|
26944
|
-----------------------------------------------------------------------
-- are-generator-ada2012 -- Generator for Ada
-- Copyright (C) 2021 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
private with Ada.Text_IO;
private with Util.Strings.Vectors;
-- == Ada Generator ==
-- The Ada code generator produces for each resource description an Ada
-- package with the name of that resource. Sometimes, the Ada package
-- specification is enough and it contains all necessary definitions including
-- the content of files. In other cases, an Ada package body is also generated
-- and it contains the generated files with a function that allows to query
-- and retrieve the file content. The Ada code generator is driven by the
-- resource description and also by the tool options.
--
-- The code generator supports several data format to access the file content.
--
-- | Format | Ada type |
-- |--------|--------------------------------------------------|
-- | binary | access constant Ada.Streams.Stream_Element_Array |
-- | string | access constant String |
-- | lines | array of access constant String |
--
-- When the `--content-only` option is used, the code generator uses the
-- following type to describe a file content in the `binary` format:
--
-- type Content_Access is
-- access constant Ada.Streams.Stream_Element_Array;
--
-- for the `string` format it defines:
--
-- type Content_Access is access constant String;
--
-- and for the `lines` format it defines:
--
-- type Content_Array is
-- array (Natural range <>) of access constant String;
-- type Content_Access is access constant Content_Array;
--
-- These type definitions give access to a readonly binary or string content
-- and provides enough information to also indicate the size of that content.
-- Then when the `--name-access` option is passed, the code generator declares
-- and implements the following function:
--
-- function Get_Content (Name : String) return Content_Access;
--
-- That function will return either a content access or null if it was not found.
--
-- By default, when the `--content-only` option is not passed, the code generator
-- provides more information about the embedded content such as the file name,
-- the modification time of the file and the target file format.
-- In that case, the following Ada record is declared in the Ada specification:
--
-- type Name_Access is access constant String;
-- type Format_Type is (FILE_RAW, FILE_GZIP);
-- type Content_Type is record
-- Name : Name_Access;
-- Content : Content_Access;
-- Modtime : Interfaces.C.long = 0;
-- Format : Format_Type := FILE_RAW;
-- end record;
--
-- The generated `Get_Content` function will return a `Content_Type`. You must
-- compare the result with the `Null_Content` constant to check if the embedded
-- file was found.
--
-- When the `--list-access` option is passed, the code generator emits a code
-- that gives access to the list of file names embedded in the resource.
-- The list of names is a simple Ada constant array. The array is sorted
-- on the name. It is declared as follows:
--
-- type Name_Array is array (Natural range <>) of Name_Access;
-- Names : constant Name_Array;
--
private package Are.Generator.Ada2012 is
type Generator_Type is new Are.Generator.Generator_Type with private;
-- Generate the Ada code for the resources that have been collected.
overriding
procedure Generate (Generator : in out Generator_Type;
Resources : in Resource_List;
Context : in out Are.Context_Type'Class);
-- Setup the command line configuration to accept specific generation options.
overriding
procedure Setup (Generator : in out Generator_Type;
Config : in out GC.Command_Line_Configuration);
private
type Generator_Type is new Are.Generator.Generator_Type with record
Pragma_Preelaborate : aliased Boolean := False;
Content_Only : aliased Boolean := False;
Names : Util.Strings.Vectors.Vector;
end record;
-- Generate the package specification.
procedure Generate_Specs (Generator : in out Generator_Type;
Resource : in Are.Resource_Type;
Context : in out Are.Context_Type'Class);
-- Generate the package body.
procedure Generate_Body (Generator : in out Generator_Type;
Resource : in Are.Resource_Type;
Context : in out Are.Context_Type'Class);
-- Generate the perfect hash implementation used by the name indexer.
procedure Generate_Perfect_Hash (Generator : in out Generator_Type;
Resource : in Are.Resource_Type;
Context : in out Are.Context_Type'Class);
-- Generate the keyword table.
procedure Generate_Keyword_Table (Generator : in out Generator_Type;
Into : in out Ada.Text_IO.File_Type);
function To_File_Name (Name : in String) return String;
function To_Ada_Name (Prefix : in String;
Name : in String) return String;
end Are.Generator.Ada2012;
| true |
-----------------------------------------------------------------------
-- are-generator-ada2012 -- Generator for Ada
-- Copyright (C) 2021 PI:NAME:<NAME>END_PI
-- Written by PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
private with Ada.Text_IO;
private with Util.Strings.Vectors;
-- == Ada Generator ==
-- The Ada code generator produces for each resource description an Ada
-- package with the name of that resource. Sometimes, the Ada package
-- specification is enough and it contains all necessary definitions including
-- the content of files. In other cases, an Ada package body is also generated
-- and it contains the generated files with a function that allows to query
-- and retrieve the file content. The Ada code generator is driven by the
-- resource description and also by the tool options.
--
-- The code generator supports several data format to access the file content.
--
-- | Format | Ada type |
-- |--------|--------------------------------------------------|
-- | binary | access constant Ada.Streams.Stream_Element_Array |
-- | string | access constant String |
-- | lines | array of access constant String |
--
-- When the `--content-only` option is used, the code generator uses the
-- following type to describe a file content in the `binary` format:
--
-- type Content_Access is
-- access constant Ada.Streams.Stream_Element_Array;
--
-- for the `string` format it defines:
--
-- type Content_Access is access constant String;
--
-- and for the `lines` format it defines:
--
-- type Content_Array is
-- array (Natural range <>) of access constant String;
-- type Content_Access is access constant Content_Array;
--
-- These type definitions give access to a readonly binary or string content
-- and provides enough information to also indicate the size of that content.
-- Then when the `--name-access` option is passed, the code generator declares
-- and implements the following function:
--
-- function Get_Content (Name : String) return Content_Access;
--
-- That function will return either a content access or null if it was not found.
--
-- By default, when the `--content-only` option is not passed, the code generator
-- provides more information about the embedded content such as the file name,
-- the modification time of the file and the target file format.
-- In that case, the following Ada record is declared in the Ada specification:
--
-- type Name_Access is access constant String;
-- type Format_Type is (FILE_RAW, FILE_GZIP);
-- type Content_Type is record
-- Name : Name_Access;
-- Content : Content_Access;
-- Modtime : Interfaces.C.long = 0;
-- Format : Format_Type := FILE_RAW;
-- end record;
--
-- The generated `Get_Content` function will return a `Content_Type`. You must
-- compare the result with the `Null_Content` constant to check if the embedded
-- file was found.
--
-- When the `--list-access` option is passed, the code generator emits a code
-- that gives access to the list of file names embedded in the resource.
-- The list of names is a simple Ada constant array. The array is sorted
-- on the name. It is declared as follows:
--
-- type Name_Array is array (Natural range <>) of Name_Access;
-- Names : constant Name_Array;
--
private package Are.Generator.Ada2012 is
type Generator_Type is new Are.Generator.Generator_Type with private;
-- Generate the Ada code for the resources that have been collected.
overriding
procedure Generate (Generator : in out Generator_Type;
Resources : in Resource_List;
Context : in out Are.Context_Type'Class);
-- Setup the command line configuration to accept specific generation options.
overriding
procedure Setup (Generator : in out Generator_Type;
Config : in out GC.Command_Line_Configuration);
private
type Generator_Type is new Are.Generator.Generator_Type with record
Pragma_Preelaborate : aliased Boolean := False;
Content_Only : aliased Boolean := False;
Names : Util.Strings.Vectors.Vector;
end record;
-- Generate the package specification.
procedure Generate_Specs (Generator : in out Generator_Type;
Resource : in Are.Resource_Type;
Context : in out Are.Context_Type'Class);
-- Generate the package body.
procedure Generate_Body (Generator : in out Generator_Type;
Resource : in Are.Resource_Type;
Context : in out Are.Context_Type'Class);
-- Generate the perfect hash implementation used by the name indexer.
procedure Generate_Perfect_Hash (Generator : in out Generator_Type;
Resource : in Are.Resource_Type;
Context : in out Are.Context_Type'Class);
-- Generate the keyword table.
procedure Generate_Keyword_Table (Generator : in out Generator_Type;
Into : in out Ada.Text_IO.File_Type);
function To_File_Name (Name : in String) return String;
function To_Ada_Name (Prefix : in String;
Name : in String) return String;
end Are.Generator.Ada2012;
|
[
{
"context": "n Authenticated\n-- Encryption Algorithm created by Christoph Dobraunig, Maria Eichlseder,\n-- Florian Mendel and Martin S",
"end": 150,
"score": 0.9998789429664612,
"start": 131,
"tag": "NAME",
"value": "Christoph Dobraunig"
},
{
"context": "cryption Algorithm created by Christoph Dobraunig, Maria Eichlseder,\n-- Florian Mendel and Martin Schläffer.\n\n-- Copy",
"end": 168,
"score": 0.9998774528503418,
"start": 152,
"tag": "NAME",
"value": "Maria Eichlseder"
},
{
"context": "eated by Christoph Dobraunig, Maria Eichlseder,\n-- Florian Mendel and Martin Schläffer.\n\n-- Copyright (c) 2016-2018",
"end": 187,
"score": 0.9998670816421509,
"start": 173,
"tag": "NAME",
"value": "Florian Mendel"
},
{
"context": "Dobraunig, Maria Eichlseder,\n-- Florian Mendel and Martin Schläffer.\n\n-- Copyright (c) 2016-2018, James Humphry - see",
"end": 208,
"score": 0.9998683929443359,
"start": 192,
"tag": "NAME",
"value": "Martin Schläffer"
},
{
"context": "and Martin Schläffer.\n\n-- Copyright (c) 2016-2018, James Humphry - see LICENSE file for details\n\npragma SPARK_Mode",
"end": 252,
"score": 0.9998800158500671,
"start": 239,
"tag": "NAME",
"value": "James Humphry"
}
] |
src/ascon128v11.ads
|
jhumphry/Ascon_SPARK
| 1 |
-- Ascon128v11
-- an instantiation of the Ascon-128 (v 1.1) variant of the Ascon Authenticated
-- Encryption Algorithm created by Christoph Dobraunig, Maria Eichlseder,
-- Florian Mendel and Martin Schläffer.
-- Copyright (c) 2016-2018, James Humphry - see LICENSE file for details
pragma SPARK_Mode(On);
with Ascon;
package Ascon128v11 is new Ascon(a_rounds => 12,
b_rounds => 6,
b_round_constants_offset => 0,
rate => 64);
|
15146
|
-- Ascon128v11
-- an instantiation of the Ascon-128 (v 1.1) variant of the Ascon Authenticated
-- Encryption Algorithm created by <NAME>, <NAME>,
-- <NAME> and <NAME>.
-- Copyright (c) 2016-2018, <NAME> - see LICENSE file for details
pragma SPARK_Mode(On);
with Ascon;
package Ascon128v11 is new Ascon(a_rounds => 12,
b_rounds => 6,
b_round_constants_offset => 0,
rate => 64);
| true |
-- Ascon128v11
-- an instantiation of the Ascon-128 (v 1.1) variant of the Ascon Authenticated
-- Encryption Algorithm created by PI:NAME:<NAME>END_PI, PI:NAME:<NAME>END_PI,
-- PI:NAME:<NAME>END_PI and PI:NAME:<NAME>END_PI.
-- Copyright (c) 2016-2018, PI:NAME:<NAME>END_PI - see LICENSE file for details
pragma SPARK_Mode(On);
with Ascon;
package Ascon128v11 is new Ascon(a_rounds => 12,
b_rounds => 6,
b_round_constants_offset => 0,
rate => 64);
|
[
{
"context": " library specification\n-- Copyright (c) 2003-2018 Maxim Reznik <[email protected]>\n-- Copyright (c) 2004-2016 ",
"end": 97,
"score": 0.9997919201850891,
"start": 85,
"tag": "NAME",
"value": "Maxim Reznik"
},
{
"context": "ication\n-- Copyright (c) 2003-2018 Maxim Reznik <[email protected]>\n-- Copyright (c) 2004-2016 AXE Consultants\n-- ",
"end": 117,
"score": 0.9999303817749023,
"start": 99,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
ada-containers-generic_constrained_array_sort.ads
|
mgrojo/adalib
| 15 |
-- Standard Ada library specification
-- Copyright (c) 2003-2018 Maxim Reznik <[email protected]>
-- Copyright (c) 2004-2016 AXE Consultants
-- Copyright (c) 2004, 2005, 2006 Ada-Europe
-- Copyright (c) 2000 The MITRE Corporation, Inc.
-- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc.
-- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual
---------------------------------------------------------------------------
generic
type Index_Type is (<>);
type Element_Type is private;
type Array_Type is array (Index_Type) of Element_Type;
with function "<" (Left : in Element_Type;
Right : in Element_Type)
return Boolean is <>;
procedure Ada.Containers.Generic_Constrained_Array_Sort
(Container : in out Array_Type);
pragma Pure (Ada.Containers.Generic_Constrained_Array_Sort);
|
30162
|
-- Standard Ada library specification
-- Copyright (c) 2003-2018 <NAME> <<EMAIL>>
-- Copyright (c) 2004-2016 AXE Consultants
-- Copyright (c) 2004, 2005, 2006 Ada-Europe
-- Copyright (c) 2000 The MITRE Corporation, Inc.
-- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc.
-- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual
---------------------------------------------------------------------------
generic
type Index_Type is (<>);
type Element_Type is private;
type Array_Type is array (Index_Type) of Element_Type;
with function "<" (Left : in Element_Type;
Right : in Element_Type)
return Boolean is <>;
procedure Ada.Containers.Generic_Constrained_Array_Sort
(Container : in out Array_Type);
pragma Pure (Ada.Containers.Generic_Constrained_Array_Sort);
| true |
-- Standard Ada library specification
-- Copyright (c) 2003-2018 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>
-- Copyright (c) 2004-2016 AXE Consultants
-- Copyright (c) 2004, 2005, 2006 Ada-Europe
-- Copyright (c) 2000 The MITRE Corporation, Inc.
-- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc.
-- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual
---------------------------------------------------------------------------
generic
type Index_Type is (<>);
type Element_Type is private;
type Array_Type is array (Index_Type) of Element_Type;
with function "<" (Left : in Element_Type;
Right : in Element_Type)
return Boolean is <>;
procedure Ada.Containers.Generic_Constrained_Array_Sort
(Container : in out Array_Type);
pragma Pure (Ada.Containers.Generic_Constrained_Array_Sort);
|
[
{
"context": "he file gate3_license.txt !!!\n--\n-- Copyright (c) F. J. FABIEN - 2013\n-- Berry\n-- FRANCE\n-- Send bug reports ",
"end": 789,
"score": 0.9998372793197632,
"start": 777,
"tag": "NAME",
"value": "F. J. FABIEN"
},
{
"context": "t !!!\n--\n-- Copyright (c) F. J. FABIEN - 2013\n-- Berry\n-- FRANCE\n-- Send bug reports or feedback to : ",
"end": 806,
"score": 0.9997111558914185,
"start": 801,
"tag": "NAME",
"value": "Berry"
},
{
"context": "- Copyright (c) F. J. FABIEN - 2013\n-- Berry\n-- FRANCE\n-- Send bug reports or feedback to : francois_fa",
"end": 817,
"score": 0.9997652173042297,
"start": 811,
"tag": "NAME",
"value": "FRANCE"
},
{
"context": "y\n-- FRANCE\n-- Send bug reports or feedback to : [email protected]\n--\n-- THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT ",
"end": 883,
"score": 0.9999351501464844,
"start": 856,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
tutorial/src/factorial.adb
|
Blady-Com/Gate3
| 1 |
------------------------------------------------------------------------------
-- --
-- File generated by gate3 --
-- Glade3 original file : /usr/local/src-2019/gate3_05/tutorial/factorial.glade
-- Generation date : 2019-08-24 04:42:08 --
--
-- Gate3 web site : https://sourceforge.net/projects/lorenz/ --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Legal licensing note : !!! Edit the file gate3_license.txt !!!
--
-- Copyright (c) F. J. FABIEN - 2013
-- Berry
-- FRANCE
-- Send bug reports or feedback to : [email protected]
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-- DEALINGS IN THE SOFTWARE.
-- NB: this is the MIT License, as found 12-Sep-2007 on the site
-- http://www.opensource.org/licenses/mit-license.php
------------------------------------------------------------------------------
-- units from Gtk
with Gtk; use Gtk;
with Gtk.Main;
with Glib; use Glib;
with Glib.Object;
with Glib.Error; use Glib.Error;
with Gtk.Widget; use Gtk.Widget;
with Gtkada.Builder; use Gtkada.Builder;
-- Ada predefined units
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Exceptions; use Ada.Exceptions;
-- Application specific units
with Window1_Callbacks; use Window1_Callbacks;
procedure Factorial is
Builder : Gtkada_Builder;
Error : aliased Glib.Error.GError;
GladeFileName : constant String := "factorial.glade";
begin
Gtk.Main.Init;
-- Step 1: create a Builder and add the XML data
Gtk_New (Builder);
if Add_From_File (Builder, GladeFileName, Error'Access) = 0 then
Put_Line ("Error : " & Get_Message (Error));
Error_Free (Error);
return;
end if;
-- Step 2: add calls to "Register_Handler" to associate your
-- handlers with your callbacks.
Register_Handler (Builder, "on_window1_delete_event", On_Window1_Delete_Event'Access);
Register_Handler (Builder, "gtk_main_quit", Gtk_Main_Quit'Access);
Register_Handler (Builder, "on_button2_clicked", On_Button2_Clicked'Access);
-- Step 3: call Do_Connect. Once to connect all registered handlers
Do_Connect (Builder);
Put_Line ("Factorial : loading and connexion of builder OK ");
-- Step 3.5 : display the windows and all of their children.
-- Remove objects than are not windows as necessary.
Show_All (Gtk.Widget.Gtk_Widget (Get_Object (Builder, "window1")));
Gtk.Main.Main;
-- Step 4: when the application terminates
-- call Unref to free memory associated with the Builder.
Unref (Builder);
Put_Line ("Program Factorial is finished !");
exception
when Error : others =>
Ada.Text_IO.Put_Line (Ada.Exceptions.Exception_Information (Error));
end Factorial;
|
23478
|
------------------------------------------------------------------------------
-- --
-- File generated by gate3 --
-- Glade3 original file : /usr/local/src-2019/gate3_05/tutorial/factorial.glade
-- Generation date : 2019-08-24 04:42:08 --
--
-- Gate3 web site : https://sourceforge.net/projects/lorenz/ --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Legal licensing note : !!! Edit the file gate3_license.txt !!!
--
-- Copyright (c) <NAME> - 2013
-- <NAME>
-- <NAME>
-- Send bug reports or feedback to : <EMAIL>
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-- DEALINGS IN THE SOFTWARE.
-- NB: this is the MIT License, as found 12-Sep-2007 on the site
-- http://www.opensource.org/licenses/mit-license.php
------------------------------------------------------------------------------
-- units from Gtk
with Gtk; use Gtk;
with Gtk.Main;
with Glib; use Glib;
with Glib.Object;
with Glib.Error; use Glib.Error;
with Gtk.Widget; use Gtk.Widget;
with Gtkada.Builder; use Gtkada.Builder;
-- Ada predefined units
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Exceptions; use Ada.Exceptions;
-- Application specific units
with Window1_Callbacks; use Window1_Callbacks;
procedure Factorial is
Builder : Gtkada_Builder;
Error : aliased Glib.Error.GError;
GladeFileName : constant String := "factorial.glade";
begin
Gtk.Main.Init;
-- Step 1: create a Builder and add the XML data
Gtk_New (Builder);
if Add_From_File (Builder, GladeFileName, Error'Access) = 0 then
Put_Line ("Error : " & Get_Message (Error));
Error_Free (Error);
return;
end if;
-- Step 2: add calls to "Register_Handler" to associate your
-- handlers with your callbacks.
Register_Handler (Builder, "on_window1_delete_event", On_Window1_Delete_Event'Access);
Register_Handler (Builder, "gtk_main_quit", Gtk_Main_Quit'Access);
Register_Handler (Builder, "on_button2_clicked", On_Button2_Clicked'Access);
-- Step 3: call Do_Connect. Once to connect all registered handlers
Do_Connect (Builder);
Put_Line ("Factorial : loading and connexion of builder OK ");
-- Step 3.5 : display the windows and all of their children.
-- Remove objects than are not windows as necessary.
Show_All (Gtk.Widget.Gtk_Widget (Get_Object (Builder, "window1")));
Gtk.Main.Main;
-- Step 4: when the application terminates
-- call Unref to free memory associated with the Builder.
Unref (Builder);
Put_Line ("Program Factorial is finished !");
exception
when Error : others =>
Ada.Text_IO.Put_Line (Ada.Exceptions.Exception_Information (Error));
end Factorial;
| true |
------------------------------------------------------------------------------
-- --
-- File generated by gate3 --
-- Glade3 original file : /usr/local/src-2019/gate3_05/tutorial/factorial.glade
-- Generation date : 2019-08-24 04:42:08 --
--
-- Gate3 web site : https://sourceforge.net/projects/lorenz/ --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Legal licensing note : !!! Edit the file gate3_license.txt !!!
--
-- Copyright (c) PI:NAME:<NAME>END_PI - 2013
-- PI:NAME:<NAME>END_PI
-- PI:NAME:<NAME>END_PI
-- Send bug reports or feedback to : PI:EMAIL:<EMAIL>END_PI
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-- DEALINGS IN THE SOFTWARE.
-- NB: this is the MIT License, as found 12-Sep-2007 on the site
-- http://www.opensource.org/licenses/mit-license.php
------------------------------------------------------------------------------
-- units from Gtk
with Gtk; use Gtk;
with Gtk.Main;
with Glib; use Glib;
with Glib.Object;
with Glib.Error; use Glib.Error;
with Gtk.Widget; use Gtk.Widget;
with Gtkada.Builder; use Gtkada.Builder;
-- Ada predefined units
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Exceptions; use Ada.Exceptions;
-- Application specific units
with Window1_Callbacks; use Window1_Callbacks;
procedure Factorial is
Builder : Gtkada_Builder;
Error : aliased Glib.Error.GError;
GladeFileName : constant String := "factorial.glade";
begin
Gtk.Main.Init;
-- Step 1: create a Builder and add the XML data
Gtk_New (Builder);
if Add_From_File (Builder, GladeFileName, Error'Access) = 0 then
Put_Line ("Error : " & Get_Message (Error));
Error_Free (Error);
return;
end if;
-- Step 2: add calls to "Register_Handler" to associate your
-- handlers with your callbacks.
Register_Handler (Builder, "on_window1_delete_event", On_Window1_Delete_Event'Access);
Register_Handler (Builder, "gtk_main_quit", Gtk_Main_Quit'Access);
Register_Handler (Builder, "on_button2_clicked", On_Button2_Clicked'Access);
-- Step 3: call Do_Connect. Once to connect all registered handlers
Do_Connect (Builder);
Put_Line ("Factorial : loading and connexion of builder OK ");
-- Step 3.5 : display the windows and all of their children.
-- Remove objects than are not windows as necessary.
Show_All (Gtk.Widget.Gtk_Widget (Get_Object (Builder, "window1")));
Gtk.Main.Main;
-- Step 4: when the application terminates
-- call Unref to free memory associated with the Builder.
Unref (Builder);
Put_Line ("Program Factorial is finished !");
exception
when Error : others =>
Ada.Text_IO.Put_Line (Ada.Exceptions.Exception_Information (Error));
end Factorial;
|
[
{
"context": "---------------------------\n-- Copyright (c) 2015, Natacha Porté --\n-- ",
"end": 115,
"score": 0.9998539686203003,
"start": 102,
"tag": "NAME",
"value": "Natacha Porté"
}
] |
src/natools-file_streams.ads
|
faelys/natools
| 0 |
------------------------------------------------------------------------------
-- Copyright (c) 2015, Natacha Porté --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Natools.File_Streams provides a standard stream object associated with --
-- a file on disk. The semantics of the provided subprograms mirror those --
-- of Ada.Streams.Stream_IO, except that the file has to be opened on --
-- object initialization and closed on finalization. --
-- The current implementation does not expose most useful primitives, but --
-- is enough for a direct use as a stream object. --
------------------------------------------------------------------------------
with Ada.Streams.Stream_IO;
private with Ada.Finalization;
package Natools.File_Streams is
pragma Preelaborate;
package Stream_IO renames Ada.Streams.Stream_IO;
type File_Stream is limited new Ada.Streams.Root_Stream_Type with private;
overriding procedure Read
(Stream : in out File_Stream;
Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset);
overriding procedure Write
(Stream : in out File_Stream;
Item : in Ada.Streams.Stream_Element_Array);
not overriding function Create
(Mode : in Stream_IO.File_Mode := Stream_IO.Out_File;
Name : in String := "";
Form : in String := "")
return File_Stream;
not overriding function Open
(Mode : in Stream_IO.File_Mode;
Name : in String;
Form : in String := "")
return File_Stream;
not overriding function Mode (File : in File_Stream)
return Stream_IO.File_Mode;
not overriding function Name (File : in File_Stream) return String;
not overriding function Form (File : in File_Stream) return String;
private
type Autoclose is new Ada.Finalization.Limited_Controlled with record
Backend : Stream_IO.File_Type;
end record;
overriding procedure Finalize (Object : in out Autoclose);
type File_Stream is limited new Ada.Streams.Root_Stream_Type
with record
Internal : Autoclose;
end record;
end Natools.File_Streams;
|
11726
|
------------------------------------------------------------------------------
-- Copyright (c) 2015, <NAME> --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Natools.File_Streams provides a standard stream object associated with --
-- a file on disk. The semantics of the provided subprograms mirror those --
-- of Ada.Streams.Stream_IO, except that the file has to be opened on --
-- object initialization and closed on finalization. --
-- The current implementation does not expose most useful primitives, but --
-- is enough for a direct use as a stream object. --
------------------------------------------------------------------------------
with Ada.Streams.Stream_IO;
private with Ada.Finalization;
package Natools.File_Streams is
pragma Preelaborate;
package Stream_IO renames Ada.Streams.Stream_IO;
type File_Stream is limited new Ada.Streams.Root_Stream_Type with private;
overriding procedure Read
(Stream : in out File_Stream;
Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset);
overriding procedure Write
(Stream : in out File_Stream;
Item : in Ada.Streams.Stream_Element_Array);
not overriding function Create
(Mode : in Stream_IO.File_Mode := Stream_IO.Out_File;
Name : in String := "";
Form : in String := "")
return File_Stream;
not overriding function Open
(Mode : in Stream_IO.File_Mode;
Name : in String;
Form : in String := "")
return File_Stream;
not overriding function Mode (File : in File_Stream)
return Stream_IO.File_Mode;
not overriding function Name (File : in File_Stream) return String;
not overriding function Form (File : in File_Stream) return String;
private
type Autoclose is new Ada.Finalization.Limited_Controlled with record
Backend : Stream_IO.File_Type;
end record;
overriding procedure Finalize (Object : in out Autoclose);
type File_Stream is limited new Ada.Streams.Root_Stream_Type
with record
Internal : Autoclose;
end record;
end Natools.File_Streams;
| true |
------------------------------------------------------------------------------
-- Copyright (c) 2015, PI:NAME:<NAME>END_PI --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Natools.File_Streams provides a standard stream object associated with --
-- a file on disk. The semantics of the provided subprograms mirror those --
-- of Ada.Streams.Stream_IO, except that the file has to be opened on --
-- object initialization and closed on finalization. --
-- The current implementation does not expose most useful primitives, but --
-- is enough for a direct use as a stream object. --
------------------------------------------------------------------------------
with Ada.Streams.Stream_IO;
private with Ada.Finalization;
package Natools.File_Streams is
pragma Preelaborate;
package Stream_IO renames Ada.Streams.Stream_IO;
type File_Stream is limited new Ada.Streams.Root_Stream_Type with private;
overriding procedure Read
(Stream : in out File_Stream;
Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset);
overriding procedure Write
(Stream : in out File_Stream;
Item : in Ada.Streams.Stream_Element_Array);
not overriding function Create
(Mode : in Stream_IO.File_Mode := Stream_IO.Out_File;
Name : in String := "";
Form : in String := "")
return File_Stream;
not overriding function Open
(Mode : in Stream_IO.File_Mode;
Name : in String;
Form : in String := "")
return File_Stream;
not overriding function Mode (File : in File_Stream)
return Stream_IO.File_Mode;
not overriding function Name (File : in File_Stream) return String;
not overriding function Form (File : in File_Stream) return String;
private
type Autoclose is new Ada.Finalization.Limited_Controlled with record
Backend : Stream_IO.File_Type;
end record;
overriding procedure Finalize (Object : in out Autoclose);
type File_Stream is limited new Ada.Streams.Root_Stream_Type
with record
Internal : Autoclose;
end record;
end Natools.File_Streams;
|
[
{
"context": "-- part of OpenGLAda, (c) 2017 Felix Krause\n-- released under the terms of the MIT license, ",
"end": 44,
"score": 0.9998456239700317,
"start": 32,
"tag": "NAME",
"value": "Felix Krause"
}
] |
src/gl/implementation/gl-pixels.adb
|
Roldak/OpenGLAda
| 79 |
-- part of OpenGLAda, (c) 2017 Felix Krause
-- released under the terms of the MIT license, see the file "COPYING"
with GL.API;
with GL.Enums.Getter;
package body GL.Pixels is
procedure Set_Pack_Swap_Bytes (Value : Boolean) is
begin
API.Pixel_Store (Enums.Pack_Swap_Bytes, Low_Level.Bool (Value));
Raise_Exception_On_OpenGL_Error;
end Set_Pack_Swap_Bytes;
procedure Set_Pack_LSB_First (Value : Boolean) is
begin
API.Pixel_Store (Enums.Pack_LSB_First, Low_Level.Bool (Value));
Raise_Exception_On_OpenGL_Error;
end Set_Pack_LSB_First;
procedure Set_Pack_Row_Length (Value : Size) is
begin
API.Pixel_Store (Enums.Pack_Row_Length, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Pack_Row_Length;
procedure Set_Pack_Image_Height (Value : Size) is
begin
API.Pixel_Store (Enums.Pack_Image_Height, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Pack_Image_Height;
procedure Set_Pack_Skip_Pixels (Value : Size) is
begin
API.Pixel_Store (Enums.Pack_Skip_Pixels, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Pack_Skip_Pixels;
procedure Set_Pack_Skip_Rows (Value : Size) is
begin
API.Pixel_Store (Enums.Pack_Skip_Rows, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Pack_Skip_Rows;
procedure Set_Pack_Skip_Images (Value : Size) is
begin
API.Pixel_Store (Enums.Pack_Skip_Images, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Pack_Skip_Images;
procedure Set_Pack_Alignment (Value : Alignment) is
begin
API.Pixel_Store (Enums.Pack_Alignment, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Pack_Alignment;
function Pack_Swap_Bytes return Boolean is
Ret : aliased Low_Level.Bool;
begin
API.Get_Boolean (Enums.Getter.Pack_Swap_Bytes, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Boolean (Ret);
end Pack_Swap_Bytes;
function Pack_LSB_First return Boolean is
Ret : aliased Low_Level.Bool;
begin
API.Get_Boolean (Enums.Getter.Pack_Lsb_First, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Boolean (Ret);
end Pack_LSB_First;
function Pack_Row_Length return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Pack_Row_Length, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Pack_Row_Length;
function Pack_Image_Height return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Pack_Image_Height, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Pack_Image_Height;
function Pack_Skip_Pixels return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Pack_Skip_Pixels, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Pack_Skip_Pixels;
function Pack_Skip_Rows return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Pack_Skip_Rows, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Pack_Skip_Rows;
function Pack_Skip_Images return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Pack_Skip_Images, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Pack_Skip_Images;
function Pack_Alignment return Alignment is
Ret : aliased Alignment;
begin
API.Get_Alignment (Enums.Getter.Pack_Alignment, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Pack_Alignment;
procedure Set_Unpack_Swap_Bytes (Value : Boolean) is
begin
API.Pixel_Store (Enums.Unpack_Swap_Bytes, Low_Level.Bool (Value));
Raise_Exception_On_OpenGL_Error;
end Set_Unpack_Swap_Bytes;
procedure Set_Unpack_LSB_First (Value : Boolean) is
begin
API.Pixel_Store (Enums.Unpack_LSB_First, Low_Level.Bool (Value));
Raise_Exception_On_OpenGL_Error;
end Set_Unpack_LSB_First;
procedure Set_Unpack_Row_Length (Value : Size) is
begin
API.Pixel_Store (Enums.Unpack_Row_Length, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Unpack_Row_Length;
procedure Set_Unpack_Image_Height (Value : Size) is
begin
API.Pixel_Store (Enums.Unpack_Image_Height, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Unpack_Image_Height;
procedure Set_Unpack_Skip_Pixels (Value : Size) is
begin
API.Pixel_Store (Enums.Unpack_Skip_Pixels, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Unpack_Skip_Pixels;
procedure Set_Unpack_Skip_Rows (Value : Size) is
begin
API.Pixel_Store (Enums.Unpack_Skip_Rows, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Unpack_Skip_Rows;
procedure Set_Unpack_Skip_Images (Value : Size) is
begin
API.Pixel_Store (Enums.Unpack_Skip_Images, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Unpack_Skip_Images;
procedure Set_Unpack_Alignment (Value : Alignment) is
begin
API.Pixel_Store (Enums.Unpack_Alignment, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Unpack_Alignment;
function Unpack_Swap_Bytes return Boolean is
Ret : aliased Low_Level.Bool;
begin
API.Get_Boolean (Enums.Getter.Unpack_Swap_Bytes, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Boolean (Ret);
end Unpack_Swap_Bytes;
function Unpack_LSB_First return Boolean is
Ret : aliased Low_Level.Bool;
begin
API.Get_Boolean (Enums.Getter.Unpack_Lsb_First, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Boolean (Ret);
end Unpack_LSB_First;
function Unpack_Row_Length return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Unpack_Row_Length, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Unpack_Row_Length;
function Unpack_Image_Height return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Unpack_Image_Height, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Unpack_Image_Height;
function Unpack_Skip_Pixels return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Unpack_Skip_Pixels, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Unpack_Skip_Pixels;
function Unpack_Skip_Rows return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Unpack_Skip_Rows, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Unpack_Skip_Rows;
function Unpack_Skip_Images return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Unpack_Skip_Images, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Unpack_Skip_Images;
function Unpack_Alignment return Alignment is
Ret : aliased Alignment;
begin
API.Get_Alignment (Enums.Getter.Unpack_Alignment, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Unpack_Alignment;
end GL.Pixels;
|
24646
|
-- part of OpenGLAda, (c) 2017 <NAME>
-- released under the terms of the MIT license, see the file "COPYING"
with GL.API;
with GL.Enums.Getter;
package body GL.Pixels is
procedure Set_Pack_Swap_Bytes (Value : Boolean) is
begin
API.Pixel_Store (Enums.Pack_Swap_Bytes, Low_Level.Bool (Value));
Raise_Exception_On_OpenGL_Error;
end Set_Pack_Swap_Bytes;
procedure Set_Pack_LSB_First (Value : Boolean) is
begin
API.Pixel_Store (Enums.Pack_LSB_First, Low_Level.Bool (Value));
Raise_Exception_On_OpenGL_Error;
end Set_Pack_LSB_First;
procedure Set_Pack_Row_Length (Value : Size) is
begin
API.Pixel_Store (Enums.Pack_Row_Length, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Pack_Row_Length;
procedure Set_Pack_Image_Height (Value : Size) is
begin
API.Pixel_Store (Enums.Pack_Image_Height, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Pack_Image_Height;
procedure Set_Pack_Skip_Pixels (Value : Size) is
begin
API.Pixel_Store (Enums.Pack_Skip_Pixels, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Pack_Skip_Pixels;
procedure Set_Pack_Skip_Rows (Value : Size) is
begin
API.Pixel_Store (Enums.Pack_Skip_Rows, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Pack_Skip_Rows;
procedure Set_Pack_Skip_Images (Value : Size) is
begin
API.Pixel_Store (Enums.Pack_Skip_Images, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Pack_Skip_Images;
procedure Set_Pack_Alignment (Value : Alignment) is
begin
API.Pixel_Store (Enums.Pack_Alignment, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Pack_Alignment;
function Pack_Swap_Bytes return Boolean is
Ret : aliased Low_Level.Bool;
begin
API.Get_Boolean (Enums.Getter.Pack_Swap_Bytes, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Boolean (Ret);
end Pack_Swap_Bytes;
function Pack_LSB_First return Boolean is
Ret : aliased Low_Level.Bool;
begin
API.Get_Boolean (Enums.Getter.Pack_Lsb_First, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Boolean (Ret);
end Pack_LSB_First;
function Pack_Row_Length return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Pack_Row_Length, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Pack_Row_Length;
function Pack_Image_Height return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Pack_Image_Height, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Pack_Image_Height;
function Pack_Skip_Pixels return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Pack_Skip_Pixels, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Pack_Skip_Pixels;
function Pack_Skip_Rows return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Pack_Skip_Rows, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Pack_Skip_Rows;
function Pack_Skip_Images return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Pack_Skip_Images, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Pack_Skip_Images;
function Pack_Alignment return Alignment is
Ret : aliased Alignment;
begin
API.Get_Alignment (Enums.Getter.Pack_Alignment, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Pack_Alignment;
procedure Set_Unpack_Swap_Bytes (Value : Boolean) is
begin
API.Pixel_Store (Enums.Unpack_Swap_Bytes, Low_Level.Bool (Value));
Raise_Exception_On_OpenGL_Error;
end Set_Unpack_Swap_Bytes;
procedure Set_Unpack_LSB_First (Value : Boolean) is
begin
API.Pixel_Store (Enums.Unpack_LSB_First, Low_Level.Bool (Value));
Raise_Exception_On_OpenGL_Error;
end Set_Unpack_LSB_First;
procedure Set_Unpack_Row_Length (Value : Size) is
begin
API.Pixel_Store (Enums.Unpack_Row_Length, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Unpack_Row_Length;
procedure Set_Unpack_Image_Height (Value : Size) is
begin
API.Pixel_Store (Enums.Unpack_Image_Height, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Unpack_Image_Height;
procedure Set_Unpack_Skip_Pixels (Value : Size) is
begin
API.Pixel_Store (Enums.Unpack_Skip_Pixels, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Unpack_Skip_Pixels;
procedure Set_Unpack_Skip_Rows (Value : Size) is
begin
API.Pixel_Store (Enums.Unpack_Skip_Rows, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Unpack_Skip_Rows;
procedure Set_Unpack_Skip_Images (Value : Size) is
begin
API.Pixel_Store (Enums.Unpack_Skip_Images, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Unpack_Skip_Images;
procedure Set_Unpack_Alignment (Value : Alignment) is
begin
API.Pixel_Store (Enums.Unpack_Alignment, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Unpack_Alignment;
function Unpack_Swap_Bytes return Boolean is
Ret : aliased Low_Level.Bool;
begin
API.Get_Boolean (Enums.Getter.Unpack_Swap_Bytes, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Boolean (Ret);
end Unpack_Swap_Bytes;
function Unpack_LSB_First return Boolean is
Ret : aliased Low_Level.Bool;
begin
API.Get_Boolean (Enums.Getter.Unpack_Lsb_First, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Boolean (Ret);
end Unpack_LSB_First;
function Unpack_Row_Length return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Unpack_Row_Length, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Unpack_Row_Length;
function Unpack_Image_Height return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Unpack_Image_Height, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Unpack_Image_Height;
function Unpack_Skip_Pixels return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Unpack_Skip_Pixels, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Unpack_Skip_Pixels;
function Unpack_Skip_Rows return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Unpack_Skip_Rows, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Unpack_Skip_Rows;
function Unpack_Skip_Images return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Unpack_Skip_Images, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Unpack_Skip_Images;
function Unpack_Alignment return Alignment is
Ret : aliased Alignment;
begin
API.Get_Alignment (Enums.Getter.Unpack_Alignment, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Unpack_Alignment;
end GL.Pixels;
| true |
-- part of OpenGLAda, (c) 2017 PI:NAME:<NAME>END_PI
-- released under the terms of the MIT license, see the file "COPYING"
with GL.API;
with GL.Enums.Getter;
package body GL.Pixels is
procedure Set_Pack_Swap_Bytes (Value : Boolean) is
begin
API.Pixel_Store (Enums.Pack_Swap_Bytes, Low_Level.Bool (Value));
Raise_Exception_On_OpenGL_Error;
end Set_Pack_Swap_Bytes;
procedure Set_Pack_LSB_First (Value : Boolean) is
begin
API.Pixel_Store (Enums.Pack_LSB_First, Low_Level.Bool (Value));
Raise_Exception_On_OpenGL_Error;
end Set_Pack_LSB_First;
procedure Set_Pack_Row_Length (Value : Size) is
begin
API.Pixel_Store (Enums.Pack_Row_Length, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Pack_Row_Length;
procedure Set_Pack_Image_Height (Value : Size) is
begin
API.Pixel_Store (Enums.Pack_Image_Height, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Pack_Image_Height;
procedure Set_Pack_Skip_Pixels (Value : Size) is
begin
API.Pixel_Store (Enums.Pack_Skip_Pixels, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Pack_Skip_Pixels;
procedure Set_Pack_Skip_Rows (Value : Size) is
begin
API.Pixel_Store (Enums.Pack_Skip_Rows, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Pack_Skip_Rows;
procedure Set_Pack_Skip_Images (Value : Size) is
begin
API.Pixel_Store (Enums.Pack_Skip_Images, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Pack_Skip_Images;
procedure Set_Pack_Alignment (Value : Alignment) is
begin
API.Pixel_Store (Enums.Pack_Alignment, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Pack_Alignment;
function Pack_Swap_Bytes return Boolean is
Ret : aliased Low_Level.Bool;
begin
API.Get_Boolean (Enums.Getter.Pack_Swap_Bytes, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Boolean (Ret);
end Pack_Swap_Bytes;
function Pack_LSB_First return Boolean is
Ret : aliased Low_Level.Bool;
begin
API.Get_Boolean (Enums.Getter.Pack_Lsb_First, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Boolean (Ret);
end Pack_LSB_First;
function Pack_Row_Length return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Pack_Row_Length, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Pack_Row_Length;
function Pack_Image_Height return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Pack_Image_Height, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Pack_Image_Height;
function Pack_Skip_Pixels return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Pack_Skip_Pixels, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Pack_Skip_Pixels;
function Pack_Skip_Rows return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Pack_Skip_Rows, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Pack_Skip_Rows;
function Pack_Skip_Images return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Pack_Skip_Images, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Pack_Skip_Images;
function Pack_Alignment return Alignment is
Ret : aliased Alignment;
begin
API.Get_Alignment (Enums.Getter.Pack_Alignment, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Pack_Alignment;
procedure Set_Unpack_Swap_Bytes (Value : Boolean) is
begin
API.Pixel_Store (Enums.Unpack_Swap_Bytes, Low_Level.Bool (Value));
Raise_Exception_On_OpenGL_Error;
end Set_Unpack_Swap_Bytes;
procedure Set_Unpack_LSB_First (Value : Boolean) is
begin
API.Pixel_Store (Enums.Unpack_LSB_First, Low_Level.Bool (Value));
Raise_Exception_On_OpenGL_Error;
end Set_Unpack_LSB_First;
procedure Set_Unpack_Row_Length (Value : Size) is
begin
API.Pixel_Store (Enums.Unpack_Row_Length, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Unpack_Row_Length;
procedure Set_Unpack_Image_Height (Value : Size) is
begin
API.Pixel_Store (Enums.Unpack_Image_Height, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Unpack_Image_Height;
procedure Set_Unpack_Skip_Pixels (Value : Size) is
begin
API.Pixel_Store (Enums.Unpack_Skip_Pixels, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Unpack_Skip_Pixels;
procedure Set_Unpack_Skip_Rows (Value : Size) is
begin
API.Pixel_Store (Enums.Unpack_Skip_Rows, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Unpack_Skip_Rows;
procedure Set_Unpack_Skip_Images (Value : Size) is
begin
API.Pixel_Store (Enums.Unpack_Skip_Images, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Unpack_Skip_Images;
procedure Set_Unpack_Alignment (Value : Alignment) is
begin
API.Pixel_Store (Enums.Unpack_Alignment, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Unpack_Alignment;
function Unpack_Swap_Bytes return Boolean is
Ret : aliased Low_Level.Bool;
begin
API.Get_Boolean (Enums.Getter.Unpack_Swap_Bytes, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Boolean (Ret);
end Unpack_Swap_Bytes;
function Unpack_LSB_First return Boolean is
Ret : aliased Low_Level.Bool;
begin
API.Get_Boolean (Enums.Getter.Unpack_Lsb_First, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Boolean (Ret);
end Unpack_LSB_First;
function Unpack_Row_Length return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Unpack_Row_Length, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Unpack_Row_Length;
function Unpack_Image_Height return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Unpack_Image_Height, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Unpack_Image_Height;
function Unpack_Skip_Pixels return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Unpack_Skip_Pixels, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Unpack_Skip_Pixels;
function Unpack_Skip_Rows return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Unpack_Skip_Rows, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Unpack_Skip_Rows;
function Unpack_Skip_Images return Size is
Ret : aliased Types.Int;
begin
API.Get_Integer (Enums.Getter.Unpack_Skip_Images, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Size (Ret);
end Unpack_Skip_Images;
function Unpack_Alignment return Alignment is
Ret : aliased Alignment;
begin
API.Get_Alignment (Enums.Getter.Unpack_Alignment, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Unpack_Alignment;
end GL.Pixels;
|
[
{
"context": "atter_Test\n\n Test_1:\n begin\n Name := \"Test_1\";\n Ada_Format.Put(\"%s:\\tDefault Formats\\n\",",
"end": 1383,
"score": 0.9017577171325684,
"start": 1377,
"tag": "USERNAME",
"value": "Test_1"
},
{
"context": "nd Test_1;\n\n Test_2:\n begin\n Name := \"Test_2\";\n Ada_Format.Put(\"%s:\\t\" &\n ",
"end": 1993,
"score": 0.9644522666931152,
"start": 1987,
"tag": "USERNAME",
"value": "Test_2"
},
{
"context": "nd Test_2;\n\n Test_3:\n begin\n Name := \"Test_3\";\n Ada_Format.Put(\"%s:\\t\" &\n ",
"end": 2777,
"score": 0.9895889759063721,
"start": 2771,
"tag": "USERNAME",
"value": "Test_3"
},
{
"context": "nd Test_3;\n\n Test_4:\n begin\n Name := \"Test_4\";\n Ada_Format.Put(\"%s:\\tDefault Formats, Ze",
"end": 3581,
"score": 0.9898335337638855,
"start": 3575,
"tag": "USERNAME",
"value": "Test_4"
},
{
"context": "nd Test_4;\n\n Test_5:\n begin\n Name := \"Test_5\";\n Ada_Format.Put(\"%s:\\t\" &\n ",
"end": 4057,
"score": 0.5577200055122375,
"start": 4053,
"tag": "NAME",
"value": "Test"
},
{
"context": "est_4;\n\n Test_5:\n begin\n Name := \"Test_5\";\n Ada_Format.Put(\"%s:\\t\" &\n ",
"end": 4059,
"score": 0.8658063411712646,
"start": 4058,
"tag": "USERNAME",
"value": "5"
},
{
"context": "nd Test_5;\n\n Test_6:\n begin\n Name := \"Test_6\";\n Ada_Format.Put(\"%s:\\t\" &\n ",
"end": 4670,
"score": 0.7993040680885315,
"start": 4664,
"tag": "USERNAME",
"value": "Test_6"
},
{
"context": "nd Test_6;\n\n Test_7:\n begin\n Name := \"Test_7\";\n Ada_Format.Put(\"%s:\\t\" &\n ",
"end": 5350,
"score": 0.7810128331184387,
"start": 5344,
"tag": "USERNAME",
"value": "Test_7"
}
] |
src/formatter_test.adb
|
zenharris/ada-bbs
| 2 |
--------------------------
with Text_IO;
with Formatter;
procedure Formatter_Test is
-- ++
--
-- FUNCTIONAL DESCRIPTION:
--
-- This is a test driver program for the generic Formatter package.
--
-- FORMAL PARAMETERS:
--
-- None.
--
-- DESIGN:
--
-- This test driver contains a number of calls to the Formatter Put
-- procedure with a format string and data values. Each test is identified
-- by a test number and a description of the test.
--
-- EXCEPTIONS:
--
-- No exceptions are declared in this test driver, although any exception
-- raised by Formatter.Put are handled.
--
-- KEYWORDS:
--
-- Test Driver.
--
-- --
type Days_of_Week is (Sunday,
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday);
package Ada_Format is
new Formatter (Enumerated => Days_of_Week);
use Ada_Format; -- Direct visibility of F conversion functions
Name : String(1..6);
Integer_Value : Positive := 66;
Real_Value : Float := 3.1415927;
Character_Value : Character := 'x';
Enumeration_Value : Days_of_Week := Thursday;
begin -- Formatter_Test
Test_1:
begin
Name := "Test_1";
Ada_Format.Put("%s:\tDefault Formats\n", F(Name));
Ada_Format.Put("Integer_Value = '%i'\n", F(Integer_Value));
Ada_Format.Put("Real_Value = '%f'\n", F(Real_Value));
Ada_Format.Put("Scientific_Value = '%e'\n", F(Real_Value));
Ada_Format.Put("Character_Value = '%c'\n", F(Character_Value));
Ada_Format.Put("Enumeration_Value = '%s'\n\n", F(Enumeration_Value));
exception
when others =>
Text_IO.Put_Line("Test_1: Unknown exception raised.");
Text_IO.New_Line;
end Test_1;
Test_2:
begin
Name := "Test_2";
Ada_Format.Put("%s:\t" &
"Wide-Field Formats\n" &
"Integer_Value = '%15i'\n" &
"Real_Value = '%15f'\n" &
"Scientific_Value = '%15e'\n" &
"Character_Value = '%15c'\n" &
"Enumeration_Value = '%15s'\n\n",
(F(Name),
F(Integer_Value),
F(Real_Value),
F(Real_Value),
F(Character_Value),
F(Enumeration_Value)));
exception
when others =>
Text_IO.Put_Line("Test_2: Unknown exception raised.");
Text_IO.New_Line;
end Test_2;
Test_3:
begin
Name := "Test_3";
Ada_Format.Put("%s:\t" &
"Wide-Field Left-Justified Formats\n" &
"Integer_Value = '%-15i'\n" &
"Real_Value = '%-15f'\n" &
"Scientific_Value = '%-15e'\n" &
"Character_Value = '%-15c'\n" &
"Enumeration_Value = '%-15s'\n\n",
(F(Name),
F(Integer_Value),
F(Real_Value),
F(Real_Value),
F(Character_Value),
F(Enumeration_Value)));
exception
when others =>
Text_IO.Put_Line("Test_3: Unknown exception raised.");
Text_IO.New_Line;
end Test_3;
Test_4:
begin
Name := "Test_4";
Ada_Format.Put("%s:\tDefault Formats, Zero-Fill\n", F(Name));
Ada_Format.Put("Integer_Value = '%0i'\n", F(Integer_Value));
Ada_Format.Put("Real_Value = '%0f'\n", F(Real_Value));
Ada_Format.Put("Scientific_Value = '%0e'\n\n", F(Real_Value));
exception
when others =>
Text_IO.Put_Line("Test_4: Unknown exception raised.");
Text_IO.New_Line;
end Test_4;
Test_5:
begin
Name := "Test_5";
Ada_Format.Put("%s:\t" &
"Specified Field Width, Non-Decimal Bases\n" &
"Integer Value = '%4i'\n" &
"Hexadecimal Value = '%4x'\n" &
"Octal Value = '%4o'\n\n",
(F(Name),
F(Integer_Value),
F(Integer_Value),
F(Integer_Value)));
exception
when others =>
Text_IO.Put_Line("Test_5: Unknown exception raised.");
Text_IO.New_Line;
end Test_5;
Test_6:
begin
Name := "Test_6";
Ada_Format.Put("%s:\t" &
"Precision Formats\n" &
"Integer_Value = '%15.4i'\n" &
"Real_Value = '%15.4f'\n" &
"Scientific_Value = '%15.4e'\n" &
"String_Value = '%15.6s'\n\n",
(F(Name),
F(Integer_Value),
F(Real_Value),
F(Real_Value),
F(Name)));
exception
when others =>
Text_IO.Put_Line("Test_6: Unknown exception raised.");
Text_IO.New_Line;
end Test_6;
Test_7:
begin
Name := "Test_7";
Ada_Format.Put("%s:\t" &
"Incorrect Field Widths\n" &
"Integer_Value = '%1i'\n" &
"Real_Value = '%2.1f'\n" &
"Scientific_Value = '%3.2e'\n" &
"String_Value = '%4s'\n" &
"Unknown Format = '%+02,7z'\n\n",
(F(Name),
F(Integer_Value),
F(Real_Value),
F(Real_Value),
F(Name),
F(25)));
exception
when others =>
Text_IO.Put_Line("Test_7: Unknown exception raised.");
Text_IO.New_Line;
end Test_7;
end Formatter_Test;
-----------------------------
|
24304
|
--------------------------
with Text_IO;
with Formatter;
procedure Formatter_Test is
-- ++
--
-- FUNCTIONAL DESCRIPTION:
--
-- This is a test driver program for the generic Formatter package.
--
-- FORMAL PARAMETERS:
--
-- None.
--
-- DESIGN:
--
-- This test driver contains a number of calls to the Formatter Put
-- procedure with a format string and data values. Each test is identified
-- by a test number and a description of the test.
--
-- EXCEPTIONS:
--
-- No exceptions are declared in this test driver, although any exception
-- raised by Formatter.Put are handled.
--
-- KEYWORDS:
--
-- Test Driver.
--
-- --
type Days_of_Week is (Sunday,
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday);
package Ada_Format is
new Formatter (Enumerated => Days_of_Week);
use Ada_Format; -- Direct visibility of F conversion functions
Name : String(1..6);
Integer_Value : Positive := 66;
Real_Value : Float := 3.1415927;
Character_Value : Character := 'x';
Enumeration_Value : Days_of_Week := Thursday;
begin -- Formatter_Test
Test_1:
begin
Name := "Test_1";
Ada_Format.Put("%s:\tDefault Formats\n", F(Name));
Ada_Format.Put("Integer_Value = '%i'\n", F(Integer_Value));
Ada_Format.Put("Real_Value = '%f'\n", F(Real_Value));
Ada_Format.Put("Scientific_Value = '%e'\n", F(Real_Value));
Ada_Format.Put("Character_Value = '%c'\n", F(Character_Value));
Ada_Format.Put("Enumeration_Value = '%s'\n\n", F(Enumeration_Value));
exception
when others =>
Text_IO.Put_Line("Test_1: Unknown exception raised.");
Text_IO.New_Line;
end Test_1;
Test_2:
begin
Name := "Test_2";
Ada_Format.Put("%s:\t" &
"Wide-Field Formats\n" &
"Integer_Value = '%15i'\n" &
"Real_Value = '%15f'\n" &
"Scientific_Value = '%15e'\n" &
"Character_Value = '%15c'\n" &
"Enumeration_Value = '%15s'\n\n",
(F(Name),
F(Integer_Value),
F(Real_Value),
F(Real_Value),
F(Character_Value),
F(Enumeration_Value)));
exception
when others =>
Text_IO.Put_Line("Test_2: Unknown exception raised.");
Text_IO.New_Line;
end Test_2;
Test_3:
begin
Name := "Test_3";
Ada_Format.Put("%s:\t" &
"Wide-Field Left-Justified Formats\n" &
"Integer_Value = '%-15i'\n" &
"Real_Value = '%-15f'\n" &
"Scientific_Value = '%-15e'\n" &
"Character_Value = '%-15c'\n" &
"Enumeration_Value = '%-15s'\n\n",
(F(Name),
F(Integer_Value),
F(Real_Value),
F(Real_Value),
F(Character_Value),
F(Enumeration_Value)));
exception
when others =>
Text_IO.Put_Line("Test_3: Unknown exception raised.");
Text_IO.New_Line;
end Test_3;
Test_4:
begin
Name := "Test_4";
Ada_Format.Put("%s:\tDefault Formats, Zero-Fill\n", F(Name));
Ada_Format.Put("Integer_Value = '%0i'\n", F(Integer_Value));
Ada_Format.Put("Real_Value = '%0f'\n", F(Real_Value));
Ada_Format.Put("Scientific_Value = '%0e'\n\n", F(Real_Value));
exception
when others =>
Text_IO.Put_Line("Test_4: Unknown exception raised.");
Text_IO.New_Line;
end Test_4;
Test_5:
begin
Name := "<NAME>_5";
Ada_Format.Put("%s:\t" &
"Specified Field Width, Non-Decimal Bases\n" &
"Integer Value = '%4i'\n" &
"Hexadecimal Value = '%4x'\n" &
"Octal Value = '%4o'\n\n",
(F(Name),
F(Integer_Value),
F(Integer_Value),
F(Integer_Value)));
exception
when others =>
Text_IO.Put_Line("Test_5: Unknown exception raised.");
Text_IO.New_Line;
end Test_5;
Test_6:
begin
Name := "Test_6";
Ada_Format.Put("%s:\t" &
"Precision Formats\n" &
"Integer_Value = '%15.4i'\n" &
"Real_Value = '%15.4f'\n" &
"Scientific_Value = '%15.4e'\n" &
"String_Value = '%15.6s'\n\n",
(F(Name),
F(Integer_Value),
F(Real_Value),
F(Real_Value),
F(Name)));
exception
when others =>
Text_IO.Put_Line("Test_6: Unknown exception raised.");
Text_IO.New_Line;
end Test_6;
Test_7:
begin
Name := "Test_7";
Ada_Format.Put("%s:\t" &
"Incorrect Field Widths\n" &
"Integer_Value = '%1i'\n" &
"Real_Value = '%2.1f'\n" &
"Scientific_Value = '%3.2e'\n" &
"String_Value = '%4s'\n" &
"Unknown Format = '%+02,7z'\n\n",
(F(Name),
F(Integer_Value),
F(Real_Value),
F(Real_Value),
F(Name),
F(25)));
exception
when others =>
Text_IO.Put_Line("Test_7: Unknown exception raised.");
Text_IO.New_Line;
end Test_7;
end Formatter_Test;
-----------------------------
| true |
--------------------------
with Text_IO;
with Formatter;
procedure Formatter_Test is
-- ++
--
-- FUNCTIONAL DESCRIPTION:
--
-- This is a test driver program for the generic Formatter package.
--
-- FORMAL PARAMETERS:
--
-- None.
--
-- DESIGN:
--
-- This test driver contains a number of calls to the Formatter Put
-- procedure with a format string and data values. Each test is identified
-- by a test number and a description of the test.
--
-- EXCEPTIONS:
--
-- No exceptions are declared in this test driver, although any exception
-- raised by Formatter.Put are handled.
--
-- KEYWORDS:
--
-- Test Driver.
--
-- --
type Days_of_Week is (Sunday,
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday);
package Ada_Format is
new Formatter (Enumerated => Days_of_Week);
use Ada_Format; -- Direct visibility of F conversion functions
Name : String(1..6);
Integer_Value : Positive := 66;
Real_Value : Float := 3.1415927;
Character_Value : Character := 'x';
Enumeration_Value : Days_of_Week := Thursday;
begin -- Formatter_Test
Test_1:
begin
Name := "Test_1";
Ada_Format.Put("%s:\tDefault Formats\n", F(Name));
Ada_Format.Put("Integer_Value = '%i'\n", F(Integer_Value));
Ada_Format.Put("Real_Value = '%f'\n", F(Real_Value));
Ada_Format.Put("Scientific_Value = '%e'\n", F(Real_Value));
Ada_Format.Put("Character_Value = '%c'\n", F(Character_Value));
Ada_Format.Put("Enumeration_Value = '%s'\n\n", F(Enumeration_Value));
exception
when others =>
Text_IO.Put_Line("Test_1: Unknown exception raised.");
Text_IO.New_Line;
end Test_1;
Test_2:
begin
Name := "Test_2";
Ada_Format.Put("%s:\t" &
"Wide-Field Formats\n" &
"Integer_Value = '%15i'\n" &
"Real_Value = '%15f'\n" &
"Scientific_Value = '%15e'\n" &
"Character_Value = '%15c'\n" &
"Enumeration_Value = '%15s'\n\n",
(F(Name),
F(Integer_Value),
F(Real_Value),
F(Real_Value),
F(Character_Value),
F(Enumeration_Value)));
exception
when others =>
Text_IO.Put_Line("Test_2: Unknown exception raised.");
Text_IO.New_Line;
end Test_2;
Test_3:
begin
Name := "Test_3";
Ada_Format.Put("%s:\t" &
"Wide-Field Left-Justified Formats\n" &
"Integer_Value = '%-15i'\n" &
"Real_Value = '%-15f'\n" &
"Scientific_Value = '%-15e'\n" &
"Character_Value = '%-15c'\n" &
"Enumeration_Value = '%-15s'\n\n",
(F(Name),
F(Integer_Value),
F(Real_Value),
F(Real_Value),
F(Character_Value),
F(Enumeration_Value)));
exception
when others =>
Text_IO.Put_Line("Test_3: Unknown exception raised.");
Text_IO.New_Line;
end Test_3;
Test_4:
begin
Name := "Test_4";
Ada_Format.Put("%s:\tDefault Formats, Zero-Fill\n", F(Name));
Ada_Format.Put("Integer_Value = '%0i'\n", F(Integer_Value));
Ada_Format.Put("Real_Value = '%0f'\n", F(Real_Value));
Ada_Format.Put("Scientific_Value = '%0e'\n\n", F(Real_Value));
exception
when others =>
Text_IO.Put_Line("Test_4: Unknown exception raised.");
Text_IO.New_Line;
end Test_4;
Test_5:
begin
Name := "PI:NAME:<NAME>END_PI_5";
Ada_Format.Put("%s:\t" &
"Specified Field Width, Non-Decimal Bases\n" &
"Integer Value = '%4i'\n" &
"Hexadecimal Value = '%4x'\n" &
"Octal Value = '%4o'\n\n",
(F(Name),
F(Integer_Value),
F(Integer_Value),
F(Integer_Value)));
exception
when others =>
Text_IO.Put_Line("Test_5: Unknown exception raised.");
Text_IO.New_Line;
end Test_5;
Test_6:
begin
Name := "Test_6";
Ada_Format.Put("%s:\t" &
"Precision Formats\n" &
"Integer_Value = '%15.4i'\n" &
"Real_Value = '%15.4f'\n" &
"Scientific_Value = '%15.4e'\n" &
"String_Value = '%15.6s'\n\n",
(F(Name),
F(Integer_Value),
F(Real_Value),
F(Real_Value),
F(Name)));
exception
when others =>
Text_IO.Put_Line("Test_6: Unknown exception raised.");
Text_IO.New_Line;
end Test_6;
Test_7:
begin
Name := "Test_7";
Ada_Format.Put("%s:\t" &
"Incorrect Field Widths\n" &
"Integer_Value = '%1i'\n" &
"Real_Value = '%2.1f'\n" &
"Scientific_Value = '%3.2e'\n" &
"String_Value = '%4s'\n" &
"Unknown Format = '%+02,7z'\n\n",
(F(Name),
F(Integer_Value),
F(Real_Value),
F(Real_Value),
F(Name),
F(25)));
exception
when others =>
Text_IO.Put_Line("Test_7: Unknown exception raised.");
Text_IO.New_Line;
end Test_7;
end Formatter_Test;
-----------------------------
|
[
{
"context": "-- Copyright (C) 2019 Thierry Rascle <[email protected]>\n-- MIT license. Please refer t",
"end": 36,
"score": 0.999873161315918,
"start": 22,
"tag": "NAME",
"value": "Thierry Rascle"
},
{
"context": "-- Copyright (C) 2019 Thierry Rascle <[email protected]>\n-- MIT license. Please refer to the LICENSE file",
"end": 54,
"score": 0.9999322891235352,
"start": 38,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
src/apsepp-test_node_class.ads
|
thierr26/ada-apsepp
| 0 |
-- Copyright (C) 2019 Thierry Rascle <[email protected]>
-- MIT license. Please refer to the LICENSE file.
with Ada.Tags; use Ada.Tags;
with Apsepp.Generic_Prot_Integer;
private with Ada.Containers.Hashed_Maps,
Apsepp.Containers,
Apsepp.Tags;
package Apsepp.Test_Node_Class is
-- Evaluate the pre-conditions and class-wide pre-conditions in this
-- package.
pragma Assertion_Policy (Pre'Class => Check);
type Test_Outcome is (Failed, Passed);
type Run_Kind is (Check_Cond, Assert_Cond_And_Run_Test);
function Check_Cond_Run (Kind : Run_Kind) return Boolean
is (case Kind is
when Check_Cond => True,
when Assert_Cond_And_Run_Test => False);
type Test_Node_Count is new Natural;
subtype Test_Node_Index is Test_Node_Count range 1 .. Test_Node_Count'Last;
type Test_Routine_Count is new Natural;
subtype Test_Routine_Index
is Test_Routine_Count range 1 .. Test_Routine_Count'Last;
type Test_Routine is not null access procedure;
procedure Null_Test_Routine is null;
type Test_Assert_Count is new Natural;
package Prot_Test_Assert_Count
is new Generic_Prot_Integer (Test_Assert_Count);
subtype O_P_I_Test_Assert_Count is Prot_Test_Assert_Count.O_P_I_Type;
type Routine_State is record
Routine_Index : Test_Routine_Index;
Assert_Count : O_P_I_Test_Assert_Count;
Assert_Outcome : Test_Outcome;
end record;
type Tag_Routine_State is record
T : Tag;
S : Routine_State;
end record;
-- TODOC: A test node must not have two children with the same tag.
-- <2019-03-02>
-- TODOC: A runner must make sure that only one test node with a given tag
-- is running at a given time. <2019-03-02>
type Test_Node_Interfa is limited interface;
-- PORT: Type_Invariant'Class aspect causes compiler error.
-- 8.3.0 (x86_64-linux-gnu) GCC error:
-- in gnat_to_gnu_entity, at ada/gcc-interface/decl.c:425
-- <2019-06-10>
-- with Type_Invariant'Class
-- => (for all K_1 in 1 .. Test_Node_Interfa.Child_Count
-- => (for all K_2 in 1 .. Test_Node_Interfa.Child_Count
-- => K_2 = K_1 or else Test_Node_Interfa.Child (K_1)'Tag
-- /=
-- Test_Node_Interfa.Child (K_2)'Tag))
-- and then
-- (
-- Test_Node_Interfa.Has_Early_Test
-- or else
-- Test_Node_Interfa.Early_Run_Done
-- );
type Test_Node_Access is not null access all Test_Node_Interfa'Class;
type Test_Node_Array
is array (Test_Node_Index range <>) of Test_Node_Access;
type Test_Node_Array_Access is access Test_Node_Array;
not overriding
function Child_Count (Obj : Test_Node_Interfa)
return Test_Node_Count is abstract;
not overriding
function Child (Obj : Test_Node_Interfa;
K : Test_Node_Index) return Test_Node_Access is abstract
with Pre'Class => K <= Obj.Child_Count;
not overriding
function Routine_Count (Obj : Test_Node_Interfa) return Test_Routine_Count
is abstract;
not overriding
function Routine (Obj : Test_Node_Interfa;
K : Test_Routine_Index) return Test_Routine is abstract
with Pre'Class => K <= Obj.Routine_Count;
-- TODOC: Never called in implementations where Routine_Count returns 0.
-- <2019-03-19>
not overriding
procedure Setup_Routine (Obj : Test_Node_Interfa) is null;
not overriding
function No_Subtasking (Obj : Test_Node_Interfa)
return Boolean is abstract;
not overriding
function Has_Early_Test
(Obj : Test_Node_Interfa) return Boolean is abstract;
not overriding
function Early_Run_Done (Obj : Test_Node_Interfa) return Boolean
is abstract;
not overriding
procedure Early_Run (Obj : in out Test_Node_Interfa) is abstract
with Pre'Class => not Obj.Early_Run_Done,
Post'Class => Obj.Early_Run_Done;
not overriding
procedure Run
(Obj : in out Test_Node_Interfa;
Outcome : out Test_Outcome;
Kind : Run_Kind := Assert_Cond_And_Run_Test)
is abstract
with Post'Class => (case Kind is
when Check_Cond =>
True,
when Assert_Cond_And_Run_Test =>
Obj.Has_Early_Test xor Obj.Early_Run_Done);
procedure Run_Test_Routines (Obj : Test_Node_Interfa'Class;
Outcome : out Test_Outcome;
Kind : Run_Kind)
with Pre => Kind = Assert_Cond_And_Run_Test;
procedure Assert (Node_Tag : Tag; Cond : Boolean; Message : String := "");
private
use Ada.Containers,
Apsepp.Containers,
Apsepp.Tags;
package Routine_State_Hashed_Maps
is new Ada.Containers.Hashed_Maps (Key_Type => Tag,
Element_Type => Routine_State,
Hash => Tag_Hash,
Equivalent_Keys => "=");
type Tag_Routine_State_Array
is array (Index_Type range <>) of Tag_Routine_State;
----------------------------------------------------------------------------
protected Routine_State_Map_Handler is
procedure Reset_Routine_State (Node_Tag : Tag;
Routine_Index : Test_Routine_Index)
with Pre => Node_Tag /= No_Tag,
Post => Invariant;
procedure Increment_Assert_Count (Node_Tag : Tag)
with Pre => Node_Tag /= No_Tag,
Post => Invariant;
procedure Set_Failed_Outcome (Node_Tag : Tag)
with Pre => Node_Tag /= No_Tag,
Post => Invariant;
procedure Get_Assert_Count (Node_Tag : Tag;
Routine_Index : out Test_Routine_Index;
Count : out O_P_I_Test_Assert_Count)
with Pre => Node_Tag /= No_Tag,
Post => Invariant;
procedure Get_Assert_Outcome (Node_Tag : Tag;
Outcome : out Test_Outcome)
with Pre => Node_Tag /= No_Tag,
Post => Invariant;
procedure Delete (Node_Tag : Tag)
with Pre => Node_Tag /= No_Tag,
Post => Invariant;
function Invariant return Boolean;
function Count return Count_Type;
function To_Array return Tag_Routine_State_Array
with Post => To_Array'Result'First = 1
and then
To_Array'Result'Length = Count
and then
(for all R of To_Array'Result => R.T /= No_Tag);
private
T : Tag;
S : Routine_State;
M : Routine_State_Hashed_Maps.Map;
end Routine_State_Map_Handler;
----------------------------------------------------------------------------
end Apsepp.Test_Node_Class;
|
12049
|
-- Copyright (C) 2019 <NAME> <<EMAIL>>
-- MIT license. Please refer to the LICENSE file.
with Ada.Tags; use Ada.Tags;
with Apsepp.Generic_Prot_Integer;
private with Ada.Containers.Hashed_Maps,
Apsepp.Containers,
Apsepp.Tags;
package Apsepp.Test_Node_Class is
-- Evaluate the pre-conditions and class-wide pre-conditions in this
-- package.
pragma Assertion_Policy (Pre'Class => Check);
type Test_Outcome is (Failed, Passed);
type Run_Kind is (Check_Cond, Assert_Cond_And_Run_Test);
function Check_Cond_Run (Kind : Run_Kind) return Boolean
is (case Kind is
when Check_Cond => True,
when Assert_Cond_And_Run_Test => False);
type Test_Node_Count is new Natural;
subtype Test_Node_Index is Test_Node_Count range 1 .. Test_Node_Count'Last;
type Test_Routine_Count is new Natural;
subtype Test_Routine_Index
is Test_Routine_Count range 1 .. Test_Routine_Count'Last;
type Test_Routine is not null access procedure;
procedure Null_Test_Routine is null;
type Test_Assert_Count is new Natural;
package Prot_Test_Assert_Count
is new Generic_Prot_Integer (Test_Assert_Count);
subtype O_P_I_Test_Assert_Count is Prot_Test_Assert_Count.O_P_I_Type;
type Routine_State is record
Routine_Index : Test_Routine_Index;
Assert_Count : O_P_I_Test_Assert_Count;
Assert_Outcome : Test_Outcome;
end record;
type Tag_Routine_State is record
T : Tag;
S : Routine_State;
end record;
-- TODOC: A test node must not have two children with the same tag.
-- <2019-03-02>
-- TODOC: A runner must make sure that only one test node with a given tag
-- is running at a given time. <2019-03-02>
type Test_Node_Interfa is limited interface;
-- PORT: Type_Invariant'Class aspect causes compiler error.
-- 8.3.0 (x86_64-linux-gnu) GCC error:
-- in gnat_to_gnu_entity, at ada/gcc-interface/decl.c:425
-- <2019-06-10>
-- with Type_Invariant'Class
-- => (for all K_1 in 1 .. Test_Node_Interfa.Child_Count
-- => (for all K_2 in 1 .. Test_Node_Interfa.Child_Count
-- => K_2 = K_1 or else Test_Node_Interfa.Child (K_1)'Tag
-- /=
-- Test_Node_Interfa.Child (K_2)'Tag))
-- and then
-- (
-- Test_Node_Interfa.Has_Early_Test
-- or else
-- Test_Node_Interfa.Early_Run_Done
-- );
type Test_Node_Access is not null access all Test_Node_Interfa'Class;
type Test_Node_Array
is array (Test_Node_Index range <>) of Test_Node_Access;
type Test_Node_Array_Access is access Test_Node_Array;
not overriding
function Child_Count (Obj : Test_Node_Interfa)
return Test_Node_Count is abstract;
not overriding
function Child (Obj : Test_Node_Interfa;
K : Test_Node_Index) return Test_Node_Access is abstract
with Pre'Class => K <= Obj.Child_Count;
not overriding
function Routine_Count (Obj : Test_Node_Interfa) return Test_Routine_Count
is abstract;
not overriding
function Routine (Obj : Test_Node_Interfa;
K : Test_Routine_Index) return Test_Routine is abstract
with Pre'Class => K <= Obj.Routine_Count;
-- TODOC: Never called in implementations where Routine_Count returns 0.
-- <2019-03-19>
not overriding
procedure Setup_Routine (Obj : Test_Node_Interfa) is null;
not overriding
function No_Subtasking (Obj : Test_Node_Interfa)
return Boolean is abstract;
not overriding
function Has_Early_Test
(Obj : Test_Node_Interfa) return Boolean is abstract;
not overriding
function Early_Run_Done (Obj : Test_Node_Interfa) return Boolean
is abstract;
not overriding
procedure Early_Run (Obj : in out Test_Node_Interfa) is abstract
with Pre'Class => not Obj.Early_Run_Done,
Post'Class => Obj.Early_Run_Done;
not overriding
procedure Run
(Obj : in out Test_Node_Interfa;
Outcome : out Test_Outcome;
Kind : Run_Kind := Assert_Cond_And_Run_Test)
is abstract
with Post'Class => (case Kind is
when Check_Cond =>
True,
when Assert_Cond_And_Run_Test =>
Obj.Has_Early_Test xor Obj.Early_Run_Done);
procedure Run_Test_Routines (Obj : Test_Node_Interfa'Class;
Outcome : out Test_Outcome;
Kind : Run_Kind)
with Pre => Kind = Assert_Cond_And_Run_Test;
procedure Assert (Node_Tag : Tag; Cond : Boolean; Message : String := "");
private
use Ada.Containers,
Apsepp.Containers,
Apsepp.Tags;
package Routine_State_Hashed_Maps
is new Ada.Containers.Hashed_Maps (Key_Type => Tag,
Element_Type => Routine_State,
Hash => Tag_Hash,
Equivalent_Keys => "=");
type Tag_Routine_State_Array
is array (Index_Type range <>) of Tag_Routine_State;
----------------------------------------------------------------------------
protected Routine_State_Map_Handler is
procedure Reset_Routine_State (Node_Tag : Tag;
Routine_Index : Test_Routine_Index)
with Pre => Node_Tag /= No_Tag,
Post => Invariant;
procedure Increment_Assert_Count (Node_Tag : Tag)
with Pre => Node_Tag /= No_Tag,
Post => Invariant;
procedure Set_Failed_Outcome (Node_Tag : Tag)
with Pre => Node_Tag /= No_Tag,
Post => Invariant;
procedure Get_Assert_Count (Node_Tag : Tag;
Routine_Index : out Test_Routine_Index;
Count : out O_P_I_Test_Assert_Count)
with Pre => Node_Tag /= No_Tag,
Post => Invariant;
procedure Get_Assert_Outcome (Node_Tag : Tag;
Outcome : out Test_Outcome)
with Pre => Node_Tag /= No_Tag,
Post => Invariant;
procedure Delete (Node_Tag : Tag)
with Pre => Node_Tag /= No_Tag,
Post => Invariant;
function Invariant return Boolean;
function Count return Count_Type;
function To_Array return Tag_Routine_State_Array
with Post => To_Array'Result'First = 1
and then
To_Array'Result'Length = Count
and then
(for all R of To_Array'Result => R.T /= No_Tag);
private
T : Tag;
S : Routine_State;
M : Routine_State_Hashed_Maps.Map;
end Routine_State_Map_Handler;
----------------------------------------------------------------------------
end Apsepp.Test_Node_Class;
| true |
-- Copyright (C) 2019 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>
-- MIT license. Please refer to the LICENSE file.
with Ada.Tags; use Ada.Tags;
with Apsepp.Generic_Prot_Integer;
private with Ada.Containers.Hashed_Maps,
Apsepp.Containers,
Apsepp.Tags;
package Apsepp.Test_Node_Class is
-- Evaluate the pre-conditions and class-wide pre-conditions in this
-- package.
pragma Assertion_Policy (Pre'Class => Check);
type Test_Outcome is (Failed, Passed);
type Run_Kind is (Check_Cond, Assert_Cond_And_Run_Test);
function Check_Cond_Run (Kind : Run_Kind) return Boolean
is (case Kind is
when Check_Cond => True,
when Assert_Cond_And_Run_Test => False);
type Test_Node_Count is new Natural;
subtype Test_Node_Index is Test_Node_Count range 1 .. Test_Node_Count'Last;
type Test_Routine_Count is new Natural;
subtype Test_Routine_Index
is Test_Routine_Count range 1 .. Test_Routine_Count'Last;
type Test_Routine is not null access procedure;
procedure Null_Test_Routine is null;
type Test_Assert_Count is new Natural;
package Prot_Test_Assert_Count
is new Generic_Prot_Integer (Test_Assert_Count);
subtype O_P_I_Test_Assert_Count is Prot_Test_Assert_Count.O_P_I_Type;
type Routine_State is record
Routine_Index : Test_Routine_Index;
Assert_Count : O_P_I_Test_Assert_Count;
Assert_Outcome : Test_Outcome;
end record;
type Tag_Routine_State is record
T : Tag;
S : Routine_State;
end record;
-- TODOC: A test node must not have two children with the same tag.
-- <2019-03-02>
-- TODOC: A runner must make sure that only one test node with a given tag
-- is running at a given time. <2019-03-02>
type Test_Node_Interfa is limited interface;
-- PORT: Type_Invariant'Class aspect causes compiler error.
-- 8.3.0 (x86_64-linux-gnu) GCC error:
-- in gnat_to_gnu_entity, at ada/gcc-interface/decl.c:425
-- <2019-06-10>
-- with Type_Invariant'Class
-- => (for all K_1 in 1 .. Test_Node_Interfa.Child_Count
-- => (for all K_2 in 1 .. Test_Node_Interfa.Child_Count
-- => K_2 = K_1 or else Test_Node_Interfa.Child (K_1)'Tag
-- /=
-- Test_Node_Interfa.Child (K_2)'Tag))
-- and then
-- (
-- Test_Node_Interfa.Has_Early_Test
-- or else
-- Test_Node_Interfa.Early_Run_Done
-- );
type Test_Node_Access is not null access all Test_Node_Interfa'Class;
type Test_Node_Array
is array (Test_Node_Index range <>) of Test_Node_Access;
type Test_Node_Array_Access is access Test_Node_Array;
not overriding
function Child_Count (Obj : Test_Node_Interfa)
return Test_Node_Count is abstract;
not overriding
function Child (Obj : Test_Node_Interfa;
K : Test_Node_Index) return Test_Node_Access is abstract
with Pre'Class => K <= Obj.Child_Count;
not overriding
function Routine_Count (Obj : Test_Node_Interfa) return Test_Routine_Count
is abstract;
not overriding
function Routine (Obj : Test_Node_Interfa;
K : Test_Routine_Index) return Test_Routine is abstract
with Pre'Class => K <= Obj.Routine_Count;
-- TODOC: Never called in implementations where Routine_Count returns 0.
-- <2019-03-19>
not overriding
procedure Setup_Routine (Obj : Test_Node_Interfa) is null;
not overriding
function No_Subtasking (Obj : Test_Node_Interfa)
return Boolean is abstract;
not overriding
function Has_Early_Test
(Obj : Test_Node_Interfa) return Boolean is abstract;
not overriding
function Early_Run_Done (Obj : Test_Node_Interfa) return Boolean
is abstract;
not overriding
procedure Early_Run (Obj : in out Test_Node_Interfa) is abstract
with Pre'Class => not Obj.Early_Run_Done,
Post'Class => Obj.Early_Run_Done;
not overriding
procedure Run
(Obj : in out Test_Node_Interfa;
Outcome : out Test_Outcome;
Kind : Run_Kind := Assert_Cond_And_Run_Test)
is abstract
with Post'Class => (case Kind is
when Check_Cond =>
True,
when Assert_Cond_And_Run_Test =>
Obj.Has_Early_Test xor Obj.Early_Run_Done);
procedure Run_Test_Routines (Obj : Test_Node_Interfa'Class;
Outcome : out Test_Outcome;
Kind : Run_Kind)
with Pre => Kind = Assert_Cond_And_Run_Test;
procedure Assert (Node_Tag : Tag; Cond : Boolean; Message : String := "");
private
use Ada.Containers,
Apsepp.Containers,
Apsepp.Tags;
package Routine_State_Hashed_Maps
is new Ada.Containers.Hashed_Maps (Key_Type => Tag,
Element_Type => Routine_State,
Hash => Tag_Hash,
Equivalent_Keys => "=");
type Tag_Routine_State_Array
is array (Index_Type range <>) of Tag_Routine_State;
----------------------------------------------------------------------------
protected Routine_State_Map_Handler is
procedure Reset_Routine_State (Node_Tag : Tag;
Routine_Index : Test_Routine_Index)
with Pre => Node_Tag /= No_Tag,
Post => Invariant;
procedure Increment_Assert_Count (Node_Tag : Tag)
with Pre => Node_Tag /= No_Tag,
Post => Invariant;
procedure Set_Failed_Outcome (Node_Tag : Tag)
with Pre => Node_Tag /= No_Tag,
Post => Invariant;
procedure Get_Assert_Count (Node_Tag : Tag;
Routine_Index : out Test_Routine_Index;
Count : out O_P_I_Test_Assert_Count)
with Pre => Node_Tag /= No_Tag,
Post => Invariant;
procedure Get_Assert_Outcome (Node_Tag : Tag;
Outcome : out Test_Outcome)
with Pre => Node_Tag /= No_Tag,
Post => Invariant;
procedure Delete (Node_Tag : Tag)
with Pre => Node_Tag /= No_Tag,
Post => Invariant;
function Invariant return Boolean;
function Count return Count_Type;
function To_Array return Tag_Routine_State_Array
with Post => To_Array'Result'First = 1
and then
To_Array'Result'Length = Count
and then
(for all R of To_Array'Result => R.T /= No_Tag);
private
T : Tag;
S : Routine_State;
M : Routine_State_Hashed_Maps.Map;
end Routine_State_Map_Handler;
----------------------------------------------------------------------------
end Apsepp.Test_Node_Class;
|
[
{
"context": "le DirectMedia Layer\n -- Copyright (C) 1997-2018 Sam Lantinga <[email protected]>\n -- This software is provi",
"end": 658,
"score": 0.9998810887336731,
"start": 646,
"tag": "NAME",
"value": "Sam Lantinga"
},
{
"context": "Layer\n -- Copyright (C) 1997-2018 Sam Lantinga <[email protected]>\n -- This software is provided 'as-is', without",
"end": 678,
"score": 0.9999274611473083,
"start": 660,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
extern/gnat_sdl/gnat_sdl2/src/sdl_atomic_h.ads
|
AdaCore/training_material
| 15 |
pragma Ada_2005;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
with SDL_stdinc_h;
with System;
package SDL_atomic_h is
-- arg-macro: procedure SDL_CompilerBarrier ()
-- __asm__ __volatile__ ("" : : : & "memory")
-- arg-macro: procedure SDL_MemoryBarrierRelease ()
-- SDL_CompilerBarrier()
-- arg-macro: procedure SDL_MemoryBarrierAcquire ()
-- SDL_CompilerBarrier()
-- arg-macro: procedure SDL_AtomicIncRef (a)
-- SDL_AtomicAdd(a, 1)
-- arg-macro: function SDL_AtomicDecRef (a)
-- return SDL_AtomicAdd(a, -1) = 1;
-- Simple DirectMedia Layer
-- Copyright (C) 1997-2018 Sam Lantinga <[email protected]>
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
-- 3. This notice may not be removed or altered from any source distribution.
--
--*
-- * \file SDL_atomic.h
-- *
-- * Atomic operations.
-- *
-- * IMPORTANT:
-- * If you are not an expert in concurrent lockless programming, you should
-- * only be using the atomic lock and reference counting functions in this
-- * file. In all other cases you should be protecting your data structures
-- * with full mutexes.
-- *
-- * The list of "safe" functions to use are:
-- * SDL_AtomicLock()
-- * SDL_AtomicUnlock()
-- * SDL_AtomicIncRef()
-- * SDL_AtomicDecRef()
-- *
-- * Seriously, here be dragons!
-- * ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-- *
-- * You can find out a little more about lockless programming and the
-- * subtle issues that can arise here:
-- * http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx
-- *
-- * There's also lots of good information here:
-- * http://www.1024cores.net/home/lock-free-algorithms
-- * http://preshing.com/
-- *
-- * These operations may or may not actually be implemented using
-- * processor specific atomic operations. When possible they are
-- * implemented as true processor specific atomic operations. When that
-- * is not possible the are implemented using locks that *do* use the
-- * available atomic operations.
-- *
-- * All of the atomic operations that modify memory are full memory barriers.
--
-- Set up for C function definitions, even when using C++
--*
-- * \name SDL AtomicLock
-- *
-- * The atomic locks are efficient spinlocks using CPU instructions,
-- * but are vulnerable to starvation and can spin forever if a thread
-- * holding a lock has been terminated. For this reason you should
-- * minimize the code executed inside an atomic lock and never do
-- * expensive things like API or system calls while holding them.
-- *
-- * The atomic locks are not safe to lock recursively.
-- *
-- * Porting Note:
-- * The spin lock functions and type are required and can not be
-- * emulated because they are used in the atomic emulation code.
--
-- @{
subtype SDL_SpinLock is int; -- ..\SDL2_tmp\SDL_atomic.h:89
--*
-- * \brief Try to lock a spin lock by setting it to a non-zero value.
-- *
-- * \param lock Points to the lock.
-- *
-- * \return SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already held.
--
function SDL_AtomicTryLock (lock : access SDL_SpinLock) return SDL_stdinc_h.SDL_bool; -- ..\SDL2_tmp\SDL_atomic.h:98
pragma Import (C, SDL_AtomicTryLock, "SDL_AtomicTryLock");
--*
-- * \brief Lock a spin lock by setting it to a non-zero value.
-- *
-- * \param lock Points to the lock.
--
procedure SDL_AtomicLock (lock : access SDL_SpinLock); -- ..\SDL2_tmp\SDL_atomic.h:105
pragma Import (C, SDL_AtomicLock, "SDL_AtomicLock");
--*
-- * \brief Unlock a spin lock by setting it to 0. Always returns immediately
-- *
-- * \param lock Points to the lock.
--
procedure SDL_AtomicUnlock (lock : access SDL_SpinLock); -- ..\SDL2_tmp\SDL_atomic.h:112
pragma Import (C, SDL_AtomicUnlock, "SDL_AtomicUnlock");
-- @}
-- SDL AtomicLock
--*
-- * The compiler barrier prevents the compiler from reordering
-- * reads and writes to globally visible variables across the call.
--
-- This is correct for all CPUs when using GCC or Solaris Studio 12.1+.
--*
-- * Memory barriers are designed to prevent reads and writes from being
-- * reordered by the compiler and being seen out of order on multi-core CPUs.
-- *
-- * A typical pattern would be for thread A to write some data and a flag,
-- * and for thread B to read the flag and get the data. In this case you
-- * would insert a release barrier between writing the data and the flag,
-- * guaranteeing that the data write completes no later than the flag is
-- * written, and you would insert an acquire barrier between reading the
-- * flag and reading the data, to ensure that all the reads associated
-- * with the flag have completed.
-- *
-- * In this pattern you should always see a release barrier paired with
-- * an acquire barrier and you should gate the data reads/writes with a
-- * single flag variable.
-- *
-- * For more information on these semantics, take a look at the blog post:
-- * http://preshing.com/20120913/acquire-and-release-semantics
--
procedure SDL_MemoryBarrierReleaseFunction; -- ..\SDL2_tmp\SDL_atomic.h:155
pragma Import (C, SDL_MemoryBarrierReleaseFunction, "SDL_MemoryBarrierReleaseFunction");
procedure SDL_MemoryBarrierAcquireFunction; -- ..\SDL2_tmp\SDL_atomic.h:156
pragma Import (C, SDL_MemoryBarrierAcquireFunction, "SDL_MemoryBarrierAcquireFunction");
-- The mcr instruction isn't available in thumb mode, use real functions
-- This is correct for all CPUs on Solaris when using Solaris Studio 12.1+.
-- This is correct for the x86 and x64 CPUs, and we'll expand this over time.
--*
-- * \brief A type representing an atomic integer value. It is a struct
-- * so people don't accidentally use numeric operations on it.
--
-- skipped anonymous struct anon_5
type SDL_atomic_t is record
value : aliased int; -- ..\SDL2_tmp\SDL_atomic.h:198
end record;
pragma Convention (C_Pass_By_Copy, SDL_atomic_t); -- ..\SDL2_tmp\SDL_atomic.h:198
--*
-- * \brief Set an atomic variable to a new value if it is currently an old value.
-- *
-- * \return SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
-- *
-- * \note If you don't know what this function is for, you shouldn't use it!
--
function SDL_AtomicCAS
(a : access SDL_atomic_t;
oldval : int;
newval : int) return SDL_stdinc_h.SDL_bool; -- ..\SDL2_tmp\SDL_atomic.h:207
pragma Import (C, SDL_AtomicCAS, "SDL_AtomicCAS");
--*
-- * \brief Set an atomic variable to a value.
-- *
-- * \return The previous value of the atomic variable.
--
function SDL_AtomicSet (a : access SDL_atomic_t; v : int) return int; -- ..\SDL2_tmp\SDL_atomic.h:214
pragma Import (C, SDL_AtomicSet, "SDL_AtomicSet");
--*
-- * \brief Get the value of an atomic variable
--
function SDL_AtomicGet (a : access SDL_atomic_t) return int; -- ..\SDL2_tmp\SDL_atomic.h:219
pragma Import (C, SDL_AtomicGet, "SDL_AtomicGet");
--*
-- * \brief Add to an atomic variable.
-- *
-- * \return The previous value of the atomic variable.
-- *
-- * \note This same style can be used for any number operation
--
function SDL_AtomicAdd (a : access SDL_atomic_t; v : int) return int; -- ..\SDL2_tmp\SDL_atomic.h:228
pragma Import (C, SDL_AtomicAdd, "SDL_AtomicAdd");
--*
-- * \brief Increment an atomic variable used as a reference count.
--
--*
-- * \brief Decrement an atomic variable used as a reference count.
-- *
-- * \return SDL_TRUE if the variable reached zero after decrementing,
-- * SDL_FALSE otherwise
--
--*
-- * \brief Set a pointer to a new value if it is currently an old value.
-- *
-- * \return SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
-- *
-- * \note If you don't know what this function is for, you shouldn't use it!
--
function SDL_AtomicCASPtr
(a : System.Address;
oldval : System.Address;
newval : System.Address) return SDL_stdinc_h.SDL_bool; -- ..\SDL2_tmp\SDL_atomic.h:254
pragma Import (C, SDL_AtomicCASPtr, "SDL_AtomicCASPtr");
--*
-- * \brief Set a pointer to a value atomically.
-- *
-- * \return The previous value of the pointer.
--
function SDL_AtomicSetPtr (a : System.Address; v : System.Address) return System.Address; -- ..\SDL2_tmp\SDL_atomic.h:261
pragma Import (C, SDL_AtomicSetPtr, "SDL_AtomicSetPtr");
--*
-- * \brief Get the value of a pointer atomically.
--
function SDL_AtomicGetPtr (a : System.Address) return System.Address; -- ..\SDL2_tmp\SDL_atomic.h:266
pragma Import (C, SDL_AtomicGetPtr, "SDL_AtomicGetPtr");
-- Ends C function definitions when using C++
-- vi: set ts=4 sw=4 expandtab:
end SDL_atomic_h;
|
6004
|
pragma Ada_2005;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
with SDL_stdinc_h;
with System;
package SDL_atomic_h is
-- arg-macro: procedure SDL_CompilerBarrier ()
-- __asm__ __volatile__ ("" : : : & "memory")
-- arg-macro: procedure SDL_MemoryBarrierRelease ()
-- SDL_CompilerBarrier()
-- arg-macro: procedure SDL_MemoryBarrierAcquire ()
-- SDL_CompilerBarrier()
-- arg-macro: procedure SDL_AtomicIncRef (a)
-- SDL_AtomicAdd(a, 1)
-- arg-macro: function SDL_AtomicDecRef (a)
-- return SDL_AtomicAdd(a, -1) = 1;
-- Simple DirectMedia Layer
-- Copyright (C) 1997-2018 <NAME> <<EMAIL>>
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
-- 3. This notice may not be removed or altered from any source distribution.
--
--*
-- * \file SDL_atomic.h
-- *
-- * Atomic operations.
-- *
-- * IMPORTANT:
-- * If you are not an expert in concurrent lockless programming, you should
-- * only be using the atomic lock and reference counting functions in this
-- * file. In all other cases you should be protecting your data structures
-- * with full mutexes.
-- *
-- * The list of "safe" functions to use are:
-- * SDL_AtomicLock()
-- * SDL_AtomicUnlock()
-- * SDL_AtomicIncRef()
-- * SDL_AtomicDecRef()
-- *
-- * Seriously, here be dragons!
-- * ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-- *
-- * You can find out a little more about lockless programming and the
-- * subtle issues that can arise here:
-- * http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx
-- *
-- * There's also lots of good information here:
-- * http://www.1024cores.net/home/lock-free-algorithms
-- * http://preshing.com/
-- *
-- * These operations may or may not actually be implemented using
-- * processor specific atomic operations. When possible they are
-- * implemented as true processor specific atomic operations. When that
-- * is not possible the are implemented using locks that *do* use the
-- * available atomic operations.
-- *
-- * All of the atomic operations that modify memory are full memory barriers.
--
-- Set up for C function definitions, even when using C++
--*
-- * \name SDL AtomicLock
-- *
-- * The atomic locks are efficient spinlocks using CPU instructions,
-- * but are vulnerable to starvation and can spin forever if a thread
-- * holding a lock has been terminated. For this reason you should
-- * minimize the code executed inside an atomic lock and never do
-- * expensive things like API or system calls while holding them.
-- *
-- * The atomic locks are not safe to lock recursively.
-- *
-- * Porting Note:
-- * The spin lock functions and type are required and can not be
-- * emulated because they are used in the atomic emulation code.
--
-- @{
subtype SDL_SpinLock is int; -- ..\SDL2_tmp\SDL_atomic.h:89
--*
-- * \brief Try to lock a spin lock by setting it to a non-zero value.
-- *
-- * \param lock Points to the lock.
-- *
-- * \return SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already held.
--
function SDL_AtomicTryLock (lock : access SDL_SpinLock) return SDL_stdinc_h.SDL_bool; -- ..\SDL2_tmp\SDL_atomic.h:98
pragma Import (C, SDL_AtomicTryLock, "SDL_AtomicTryLock");
--*
-- * \brief Lock a spin lock by setting it to a non-zero value.
-- *
-- * \param lock Points to the lock.
--
procedure SDL_AtomicLock (lock : access SDL_SpinLock); -- ..\SDL2_tmp\SDL_atomic.h:105
pragma Import (C, SDL_AtomicLock, "SDL_AtomicLock");
--*
-- * \brief Unlock a spin lock by setting it to 0. Always returns immediately
-- *
-- * \param lock Points to the lock.
--
procedure SDL_AtomicUnlock (lock : access SDL_SpinLock); -- ..\SDL2_tmp\SDL_atomic.h:112
pragma Import (C, SDL_AtomicUnlock, "SDL_AtomicUnlock");
-- @}
-- SDL AtomicLock
--*
-- * The compiler barrier prevents the compiler from reordering
-- * reads and writes to globally visible variables across the call.
--
-- This is correct for all CPUs when using GCC or Solaris Studio 12.1+.
--*
-- * Memory barriers are designed to prevent reads and writes from being
-- * reordered by the compiler and being seen out of order on multi-core CPUs.
-- *
-- * A typical pattern would be for thread A to write some data and a flag,
-- * and for thread B to read the flag and get the data. In this case you
-- * would insert a release barrier between writing the data and the flag,
-- * guaranteeing that the data write completes no later than the flag is
-- * written, and you would insert an acquire barrier between reading the
-- * flag and reading the data, to ensure that all the reads associated
-- * with the flag have completed.
-- *
-- * In this pattern you should always see a release barrier paired with
-- * an acquire barrier and you should gate the data reads/writes with a
-- * single flag variable.
-- *
-- * For more information on these semantics, take a look at the blog post:
-- * http://preshing.com/20120913/acquire-and-release-semantics
--
procedure SDL_MemoryBarrierReleaseFunction; -- ..\SDL2_tmp\SDL_atomic.h:155
pragma Import (C, SDL_MemoryBarrierReleaseFunction, "SDL_MemoryBarrierReleaseFunction");
procedure SDL_MemoryBarrierAcquireFunction; -- ..\SDL2_tmp\SDL_atomic.h:156
pragma Import (C, SDL_MemoryBarrierAcquireFunction, "SDL_MemoryBarrierAcquireFunction");
-- The mcr instruction isn't available in thumb mode, use real functions
-- This is correct for all CPUs on Solaris when using Solaris Studio 12.1+.
-- This is correct for the x86 and x64 CPUs, and we'll expand this over time.
--*
-- * \brief A type representing an atomic integer value. It is a struct
-- * so people don't accidentally use numeric operations on it.
--
-- skipped anonymous struct anon_5
type SDL_atomic_t is record
value : aliased int; -- ..\SDL2_tmp\SDL_atomic.h:198
end record;
pragma Convention (C_Pass_By_Copy, SDL_atomic_t); -- ..\SDL2_tmp\SDL_atomic.h:198
--*
-- * \brief Set an atomic variable to a new value if it is currently an old value.
-- *
-- * \return SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
-- *
-- * \note If you don't know what this function is for, you shouldn't use it!
--
function SDL_AtomicCAS
(a : access SDL_atomic_t;
oldval : int;
newval : int) return SDL_stdinc_h.SDL_bool; -- ..\SDL2_tmp\SDL_atomic.h:207
pragma Import (C, SDL_AtomicCAS, "SDL_AtomicCAS");
--*
-- * \brief Set an atomic variable to a value.
-- *
-- * \return The previous value of the atomic variable.
--
function SDL_AtomicSet (a : access SDL_atomic_t; v : int) return int; -- ..\SDL2_tmp\SDL_atomic.h:214
pragma Import (C, SDL_AtomicSet, "SDL_AtomicSet");
--*
-- * \brief Get the value of an atomic variable
--
function SDL_AtomicGet (a : access SDL_atomic_t) return int; -- ..\SDL2_tmp\SDL_atomic.h:219
pragma Import (C, SDL_AtomicGet, "SDL_AtomicGet");
--*
-- * \brief Add to an atomic variable.
-- *
-- * \return The previous value of the atomic variable.
-- *
-- * \note This same style can be used for any number operation
--
function SDL_AtomicAdd (a : access SDL_atomic_t; v : int) return int; -- ..\SDL2_tmp\SDL_atomic.h:228
pragma Import (C, SDL_AtomicAdd, "SDL_AtomicAdd");
--*
-- * \brief Increment an atomic variable used as a reference count.
--
--*
-- * \brief Decrement an atomic variable used as a reference count.
-- *
-- * \return SDL_TRUE if the variable reached zero after decrementing,
-- * SDL_FALSE otherwise
--
--*
-- * \brief Set a pointer to a new value if it is currently an old value.
-- *
-- * \return SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
-- *
-- * \note If you don't know what this function is for, you shouldn't use it!
--
function SDL_AtomicCASPtr
(a : System.Address;
oldval : System.Address;
newval : System.Address) return SDL_stdinc_h.SDL_bool; -- ..\SDL2_tmp\SDL_atomic.h:254
pragma Import (C, SDL_AtomicCASPtr, "SDL_AtomicCASPtr");
--*
-- * \brief Set a pointer to a value atomically.
-- *
-- * \return The previous value of the pointer.
--
function SDL_AtomicSetPtr (a : System.Address; v : System.Address) return System.Address; -- ..\SDL2_tmp\SDL_atomic.h:261
pragma Import (C, SDL_AtomicSetPtr, "SDL_AtomicSetPtr");
--*
-- * \brief Get the value of a pointer atomically.
--
function SDL_AtomicGetPtr (a : System.Address) return System.Address; -- ..\SDL2_tmp\SDL_atomic.h:266
pragma Import (C, SDL_AtomicGetPtr, "SDL_AtomicGetPtr");
-- Ends C function definitions when using C++
-- vi: set ts=4 sw=4 expandtab:
end SDL_atomic_h;
| true |
pragma Ada_2005;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
with SDL_stdinc_h;
with System;
package SDL_atomic_h is
-- arg-macro: procedure SDL_CompilerBarrier ()
-- __asm__ __volatile__ ("" : : : & "memory")
-- arg-macro: procedure SDL_MemoryBarrierRelease ()
-- SDL_CompilerBarrier()
-- arg-macro: procedure SDL_MemoryBarrierAcquire ()
-- SDL_CompilerBarrier()
-- arg-macro: procedure SDL_AtomicIncRef (a)
-- SDL_AtomicAdd(a, 1)
-- arg-macro: function SDL_AtomicDecRef (a)
-- return SDL_AtomicAdd(a, -1) = 1;
-- Simple DirectMedia Layer
-- Copyright (C) 1997-2018 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
-- 3. This notice may not be removed or altered from any source distribution.
--
--*
-- * \file SDL_atomic.h
-- *
-- * Atomic operations.
-- *
-- * IMPORTANT:
-- * If you are not an expert in concurrent lockless programming, you should
-- * only be using the atomic lock and reference counting functions in this
-- * file. In all other cases you should be protecting your data structures
-- * with full mutexes.
-- *
-- * The list of "safe" functions to use are:
-- * SDL_AtomicLock()
-- * SDL_AtomicUnlock()
-- * SDL_AtomicIncRef()
-- * SDL_AtomicDecRef()
-- *
-- * Seriously, here be dragons!
-- * ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-- *
-- * You can find out a little more about lockless programming and the
-- * subtle issues that can arise here:
-- * http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx
-- *
-- * There's also lots of good information here:
-- * http://www.1024cores.net/home/lock-free-algorithms
-- * http://preshing.com/
-- *
-- * These operations may or may not actually be implemented using
-- * processor specific atomic operations. When possible they are
-- * implemented as true processor specific atomic operations. When that
-- * is not possible the are implemented using locks that *do* use the
-- * available atomic operations.
-- *
-- * All of the atomic operations that modify memory are full memory barriers.
--
-- Set up for C function definitions, even when using C++
--*
-- * \name SDL AtomicLock
-- *
-- * The atomic locks are efficient spinlocks using CPU instructions,
-- * but are vulnerable to starvation and can spin forever if a thread
-- * holding a lock has been terminated. For this reason you should
-- * minimize the code executed inside an atomic lock and never do
-- * expensive things like API or system calls while holding them.
-- *
-- * The atomic locks are not safe to lock recursively.
-- *
-- * Porting Note:
-- * The spin lock functions and type are required and can not be
-- * emulated because they are used in the atomic emulation code.
--
-- @{
subtype SDL_SpinLock is int; -- ..\SDL2_tmp\SDL_atomic.h:89
--*
-- * \brief Try to lock a spin lock by setting it to a non-zero value.
-- *
-- * \param lock Points to the lock.
-- *
-- * \return SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already held.
--
function SDL_AtomicTryLock (lock : access SDL_SpinLock) return SDL_stdinc_h.SDL_bool; -- ..\SDL2_tmp\SDL_atomic.h:98
pragma Import (C, SDL_AtomicTryLock, "SDL_AtomicTryLock");
--*
-- * \brief Lock a spin lock by setting it to a non-zero value.
-- *
-- * \param lock Points to the lock.
--
procedure SDL_AtomicLock (lock : access SDL_SpinLock); -- ..\SDL2_tmp\SDL_atomic.h:105
pragma Import (C, SDL_AtomicLock, "SDL_AtomicLock");
--*
-- * \brief Unlock a spin lock by setting it to 0. Always returns immediately
-- *
-- * \param lock Points to the lock.
--
procedure SDL_AtomicUnlock (lock : access SDL_SpinLock); -- ..\SDL2_tmp\SDL_atomic.h:112
pragma Import (C, SDL_AtomicUnlock, "SDL_AtomicUnlock");
-- @}
-- SDL AtomicLock
--*
-- * The compiler barrier prevents the compiler from reordering
-- * reads and writes to globally visible variables across the call.
--
-- This is correct for all CPUs when using GCC or Solaris Studio 12.1+.
--*
-- * Memory barriers are designed to prevent reads and writes from being
-- * reordered by the compiler and being seen out of order on multi-core CPUs.
-- *
-- * A typical pattern would be for thread A to write some data and a flag,
-- * and for thread B to read the flag and get the data. In this case you
-- * would insert a release barrier between writing the data and the flag,
-- * guaranteeing that the data write completes no later than the flag is
-- * written, and you would insert an acquire barrier between reading the
-- * flag and reading the data, to ensure that all the reads associated
-- * with the flag have completed.
-- *
-- * In this pattern you should always see a release barrier paired with
-- * an acquire barrier and you should gate the data reads/writes with a
-- * single flag variable.
-- *
-- * For more information on these semantics, take a look at the blog post:
-- * http://preshing.com/20120913/acquire-and-release-semantics
--
procedure SDL_MemoryBarrierReleaseFunction; -- ..\SDL2_tmp\SDL_atomic.h:155
pragma Import (C, SDL_MemoryBarrierReleaseFunction, "SDL_MemoryBarrierReleaseFunction");
procedure SDL_MemoryBarrierAcquireFunction; -- ..\SDL2_tmp\SDL_atomic.h:156
pragma Import (C, SDL_MemoryBarrierAcquireFunction, "SDL_MemoryBarrierAcquireFunction");
-- The mcr instruction isn't available in thumb mode, use real functions
-- This is correct for all CPUs on Solaris when using Solaris Studio 12.1+.
-- This is correct for the x86 and x64 CPUs, and we'll expand this over time.
--*
-- * \brief A type representing an atomic integer value. It is a struct
-- * so people don't accidentally use numeric operations on it.
--
-- skipped anonymous struct anon_5
type SDL_atomic_t is record
value : aliased int; -- ..\SDL2_tmp\SDL_atomic.h:198
end record;
pragma Convention (C_Pass_By_Copy, SDL_atomic_t); -- ..\SDL2_tmp\SDL_atomic.h:198
--*
-- * \brief Set an atomic variable to a new value if it is currently an old value.
-- *
-- * \return SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
-- *
-- * \note If you don't know what this function is for, you shouldn't use it!
--
function SDL_AtomicCAS
(a : access SDL_atomic_t;
oldval : int;
newval : int) return SDL_stdinc_h.SDL_bool; -- ..\SDL2_tmp\SDL_atomic.h:207
pragma Import (C, SDL_AtomicCAS, "SDL_AtomicCAS");
--*
-- * \brief Set an atomic variable to a value.
-- *
-- * \return The previous value of the atomic variable.
--
function SDL_AtomicSet (a : access SDL_atomic_t; v : int) return int; -- ..\SDL2_tmp\SDL_atomic.h:214
pragma Import (C, SDL_AtomicSet, "SDL_AtomicSet");
--*
-- * \brief Get the value of an atomic variable
--
function SDL_AtomicGet (a : access SDL_atomic_t) return int; -- ..\SDL2_tmp\SDL_atomic.h:219
pragma Import (C, SDL_AtomicGet, "SDL_AtomicGet");
--*
-- * \brief Add to an atomic variable.
-- *
-- * \return The previous value of the atomic variable.
-- *
-- * \note This same style can be used for any number operation
--
function SDL_AtomicAdd (a : access SDL_atomic_t; v : int) return int; -- ..\SDL2_tmp\SDL_atomic.h:228
pragma Import (C, SDL_AtomicAdd, "SDL_AtomicAdd");
--*
-- * \brief Increment an atomic variable used as a reference count.
--
--*
-- * \brief Decrement an atomic variable used as a reference count.
-- *
-- * \return SDL_TRUE if the variable reached zero after decrementing,
-- * SDL_FALSE otherwise
--
--*
-- * \brief Set a pointer to a new value if it is currently an old value.
-- *
-- * \return SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
-- *
-- * \note If you don't know what this function is for, you shouldn't use it!
--
function SDL_AtomicCASPtr
(a : System.Address;
oldval : System.Address;
newval : System.Address) return SDL_stdinc_h.SDL_bool; -- ..\SDL2_tmp\SDL_atomic.h:254
pragma Import (C, SDL_AtomicCASPtr, "SDL_AtomicCASPtr");
--*
-- * \brief Set a pointer to a value atomically.
-- *
-- * \return The previous value of the pointer.
--
function SDL_AtomicSetPtr (a : System.Address; v : System.Address) return System.Address; -- ..\SDL2_tmp\SDL_atomic.h:261
pragma Import (C, SDL_AtomicSetPtr, "SDL_AtomicSetPtr");
--*
-- * \brief Get the value of a pointer atomically.
--
function SDL_AtomicGetPtr (a : System.Address) return System.Address; -- ..\SDL2_tmp\SDL_atomic.h:266
pragma Import (C, SDL_AtomicGetPtr, "SDL_AtomicGetPtr");
-- Ends C function definitions when using C++
-- vi: set ts=4 sw=4 expandtab:
end SDL_atomic_h;
|
[
{
"context": "hts reserved.\n--\n-- This software was developed by John Self of the Arcadia project\n-- at the University of Ca",
"end": 133,
"score": 0.9998452663421631,
"start": 124,
"tag": "NAME",
"value": "John Self"
},
{
"context": "URPOSE.\n\n-- TITLE symbol table routines\n-- AUTHOR: John Self (UCI)\n-- DESCRIPTION implements only a simple sym",
"end": 978,
"score": 0.9998539090156555,
"start": 969,
"tag": "NAME",
"value": "John Self"
}
] |
tools/aflex/src/sym.ads
|
svn2github/matreshka
| 24 |
-- Copyright (c) 1990 Regents of the University of California.
-- All rights reserved.
--
-- This software was developed by John Self of the Arcadia project
-- at the University of California, Irvine.
--
-- Redistribution and use in source and binary forms are permitted
-- provided that the above copyright notice and this paragraph are
-- duplicated in all such forms and that any documentation,
-- advertising materials, and other materials related to such
-- distribution and use acknowledge that the software was developed
-- by the University of California, Irvine. The name of the
-- University may not be used to endorse or promote products derived
-- from this software without specific prior written permission.
-- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-- TITLE symbol table routines
-- AUTHOR: John Self (UCI)
-- DESCRIPTION implements only a simple symbol table using open hashing
-- NOTES could be faster, but it isn't used much
-- $Header: /co/ua/self/arcadia/aflex/ada/src/RCS/symS.a,v 1.4 90/01/12 15:20:42 self Exp Locker: self $
with Ada.Strings.Wide_Wide_Unbounded;
with MISC_DEFS;
package SYM is
use MISC_DEFS;
procedure ADDSYM
(SYM, STR_DEF : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String;
INT_DEF : in INTEGER;
TABLE : in out HASH_TABLE;
TABLE_SIZE : in INTEGER;
RESULT : out BOOLEAN);
-- result indicates success
procedure CCLINSTAL
(CCLTXT : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String;
CCLNUM : INTEGER);
function CCLLOOKUP
(CCLTXT : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String)
return INTEGER;
function FINDSYM
(SYMBOL : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String;
TABLE : HASH_TABLE;
TABLE_SIZE : INTEGER) return HASH_LINK;
function HASHFUNCT
(STR : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String;
HASH_SIZE : INTEGER) return INTEGER;
procedure NDINSTAL
(ND, DEF : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String);
function NDLOOKUP
(ND : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String)
return Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String;
procedure SCINSTAL
(STR : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String;
XCLUFLG : Boolean);
function SCLOOKUP
(STR : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String)
return Integer;
end SYM;
|
17679
|
-- Copyright (c) 1990 Regents of the University of California.
-- All rights reserved.
--
-- This software was developed by <NAME> of the Arcadia project
-- at the University of California, Irvine.
--
-- Redistribution and use in source and binary forms are permitted
-- provided that the above copyright notice and this paragraph are
-- duplicated in all such forms and that any documentation,
-- advertising materials, and other materials related to such
-- distribution and use acknowledge that the software was developed
-- by the University of California, Irvine. The name of the
-- University may not be used to endorse or promote products derived
-- from this software without specific prior written permission.
-- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-- TITLE symbol table routines
-- AUTHOR: <NAME> (UCI)
-- DESCRIPTION implements only a simple symbol table using open hashing
-- NOTES could be faster, but it isn't used much
-- $Header: /co/ua/self/arcadia/aflex/ada/src/RCS/symS.a,v 1.4 90/01/12 15:20:42 self Exp Locker: self $
with Ada.Strings.Wide_Wide_Unbounded;
with MISC_DEFS;
package SYM is
use MISC_DEFS;
procedure ADDSYM
(SYM, STR_DEF : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String;
INT_DEF : in INTEGER;
TABLE : in out HASH_TABLE;
TABLE_SIZE : in INTEGER;
RESULT : out BOOLEAN);
-- result indicates success
procedure CCLINSTAL
(CCLTXT : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String;
CCLNUM : INTEGER);
function CCLLOOKUP
(CCLTXT : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String)
return INTEGER;
function FINDSYM
(SYMBOL : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String;
TABLE : HASH_TABLE;
TABLE_SIZE : INTEGER) return HASH_LINK;
function HASHFUNCT
(STR : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String;
HASH_SIZE : INTEGER) return INTEGER;
procedure NDINSTAL
(ND, DEF : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String);
function NDLOOKUP
(ND : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String)
return Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String;
procedure SCINSTAL
(STR : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String;
XCLUFLG : Boolean);
function SCLOOKUP
(STR : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String)
return Integer;
end SYM;
| true |
-- Copyright (c) 1990 Regents of the University of California.
-- All rights reserved.
--
-- This software was developed by PI:NAME:<NAME>END_PI of the Arcadia project
-- at the University of California, Irvine.
--
-- Redistribution and use in source and binary forms are permitted
-- provided that the above copyright notice and this paragraph are
-- duplicated in all such forms and that any documentation,
-- advertising materials, and other materials related to such
-- distribution and use acknowledge that the software was developed
-- by the University of California, Irvine. The name of the
-- University may not be used to endorse or promote products derived
-- from this software without specific prior written permission.
-- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-- TITLE symbol table routines
-- AUTHOR: PI:NAME:<NAME>END_PI (UCI)
-- DESCRIPTION implements only a simple symbol table using open hashing
-- NOTES could be faster, but it isn't used much
-- $Header: /co/ua/self/arcadia/aflex/ada/src/RCS/symS.a,v 1.4 90/01/12 15:20:42 self Exp Locker: self $
with Ada.Strings.Wide_Wide_Unbounded;
with MISC_DEFS;
package SYM is
use MISC_DEFS;
procedure ADDSYM
(SYM, STR_DEF : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String;
INT_DEF : in INTEGER;
TABLE : in out HASH_TABLE;
TABLE_SIZE : in INTEGER;
RESULT : out BOOLEAN);
-- result indicates success
procedure CCLINSTAL
(CCLTXT : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String;
CCLNUM : INTEGER);
function CCLLOOKUP
(CCLTXT : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String)
return INTEGER;
function FINDSYM
(SYMBOL : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String;
TABLE : HASH_TABLE;
TABLE_SIZE : INTEGER) return HASH_LINK;
function HASHFUNCT
(STR : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String;
HASH_SIZE : INTEGER) return INTEGER;
procedure NDINSTAL
(ND, DEF : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String);
function NDLOOKUP
(ND : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String)
return Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String;
procedure SCINSTAL
(STR : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String;
XCLUFLG : Boolean);
function SCLOOKUP
(STR : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String)
return Integer;
end SYM;
|
[
{
"context": " --\n-- Author: Jorge Real --\n-- Univers",
"end": 507,
"score": 0.9998795390129089,
"start": 497,
"tag": "NAME",
"value": "Jorge Real"
}
] |
src/bb-gui-controller.adb
|
jorge-real/Ball-On-Beam
| 4 |
------------------------------------------------------------
-- B B . G U I . C O N T R O L L E R --
-- --
-- Body --
-- --
-- "Controller" package of Ball on Beam simulator GUI. -- --
-- --
-- Author: Jorge Real --
-- Universitat Politecnica de Valencia --
-- July, 2020 - Version 1 --
-- February, 2021 - Version 2 --
-- --
-- This is free software in the ample sense: --
-- you can use it freely, provided you preserve --
-- this comment at the header of source files --
-- and you clearly indicate the changes made to --
-- the original file, if any. --
------------------------------------------------------------
with BB.GUI.View;
use BB.GUI.View;
with Gnoga.Gui.Base;
with Gnoga.Gui.Element.Canvas.Context_2D;
with Gnoga.Application.Singleton;
with Gnoga.Types;
with System;
with Ada.Numerics.Elementary_Functions;
with Ada.Real_Time; use Ada.Real_Time;
with Ada.Synchronous_Task_Control; use Ada.Synchronous_Task_Control;
package body BB.GUI.Controller is
View : BB.GUI.View.Default_View_Access :=
new BB.GUI.View.Default_View_Type;
Simulation_Running : Boolean := True;
Updater_Terminated : Boolean := False;
GUI_Is_Usable : Suspension_Object;
-- GUI refresh period
Updater_Period : constant Duration := 0.1;
-- Declaration of procedure in charge of updating the GUI
procedure Update_Animation
(Inclination : Angle;
Ball_Pos : Position;
Target_Pos : Position);
-- Quit button On_Click handler
procedure On_Quit (Object : in out Gnoga.Gui.Base.Base_Type'Class) is
begin
-- Inform updater task to terminate
Simulation_Running := False;
-- Poll for updater task terminated
while not Updater_Terminated loop
delay 0.05;
end loop;
Gnoga.Application.Singleton.End_Application;
end On_Quit;
-- Pause plot button On_Click handler
Paused : Boolean := False;
procedure On_Pause (Object : in out Gnoga.Gui.Base.Base_Type'Class) is
begin
Paused := not Paused;
if Paused then
null; -- release updater task in controller
-- View.Pause_Button.Property (Name => ,
-- Value => "Unpause plot");
else
null; -- pause updater task
-- View.Pause_Button.Property (Name => ,
-- Value => "Pause plot");
end if;
end On_Pause;
-- Updater - Task in charge of refreshing the GUI window.
-- It uses Last_Angle and Last_Pos, so it doesn't imply calculation of
-- simulation steps.
task Updater
with Priority => System.Priority'First;
task body Updater is
Next : Time := Clock;
Refresh_Period : constant Time_Span := To_Time_Span (Updater_Period);
begin
Suspend_Until_True (GUI_Is_Usable);
while Simulation_Running loop
Next := Next + Refresh_Period;
delay until Next;
Update_Animation (Last_Angle, Last_Pos, Current_Target_Pos);
end loop;
Updater_Terminated := True;
end Updater;
-- Declarations for Update_Animation
-- Graphical coordinates of pivot point for all rotations
-- Integer versions for coordinates
x0c : constant := Canvas_X_Size / 2;
y0c : constant := Canvas_Y_Size / 2;
-- Float versions, for trigonometry
x0 : constant := Float (x0c);
y0 : constant := Float (y0c);
-- Rectangles that cover the Animation and Status areas
Cover_Animated_BB : constant Gnoga.Types.Rectangle_Type :=
(X => 20, Y => 20, Width => Canvas_X_Size - 40,
Height => Canvas_Y_Size - 40);
Cover_Plot : constant Gnoga.Types.Rectangle_Type :=
(X => 30, Y => 20, Width => Canvas_X_Size - 45,
Height => Canvas_Y_Size - 50);
-- Background of the animation area (rectangle, beam pier, and labels)
Anim_Background : Gnoga.Gui.Element.Canvas.Context_2D.Image_Data_Type;
-- Background of the plot area (axis marks, labels, and grid)
Plot_Background : Gnoga.Gui.Element.Canvas.Context_2D.Image_Data_Type;
-- Scaling factor between 340 pixels of drawn beam (with some leeway for the
-- stoppers at both ends) and the beam length
X_Beam_Scaling : constant Float := 340.0 / (Max_Position - Min_Position);
-- Declaratons for the graph view
-- Vertical axis: ball position in millimeters
Y_Min_Pos : constant Float := Position'First;
Y_Max_Pos : constant Float := Position'Last;
-- Horizontal axis: time in seconds
X_Min_Time : constant := 0.0;
X_Max_Time : constant := 12.0;
-- Values over the range of Position that will be included in the Y axis.
-- This is so that saturated values can be clearly seen in the graph.
-- The graph range will be [Min_Position - Over .. Max_Postion + Over]
Over : constant := 10.0;
Y_Plot_Scaling : constant :=
(Float (Canvas_Y_Size) - 50.0) / (Y_Max_Pos - Y_Min_Pos + (2.0 * Over));
-- Pixel / mm
X_Plot_Scaling : constant :=
(Float (Canvas_X_Size) - 45.0) / (X_Max_Time - X_Min_Time);
-- Pixel / s
-- Number of points that will be plotted
List_Length : constant :=
Integer ((X_Max_Time - X_Min_Time) / Updater_Period);
-- Nr of pixels in X between two consecutive updater samples. Keep it Float
-- and use as an integer later, when plotting, to avoid cummulative error
Delta_X : constant Float := X_Plot_Scaling * Float (Updater_Period);
type Position_Plot is array (1..List_Length) of Position;
-- Plot values
Pos_Plot : Position_Plot := (others => 0.0);
Target_Plot : Position_Plot := (others => 0.0);
-- Counter of valid points in a Position_Plot array. The algorithm for
-- plotting is different for the first List_Length values to plot, since
-- there is no need to scroll the plot until the number of values to plot
-- is larger than List_Length
N_Plot_Points : Integer := 0;
-- X offset of target value printed in status line, wrt label "Target = "
Target_Text_X_Offset : Integer;
-- Same for beam angle
Angle_Text_X_Offset : Integer;
-- Same for ball position
Pos_Text_X_Offset : Integer;
------------------------
-- Update_Animation --
------------------------
-- Updates the ball and beam animation.
-- If plot refresh is not paused, it also updates the plot
procedure Update_Animation
(Inclination : Angle;
Ball_Pos : Position;
Target_Pos : Position) is
use Ada.Numerics.Elementary_Functions;
use Ada.Numerics;
-- Auxiliaries for printing the lower status line
-- Scaled angle to extract two decimals
Aux_Angle : constant Integer := Integer (Inclination * 100.0);
-- String that contains the integer part of Angle
Angle_Int : constant String := Integer'Image (Aux_Angle / 100);
-- String that contains the decimal part of Angle, with a leading space
Angle_Dec : constant String := Integer'Image (Aux_Angle mod 100);
-- String that represents the position in mm
Pos_Str : constant String := Integer'Image (Integer (Ball_Pos));
-- String that represents the target position in mm
Tgt_Str : constant String := Integer'Image (Integer (Target_Pos));
-- Auxiliaries for drawing
-- Angle in radians for trigonometrical functions
Ang : constant Float := (Inclination * Pi) / 180.0;
Sin_A : constant Float := Sin (-Ang);
Cos_A : constant Float := Cos (-Ang);
-- Coordinates of Ball center at Ball_Pos when Angle = 0.0
X_Pos_0: constant Float := x0 + Ball_Pos * X_Beam_Scaling;
Y_Pos_0: constant Float := y0 - 20.0;
-- Coordinates of top of target marker when Angle = 0.0
X_Tgt_0: constant Float := x0 + Target_Pos * X_Beam_Scaling;
Y_Tgt_0: constant Float := y0 - 10.0;
-- Rotation transform functions:
--
-- x' = x0 - (x - x0)*cos(Ang) - (y - y0)*sin(Ang)
-- y' = y0 + (x - x0)*sin(Ang) - (y - y0)*cos(Ang)
--
-- where: (x0, y0) = pivot point (declared global constants)
-- (X, Y) = Coordinates of point to rotate when Angle = 0.0
--
-- With sign variations depending on which object is rotated, the
-- beam, the ball, or the target marker.
function X_Beam (X, Y: Float) return Integer is
(Integer (x0 - (X - x0) * Cos_A - (Y - y0) * Sin_A));
function Y_Beam (X, Y: Float) return Integer is
(Integer (y0 - (X - x0) * Sin_A + (Y - y0) * Cos_A));
function X_Ball (X, Y: Float) return Integer is
(Integer (x0 + (X - x0) * Cos_A - (Y - y0) * Sin_A));
function Y_Ball (X, Y: Float) return Integer is
(Integer (y0 + (X - x0) * Sin_A + (Y - y0) * Cos_A));
-- Same transform for target position marker as for the ball
function X_Tgt (X, Y: Float) return Integer renames X_Ball;
function Y_Tgt (X, Y: Float) return Integer renames Y_Ball;
X_Plot_Offset : Integer;
begin
----------------------------------
-- Redraw the animation panel --
----------------------------------
-- Put background image of animation panel
View.BB_Animation.Put_Image_Data (Anim_Background, 0, 0);
-- Update status info
View.BB_Animation.Fill_Color ("Black");
-- Print angle value
View.BB_Animation.Fill_Text
(Angle_Int & "." &
Angle_Dec (Angle_Dec'First + 1 .. Angle_Dec'Last) &
" deg", 150 + Angle_Text_X_Offset, Canvas_Y_Size - 5);
-- Print ball position value
View.BB_Animation.Fill_Text
(Pos_Str &
" mm", 270 + Pos_Text_X_Offset, Canvas_Y_Size - 5);
-- Print SSO name
-- View.BB_Animation.Fill_Text
-- (" ", (Canvas_X_Size / 2) - 20, 14);
View.BB_Animation.Fill_Text
(Current_Planet'Image, (Canvas_X_Size / 2) - 20, 14);
-- Draw beam with angle given by Inclination
--
-- Four symmetric points define the beam shape: Outer top (OTop),
-- Inner top (ITop), Middle pint (Mid), and Outer bottom (OBot).
-- For example, OTop opposes -OTop, with respect to symmetry axis
-- defined by the orthogonal to the beam that crosses the pivot point.
--
-- -ITop |Symmetry OTop
-- ^ .axis ^
-- -OTop | ITop
-- ^_ -Mid Negative . Positive Mid ^_
-- | | / positions | positions \ | |
-- | |/____________________.____________________\| |
-- |_______________________+_______________________|
-- ^ -OBot ^ ^ OBot
-- Pivot point (x0, y0)
View.BB_Animation.Fill_Color ("Maroon");
View.BB_Animation.Begin_Path;
View.BB_Animation.Move_To (X_Beam (x0 - 180.0, y0),
Y_Beam (x0 - 180.0, y0)); -- a -OBot
View.BB_Animation.Line_To (X_Beam (x0 + 180.0, y0),
Y_Beam (x0 + 180.0, y0)); -- b OBot
View.BB_Animation.Line_To (X_Beam (x0 + 180.0, y0 - 25.0),
Y_Beam (x0 + 180.0, y0 - 25.0)); -- c OTop
View.BB_Animation.Line_To (X_Beam (x0 + 178.0, y0 - 25.0),
Y_Beam (x0 + 178.0, y0 - 25.0)); -- d ITop
View.BB_Animation.Line_To (X_Beam (x0 + 178.0, y0 - 10.0),
Y_Beam (x0 + 178.0, y0 - 10.0)); -- e Mid
View.BB_Animation.Line_To (X_Beam (x0 - 178.0, y0 - 10.0),
Y_Beam (x0 - 178.0, y0 - 10.0)); -- f -Mid
View.BB_Animation.Line_To (X_Beam (x0 - 178.0, y0 - 25.0),
Y_Beam (x0 - 178.0, y0 - 25.0)); -- g -ITop
View.BB_Animation.Line_To (X_Beam (x0 - 180.0, y0 - 25.0),
Y_Beam (x0 - 180.0, y0 - 25.0)); -- h -OTop
View.BB_Animation.Close_Path;
View.BB_Animation.Fill;
-- Draw a target marker on the beam
View.BB_Animation.Stroke_Color ("peachpuff");
View.BB_Animation.Line_Width (3);
View.BB_Animation.Begin_Path;
View.BB_Animation.Move_To (X_Tgt (X_Tgt_0, Y_Tgt_0),
Y_Tgt (X_Tgt_0, Y_Tgt_0));
View.BB_Animation.Line_To (X_Tgt (X_Tgt_0, y0),
Y_Tgt (X_Tgt_0, y0));
View.BB_Animation.Stroke;
-- Draw ball on the beam at position given by Ball_Pos
View.BB_Animation.Fill_Color ("Olive");
View.BB_Animation.Begin_Path;
View.BB_Animation.Arc_Degrees (X_Ball (X_Pos_0, Y_Pos_0),
Y_Ball (X_Pos_0, Y_Pos_0),
10, 0.0, 360.0);
View.BB_Animation.Close_Path;
View.BB_Animation.Fill;
-- Reflection effect on ball
View.BB_Animation.Fill_Color ("White");
View.BB_Animation.Begin_Path;
View.BB_Animation.Arc_Degrees (X_Ball (X_Pos_0, Y_Pos_0) - 3,
Y_Ball (X_Pos_0, Y_Pos_0) - 3,
2, 0.0, 360.0);
View.BB_Animation.Close_Path;
View.BB_Animation.Fill;
------------------------------
-- Redraw the graph panel --
------------------------------
-- The graph panel is only refreshed if plotting is not paused
if not Paused then
-- Put background image (axes, grid and "Target = " label)
View.BB_Pos_Graph.Put_Image_Data (Plot_Background, 0, 0);
-- Prepare the plot points in Pos_Plot and Target_Plot
if N_Plot_Points < List_Length then
-- No need to scroll
N_Plot_Points := N_Plot_Points + 1;
else
-- Need to scroll
Pos_Plot (1..N_Plot_Points - 1) := Pos_Plot (2..N_Plot_Points);
Target_Plot (1..N_Plot_Points - 1) := Target_Plot (2..N_Plot_Points);
end if;
Pos_Plot (N_Plot_Points) := Ball_Pos;
Target_Plot (N_Plot_Points) := Current_Target_Pos;
-- Plot Position graph
-- Status line. Print target position
View.BB_Pos_Graph.Fill_Color ("Black");
View.BB_Pos_Graph.Fill_Text
((if Tgt_Str (Tgt_Str'First) = '-' then
Tgt_Str
else
Tgt_Str (Tgt_Str'First + 1 .. Tgt_Str'Last)) &
" mm", 200 + Target_Text_X_Offset, Canvas_Y_Size - 5);
X_Plot_Offset := 0;
View.BB_Pos_Graph.Stroke_Color ("Blue");
View.BB_Pos_Graph.Begin_Path;
-- Move to coordinates of first point in list
View.BB_Pos_Graph.Move_To
(30 + X_Plot_Offset,
20 + Integer ((Y_Max_Pos + Over) * Y_Plot_Scaling -
(Pos_Plot (1) * Y_Plot_Scaling)));
for I in 2..N_Plot_Points loop
X_Plot_Offset := Integer (Delta_X * Float (I - 1));
View.BB_Pos_Graph.Line_To
(30 + X_Plot_Offset,
20 + Integer ((Y_Max_Pos + Over) * Y_Plot_Scaling -
(Pos_Plot (I) * Y_Plot_Scaling)));
end loop;
View.BB_Pos_Graph.Stroke;
-- Plot Target Position graph
X_Plot_Offset := 0;
View.BB_Pos_Graph.Stroke_Color ("Maroon");
View.BB_Pos_Graph.Begin_Path;
-- Move to coordinates of first point in list
View.BB_Pos_Graph.Move_To
(30 + X_Plot_Offset,
20 + Integer ((Y_Max_Pos + Over) * Y_Plot_Scaling -
(Target_Plot (1) * Y_Plot_Scaling)));
for I in 2..N_Plot_Points loop
X_Plot_Offset := Integer (Delta_X * Float (I - 1));
View.BB_Pos_Graph.Line_To
(30 + X_Plot_Offset,
20 + Integer ((Y_Max_Pos + Over) * Y_Plot_Scaling -
(Target_Plot (I) * Y_Plot_Scaling)));
end loop;
View.BB_Pos_Graph.Stroke;
end if;
end Update_Animation;
----------------------------
-- Draw_Plot_Background --
----------------------------
--
-- Draws all background elements of the plot area and saves the image to
-- Plot_Background for convenient use from Update_Animation
--
procedure Draw_Plot_Background is
-- Length of mark. Applies to both axes
Mark_Size : constant := 5;
-- Y axis related (Position axis)
Y_Step : constant Float := 50.0; -- Y interval step, in mm
Y_Interval : constant Float := Y_Step * Y_Plot_Scaling;
Y_Start_X : constant Integer := 30;
Y_Start_Y : constant Integer := 20;
Y_Offset : Integer := 0;
Y_Steps : Float := 0.0;
-- Start at the top mark of axis Y
Mark : Float := Max_Position + Over;
Val_Label : Integer; -- Value to print label from it
-- X axis related (Time axis)
X_Step : constant Float := 1.0; -- X interval step, in s
X_Interval : constant Float := X_Step * X_Plot_Scaling;
X_Start_X : constant Integer := 30;
X_Start_Y : constant Integer := Y_Start_Y + Canvas_Y_Size - 50;
X_Offset : Integer := 0;
X_Steps : Float := 0.0;
begin
-- Stroke graph rectangle
View.BB_Pos_Graph.Stroke_Color ("Black");
View.BB_Pos_Graph.Stroke_Rectangle (Cover_Plot);
-- Draw Y axis
-- Start at the top mark of axis Y
loop
-- Draw mark line
View.BB_Pos_Graph.Stroke_Color ("Black");
View.BB_Pos_Graph.Begin_Path;
View.BB_Pos_Graph.Move_To (Y_Start_X, Y_Start_Y + Y_Offset);
View.BB_Pos_Graph.Line_To (Y_Start_X - Mark_Size, Y_Start_Y + Y_Offset);
View.BB_Pos_Graph.Stroke;
-- Draw grid line
View.BB_Pos_Graph.Stroke_Color ("Silver");
View.BB_Pos_Graph.Begin_Path;
View.BB_Pos_Graph.Move_To (Y_Start_X, Y_Start_Y + Y_Offset);
View.BB_Pos_Graph.Line_To (Canvas_X_Size - 15, Y_Start_Y + Y_Offset);
View.BB_Pos_Graph.Stroke;
-- Put label
Val_Label := Integer (Mark);
View.BB_Pos_Graph.Fill_Color ("Black");
View.BB_Pos_Graph.Fill_Text
(Val_Label'Image,
Y_Start_X - (if Val_Label >= 100 or Val_Label <= -100 then 28
elsif Val_Label >= 10 or Val_Label <= -10 then 22
else 16),
Y_Start_Y + Y_Offset + 3);
-- Prepare next iteration or exit loop
Y_Steps := Y_Steps + 1.0;
Y_Offset := Integer (Y_Steps * Y_Interval);
Mark := Mark - Y_Step;
exit when Mark < Position'First - Over;
end loop;
-- Draw X Axis
-- Start at the leftmost mark of axis X
loop
-- Draw mark line
View.BB_Pos_Graph.Stroke_Color ("Black");
View.BB_Pos_Graph.Begin_Path;
View.BB_Pos_Graph.Move_To (X_Start_X + X_Offset, X_Start_Y);
View.BB_Pos_Graph.Line_To (X_Start_X + X_Offset, X_Start_Y + Mark_Size);
View.BB_Pos_Graph.Stroke;
-- Draw grid line
View.BB_Pos_Graph.Stroke_Color ("Silver");
View.BB_Pos_Graph.Begin_Path;
View.BB_Pos_Graph.Move_To (X_Start_X + X_Offset, X_Start_Y);
View.BB_Pos_Graph.Line_To (X_Start_X + X_Offset, 20);
View.BB_Pos_Graph.Stroke;
-- Prepare next iteration or exit loop
X_Steps := X_Steps + 1.0;
X_Offset := Integer (X_Steps * X_Interval);
exit when X_Steps > X_Max_Time;
end loop;
-- Write status text at bottom of graph
View.BB_Pos_Graph.Fill_Color ("Black");
View.BB_Pos_Graph.Fill_Text ("Target = ", 200, Canvas_Y_Size - 5);
Target_Text_X_Offset := Integer
(View.BB_Pos_Graph.Measure_Text_Width ("Target = "));
-- Write units next to both axes
View.BB_Pos_Graph.Fill_Text ("(mm)", 3, Canvas_Y_Size - 10);
View.BB_Pos_Graph.Fill_Text ("(1 sec/div)",
Canvas_X_Size - 60,
Canvas_Y_Size - 10);
-- Copy background to image Plot_Background. The plot background can then
-- be redrawn with Put_Image_Data, more efficient than redrawing from
-- scratch every time the plot is refreshed
View.BB_Pos_Graph.Get_Image_Data
(Image_Data => Plot_Background,
Left => 0,
Top => 0,
Width => Canvas_X_Size,
Height => Canvas_Y_Size);
end Draw_Plot_Background;
---------------------------------
-- Draw_Animation_Background --
---------------------------------
--
-- Draws all background elements of the animation area and saves the image
-- to Anim_Background for convenient use from Update_Animation
--
procedure Draw_Animation_Background is
begin
-- Draw background rectangle
View.BB_Animation.Fill_Color ("Linen");
View.BB_Animation.Fill_Rectangle (Cover_Animated_BB);
-- Draw beam pier
View.BB_Animation.Fill_Color ("Silver");
View.BB_Animation.Stroke_Color ("Grey");
View.BB_Animation.Begin_Path;
View.BB_Animation.Move_To (x0c, y0c); -- Top of beam pier (pivot point)
View.BB_Animation.Line_To (x0c + 40, y0c + 40);
View.BB_Animation.Line_To (x0c + 40, y0c + 115);
View.BB_Animation.Line_To (x0c - 40, y0c + 115);
View.BB_Animation.Line_To (x0c - 40, y0c + 40);
View.BB_Animation.Close_Path;
View.BB_Animation.Fill;
View.BB_Animation.Stroke;
-- Place text labels
View.BB_Animation.Fill_Color ("Black");
View.BB_Animation.Fill_Text
("Angle = ", 150, Canvas_Y_Size - 5);
View.BB_Animation.Fill_Text
("Position = ", 270, Canvas_Y_Size - 5);
-- Copy background to Anim_Background image
View.BB_Animation.Get_Image_Data
(Image_Data => Anim_Background,
Left => 0,
Top => 0,
Width => Canvas_X_Size,
Height => Canvas_Y_Size);
-- Measure X offsets for Angle and Pos values
Angle_Text_X_Offset :=
Integer (View.BB_Animation.Measure_Text_Width ("Angle = "));
Pos_Text_X_Offset :=
Integer (View.BB_Animation.Measure_Text_Width ("Position = "));
end Draw_Animation_Background;
-----------------
-- Create_GUI --
-----------------
procedure Create_GUI
(Main_Window : in out Gnoga.Gui.Window.Window_Type'Class) is
begin
View.Dynamic;
View.Create (Parent => Main_Window);
View.Quit_Button.On_Click_Handler (On_Quit'Access);
View.Pause_Button.On_Click_Handler (On_Pause'Access);
-- Draw plot and animation background images and save them for future use
Draw_Plot_Background;
Draw_Animation_Background;
-- Signal the updater task that it can start using the GUI
Set_True (GUI_Is_Usable);
end Create_GUI;
end BB.GUI.Controller;
|
27315
|
------------------------------------------------------------
-- B B . G U I . C O N T R O L L E R --
-- --
-- Body --
-- --
-- "Controller" package of Ball on Beam simulator GUI. -- --
-- --
-- Author: <NAME> --
-- Universitat Politecnica de Valencia --
-- July, 2020 - Version 1 --
-- February, 2021 - Version 2 --
-- --
-- This is free software in the ample sense: --
-- you can use it freely, provided you preserve --
-- this comment at the header of source files --
-- and you clearly indicate the changes made to --
-- the original file, if any. --
------------------------------------------------------------
with BB.GUI.View;
use BB.GUI.View;
with Gnoga.Gui.Base;
with Gnoga.Gui.Element.Canvas.Context_2D;
with Gnoga.Application.Singleton;
with Gnoga.Types;
with System;
with Ada.Numerics.Elementary_Functions;
with Ada.Real_Time; use Ada.Real_Time;
with Ada.Synchronous_Task_Control; use Ada.Synchronous_Task_Control;
package body BB.GUI.Controller is
View : BB.GUI.View.Default_View_Access :=
new BB.GUI.View.Default_View_Type;
Simulation_Running : Boolean := True;
Updater_Terminated : Boolean := False;
GUI_Is_Usable : Suspension_Object;
-- GUI refresh period
Updater_Period : constant Duration := 0.1;
-- Declaration of procedure in charge of updating the GUI
procedure Update_Animation
(Inclination : Angle;
Ball_Pos : Position;
Target_Pos : Position);
-- Quit button On_Click handler
procedure On_Quit (Object : in out Gnoga.Gui.Base.Base_Type'Class) is
begin
-- Inform updater task to terminate
Simulation_Running := False;
-- Poll for updater task terminated
while not Updater_Terminated loop
delay 0.05;
end loop;
Gnoga.Application.Singleton.End_Application;
end On_Quit;
-- Pause plot button On_Click handler
Paused : Boolean := False;
procedure On_Pause (Object : in out Gnoga.Gui.Base.Base_Type'Class) is
begin
Paused := not Paused;
if Paused then
null; -- release updater task in controller
-- View.Pause_Button.Property (Name => ,
-- Value => "Unpause plot");
else
null; -- pause updater task
-- View.Pause_Button.Property (Name => ,
-- Value => "Pause plot");
end if;
end On_Pause;
-- Updater - Task in charge of refreshing the GUI window.
-- It uses Last_Angle and Last_Pos, so it doesn't imply calculation of
-- simulation steps.
task Updater
with Priority => System.Priority'First;
task body Updater is
Next : Time := Clock;
Refresh_Period : constant Time_Span := To_Time_Span (Updater_Period);
begin
Suspend_Until_True (GUI_Is_Usable);
while Simulation_Running loop
Next := Next + Refresh_Period;
delay until Next;
Update_Animation (Last_Angle, Last_Pos, Current_Target_Pos);
end loop;
Updater_Terminated := True;
end Updater;
-- Declarations for Update_Animation
-- Graphical coordinates of pivot point for all rotations
-- Integer versions for coordinates
x0c : constant := Canvas_X_Size / 2;
y0c : constant := Canvas_Y_Size / 2;
-- Float versions, for trigonometry
x0 : constant := Float (x0c);
y0 : constant := Float (y0c);
-- Rectangles that cover the Animation and Status areas
Cover_Animated_BB : constant Gnoga.Types.Rectangle_Type :=
(X => 20, Y => 20, Width => Canvas_X_Size - 40,
Height => Canvas_Y_Size - 40);
Cover_Plot : constant Gnoga.Types.Rectangle_Type :=
(X => 30, Y => 20, Width => Canvas_X_Size - 45,
Height => Canvas_Y_Size - 50);
-- Background of the animation area (rectangle, beam pier, and labels)
Anim_Background : Gnoga.Gui.Element.Canvas.Context_2D.Image_Data_Type;
-- Background of the plot area (axis marks, labels, and grid)
Plot_Background : Gnoga.Gui.Element.Canvas.Context_2D.Image_Data_Type;
-- Scaling factor between 340 pixels of drawn beam (with some leeway for the
-- stoppers at both ends) and the beam length
X_Beam_Scaling : constant Float := 340.0 / (Max_Position - Min_Position);
-- Declaratons for the graph view
-- Vertical axis: ball position in millimeters
Y_Min_Pos : constant Float := Position'First;
Y_Max_Pos : constant Float := Position'Last;
-- Horizontal axis: time in seconds
X_Min_Time : constant := 0.0;
X_Max_Time : constant := 12.0;
-- Values over the range of Position that will be included in the Y axis.
-- This is so that saturated values can be clearly seen in the graph.
-- The graph range will be [Min_Position - Over .. Max_Postion + Over]
Over : constant := 10.0;
Y_Plot_Scaling : constant :=
(Float (Canvas_Y_Size) - 50.0) / (Y_Max_Pos - Y_Min_Pos + (2.0 * Over));
-- Pixel / mm
X_Plot_Scaling : constant :=
(Float (Canvas_X_Size) - 45.0) / (X_Max_Time - X_Min_Time);
-- Pixel / s
-- Number of points that will be plotted
List_Length : constant :=
Integer ((X_Max_Time - X_Min_Time) / Updater_Period);
-- Nr of pixels in X between two consecutive updater samples. Keep it Float
-- and use as an integer later, when plotting, to avoid cummulative error
Delta_X : constant Float := X_Plot_Scaling * Float (Updater_Period);
type Position_Plot is array (1..List_Length) of Position;
-- Plot values
Pos_Plot : Position_Plot := (others => 0.0);
Target_Plot : Position_Plot := (others => 0.0);
-- Counter of valid points in a Position_Plot array. The algorithm for
-- plotting is different for the first List_Length values to plot, since
-- there is no need to scroll the plot until the number of values to plot
-- is larger than List_Length
N_Plot_Points : Integer := 0;
-- X offset of target value printed in status line, wrt label "Target = "
Target_Text_X_Offset : Integer;
-- Same for beam angle
Angle_Text_X_Offset : Integer;
-- Same for ball position
Pos_Text_X_Offset : Integer;
------------------------
-- Update_Animation --
------------------------
-- Updates the ball and beam animation.
-- If plot refresh is not paused, it also updates the plot
procedure Update_Animation
(Inclination : Angle;
Ball_Pos : Position;
Target_Pos : Position) is
use Ada.Numerics.Elementary_Functions;
use Ada.Numerics;
-- Auxiliaries for printing the lower status line
-- Scaled angle to extract two decimals
Aux_Angle : constant Integer := Integer (Inclination * 100.0);
-- String that contains the integer part of Angle
Angle_Int : constant String := Integer'Image (Aux_Angle / 100);
-- String that contains the decimal part of Angle, with a leading space
Angle_Dec : constant String := Integer'Image (Aux_Angle mod 100);
-- String that represents the position in mm
Pos_Str : constant String := Integer'Image (Integer (Ball_Pos));
-- String that represents the target position in mm
Tgt_Str : constant String := Integer'Image (Integer (Target_Pos));
-- Auxiliaries for drawing
-- Angle in radians for trigonometrical functions
Ang : constant Float := (Inclination * Pi) / 180.0;
Sin_A : constant Float := Sin (-Ang);
Cos_A : constant Float := Cos (-Ang);
-- Coordinates of Ball center at Ball_Pos when Angle = 0.0
X_Pos_0: constant Float := x0 + Ball_Pos * X_Beam_Scaling;
Y_Pos_0: constant Float := y0 - 20.0;
-- Coordinates of top of target marker when Angle = 0.0
X_Tgt_0: constant Float := x0 + Target_Pos * X_Beam_Scaling;
Y_Tgt_0: constant Float := y0 - 10.0;
-- Rotation transform functions:
--
-- x' = x0 - (x - x0)*cos(Ang) - (y - y0)*sin(Ang)
-- y' = y0 + (x - x0)*sin(Ang) - (y - y0)*cos(Ang)
--
-- where: (x0, y0) = pivot point (declared global constants)
-- (X, Y) = Coordinates of point to rotate when Angle = 0.0
--
-- With sign variations depending on which object is rotated, the
-- beam, the ball, or the target marker.
function X_Beam (X, Y: Float) return Integer is
(Integer (x0 - (X - x0) * Cos_A - (Y - y0) * Sin_A));
function Y_Beam (X, Y: Float) return Integer is
(Integer (y0 - (X - x0) * Sin_A + (Y - y0) * Cos_A));
function X_Ball (X, Y: Float) return Integer is
(Integer (x0 + (X - x0) * Cos_A - (Y - y0) * Sin_A));
function Y_Ball (X, Y: Float) return Integer is
(Integer (y0 + (X - x0) * Sin_A + (Y - y0) * Cos_A));
-- Same transform for target position marker as for the ball
function X_Tgt (X, Y: Float) return Integer renames X_Ball;
function Y_Tgt (X, Y: Float) return Integer renames Y_Ball;
X_Plot_Offset : Integer;
begin
----------------------------------
-- Redraw the animation panel --
----------------------------------
-- Put background image of animation panel
View.BB_Animation.Put_Image_Data (Anim_Background, 0, 0);
-- Update status info
View.BB_Animation.Fill_Color ("Black");
-- Print angle value
View.BB_Animation.Fill_Text
(Angle_Int & "." &
Angle_Dec (Angle_Dec'First + 1 .. Angle_Dec'Last) &
" deg", 150 + Angle_Text_X_Offset, Canvas_Y_Size - 5);
-- Print ball position value
View.BB_Animation.Fill_Text
(Pos_Str &
" mm", 270 + Pos_Text_X_Offset, Canvas_Y_Size - 5);
-- Print SSO name
-- View.BB_Animation.Fill_Text
-- (" ", (Canvas_X_Size / 2) - 20, 14);
View.BB_Animation.Fill_Text
(Current_Planet'Image, (Canvas_X_Size / 2) - 20, 14);
-- Draw beam with angle given by Inclination
--
-- Four symmetric points define the beam shape: Outer top (OTop),
-- Inner top (ITop), Middle pint (Mid), and Outer bottom (OBot).
-- For example, OTop opposes -OTop, with respect to symmetry axis
-- defined by the orthogonal to the beam that crosses the pivot point.
--
-- -ITop |Symmetry OTop
-- ^ .axis ^
-- -OTop | ITop
-- ^_ -Mid Negative . Positive Mid ^_
-- | | / positions | positions \ | |
-- | |/____________________.____________________\| |
-- |_______________________+_______________________|
-- ^ -OBot ^ ^ OBot
-- Pivot point (x0, y0)
View.BB_Animation.Fill_Color ("Maroon");
View.BB_Animation.Begin_Path;
View.BB_Animation.Move_To (X_Beam (x0 - 180.0, y0),
Y_Beam (x0 - 180.0, y0)); -- a -OBot
View.BB_Animation.Line_To (X_Beam (x0 + 180.0, y0),
Y_Beam (x0 + 180.0, y0)); -- b OBot
View.BB_Animation.Line_To (X_Beam (x0 + 180.0, y0 - 25.0),
Y_Beam (x0 + 180.0, y0 - 25.0)); -- c OTop
View.BB_Animation.Line_To (X_Beam (x0 + 178.0, y0 - 25.0),
Y_Beam (x0 + 178.0, y0 - 25.0)); -- d ITop
View.BB_Animation.Line_To (X_Beam (x0 + 178.0, y0 - 10.0),
Y_Beam (x0 + 178.0, y0 - 10.0)); -- e Mid
View.BB_Animation.Line_To (X_Beam (x0 - 178.0, y0 - 10.0),
Y_Beam (x0 - 178.0, y0 - 10.0)); -- f -Mid
View.BB_Animation.Line_To (X_Beam (x0 - 178.0, y0 - 25.0),
Y_Beam (x0 - 178.0, y0 - 25.0)); -- g -ITop
View.BB_Animation.Line_To (X_Beam (x0 - 180.0, y0 - 25.0),
Y_Beam (x0 - 180.0, y0 - 25.0)); -- h -OTop
View.BB_Animation.Close_Path;
View.BB_Animation.Fill;
-- Draw a target marker on the beam
View.BB_Animation.Stroke_Color ("peachpuff");
View.BB_Animation.Line_Width (3);
View.BB_Animation.Begin_Path;
View.BB_Animation.Move_To (X_Tgt (X_Tgt_0, Y_Tgt_0),
Y_Tgt (X_Tgt_0, Y_Tgt_0));
View.BB_Animation.Line_To (X_Tgt (X_Tgt_0, y0),
Y_Tgt (X_Tgt_0, y0));
View.BB_Animation.Stroke;
-- Draw ball on the beam at position given by Ball_Pos
View.BB_Animation.Fill_Color ("Olive");
View.BB_Animation.Begin_Path;
View.BB_Animation.Arc_Degrees (X_Ball (X_Pos_0, Y_Pos_0),
Y_Ball (X_Pos_0, Y_Pos_0),
10, 0.0, 360.0);
View.BB_Animation.Close_Path;
View.BB_Animation.Fill;
-- Reflection effect on ball
View.BB_Animation.Fill_Color ("White");
View.BB_Animation.Begin_Path;
View.BB_Animation.Arc_Degrees (X_Ball (X_Pos_0, Y_Pos_0) - 3,
Y_Ball (X_Pos_0, Y_Pos_0) - 3,
2, 0.0, 360.0);
View.BB_Animation.Close_Path;
View.BB_Animation.Fill;
------------------------------
-- Redraw the graph panel --
------------------------------
-- The graph panel is only refreshed if plotting is not paused
if not Paused then
-- Put background image (axes, grid and "Target = " label)
View.BB_Pos_Graph.Put_Image_Data (Plot_Background, 0, 0);
-- Prepare the plot points in Pos_Plot and Target_Plot
if N_Plot_Points < List_Length then
-- No need to scroll
N_Plot_Points := N_Plot_Points + 1;
else
-- Need to scroll
Pos_Plot (1..N_Plot_Points - 1) := Pos_Plot (2..N_Plot_Points);
Target_Plot (1..N_Plot_Points - 1) := Target_Plot (2..N_Plot_Points);
end if;
Pos_Plot (N_Plot_Points) := Ball_Pos;
Target_Plot (N_Plot_Points) := Current_Target_Pos;
-- Plot Position graph
-- Status line. Print target position
View.BB_Pos_Graph.Fill_Color ("Black");
View.BB_Pos_Graph.Fill_Text
((if Tgt_Str (Tgt_Str'First) = '-' then
Tgt_Str
else
Tgt_Str (Tgt_Str'First + 1 .. Tgt_Str'Last)) &
" mm", 200 + Target_Text_X_Offset, Canvas_Y_Size - 5);
X_Plot_Offset := 0;
View.BB_Pos_Graph.Stroke_Color ("Blue");
View.BB_Pos_Graph.Begin_Path;
-- Move to coordinates of first point in list
View.BB_Pos_Graph.Move_To
(30 + X_Plot_Offset,
20 + Integer ((Y_Max_Pos + Over) * Y_Plot_Scaling -
(Pos_Plot (1) * Y_Plot_Scaling)));
for I in 2..N_Plot_Points loop
X_Plot_Offset := Integer (Delta_X * Float (I - 1));
View.BB_Pos_Graph.Line_To
(30 + X_Plot_Offset,
20 + Integer ((Y_Max_Pos + Over) * Y_Plot_Scaling -
(Pos_Plot (I) * Y_Plot_Scaling)));
end loop;
View.BB_Pos_Graph.Stroke;
-- Plot Target Position graph
X_Plot_Offset := 0;
View.BB_Pos_Graph.Stroke_Color ("Maroon");
View.BB_Pos_Graph.Begin_Path;
-- Move to coordinates of first point in list
View.BB_Pos_Graph.Move_To
(30 + X_Plot_Offset,
20 + Integer ((Y_Max_Pos + Over) * Y_Plot_Scaling -
(Target_Plot (1) * Y_Plot_Scaling)));
for I in 2..N_Plot_Points loop
X_Plot_Offset := Integer (Delta_X * Float (I - 1));
View.BB_Pos_Graph.Line_To
(30 + X_Plot_Offset,
20 + Integer ((Y_Max_Pos + Over) * Y_Plot_Scaling -
(Target_Plot (I) * Y_Plot_Scaling)));
end loop;
View.BB_Pos_Graph.Stroke;
end if;
end Update_Animation;
----------------------------
-- Draw_Plot_Background --
----------------------------
--
-- Draws all background elements of the plot area and saves the image to
-- Plot_Background for convenient use from Update_Animation
--
procedure Draw_Plot_Background is
-- Length of mark. Applies to both axes
Mark_Size : constant := 5;
-- Y axis related (Position axis)
Y_Step : constant Float := 50.0; -- Y interval step, in mm
Y_Interval : constant Float := Y_Step * Y_Plot_Scaling;
Y_Start_X : constant Integer := 30;
Y_Start_Y : constant Integer := 20;
Y_Offset : Integer := 0;
Y_Steps : Float := 0.0;
-- Start at the top mark of axis Y
Mark : Float := Max_Position + Over;
Val_Label : Integer; -- Value to print label from it
-- X axis related (Time axis)
X_Step : constant Float := 1.0; -- X interval step, in s
X_Interval : constant Float := X_Step * X_Plot_Scaling;
X_Start_X : constant Integer := 30;
X_Start_Y : constant Integer := Y_Start_Y + Canvas_Y_Size - 50;
X_Offset : Integer := 0;
X_Steps : Float := 0.0;
begin
-- Stroke graph rectangle
View.BB_Pos_Graph.Stroke_Color ("Black");
View.BB_Pos_Graph.Stroke_Rectangle (Cover_Plot);
-- Draw Y axis
-- Start at the top mark of axis Y
loop
-- Draw mark line
View.BB_Pos_Graph.Stroke_Color ("Black");
View.BB_Pos_Graph.Begin_Path;
View.BB_Pos_Graph.Move_To (Y_Start_X, Y_Start_Y + Y_Offset);
View.BB_Pos_Graph.Line_To (Y_Start_X - Mark_Size, Y_Start_Y + Y_Offset);
View.BB_Pos_Graph.Stroke;
-- Draw grid line
View.BB_Pos_Graph.Stroke_Color ("Silver");
View.BB_Pos_Graph.Begin_Path;
View.BB_Pos_Graph.Move_To (Y_Start_X, Y_Start_Y + Y_Offset);
View.BB_Pos_Graph.Line_To (Canvas_X_Size - 15, Y_Start_Y + Y_Offset);
View.BB_Pos_Graph.Stroke;
-- Put label
Val_Label := Integer (Mark);
View.BB_Pos_Graph.Fill_Color ("Black");
View.BB_Pos_Graph.Fill_Text
(Val_Label'Image,
Y_Start_X - (if Val_Label >= 100 or Val_Label <= -100 then 28
elsif Val_Label >= 10 or Val_Label <= -10 then 22
else 16),
Y_Start_Y + Y_Offset + 3);
-- Prepare next iteration or exit loop
Y_Steps := Y_Steps + 1.0;
Y_Offset := Integer (Y_Steps * Y_Interval);
Mark := Mark - Y_Step;
exit when Mark < Position'First - Over;
end loop;
-- Draw X Axis
-- Start at the leftmost mark of axis X
loop
-- Draw mark line
View.BB_Pos_Graph.Stroke_Color ("Black");
View.BB_Pos_Graph.Begin_Path;
View.BB_Pos_Graph.Move_To (X_Start_X + X_Offset, X_Start_Y);
View.BB_Pos_Graph.Line_To (X_Start_X + X_Offset, X_Start_Y + Mark_Size);
View.BB_Pos_Graph.Stroke;
-- Draw grid line
View.BB_Pos_Graph.Stroke_Color ("Silver");
View.BB_Pos_Graph.Begin_Path;
View.BB_Pos_Graph.Move_To (X_Start_X + X_Offset, X_Start_Y);
View.BB_Pos_Graph.Line_To (X_Start_X + X_Offset, 20);
View.BB_Pos_Graph.Stroke;
-- Prepare next iteration or exit loop
X_Steps := X_Steps + 1.0;
X_Offset := Integer (X_Steps * X_Interval);
exit when X_Steps > X_Max_Time;
end loop;
-- Write status text at bottom of graph
View.BB_Pos_Graph.Fill_Color ("Black");
View.BB_Pos_Graph.Fill_Text ("Target = ", 200, Canvas_Y_Size - 5);
Target_Text_X_Offset := Integer
(View.BB_Pos_Graph.Measure_Text_Width ("Target = "));
-- Write units next to both axes
View.BB_Pos_Graph.Fill_Text ("(mm)", 3, Canvas_Y_Size - 10);
View.BB_Pos_Graph.Fill_Text ("(1 sec/div)",
Canvas_X_Size - 60,
Canvas_Y_Size - 10);
-- Copy background to image Plot_Background. The plot background can then
-- be redrawn with Put_Image_Data, more efficient than redrawing from
-- scratch every time the plot is refreshed
View.BB_Pos_Graph.Get_Image_Data
(Image_Data => Plot_Background,
Left => 0,
Top => 0,
Width => Canvas_X_Size,
Height => Canvas_Y_Size);
end Draw_Plot_Background;
---------------------------------
-- Draw_Animation_Background --
---------------------------------
--
-- Draws all background elements of the animation area and saves the image
-- to Anim_Background for convenient use from Update_Animation
--
procedure Draw_Animation_Background is
begin
-- Draw background rectangle
View.BB_Animation.Fill_Color ("Linen");
View.BB_Animation.Fill_Rectangle (Cover_Animated_BB);
-- Draw beam pier
View.BB_Animation.Fill_Color ("Silver");
View.BB_Animation.Stroke_Color ("Grey");
View.BB_Animation.Begin_Path;
View.BB_Animation.Move_To (x0c, y0c); -- Top of beam pier (pivot point)
View.BB_Animation.Line_To (x0c + 40, y0c + 40);
View.BB_Animation.Line_To (x0c + 40, y0c + 115);
View.BB_Animation.Line_To (x0c - 40, y0c + 115);
View.BB_Animation.Line_To (x0c - 40, y0c + 40);
View.BB_Animation.Close_Path;
View.BB_Animation.Fill;
View.BB_Animation.Stroke;
-- Place text labels
View.BB_Animation.Fill_Color ("Black");
View.BB_Animation.Fill_Text
("Angle = ", 150, Canvas_Y_Size - 5);
View.BB_Animation.Fill_Text
("Position = ", 270, Canvas_Y_Size - 5);
-- Copy background to Anim_Background image
View.BB_Animation.Get_Image_Data
(Image_Data => Anim_Background,
Left => 0,
Top => 0,
Width => Canvas_X_Size,
Height => Canvas_Y_Size);
-- Measure X offsets for Angle and Pos values
Angle_Text_X_Offset :=
Integer (View.BB_Animation.Measure_Text_Width ("Angle = "));
Pos_Text_X_Offset :=
Integer (View.BB_Animation.Measure_Text_Width ("Position = "));
end Draw_Animation_Background;
-----------------
-- Create_GUI --
-----------------
procedure Create_GUI
(Main_Window : in out Gnoga.Gui.Window.Window_Type'Class) is
begin
View.Dynamic;
View.Create (Parent => Main_Window);
View.Quit_Button.On_Click_Handler (On_Quit'Access);
View.Pause_Button.On_Click_Handler (On_Pause'Access);
-- Draw plot and animation background images and save them for future use
Draw_Plot_Background;
Draw_Animation_Background;
-- Signal the updater task that it can start using the GUI
Set_True (GUI_Is_Usable);
end Create_GUI;
end BB.GUI.Controller;
| true |
------------------------------------------------------------
-- B B . G U I . C O N T R O L L E R --
-- --
-- Body --
-- --
-- "Controller" package of Ball on Beam simulator GUI. -- --
-- --
-- Author: PI:NAME:<NAME>END_PI --
-- Universitat Politecnica de Valencia --
-- July, 2020 - Version 1 --
-- February, 2021 - Version 2 --
-- --
-- This is free software in the ample sense: --
-- you can use it freely, provided you preserve --
-- this comment at the header of source files --
-- and you clearly indicate the changes made to --
-- the original file, if any. --
------------------------------------------------------------
with BB.GUI.View;
use BB.GUI.View;
with Gnoga.Gui.Base;
with Gnoga.Gui.Element.Canvas.Context_2D;
with Gnoga.Application.Singleton;
with Gnoga.Types;
with System;
with Ada.Numerics.Elementary_Functions;
with Ada.Real_Time; use Ada.Real_Time;
with Ada.Synchronous_Task_Control; use Ada.Synchronous_Task_Control;
package body BB.GUI.Controller is
View : BB.GUI.View.Default_View_Access :=
new BB.GUI.View.Default_View_Type;
Simulation_Running : Boolean := True;
Updater_Terminated : Boolean := False;
GUI_Is_Usable : Suspension_Object;
-- GUI refresh period
Updater_Period : constant Duration := 0.1;
-- Declaration of procedure in charge of updating the GUI
procedure Update_Animation
(Inclination : Angle;
Ball_Pos : Position;
Target_Pos : Position);
-- Quit button On_Click handler
procedure On_Quit (Object : in out Gnoga.Gui.Base.Base_Type'Class) is
begin
-- Inform updater task to terminate
Simulation_Running := False;
-- Poll for updater task terminated
while not Updater_Terminated loop
delay 0.05;
end loop;
Gnoga.Application.Singleton.End_Application;
end On_Quit;
-- Pause plot button On_Click handler
Paused : Boolean := False;
procedure On_Pause (Object : in out Gnoga.Gui.Base.Base_Type'Class) is
begin
Paused := not Paused;
if Paused then
null; -- release updater task in controller
-- View.Pause_Button.Property (Name => ,
-- Value => "Unpause plot");
else
null; -- pause updater task
-- View.Pause_Button.Property (Name => ,
-- Value => "Pause plot");
end if;
end On_Pause;
-- Updater - Task in charge of refreshing the GUI window.
-- It uses Last_Angle and Last_Pos, so it doesn't imply calculation of
-- simulation steps.
task Updater
with Priority => System.Priority'First;
task body Updater is
Next : Time := Clock;
Refresh_Period : constant Time_Span := To_Time_Span (Updater_Period);
begin
Suspend_Until_True (GUI_Is_Usable);
while Simulation_Running loop
Next := Next + Refresh_Period;
delay until Next;
Update_Animation (Last_Angle, Last_Pos, Current_Target_Pos);
end loop;
Updater_Terminated := True;
end Updater;
-- Declarations for Update_Animation
-- Graphical coordinates of pivot point for all rotations
-- Integer versions for coordinates
x0c : constant := Canvas_X_Size / 2;
y0c : constant := Canvas_Y_Size / 2;
-- Float versions, for trigonometry
x0 : constant := Float (x0c);
y0 : constant := Float (y0c);
-- Rectangles that cover the Animation and Status areas
Cover_Animated_BB : constant Gnoga.Types.Rectangle_Type :=
(X => 20, Y => 20, Width => Canvas_X_Size - 40,
Height => Canvas_Y_Size - 40);
Cover_Plot : constant Gnoga.Types.Rectangle_Type :=
(X => 30, Y => 20, Width => Canvas_X_Size - 45,
Height => Canvas_Y_Size - 50);
-- Background of the animation area (rectangle, beam pier, and labels)
Anim_Background : Gnoga.Gui.Element.Canvas.Context_2D.Image_Data_Type;
-- Background of the plot area (axis marks, labels, and grid)
Plot_Background : Gnoga.Gui.Element.Canvas.Context_2D.Image_Data_Type;
-- Scaling factor between 340 pixels of drawn beam (with some leeway for the
-- stoppers at both ends) and the beam length
X_Beam_Scaling : constant Float := 340.0 / (Max_Position - Min_Position);
-- Declaratons for the graph view
-- Vertical axis: ball position in millimeters
Y_Min_Pos : constant Float := Position'First;
Y_Max_Pos : constant Float := Position'Last;
-- Horizontal axis: time in seconds
X_Min_Time : constant := 0.0;
X_Max_Time : constant := 12.0;
-- Values over the range of Position that will be included in the Y axis.
-- This is so that saturated values can be clearly seen in the graph.
-- The graph range will be [Min_Position - Over .. Max_Postion + Over]
Over : constant := 10.0;
Y_Plot_Scaling : constant :=
(Float (Canvas_Y_Size) - 50.0) / (Y_Max_Pos - Y_Min_Pos + (2.0 * Over));
-- Pixel / mm
X_Plot_Scaling : constant :=
(Float (Canvas_X_Size) - 45.0) / (X_Max_Time - X_Min_Time);
-- Pixel / s
-- Number of points that will be plotted
List_Length : constant :=
Integer ((X_Max_Time - X_Min_Time) / Updater_Period);
-- Nr of pixels in X between two consecutive updater samples. Keep it Float
-- and use as an integer later, when plotting, to avoid cummulative error
Delta_X : constant Float := X_Plot_Scaling * Float (Updater_Period);
type Position_Plot is array (1..List_Length) of Position;
-- Plot values
Pos_Plot : Position_Plot := (others => 0.0);
Target_Plot : Position_Plot := (others => 0.0);
-- Counter of valid points in a Position_Plot array. The algorithm for
-- plotting is different for the first List_Length values to plot, since
-- there is no need to scroll the plot until the number of values to plot
-- is larger than List_Length
N_Plot_Points : Integer := 0;
-- X offset of target value printed in status line, wrt label "Target = "
Target_Text_X_Offset : Integer;
-- Same for beam angle
Angle_Text_X_Offset : Integer;
-- Same for ball position
Pos_Text_X_Offset : Integer;
------------------------
-- Update_Animation --
------------------------
-- Updates the ball and beam animation.
-- If plot refresh is not paused, it also updates the plot
procedure Update_Animation
(Inclination : Angle;
Ball_Pos : Position;
Target_Pos : Position) is
use Ada.Numerics.Elementary_Functions;
use Ada.Numerics;
-- Auxiliaries for printing the lower status line
-- Scaled angle to extract two decimals
Aux_Angle : constant Integer := Integer (Inclination * 100.0);
-- String that contains the integer part of Angle
Angle_Int : constant String := Integer'Image (Aux_Angle / 100);
-- String that contains the decimal part of Angle, with a leading space
Angle_Dec : constant String := Integer'Image (Aux_Angle mod 100);
-- String that represents the position in mm
Pos_Str : constant String := Integer'Image (Integer (Ball_Pos));
-- String that represents the target position in mm
Tgt_Str : constant String := Integer'Image (Integer (Target_Pos));
-- Auxiliaries for drawing
-- Angle in radians for trigonometrical functions
Ang : constant Float := (Inclination * Pi) / 180.0;
Sin_A : constant Float := Sin (-Ang);
Cos_A : constant Float := Cos (-Ang);
-- Coordinates of Ball center at Ball_Pos when Angle = 0.0
X_Pos_0: constant Float := x0 + Ball_Pos * X_Beam_Scaling;
Y_Pos_0: constant Float := y0 - 20.0;
-- Coordinates of top of target marker when Angle = 0.0
X_Tgt_0: constant Float := x0 + Target_Pos * X_Beam_Scaling;
Y_Tgt_0: constant Float := y0 - 10.0;
-- Rotation transform functions:
--
-- x' = x0 - (x - x0)*cos(Ang) - (y - y0)*sin(Ang)
-- y' = y0 + (x - x0)*sin(Ang) - (y - y0)*cos(Ang)
--
-- where: (x0, y0) = pivot point (declared global constants)
-- (X, Y) = Coordinates of point to rotate when Angle = 0.0
--
-- With sign variations depending on which object is rotated, the
-- beam, the ball, or the target marker.
function X_Beam (X, Y: Float) return Integer is
(Integer (x0 - (X - x0) * Cos_A - (Y - y0) * Sin_A));
function Y_Beam (X, Y: Float) return Integer is
(Integer (y0 - (X - x0) * Sin_A + (Y - y0) * Cos_A));
function X_Ball (X, Y: Float) return Integer is
(Integer (x0 + (X - x0) * Cos_A - (Y - y0) * Sin_A));
function Y_Ball (X, Y: Float) return Integer is
(Integer (y0 + (X - x0) * Sin_A + (Y - y0) * Cos_A));
-- Same transform for target position marker as for the ball
function X_Tgt (X, Y: Float) return Integer renames X_Ball;
function Y_Tgt (X, Y: Float) return Integer renames Y_Ball;
X_Plot_Offset : Integer;
begin
----------------------------------
-- Redraw the animation panel --
----------------------------------
-- Put background image of animation panel
View.BB_Animation.Put_Image_Data (Anim_Background, 0, 0);
-- Update status info
View.BB_Animation.Fill_Color ("Black");
-- Print angle value
View.BB_Animation.Fill_Text
(Angle_Int & "." &
Angle_Dec (Angle_Dec'First + 1 .. Angle_Dec'Last) &
" deg", 150 + Angle_Text_X_Offset, Canvas_Y_Size - 5);
-- Print ball position value
View.BB_Animation.Fill_Text
(Pos_Str &
" mm", 270 + Pos_Text_X_Offset, Canvas_Y_Size - 5);
-- Print SSO name
-- View.BB_Animation.Fill_Text
-- (" ", (Canvas_X_Size / 2) - 20, 14);
View.BB_Animation.Fill_Text
(Current_Planet'Image, (Canvas_X_Size / 2) - 20, 14);
-- Draw beam with angle given by Inclination
--
-- Four symmetric points define the beam shape: Outer top (OTop),
-- Inner top (ITop), Middle pint (Mid), and Outer bottom (OBot).
-- For example, OTop opposes -OTop, with respect to symmetry axis
-- defined by the orthogonal to the beam that crosses the pivot point.
--
-- -ITop |Symmetry OTop
-- ^ .axis ^
-- -OTop | ITop
-- ^_ -Mid Negative . Positive Mid ^_
-- | | / positions | positions \ | |
-- | |/____________________.____________________\| |
-- |_______________________+_______________________|
-- ^ -OBot ^ ^ OBot
-- Pivot point (x0, y0)
View.BB_Animation.Fill_Color ("Maroon");
View.BB_Animation.Begin_Path;
View.BB_Animation.Move_To (X_Beam (x0 - 180.0, y0),
Y_Beam (x0 - 180.0, y0)); -- a -OBot
View.BB_Animation.Line_To (X_Beam (x0 + 180.0, y0),
Y_Beam (x0 + 180.0, y0)); -- b OBot
View.BB_Animation.Line_To (X_Beam (x0 + 180.0, y0 - 25.0),
Y_Beam (x0 + 180.0, y0 - 25.0)); -- c OTop
View.BB_Animation.Line_To (X_Beam (x0 + 178.0, y0 - 25.0),
Y_Beam (x0 + 178.0, y0 - 25.0)); -- d ITop
View.BB_Animation.Line_To (X_Beam (x0 + 178.0, y0 - 10.0),
Y_Beam (x0 + 178.0, y0 - 10.0)); -- e Mid
View.BB_Animation.Line_To (X_Beam (x0 - 178.0, y0 - 10.0),
Y_Beam (x0 - 178.0, y0 - 10.0)); -- f -Mid
View.BB_Animation.Line_To (X_Beam (x0 - 178.0, y0 - 25.0),
Y_Beam (x0 - 178.0, y0 - 25.0)); -- g -ITop
View.BB_Animation.Line_To (X_Beam (x0 - 180.0, y0 - 25.0),
Y_Beam (x0 - 180.0, y0 - 25.0)); -- h -OTop
View.BB_Animation.Close_Path;
View.BB_Animation.Fill;
-- Draw a target marker on the beam
View.BB_Animation.Stroke_Color ("peachpuff");
View.BB_Animation.Line_Width (3);
View.BB_Animation.Begin_Path;
View.BB_Animation.Move_To (X_Tgt (X_Tgt_0, Y_Tgt_0),
Y_Tgt (X_Tgt_0, Y_Tgt_0));
View.BB_Animation.Line_To (X_Tgt (X_Tgt_0, y0),
Y_Tgt (X_Tgt_0, y0));
View.BB_Animation.Stroke;
-- Draw ball on the beam at position given by Ball_Pos
View.BB_Animation.Fill_Color ("Olive");
View.BB_Animation.Begin_Path;
View.BB_Animation.Arc_Degrees (X_Ball (X_Pos_0, Y_Pos_0),
Y_Ball (X_Pos_0, Y_Pos_0),
10, 0.0, 360.0);
View.BB_Animation.Close_Path;
View.BB_Animation.Fill;
-- Reflection effect on ball
View.BB_Animation.Fill_Color ("White");
View.BB_Animation.Begin_Path;
View.BB_Animation.Arc_Degrees (X_Ball (X_Pos_0, Y_Pos_0) - 3,
Y_Ball (X_Pos_0, Y_Pos_0) - 3,
2, 0.0, 360.0);
View.BB_Animation.Close_Path;
View.BB_Animation.Fill;
------------------------------
-- Redraw the graph panel --
------------------------------
-- The graph panel is only refreshed if plotting is not paused
if not Paused then
-- Put background image (axes, grid and "Target = " label)
View.BB_Pos_Graph.Put_Image_Data (Plot_Background, 0, 0);
-- Prepare the plot points in Pos_Plot and Target_Plot
if N_Plot_Points < List_Length then
-- No need to scroll
N_Plot_Points := N_Plot_Points + 1;
else
-- Need to scroll
Pos_Plot (1..N_Plot_Points - 1) := Pos_Plot (2..N_Plot_Points);
Target_Plot (1..N_Plot_Points - 1) := Target_Plot (2..N_Plot_Points);
end if;
Pos_Plot (N_Plot_Points) := Ball_Pos;
Target_Plot (N_Plot_Points) := Current_Target_Pos;
-- Plot Position graph
-- Status line. Print target position
View.BB_Pos_Graph.Fill_Color ("Black");
View.BB_Pos_Graph.Fill_Text
((if Tgt_Str (Tgt_Str'First) = '-' then
Tgt_Str
else
Tgt_Str (Tgt_Str'First + 1 .. Tgt_Str'Last)) &
" mm", 200 + Target_Text_X_Offset, Canvas_Y_Size - 5);
X_Plot_Offset := 0;
View.BB_Pos_Graph.Stroke_Color ("Blue");
View.BB_Pos_Graph.Begin_Path;
-- Move to coordinates of first point in list
View.BB_Pos_Graph.Move_To
(30 + X_Plot_Offset,
20 + Integer ((Y_Max_Pos + Over) * Y_Plot_Scaling -
(Pos_Plot (1) * Y_Plot_Scaling)));
for I in 2..N_Plot_Points loop
X_Plot_Offset := Integer (Delta_X * Float (I - 1));
View.BB_Pos_Graph.Line_To
(30 + X_Plot_Offset,
20 + Integer ((Y_Max_Pos + Over) * Y_Plot_Scaling -
(Pos_Plot (I) * Y_Plot_Scaling)));
end loop;
View.BB_Pos_Graph.Stroke;
-- Plot Target Position graph
X_Plot_Offset := 0;
View.BB_Pos_Graph.Stroke_Color ("Maroon");
View.BB_Pos_Graph.Begin_Path;
-- Move to coordinates of first point in list
View.BB_Pos_Graph.Move_To
(30 + X_Plot_Offset,
20 + Integer ((Y_Max_Pos + Over) * Y_Plot_Scaling -
(Target_Plot (1) * Y_Plot_Scaling)));
for I in 2..N_Plot_Points loop
X_Plot_Offset := Integer (Delta_X * Float (I - 1));
View.BB_Pos_Graph.Line_To
(30 + X_Plot_Offset,
20 + Integer ((Y_Max_Pos + Over) * Y_Plot_Scaling -
(Target_Plot (I) * Y_Plot_Scaling)));
end loop;
View.BB_Pos_Graph.Stroke;
end if;
end Update_Animation;
----------------------------
-- Draw_Plot_Background --
----------------------------
--
-- Draws all background elements of the plot area and saves the image to
-- Plot_Background for convenient use from Update_Animation
--
procedure Draw_Plot_Background is
-- Length of mark. Applies to both axes
Mark_Size : constant := 5;
-- Y axis related (Position axis)
Y_Step : constant Float := 50.0; -- Y interval step, in mm
Y_Interval : constant Float := Y_Step * Y_Plot_Scaling;
Y_Start_X : constant Integer := 30;
Y_Start_Y : constant Integer := 20;
Y_Offset : Integer := 0;
Y_Steps : Float := 0.0;
-- Start at the top mark of axis Y
Mark : Float := Max_Position + Over;
Val_Label : Integer; -- Value to print label from it
-- X axis related (Time axis)
X_Step : constant Float := 1.0; -- X interval step, in s
X_Interval : constant Float := X_Step * X_Plot_Scaling;
X_Start_X : constant Integer := 30;
X_Start_Y : constant Integer := Y_Start_Y + Canvas_Y_Size - 50;
X_Offset : Integer := 0;
X_Steps : Float := 0.0;
begin
-- Stroke graph rectangle
View.BB_Pos_Graph.Stroke_Color ("Black");
View.BB_Pos_Graph.Stroke_Rectangle (Cover_Plot);
-- Draw Y axis
-- Start at the top mark of axis Y
loop
-- Draw mark line
View.BB_Pos_Graph.Stroke_Color ("Black");
View.BB_Pos_Graph.Begin_Path;
View.BB_Pos_Graph.Move_To (Y_Start_X, Y_Start_Y + Y_Offset);
View.BB_Pos_Graph.Line_To (Y_Start_X - Mark_Size, Y_Start_Y + Y_Offset);
View.BB_Pos_Graph.Stroke;
-- Draw grid line
View.BB_Pos_Graph.Stroke_Color ("Silver");
View.BB_Pos_Graph.Begin_Path;
View.BB_Pos_Graph.Move_To (Y_Start_X, Y_Start_Y + Y_Offset);
View.BB_Pos_Graph.Line_To (Canvas_X_Size - 15, Y_Start_Y + Y_Offset);
View.BB_Pos_Graph.Stroke;
-- Put label
Val_Label := Integer (Mark);
View.BB_Pos_Graph.Fill_Color ("Black");
View.BB_Pos_Graph.Fill_Text
(Val_Label'Image,
Y_Start_X - (if Val_Label >= 100 or Val_Label <= -100 then 28
elsif Val_Label >= 10 or Val_Label <= -10 then 22
else 16),
Y_Start_Y + Y_Offset + 3);
-- Prepare next iteration or exit loop
Y_Steps := Y_Steps + 1.0;
Y_Offset := Integer (Y_Steps * Y_Interval);
Mark := Mark - Y_Step;
exit when Mark < Position'First - Over;
end loop;
-- Draw X Axis
-- Start at the leftmost mark of axis X
loop
-- Draw mark line
View.BB_Pos_Graph.Stroke_Color ("Black");
View.BB_Pos_Graph.Begin_Path;
View.BB_Pos_Graph.Move_To (X_Start_X + X_Offset, X_Start_Y);
View.BB_Pos_Graph.Line_To (X_Start_X + X_Offset, X_Start_Y + Mark_Size);
View.BB_Pos_Graph.Stroke;
-- Draw grid line
View.BB_Pos_Graph.Stroke_Color ("Silver");
View.BB_Pos_Graph.Begin_Path;
View.BB_Pos_Graph.Move_To (X_Start_X + X_Offset, X_Start_Y);
View.BB_Pos_Graph.Line_To (X_Start_X + X_Offset, 20);
View.BB_Pos_Graph.Stroke;
-- Prepare next iteration or exit loop
X_Steps := X_Steps + 1.0;
X_Offset := Integer (X_Steps * X_Interval);
exit when X_Steps > X_Max_Time;
end loop;
-- Write status text at bottom of graph
View.BB_Pos_Graph.Fill_Color ("Black");
View.BB_Pos_Graph.Fill_Text ("Target = ", 200, Canvas_Y_Size - 5);
Target_Text_X_Offset := Integer
(View.BB_Pos_Graph.Measure_Text_Width ("Target = "));
-- Write units next to both axes
View.BB_Pos_Graph.Fill_Text ("(mm)", 3, Canvas_Y_Size - 10);
View.BB_Pos_Graph.Fill_Text ("(1 sec/div)",
Canvas_X_Size - 60,
Canvas_Y_Size - 10);
-- Copy background to image Plot_Background. The plot background can then
-- be redrawn with Put_Image_Data, more efficient than redrawing from
-- scratch every time the plot is refreshed
View.BB_Pos_Graph.Get_Image_Data
(Image_Data => Plot_Background,
Left => 0,
Top => 0,
Width => Canvas_X_Size,
Height => Canvas_Y_Size);
end Draw_Plot_Background;
---------------------------------
-- Draw_Animation_Background --
---------------------------------
--
-- Draws all background elements of the animation area and saves the image
-- to Anim_Background for convenient use from Update_Animation
--
procedure Draw_Animation_Background is
begin
-- Draw background rectangle
View.BB_Animation.Fill_Color ("Linen");
View.BB_Animation.Fill_Rectangle (Cover_Animated_BB);
-- Draw beam pier
View.BB_Animation.Fill_Color ("Silver");
View.BB_Animation.Stroke_Color ("Grey");
View.BB_Animation.Begin_Path;
View.BB_Animation.Move_To (x0c, y0c); -- Top of beam pier (pivot point)
View.BB_Animation.Line_To (x0c + 40, y0c + 40);
View.BB_Animation.Line_To (x0c + 40, y0c + 115);
View.BB_Animation.Line_To (x0c - 40, y0c + 115);
View.BB_Animation.Line_To (x0c - 40, y0c + 40);
View.BB_Animation.Close_Path;
View.BB_Animation.Fill;
View.BB_Animation.Stroke;
-- Place text labels
View.BB_Animation.Fill_Color ("Black");
View.BB_Animation.Fill_Text
("Angle = ", 150, Canvas_Y_Size - 5);
View.BB_Animation.Fill_Text
("Position = ", 270, Canvas_Y_Size - 5);
-- Copy background to Anim_Background image
View.BB_Animation.Get_Image_Data
(Image_Data => Anim_Background,
Left => 0,
Top => 0,
Width => Canvas_X_Size,
Height => Canvas_Y_Size);
-- Measure X offsets for Angle and Pos values
Angle_Text_X_Offset :=
Integer (View.BB_Animation.Measure_Text_Width ("Angle = "));
Pos_Text_X_Offset :=
Integer (View.BB_Animation.Measure_Text_Width ("Position = "));
end Draw_Animation_Background;
-----------------
-- Create_GUI --
-----------------
procedure Create_GUI
(Main_Window : in out Gnoga.Gui.Window.Window_Type'Class) is
begin
View.Dynamic;
View.Create (Parent => Main_Window);
View.Quit_Button.On_Click_Handler (On_Quit'Access);
View.Pause_Button.On_Click_Handler (On_Pause'Access);
-- Draw plot and animation background images and save them for future use
Draw_Plot_Background;
Draw_Animation_Background;
-- Signal the updater task that it can start using the GUI
Set_True (GUI_Is_Usable);
end Create_GUI;
end BB.GUI.Controller;
|
[
{
"context": "-- Copyright 2015,2016 Steven Stewart-Gallus\n--\n-- Licensed under the Apache License, Version ",
"end": 44,
"score": 0.9997193813323975,
"start": 23,
"tag": "NAME",
"value": "Steven Stewart-Gallus"
}
] |
src/ada-core/src/linted-results.ads
|
mstewartgallus/linted
| 0 |
-- Copyright 2015,2016 Steven Stewart-Gallus
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-- implied. See the License for the specific language governing
-- permissions and limitations under the License.
with Linted.Errors;
generic
type Element_T is private;
package Linted.Results with
Abstract_State => null is
pragma Preelaborate;
type Result (Erroneous : Boolean) is record
case Erroneous is
when True =>
Err : Errors.Error := 0;
when False =>
Data : Element_T;
end case;
end record;
end Linted.Results;
|
9263
|
-- Copyright 2015,2016 <NAME>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-- implied. See the License for the specific language governing
-- permissions and limitations under the License.
with Linted.Errors;
generic
type Element_T is private;
package Linted.Results with
Abstract_State => null is
pragma Preelaborate;
type Result (Erroneous : Boolean) is record
case Erroneous is
when True =>
Err : Errors.Error := 0;
when False =>
Data : Element_T;
end case;
end record;
end Linted.Results;
| true |
-- Copyright 2015,2016 PI:NAME:<NAME>END_PI
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-- implied. See the License for the specific language governing
-- permissions and limitations under the License.
with Linted.Errors;
generic
type Element_T is private;
package Linted.Results with
Abstract_State => null is
pragma Preelaborate;
type Result (Erroneous : Boolean) is record
case Erroneous is
when True =>
Err : Errors.Error := 0;
when False =>
Data : Element_T;
end case;
end record;
end Linted.Results;
|
[
{
"context": "e-Identifier: Apache-2.0\n--\n-- Copyright (c) 2012 Felix Krause <[email protected]>\n--\n-- Licensed under the Apac",
"end": 78,
"score": 0.9998553991317749,
"start": 66,
"tag": "NAME",
"value": "Felix Krause"
},
{
"context": "pache-2.0\n--\n-- Copyright (c) 2012 Felix Krause <[email protected]>\n--\n-- Licensed under the Apache License, Versio",
"end": 96,
"score": 0.9999308586120605,
"start": 80,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
orka/src/gl/implementation/gl-toggles.adb
|
onox/orka
| 52 |
-- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2012 Felix Krause <[email protected]>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with GL.API;
package body GL.Toggles is
procedure Enable (Subject : Toggle) is
begin
API.Enable.Ref (Subject);
end Enable;
procedure Disable (Subject : Toggle) is
begin
API.Disable.Ref (Subject);
end Disable;
procedure Set (Subject : Toggle; Value : Toggle_State) is
begin
if Value = Enabled then
API.Enable.Ref (Subject);
else
API.Disable.Ref (Subject);
end if;
end Set;
function State (Subject : Toggle) return Toggle_State is
((if API.Is_Enabled.Ref (Subject) then Enabled else Disabled));
procedure Enable (Subject : Toggle_Indexed; Index : Types.UInt) is
begin
API.Enable_I.Ref (Subject, Index);
end Enable;
procedure Disable (Subject : Toggle_Indexed; Index : Types.UInt) is
begin
API.Disable_I.Ref (Subject, Index);
end Disable;
procedure Set (Subject : Toggle_Indexed; Index : Types.UInt; Value : Toggle_State) is
begin
if Value = Enabled then
API.Enable_I.Ref (Subject, Index);
else
API.Disable_I.Ref (Subject, Index);
end if;
end Set;
function State (Subject : Toggle_Indexed; Index : Types.UInt) return Toggle_State is
((if API.Is_Enabled_I.Ref (Subject, Index) then Enabled else Disabled));
end GL.Toggles;
|
4064
|
-- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2012 <NAME> <<EMAIL>>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with GL.API;
package body GL.Toggles is
procedure Enable (Subject : Toggle) is
begin
API.Enable.Ref (Subject);
end Enable;
procedure Disable (Subject : Toggle) is
begin
API.Disable.Ref (Subject);
end Disable;
procedure Set (Subject : Toggle; Value : Toggle_State) is
begin
if Value = Enabled then
API.Enable.Ref (Subject);
else
API.Disable.Ref (Subject);
end if;
end Set;
function State (Subject : Toggle) return Toggle_State is
((if API.Is_Enabled.Ref (Subject) then Enabled else Disabled));
procedure Enable (Subject : Toggle_Indexed; Index : Types.UInt) is
begin
API.Enable_I.Ref (Subject, Index);
end Enable;
procedure Disable (Subject : Toggle_Indexed; Index : Types.UInt) is
begin
API.Disable_I.Ref (Subject, Index);
end Disable;
procedure Set (Subject : Toggle_Indexed; Index : Types.UInt; Value : Toggle_State) is
begin
if Value = Enabled then
API.Enable_I.Ref (Subject, Index);
else
API.Disable_I.Ref (Subject, Index);
end if;
end Set;
function State (Subject : Toggle_Indexed; Index : Types.UInt) return Toggle_State is
((if API.Is_Enabled_I.Ref (Subject, Index) then Enabled else Disabled));
end GL.Toggles;
| true |
-- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2012 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with GL.API;
package body GL.Toggles is
procedure Enable (Subject : Toggle) is
begin
API.Enable.Ref (Subject);
end Enable;
procedure Disable (Subject : Toggle) is
begin
API.Disable.Ref (Subject);
end Disable;
procedure Set (Subject : Toggle; Value : Toggle_State) is
begin
if Value = Enabled then
API.Enable.Ref (Subject);
else
API.Disable.Ref (Subject);
end if;
end Set;
function State (Subject : Toggle) return Toggle_State is
((if API.Is_Enabled.Ref (Subject) then Enabled else Disabled));
procedure Enable (Subject : Toggle_Indexed; Index : Types.UInt) is
begin
API.Enable_I.Ref (Subject, Index);
end Enable;
procedure Disable (Subject : Toggle_Indexed; Index : Types.UInt) is
begin
API.Disable_I.Ref (Subject, Index);
end Disable;
procedure Set (Subject : Toggle_Indexed; Index : Types.UInt; Value : Toggle_State) is
begin
if Value = Enabled then
API.Enable_I.Ref (Subject, Index);
else
API.Disable_I.Ref (Subject, Index);
end if;
end Set;
function State (Subject : Toggle_Indexed; Index : Types.UInt) return Toggle_State is
((if API.Is_Enabled_I.Ref (Subject, Index) then Enabled else Disabled));
end GL.Toggles;
|
[
{
"context": "-- Copyright (c) 2015-2019 Marcel Schneider\n-- for details see License.txt\n\nwith Ada.Strings.",
"end": 43,
"score": 0.9998571276664734,
"start": 27,
"tag": "NAME",
"value": "Marcel Schneider"
}
] |
src/ada/AeonFlux/Parser/Punctuation.ads
|
marcello-s/AeonFlux
| 0 |
-- Copyright (c) 2015-2019 Marcel Schneider
-- for details see License.txt
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Strings.Unbounded.Equal_Case_Insensitive;
with Ada.Strings.Unbounded.Hash_Case_Insensitive;
with Ada.Containers.Hashed_Maps; use Ada.Containers;
with Tokens; use Tokens;
package Punctuation is
package TokenMap is new Ada.Containers.Hashed_Maps
(Key_Type => Unbounded_String,
Element_Type => Tokens.Token,
Hash => Hash_Case_Insensitive,
Equivalent_Keys => Equal_Case_Insensitive
);
type Object is record
Punctuators : TokenMap.Map;
Operators : TokenMap.Map;
Keywords : TokenMap.Map;
FutureReservedWords : TokenMap.Map;
end record;
procedure Initialize (O : in out Object);
procedure Clear (O : in out Object);
end Punctuation;
|
11944
|
-- Copyright (c) 2015-2019 <NAME>
-- for details see License.txt
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Strings.Unbounded.Equal_Case_Insensitive;
with Ada.Strings.Unbounded.Hash_Case_Insensitive;
with Ada.Containers.Hashed_Maps; use Ada.Containers;
with Tokens; use Tokens;
package Punctuation is
package TokenMap is new Ada.Containers.Hashed_Maps
(Key_Type => Unbounded_String,
Element_Type => Tokens.Token,
Hash => Hash_Case_Insensitive,
Equivalent_Keys => Equal_Case_Insensitive
);
type Object is record
Punctuators : TokenMap.Map;
Operators : TokenMap.Map;
Keywords : TokenMap.Map;
FutureReservedWords : TokenMap.Map;
end record;
procedure Initialize (O : in out Object);
procedure Clear (O : in out Object);
end Punctuation;
| true |
-- Copyright (c) 2015-2019 PI:NAME:<NAME>END_PI
-- for details see License.txt
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Strings.Unbounded.Equal_Case_Insensitive;
with Ada.Strings.Unbounded.Hash_Case_Insensitive;
with Ada.Containers.Hashed_Maps; use Ada.Containers;
with Tokens; use Tokens;
package Punctuation is
package TokenMap is new Ada.Containers.Hashed_Maps
(Key_Type => Unbounded_String,
Element_Type => Tokens.Token,
Hash => Hash_Case_Insensitive,
Equivalent_Keys => Equal_Case_Insensitive
);
type Object is record
Punctuators : TokenMap.Map;
Operators : TokenMap.Map;
Keywords : TokenMap.Map;
FutureReservedWords : TokenMap.Map;
end record;
procedure Initialize (O : in out Object);
procedure Clear (O : in out Object);
end Punctuation;
|
[
{
"context": " --\n-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --\n-- All rig",
"end": 829,
"score": 0.9998879432678223,
"start": 816,
"tag": "NAME",
"value": "Vadim Godunko"
},
{
"context": " --\n-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --\n-- All rights reserved. ",
"end": 849,
"score": 0.9999330043792725,
"start": 831,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
source/amf/uml/amf-uml-duration_observations.ads
|
svn2github/matreshka
| 24 |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
-- A duration observation is a reference to a duration during an execution.
-- It points out the element(s) in the model to observe and whether the
-- observations are when this model element is entered or when it is exited.
------------------------------------------------------------------------------
with AMF.Boolean_Collections;
limited with AMF.UML.Named_Elements.Collections;
with AMF.UML.Observations;
package AMF.UML.Duration_Observations is
pragma Preelaborate;
type UML_Duration_Observation is limited interface
and AMF.UML.Observations.UML_Observation;
type UML_Duration_Observation_Access is
access all UML_Duration_Observation'Class;
for UML_Duration_Observation_Access'Storage_Size use 0;
not overriding function Get_Event
(Self : not null access constant UML_Duration_Observation)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is abstract;
-- Getter of DurationObservation::event.
--
-- The observation is determined by the entering or exiting of the event
-- element during execution.
not overriding function Get_First_Event
(Self : not null access constant UML_Duration_Observation)
return AMF.Boolean_Collections.Set_Of_Boolean is abstract;
-- Getter of DurationObservation::firstEvent.
--
-- The value of firstEvent[i] is related to event[i] (where i is 1 or 2).
-- If firstEvent[i] is true, then the corresponding observation event is
-- the first time instant the execution enters event[i]. If firstEvent[i]
-- is false, then the corresponding observation event is the time instant
-- the execution exits event[i]. Default value is true applied when
-- event[i] refers an element that represents only one time instant.
end AMF.UML.Duration_Observations;
|
25060
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
-- A duration observation is a reference to a duration during an execution.
-- It points out the element(s) in the model to observe and whether the
-- observations are when this model element is entered or when it is exited.
------------------------------------------------------------------------------
with AMF.Boolean_Collections;
limited with AMF.UML.Named_Elements.Collections;
with AMF.UML.Observations;
package AMF.UML.Duration_Observations is
pragma Preelaborate;
type UML_Duration_Observation is limited interface
and AMF.UML.Observations.UML_Observation;
type UML_Duration_Observation_Access is
access all UML_Duration_Observation'Class;
for UML_Duration_Observation_Access'Storage_Size use 0;
not overriding function Get_Event
(Self : not null access constant UML_Duration_Observation)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is abstract;
-- Getter of DurationObservation::event.
--
-- The observation is determined by the entering or exiting of the event
-- element during execution.
not overriding function Get_First_Event
(Self : not null access constant UML_Duration_Observation)
return AMF.Boolean_Collections.Set_Of_Boolean is abstract;
-- Getter of DurationObservation::firstEvent.
--
-- The value of firstEvent[i] is related to event[i] (where i is 1 or 2).
-- If firstEvent[i] is true, then the corresponding observation event is
-- the first time instant the execution enters event[i]. If firstEvent[i]
-- is false, then the corresponding observation event is the time instant
-- the execution exits event[i]. Default value is true applied when
-- event[i] refers an element that represents only one time instant.
end AMF.UML.Duration_Observations;
| true |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
-- A duration observation is a reference to a duration during an execution.
-- It points out the element(s) in the model to observe and whether the
-- observations are when this model element is entered or when it is exited.
------------------------------------------------------------------------------
with AMF.Boolean_Collections;
limited with AMF.UML.Named_Elements.Collections;
with AMF.UML.Observations;
package AMF.UML.Duration_Observations is
pragma Preelaborate;
type UML_Duration_Observation is limited interface
and AMF.UML.Observations.UML_Observation;
type UML_Duration_Observation_Access is
access all UML_Duration_Observation'Class;
for UML_Duration_Observation_Access'Storage_Size use 0;
not overriding function Get_Event
(Self : not null access constant UML_Duration_Observation)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is abstract;
-- Getter of DurationObservation::event.
--
-- The observation is determined by the entering or exiting of the event
-- element during execution.
not overriding function Get_First_Event
(Self : not null access constant UML_Duration_Observation)
return AMF.Boolean_Collections.Set_Of_Boolean is abstract;
-- Getter of DurationObservation::firstEvent.
--
-- The value of firstEvent[i] is related to event[i] (where i is 1 or 2).
-- If firstEvent[i] is true, then the corresponding observation event is
-- the first time instant the execution enters event[i]. If firstEvent[i]
-- is false, then the corresponding observation event is the time instant
-- the execution exits event[i]. Default value is true applied when
-- event[i] refers an element that represents only one time instant.
end AMF.UML.Duration_Observations;
|
[
{
"context": "-- Copyright (c) 2012, mulander <[email protected]>\n-- All rights reserved.\n-- U",
"end": 31,
"score": 0.9605262279510498,
"start": 23,
"tag": "NAME",
"value": "mulander"
},
{
"context": "-- Copyright (c) 2012, mulander <[email protected]>\n-- All rights reserved.\n-- Use of this source co",
"end": 51,
"score": 0.9999231696128845,
"start": 33,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
src/main.adb
|
mulander/crawler
| 1 |
-- Copyright (c) 2012, mulander <[email protected]>
-- All rights reserved.
-- Use of this source code is governed by a BSD-style license that can be
-- found in the LICENSE file.
with Terminal_Interface.Curses;
with Crawler_Interface;
with Crawler.Entities;
procedure Main
is
package Curses renames Terminal_Interface.Curses;
package Entities renames Crawler.Entities;
Key : Curses.Key_Code;
-- Start ncurses
Screen : Crawler_Interface.Screen;
procedure Game_Loop
is
use type Curses.Line_Position;
use type Curses.Column_Position;
Key : Curses.Key_Code := Curses.Key_Home;
-- The C++ implementation doesn't refresh on each
-- tick so we also retrieve the dimensions on start.
-- Lines : Curses.Line_Count := Screen.Get_Height;
-- Columns : Curses.Column_Count := Screen.Get_Width;
Game_Map : Crawler_Interface.Frame;
Viewport : Crawler_Interface.Frame;
begin
-- Create an ncurses window to store the game map. This will be twice the size
-- of the screen and it will be positioned at (0,0) in screen coordinates
Game_Map.Make (Height => 2 * Screen.Get_Height + 1
,Width => 2 * Screen.Get_Width
,Row => 0
,Col => 0);
-- Create an ncurses subwindow of the game map. This will have the size
-- of the user screen and it will be initially postioned at (0, 0)
Viewport.Make_Sub_Window (Parent => Game_Map
,Height => Screen.Get_Height
,Width => Screen.Get_Width
,Row => 0
,Col => 0);
-- Initialize the main character. We are going to put this in the middle of
-- the game map (for now)
declare
Main_Character : Entities.Character := Entities.Make (Symbol => '@',
Row => Game_Map.Get_Height / 2,
Col => Game_Map.Get_Width / 2);
Row : Curses.Line_Position;
Col : Curses.Column_Position;
begin
-- Fill the game map with numbers
Game_Map.Fill_Window;
-- Compared to the original, just one print of the main characer is
-- all we need to update our current position as all of our options
-- are related to the player updating his position.
Game_Map.Add (Character => Main_Character);
-- ,Row => Row
-- ,Col => Col);
Viewport.Center (Character => Main_Character);
Viewport.Refresh;
-- Start the game loop
loop
-- Wait until the user presses a key
Key := Curses.Get_Keystroke; --getch();
Row := Entities.Get_Row (Main_Character);
Col := Entities.Get_Col (Main_Character);
-- Clear the screen
-- Curses.Clear;
-- We have one Erase call as we need to perform it before each move command
-- no need to repeat if four times.
---Erase(Entities.Get_Row(Main_Character),Entities.Get_Col(Main_Character));
-- Compared to the original snippet, we drop refresh()
-- as it seems to be not needed if we don't use the printw family
-- of functions. Refresh draws the 'virtual' screen to the display
-- and it seems to be also done by Curses.Add in our example.
case Key is
when Curses.Real_Key_Code(Character'Pos('q')) | Curses.Real_Key_Code(Character'Pos('Q')) =>
exit;
when Curses.KEY_LEFT =>
Game_Map.add (Main_Character, Row, Col-1);
when Curses.KEY_RIGHT =>
Game_Map.add (Main_Character, Row, Col+1);
when Curses.KEY_UP =>
Game_Map.add (Main_Character, Row-1, Col);
when Curses.KEY_DOWN =>
Game_Map.add (Main_Character, Row+1, Col);
when others => -- If the user choses to stay, show the main character at position (Row,Col)
null;
end case;
Viewport.Center (Character => Main_Character);
Viewport.Refresh;
end loop;
end;
end Game_Loop;
begin
-- Printw is not ported binded by design
-- Print a welcome message on the screen
Screen.Add (Str => "Welcome to RR game." & Standard.ASCII.LF);
Screen.Add (Str => "Press any key to start." & Standard.ASCII.LF);
Screen.Add (Str => "If you want to quit press ""q"" or ""Q""");
Key := Curses.Get_Keystroke;
if Integer(Key) not in Character'Pos('Q')|Character'Pos('q')
then
Curses.Clear;
-- Start the game loop
Game_Loop;
end if;
end Main;
|
2664
|
-- Copyright (c) 2012, <NAME> <<EMAIL>>
-- All rights reserved.
-- Use of this source code is governed by a BSD-style license that can be
-- found in the LICENSE file.
with Terminal_Interface.Curses;
with Crawler_Interface;
with Crawler.Entities;
procedure Main
is
package Curses renames Terminal_Interface.Curses;
package Entities renames Crawler.Entities;
Key : Curses.Key_Code;
-- Start ncurses
Screen : Crawler_Interface.Screen;
procedure Game_Loop
is
use type Curses.Line_Position;
use type Curses.Column_Position;
Key : Curses.Key_Code := Curses.Key_Home;
-- The C++ implementation doesn't refresh on each
-- tick so we also retrieve the dimensions on start.
-- Lines : Curses.Line_Count := Screen.Get_Height;
-- Columns : Curses.Column_Count := Screen.Get_Width;
Game_Map : Crawler_Interface.Frame;
Viewport : Crawler_Interface.Frame;
begin
-- Create an ncurses window to store the game map. This will be twice the size
-- of the screen and it will be positioned at (0,0) in screen coordinates
Game_Map.Make (Height => 2 * Screen.Get_Height + 1
,Width => 2 * Screen.Get_Width
,Row => 0
,Col => 0);
-- Create an ncurses subwindow of the game map. This will have the size
-- of the user screen and it will be initially postioned at (0, 0)
Viewport.Make_Sub_Window (Parent => Game_Map
,Height => Screen.Get_Height
,Width => Screen.Get_Width
,Row => 0
,Col => 0);
-- Initialize the main character. We are going to put this in the middle of
-- the game map (for now)
declare
Main_Character : Entities.Character := Entities.Make (Symbol => '@',
Row => Game_Map.Get_Height / 2,
Col => Game_Map.Get_Width / 2);
Row : Curses.Line_Position;
Col : Curses.Column_Position;
begin
-- Fill the game map with numbers
Game_Map.Fill_Window;
-- Compared to the original, just one print of the main characer is
-- all we need to update our current position as all of our options
-- are related to the player updating his position.
Game_Map.Add (Character => Main_Character);
-- ,Row => Row
-- ,Col => Col);
Viewport.Center (Character => Main_Character);
Viewport.Refresh;
-- Start the game loop
loop
-- Wait until the user presses a key
Key := Curses.Get_Keystroke; --getch();
Row := Entities.Get_Row (Main_Character);
Col := Entities.Get_Col (Main_Character);
-- Clear the screen
-- Curses.Clear;
-- We have one Erase call as we need to perform it before each move command
-- no need to repeat if four times.
---Erase(Entities.Get_Row(Main_Character),Entities.Get_Col(Main_Character));
-- Compared to the original snippet, we drop refresh()
-- as it seems to be not needed if we don't use the printw family
-- of functions. Refresh draws the 'virtual' screen to the display
-- and it seems to be also done by Curses.Add in our example.
case Key is
when Curses.Real_Key_Code(Character'Pos('q')) | Curses.Real_Key_Code(Character'Pos('Q')) =>
exit;
when Curses.KEY_LEFT =>
Game_Map.add (Main_Character, Row, Col-1);
when Curses.KEY_RIGHT =>
Game_Map.add (Main_Character, Row, Col+1);
when Curses.KEY_UP =>
Game_Map.add (Main_Character, Row-1, Col);
when Curses.KEY_DOWN =>
Game_Map.add (Main_Character, Row+1, Col);
when others => -- If the user choses to stay, show the main character at position (Row,Col)
null;
end case;
Viewport.Center (Character => Main_Character);
Viewport.Refresh;
end loop;
end;
end Game_Loop;
begin
-- Printw is not ported binded by design
-- Print a welcome message on the screen
Screen.Add (Str => "Welcome to RR game." & Standard.ASCII.LF);
Screen.Add (Str => "Press any key to start." & Standard.ASCII.LF);
Screen.Add (Str => "If you want to quit press ""q"" or ""Q""");
Key := Curses.Get_Keystroke;
if Integer(Key) not in Character'Pos('Q')|Character'Pos('q')
then
Curses.Clear;
-- Start the game loop
Game_Loop;
end if;
end Main;
| true |
-- Copyright (c) 2012, PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>
-- All rights reserved.
-- Use of this source code is governed by a BSD-style license that can be
-- found in the LICENSE file.
with Terminal_Interface.Curses;
with Crawler_Interface;
with Crawler.Entities;
procedure Main
is
package Curses renames Terminal_Interface.Curses;
package Entities renames Crawler.Entities;
Key : Curses.Key_Code;
-- Start ncurses
Screen : Crawler_Interface.Screen;
procedure Game_Loop
is
use type Curses.Line_Position;
use type Curses.Column_Position;
Key : Curses.Key_Code := Curses.Key_Home;
-- The C++ implementation doesn't refresh on each
-- tick so we also retrieve the dimensions on start.
-- Lines : Curses.Line_Count := Screen.Get_Height;
-- Columns : Curses.Column_Count := Screen.Get_Width;
Game_Map : Crawler_Interface.Frame;
Viewport : Crawler_Interface.Frame;
begin
-- Create an ncurses window to store the game map. This will be twice the size
-- of the screen and it will be positioned at (0,0) in screen coordinates
Game_Map.Make (Height => 2 * Screen.Get_Height + 1
,Width => 2 * Screen.Get_Width
,Row => 0
,Col => 0);
-- Create an ncurses subwindow of the game map. This will have the size
-- of the user screen and it will be initially postioned at (0, 0)
Viewport.Make_Sub_Window (Parent => Game_Map
,Height => Screen.Get_Height
,Width => Screen.Get_Width
,Row => 0
,Col => 0);
-- Initialize the main character. We are going to put this in the middle of
-- the game map (for now)
declare
Main_Character : Entities.Character := Entities.Make (Symbol => '@',
Row => Game_Map.Get_Height / 2,
Col => Game_Map.Get_Width / 2);
Row : Curses.Line_Position;
Col : Curses.Column_Position;
begin
-- Fill the game map with numbers
Game_Map.Fill_Window;
-- Compared to the original, just one print of the main characer is
-- all we need to update our current position as all of our options
-- are related to the player updating his position.
Game_Map.Add (Character => Main_Character);
-- ,Row => Row
-- ,Col => Col);
Viewport.Center (Character => Main_Character);
Viewport.Refresh;
-- Start the game loop
loop
-- Wait until the user presses a key
Key := Curses.Get_Keystroke; --getch();
Row := Entities.Get_Row (Main_Character);
Col := Entities.Get_Col (Main_Character);
-- Clear the screen
-- Curses.Clear;
-- We have one Erase call as we need to perform it before each move command
-- no need to repeat if four times.
---Erase(Entities.Get_Row(Main_Character),Entities.Get_Col(Main_Character));
-- Compared to the original snippet, we drop refresh()
-- as it seems to be not needed if we don't use the printw family
-- of functions. Refresh draws the 'virtual' screen to the display
-- and it seems to be also done by Curses.Add in our example.
case Key is
when Curses.Real_Key_Code(Character'Pos('q')) | Curses.Real_Key_Code(Character'Pos('Q')) =>
exit;
when Curses.KEY_LEFT =>
Game_Map.add (Main_Character, Row, Col-1);
when Curses.KEY_RIGHT =>
Game_Map.add (Main_Character, Row, Col+1);
when Curses.KEY_UP =>
Game_Map.add (Main_Character, Row-1, Col);
when Curses.KEY_DOWN =>
Game_Map.add (Main_Character, Row+1, Col);
when others => -- If the user choses to stay, show the main character at position (Row,Col)
null;
end case;
Viewport.Center (Character => Main_Character);
Viewport.Refresh;
end loop;
end;
end Game_Loop;
begin
-- Printw is not ported binded by design
-- Print a welcome message on the screen
Screen.Add (Str => "Welcome to RR game." & Standard.ASCII.LF);
Screen.Add (Str => "Press any key to start." & Standard.ASCII.LF);
Screen.Add (Str => "If you want to quit press ""q"" or ""Q""");
Key := Curses.Get_Keystroke;
if Integer(Key) not in Character'Pos('Q')|Character'Pos('q')
then
Curses.Clear;
-- Start the game loop
Game_Loop;
end if;
end Main;
|
[
{
"context": " --\n-- Copyright © 2009-2015, Vadim Godunko <[email protected]> --\n-- All rig",
"end": 829,
"score": 0.9998902678489685,
"start": 816,
"tag": "NAME",
"value": "Vadim Godunko"
},
{
"context": " --\n-- Copyright © 2009-2015, Vadim Godunko <[email protected]> --\n-- All rights reserved. ",
"end": 849,
"score": 0.9999303817749023,
"start": 831,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
tools/gen_norms.adb
|
svn2github/matreshka
| 24 |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Tools Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2009-2015, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Ada.Text_IO;
with Matreshka.Internals.Unicode.Ucd;
with Put_File_Header;
with Ucd_Data;
with Utils;
procedure Gen_Norms is
use Matreshka.Internals.Unicode;
use Matreshka.Internals.Unicode.Ucd;
use Ucd_Data;
use Utils;
procedure Append_Mapping
(Mapping : Code_Point_Sequence;
First : out Sequence_Index;
Last : out Sequence_Count);
type Group_Info is record
Share : First_Stage_Index;
Count : Natural;
end record;
type Composition_Mapping_Access is access all Composition_Mapping;
Decomposition_Data : Code_Point_Sequence (Sequence_Index);
Decomposition_Data_Last : Sequence_Count := 0;
Composition_Data : Composition_Mapping_Access;
First_Index_Last : Sequence_Count := 0;
Last_Index_Last : Sequence_Count := 0;
Normalization : array (Code_Point) of Normalization_Mapping
:= (others =>
((others => (0, 0)),
(0, 0),
0,
(others => Yes),
None,
(others => False)));
Groups : array (First_Stage_Index) of Group_Info
:= (others => (0, 0));
Generated : array (First_Stage_Index) of Boolean := (others => False);
type Constant_String_Access is access constant String;
DT_Canonical_Image : aliased constant String := "Canonical";
DT_Compat_Image : aliased constant String := "Compat";
DT_Circle_Image : aliased constant String := "Circle";
DT_Final_Image : aliased constant String := "Final";
DT_Font_Image : aliased constant String := "Font";
DT_Fraction_Image : aliased constant String := "Fraction";
DT_Initial_Image : aliased constant String := "Initial";
DT_Isolated_Image : aliased constant String := "Isolated";
DT_Medial_Image : aliased constant String := "Medial";
DT_Narrow_Image : aliased constant String := "Narrow";
DT_No_Break_Image : aliased constant String := "No_Break";
DT_None_Image : aliased constant String := "None";
DT_Small_Image : aliased constant String := "Small";
DT_Square_Image : aliased constant String := "Square";
DT_Sub_Image : aliased constant String := "Sub";
DT_Super_Image : aliased constant String := "Super";
DT_Vertical_Image : aliased constant String := "Vertical";
DT_Wide_Image : aliased constant String := "Wide";
Decomposition_Type_Image : constant
array (Decomposition_Type) of Constant_String_Access
:= (Canonical => DT_Canonical_Image'Access,
Compat => DT_Compat_Image'Access,
Circle => DT_Circle_Image'Access,
Final => DT_Final_Image'Access,
Font => DT_Font_Image'Access,
Fraction => DT_Fraction_Image'Access,
Initial => DT_Initial_Image'Access,
Isolated => DT_Isolated_Image'Access,
Medial => DT_Medial_Image'Access,
Narrow => DT_Narrow_Image'Access,
No_Break => DT_No_Break_Image'Access,
None => DT_None_Image'Access,
Small => DT_Small_Image'Access,
Square => DT_Square_Image'Access,
Sub => DT_Sub_Image'Access,
Super => DT_Super_Image'Access,
Vertical => DT_Vertical_Image'Access,
Wide => DT_Wide_Image'Access);
NQC_No_Image : aliased constant String := "No";
NQC_Maybe_Image : aliased constant String := "Maybe";
NQC_Yes_Image : aliased constant String := "Yes";
Normalization_Quick_Check_Image : constant
array (Normalization_Quick_Check) of Constant_String_Access
:= (No => NQC_No_Image'Access,
Maybe => NQC_Maybe_Image'Access,
Yes => NQC_Yes_Image'Access);
BP_Composition_Exclusion_Image :
aliased constant String := "Composition_Exclusion";
BP_Full_Composition_Exclusion_Image :
aliased constant String := "Full_Composition_Exclusion";
BP_Expands_On_NFC_Image : aliased constant String := "Expands_On_NFC";
BP_Expands_On_NFD_Image : aliased constant String := "Expands_On_NFD";
BP_Expands_On_NFKC_Image : aliased constant String := "Expands_On_NFKC";
BP_Expands_On_NFKD_Image : aliased constant String := "Expands_On_NFKD";
Boolean_Properties_Image : constant
array (Not_Overridable_Boolean_Properties) of Constant_String_Access
:= (Composition_Exclusion => BP_Composition_Exclusion_Image'Access,
Expands_On_NFC => BP_Expands_On_NFC_Image'Access,
Expands_On_NFD => BP_Expands_On_NFD_Image'Access,
Expands_On_NFKC => BP_Expands_On_NFKC_Image'Access,
Expands_On_NFKD => BP_Expands_On_NFKD_Image'Access,
Full_Composition_Exclusion =>
BP_Full_Composition_Exclusion_Image'Access);
--------------------
-- Append_Mapping --
--------------------
procedure Append_Mapping
(Mapping : Code_Point_Sequence;
First : out Sequence_Index;
Last : out Sequence_Count)
is
begin
if Mapping'Length = 0 then
First := 1;
Last := 0;
end if;
for J in 1 .. Decomposition_Data_Last - Mapping'Length + 1 loop
if Decomposition_Data (J .. J + Mapping'Length - 1) = Mapping then
First := J;
Last := J + Mapping'Length - 1;
return;
end if;
end loop;
First := Decomposition_Data_Last + 1;
for J in Mapping'Range loop
Decomposition_Data_Last := Decomposition_Data_Last + 1;
Decomposition_Data (Decomposition_Data_Last) := Mapping (J);
end loop;
Last := Decomposition_Data_Last;
end Append_Mapping;
---------
-- Put --
---------
procedure Put (Item : Normalization_Mapping) is
use type Ada.Text_IO.Count;
Indent : Ada.Text_IO.Count := Ada.Text_IO.Col + 1;
Counts : array (Boolean) of Natural := (0, 0);
Default : Boolean;
N : Natural := 0;
begin
Ada.Text_IO.Put
("((("
& Sequence_Count_Image (Item.Decomposition (Canonical).First)
& ", "
& Sequence_Count_Image (Item.Decomposition (Canonical).Last)
& "), ("
& Sequence_Count_Image (Item.Decomposition (Compatibility).First)
& ", "
& Sequence_Count_Image (Item.Decomposition (Compatibility).Last)
& ")), ("
& Sequence_Count_Image (Item.Composition.First)
& ", "
& Sequence_Count_Image (Item.Composition.Last)
& "),"
& Canonical_Combining_Class'Image (Item.CCC)
& ", ("
& Normalization_Quick_Check_Image (Item.NQC (NFC)).all
& ", "
& Normalization_Quick_Check_Image (Item.NQC (NFD)).all
& ", "
& Normalization_Quick_Check_Image (Item.NQC (NFKC)).all
& ", "
& Normalization_Quick_Check_Image (Item.NQC (NFKD)).all
& "), "
& Decomposition_Type_Image (Item.DT).all
& ",");
Ada.Text_IO.Set_Col (Indent);
Ada.Text_IO.Put ('(');
for J in Item.B'Range loop
Counts (Item.B (J)) := Counts (Item.B (J)) + 1;
end loop;
Default := Counts (False) < Counts (True);
for J in Item.B'Range loop
if Item.B (J) /= Default then
N := N + 1;
if N = 1 then
Ada.Text_IO.Put (Boolean_Properties_Image (J).all);
else
Ada.Text_IO.Set_Col (Indent + 3);
Ada.Text_IO.Put ("| " & Boolean_Properties_Image (J).all);
end if;
end if;
end loop;
if N /= 0 then
if Ada.Text_IO.Col > 68 then
Ada.Text_IO.Set_Col (Indent + 6);
end if;
if not Default then
Ada.Text_IO.Put (" => True,");
else
Ada.Text_IO.Put (" => False,");
end if;
Ada.Text_IO.Set_Col (Indent + 1);
end if;
if Default then
Ada.Text_IO.Put ("others => True))");
else
Ada.Text_IO.Put ("others => False))");
end if;
end Put;
begin
Ada.Text_IO.Put_Line (Ada.Text_IO.Standard_Error, " ... norms");
-- Copy properties
for J in Code_Point loop
Normalization (J).CCC := Norms (J).CCC;
Normalization (J).NQC := Norms (J).NQC;
Normalization (J).DT := Norms (J).DT;
Normalization (J).B := Norms (J).B;
end loop;
-- Construct decomposition information.
for J in Code_Point loop
-- Hangul Syllables are decomposed algorithmically, thus they are
-- excluded from data construction here.
if Norms (J).DT /= None
and then J not in Hangul_Syllable_First .. Hangul_Syllable_Last
then
Append_Mapping
(Norms (J).Values (Compatibility).all,
Normalization (J).Decomposition (Compatibility).First,
Normalization (J).Decomposition (Compatibility).Last);
if Norms (J).DT = Canonical then
Append_Mapping
(Norms (J).Values (Canonical).all,
Normalization (J).Decomposition (Canonical).First,
Normalization (J).Decomposition (Canonical).Last);
end if;
end if;
end loop;
-- Construct composition information.
for J in Code_Point loop
if Norms (J).DT = Canonical
and then J not in Hangul_Syllable_First .. Hangul_Syllable_Last
and then not Norms (J).B (Full_Composition_Exclusion)
then
declare
M : Code_Point_Sequence := Norms (J).Values (Canonical_Mapping).all;
begin
if Normalization (M (1)).Composition.First = 0 then
First_Index_Last := First_Index_Last + 1;
Normalization (M (1)).Composition.First := First_Index_Last;
end if;
if Normalization (M (2)).Composition.Last = 0 then
Last_Index_Last := Last_Index_Last + 1;
Normalization (M (2)).Composition.Last := Last_Index_Last;
end if;
end;
end if;
end loop;
Composition_Data :=
new Composition_Mapping'
(1 .. First_Index_Last => (1 .. Last_Index_Last => 16#FFFF#));
for J in Code_Point loop
if Norms (J).DT = Canonical
and then J not in Hangul_Syllable_First .. Hangul_Syllable_Last
and then not Norms (J).B (Full_Composition_Exclusion)
then
declare
M : Code_Point_Sequence
:= Norms (J).Values (Canonical_Mapping).all;
begin
Composition_Data
(Normalization (M (1)).Composition.First,
Normalization (M (2)).Composition.Last) := J;
end;
end if;
end loop;
-- Pack groups: reuse groups with the same values.
for J in Groups'Range loop
for K in 0 .. J loop
if Normalization
(Code_Unit_32 (K) * 256 .. Code_Unit_32 (K) * 256 + 255)
= Normalization
(Code_Unit_32 (J) * 256 .. Code_Unit_32 (J) * 256 + 255)
then
Groups (J).Share := K;
Groups (K).Count := Groups (K).Count + 1;
exit;
end if;
end loop;
end loop;
-- Generate source code.
Put_File_Header
("Localization, Internationalization, Globalization for Ada",
2009,
2015);
Ada.Text_IO.New_Line;
-- GNAT GPL 2011: disabling of generation of elaboration code causes incorrect
-- code generation for normalization
--
-- Ada.Text_IO.Put_Line ("pragma Restrictions (No_Elaboration_Code);");
-- Ada.Text_IO.Put_Line
-- ("-- GNAT: enforce generation of preinitialized data section instead of");
-- Ada.Text_IO.Put_Line ("-- generation of elaboration code.");
-- Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line ("package Matreshka.Internals.Unicode.Ucd.Norms is");
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line (" pragma Preelaborate;");
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line
(" Decomposition_Data : aliased constant Code_Point_Sequence");
for J in 1 .. Decomposition_Data_Last loop
if J = 1 then
Ada.Text_IO.Put (" := (");
elsif (J - 1) mod 5 = 0 then
Ada.Text_IO.Put_Line (",");
Ada.Text_IO.Put (" ");
else
Ada.Text_IO.Put (", ");
end if;
Ada.Text_IO.Put (Code_Point_Ada_Image (Decomposition_Data (J)));
end loop;
Ada.Text_IO.Put_Line (");");
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line
(" Composition_Data : aliased constant Composition_Mapping (1 .. "
& Sequence_Count_Image (Composition_Data'Length (1))
& ", 1 .. "
& Sequence_Count_Image (Composition_Data'Length (2))
& ")");
for J in Composition_Data'Range (1) loop
if J = 1 then
Ada.Text_IO.Put (" := (");
else
Ada.Text_IO.Put_Line (",");
Ada.Text_IO.Put (" ");
end if;
Ada.Text_IO.Put (Sequence_Count_Image (J) & " => (");
declare
N : Natural := 0;
begin
for K in Composition_Data'Range (2) loop
if Composition_Data (J, K) /= 16#FFFF# then
Ada.Text_IO.Put
(Sequence_Count_Image (K)
& " => "
& Code_Point_Ada_Image (Composition_Data (J, K))
& ",");
case N mod 3 is
when 0 | 1 =>
Ada.Text_IO.Put (" ");
when 2 =>
Ada.Text_IO.Set_Col (16);
when others =>
raise Program_Error;
end case;
N := N + 1;
end if;
end loop;
Ada.Text_IO.Put ("others => 16#00FFFF#)");
end;
end loop;
Ada.Text_IO.Put_Line (");");
for J in Groups'Range loop
if not Generated (Groups (J).Share) then
declare
Default : Normalization_Mapping;
Current : Normalization_Mapping;
First : Second_Stage_Index;
Last : Second_Stage_Index;
First_Code : Code_Point;
Last_Code : Code_Point;
begin
-- Looking for most useful set of values, it will be used for
-- others selector for generate more compact code.
declare
type Value_Count_Pair is record
V : Normalization_Mapping;
C : Natural;
end record;
Counts : array (Positive range 1 .. 256) of Value_Count_Pair
:= (others => <>);
Last : Natural := 0;
Maximum : Natural := 0;
begin
for K in Second_Stage_Index loop
declare
C : constant Code_Point
:= Code_Unit_32 (J) * 256 + Code_Unit_32 (K);
R : Normalization_Mapping renames Normalization (C);
F : Boolean := False;
begin
-- Go throught known values and try to find the same
-- value.
for L in 1 .. Last loop
if Counts (L).V = R then
F := True;
Counts (L).C := Counts (L).C + 1;
if Maximum < Counts (L).C then
Maximum := Counts (L).C;
Default := Counts (L).V;
end if;
exit;
end if;
end loop;
-- If value is not found, then add it to the end of list.
if not F then
Last := Last + 1;
Counts (Last) := (R, 1);
end if;
end;
end loop;
end;
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line
(" Group_"
& First_Stage_Image (Groups (J).Share)
& " : aliased constant Normalization_Mapping_Second_Stage");
Ada.Text_IO.Put (" := (");
for K in Second_Stage_Index loop
declare
Code : constant Code_Point
:= Code_Unit_32 (J) * 256 + Code_Unit_32 (K);
begin
if K = Second_Stage_Index'First then
Current := Normalization (Code);
First := K;
Last := First;
First_Code := Code;
Last_Code := Code;
elsif Normalization (Code) = Current then
Last := K;
Last_Code := Code;
else
if Current /= Default then
if First /= Last then
Ada.Text_IO.Put_Line
("16#"
& Second_Stage_Image (First)
& "# .. 16#"
& Second_Stage_Image (Last)
& "# => -- "
& Code_Point_Image (First_Code)
& " .. "
& Code_Point_Image (Last_Code));
Ada.Text_IO.Set_Col (11);
Put (Current);
Ada.Text_IO.Put (',');
else
Ada.Text_IO.Put_Line
("16#"
& Second_Stage_Image (First)
& "# => -- "
& Code_Point_Image (First_Code));
Ada.Text_IO.Set_Col (11);
Put (Current);
Ada.Text_IO.Put (',');
end if;
Ada.Text_IO.New_Line;
Ada.Text_IO.Set_Col (10);
end if;
Current := Normalization (Code);
First := K;
Last := First;
First_Code := Code;
Last_Code := First_Code;
end if;
end;
end loop;
if Current /= Default then
if First /= Last then
Ada.Text_IO.Put_Line
("16#"
& Second_Stage_Image (First)
& "# .. 16#"
& Second_Stage_Image (Last)
& "# => -- "
& Code_Point_Image (First_Code)
& " .. "
& Code_Point_Image (Last_Code));
Ada.Text_IO.Set_Col (11);
Put (Current);
Ada.Text_IO.Put (',');
else
Ada.Text_IO.Put_Line
("16#"
& Second_Stage_Image (First)
& "# => -- "
& Code_Point_Image (First_Code));
Ada.Text_IO.Set_Col (11);
Put (Current);
Ada.Text_IO.Put (',');
end if;
Ada.Text_IO.New_Line;
Ada.Text_IO.Set_Col (10);
end if;
Ada.Text_IO.Put_Line ("others =>");
Ada.Text_IO.Set_Col (11);
Put (Default);
Ada.Text_IO.Put_Line (");");
Generated (J) := True;
end;
end if;
end loop;
declare
Default : First_Stage_Index := 0;
Maximum : Natural := 0;
N : Natural := 0;
begin
for J in Groups'Range loop
if Maximum < Groups (J).Count then
Maximum := Groups (J).Count;
Default := J;
end if;
end loop;
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line
(" Mapping : aliased constant Normalization_Mapping_First_Stage");
Ada.Text_IO.Put (" := (");
for J in Groups'Range loop
if Groups (J).Share /= Default then
Ada.Text_IO.Put
("16#"
& First_Stage_Image (J)
& "# => Group_"
& First_Stage_Image (Groups (J).Share)
& "'Access,");
case N mod 2 is
when 0 =>
Ada.Text_IO.Set_Col (41);
when 1 =>
Ada.Text_IO.New_Line;
Ada.Text_IO.Set_Col (10);
when others =>
raise Program_Error;
end case;
N := N + 1;
end if;
end loop;
Ada.Text_IO.Put_Line
("others => Group_" & First_Stage_Image (Default) & "'Access);");
end;
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line ("end Matreshka.Internals.Unicode.Ucd.Norms;");
end Gen_Norms;
|
24560
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Tools Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2009-2015, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Ada.Text_IO;
with Matreshka.Internals.Unicode.Ucd;
with Put_File_Header;
with Ucd_Data;
with Utils;
procedure Gen_Norms is
use Matreshka.Internals.Unicode;
use Matreshka.Internals.Unicode.Ucd;
use Ucd_Data;
use Utils;
procedure Append_Mapping
(Mapping : Code_Point_Sequence;
First : out Sequence_Index;
Last : out Sequence_Count);
type Group_Info is record
Share : First_Stage_Index;
Count : Natural;
end record;
type Composition_Mapping_Access is access all Composition_Mapping;
Decomposition_Data : Code_Point_Sequence (Sequence_Index);
Decomposition_Data_Last : Sequence_Count := 0;
Composition_Data : Composition_Mapping_Access;
First_Index_Last : Sequence_Count := 0;
Last_Index_Last : Sequence_Count := 0;
Normalization : array (Code_Point) of Normalization_Mapping
:= (others =>
((others => (0, 0)),
(0, 0),
0,
(others => Yes),
None,
(others => False)));
Groups : array (First_Stage_Index) of Group_Info
:= (others => (0, 0));
Generated : array (First_Stage_Index) of Boolean := (others => False);
type Constant_String_Access is access constant String;
DT_Canonical_Image : aliased constant String := "Canonical";
DT_Compat_Image : aliased constant String := "Compat";
DT_Circle_Image : aliased constant String := "Circle";
DT_Final_Image : aliased constant String := "Final";
DT_Font_Image : aliased constant String := "Font";
DT_Fraction_Image : aliased constant String := "Fraction";
DT_Initial_Image : aliased constant String := "Initial";
DT_Isolated_Image : aliased constant String := "Isolated";
DT_Medial_Image : aliased constant String := "Medial";
DT_Narrow_Image : aliased constant String := "Narrow";
DT_No_Break_Image : aliased constant String := "No_Break";
DT_None_Image : aliased constant String := "None";
DT_Small_Image : aliased constant String := "Small";
DT_Square_Image : aliased constant String := "Square";
DT_Sub_Image : aliased constant String := "Sub";
DT_Super_Image : aliased constant String := "Super";
DT_Vertical_Image : aliased constant String := "Vertical";
DT_Wide_Image : aliased constant String := "Wide";
Decomposition_Type_Image : constant
array (Decomposition_Type) of Constant_String_Access
:= (Canonical => DT_Canonical_Image'Access,
Compat => DT_Compat_Image'Access,
Circle => DT_Circle_Image'Access,
Final => DT_Final_Image'Access,
Font => DT_Font_Image'Access,
Fraction => DT_Fraction_Image'Access,
Initial => DT_Initial_Image'Access,
Isolated => DT_Isolated_Image'Access,
Medial => DT_Medial_Image'Access,
Narrow => DT_Narrow_Image'Access,
No_Break => DT_No_Break_Image'Access,
None => DT_None_Image'Access,
Small => DT_Small_Image'Access,
Square => DT_Square_Image'Access,
Sub => DT_Sub_Image'Access,
Super => DT_Super_Image'Access,
Vertical => DT_Vertical_Image'Access,
Wide => DT_Wide_Image'Access);
NQC_No_Image : aliased constant String := "No";
NQC_Maybe_Image : aliased constant String := "Maybe";
NQC_Yes_Image : aliased constant String := "Yes";
Normalization_Quick_Check_Image : constant
array (Normalization_Quick_Check) of Constant_String_Access
:= (No => NQC_No_Image'Access,
Maybe => NQC_Maybe_Image'Access,
Yes => NQC_Yes_Image'Access);
BP_Composition_Exclusion_Image :
aliased constant String := "Composition_Exclusion";
BP_Full_Composition_Exclusion_Image :
aliased constant String := "Full_Composition_Exclusion";
BP_Expands_On_NFC_Image : aliased constant String := "Expands_On_NFC";
BP_Expands_On_NFD_Image : aliased constant String := "Expands_On_NFD";
BP_Expands_On_NFKC_Image : aliased constant String := "Expands_On_NFKC";
BP_Expands_On_NFKD_Image : aliased constant String := "Expands_On_NFKD";
Boolean_Properties_Image : constant
array (Not_Overridable_Boolean_Properties) of Constant_String_Access
:= (Composition_Exclusion => BP_Composition_Exclusion_Image'Access,
Expands_On_NFC => BP_Expands_On_NFC_Image'Access,
Expands_On_NFD => BP_Expands_On_NFD_Image'Access,
Expands_On_NFKC => BP_Expands_On_NFKC_Image'Access,
Expands_On_NFKD => BP_Expands_On_NFKD_Image'Access,
Full_Composition_Exclusion =>
BP_Full_Composition_Exclusion_Image'Access);
--------------------
-- Append_Mapping --
--------------------
procedure Append_Mapping
(Mapping : Code_Point_Sequence;
First : out Sequence_Index;
Last : out Sequence_Count)
is
begin
if Mapping'Length = 0 then
First := 1;
Last := 0;
end if;
for J in 1 .. Decomposition_Data_Last - Mapping'Length + 1 loop
if Decomposition_Data (J .. J + Mapping'Length - 1) = Mapping then
First := J;
Last := J + Mapping'Length - 1;
return;
end if;
end loop;
First := Decomposition_Data_Last + 1;
for J in Mapping'Range loop
Decomposition_Data_Last := Decomposition_Data_Last + 1;
Decomposition_Data (Decomposition_Data_Last) := Mapping (J);
end loop;
Last := Decomposition_Data_Last;
end Append_Mapping;
---------
-- Put --
---------
procedure Put (Item : Normalization_Mapping) is
use type Ada.Text_IO.Count;
Indent : Ada.Text_IO.Count := Ada.Text_IO.Col + 1;
Counts : array (Boolean) of Natural := (0, 0);
Default : Boolean;
N : Natural := 0;
begin
Ada.Text_IO.Put
("((("
& Sequence_Count_Image (Item.Decomposition (Canonical).First)
& ", "
& Sequence_Count_Image (Item.Decomposition (Canonical).Last)
& "), ("
& Sequence_Count_Image (Item.Decomposition (Compatibility).First)
& ", "
& Sequence_Count_Image (Item.Decomposition (Compatibility).Last)
& ")), ("
& Sequence_Count_Image (Item.Composition.First)
& ", "
& Sequence_Count_Image (Item.Composition.Last)
& "),"
& Canonical_Combining_Class'Image (Item.CCC)
& ", ("
& Normalization_Quick_Check_Image (Item.NQC (NFC)).all
& ", "
& Normalization_Quick_Check_Image (Item.NQC (NFD)).all
& ", "
& Normalization_Quick_Check_Image (Item.NQC (NFKC)).all
& ", "
& Normalization_Quick_Check_Image (Item.NQC (NFKD)).all
& "), "
& Decomposition_Type_Image (Item.DT).all
& ",");
Ada.Text_IO.Set_Col (Indent);
Ada.Text_IO.Put ('(');
for J in Item.B'Range loop
Counts (Item.B (J)) := Counts (Item.B (J)) + 1;
end loop;
Default := Counts (False) < Counts (True);
for J in Item.B'Range loop
if Item.B (J) /= Default then
N := N + 1;
if N = 1 then
Ada.Text_IO.Put (Boolean_Properties_Image (J).all);
else
Ada.Text_IO.Set_Col (Indent + 3);
Ada.Text_IO.Put ("| " & Boolean_Properties_Image (J).all);
end if;
end if;
end loop;
if N /= 0 then
if Ada.Text_IO.Col > 68 then
Ada.Text_IO.Set_Col (Indent + 6);
end if;
if not Default then
Ada.Text_IO.Put (" => True,");
else
Ada.Text_IO.Put (" => False,");
end if;
Ada.Text_IO.Set_Col (Indent + 1);
end if;
if Default then
Ada.Text_IO.Put ("others => True))");
else
Ada.Text_IO.Put ("others => False))");
end if;
end Put;
begin
Ada.Text_IO.Put_Line (Ada.Text_IO.Standard_Error, " ... norms");
-- Copy properties
for J in Code_Point loop
Normalization (J).CCC := Norms (J).CCC;
Normalization (J).NQC := Norms (J).NQC;
Normalization (J).DT := Norms (J).DT;
Normalization (J).B := Norms (J).B;
end loop;
-- Construct decomposition information.
for J in Code_Point loop
-- Hangul Syllables are decomposed algorithmically, thus they are
-- excluded from data construction here.
if Norms (J).DT /= None
and then J not in Hangul_Syllable_First .. Hangul_Syllable_Last
then
Append_Mapping
(Norms (J).Values (Compatibility).all,
Normalization (J).Decomposition (Compatibility).First,
Normalization (J).Decomposition (Compatibility).Last);
if Norms (J).DT = Canonical then
Append_Mapping
(Norms (J).Values (Canonical).all,
Normalization (J).Decomposition (Canonical).First,
Normalization (J).Decomposition (Canonical).Last);
end if;
end if;
end loop;
-- Construct composition information.
for J in Code_Point loop
if Norms (J).DT = Canonical
and then J not in Hangul_Syllable_First .. Hangul_Syllable_Last
and then not Norms (J).B (Full_Composition_Exclusion)
then
declare
M : Code_Point_Sequence := Norms (J).Values (Canonical_Mapping).all;
begin
if Normalization (M (1)).Composition.First = 0 then
First_Index_Last := First_Index_Last + 1;
Normalization (M (1)).Composition.First := First_Index_Last;
end if;
if Normalization (M (2)).Composition.Last = 0 then
Last_Index_Last := Last_Index_Last + 1;
Normalization (M (2)).Composition.Last := Last_Index_Last;
end if;
end;
end if;
end loop;
Composition_Data :=
new Composition_Mapping'
(1 .. First_Index_Last => (1 .. Last_Index_Last => 16#FFFF#));
for J in Code_Point loop
if Norms (J).DT = Canonical
and then J not in Hangul_Syllable_First .. Hangul_Syllable_Last
and then not Norms (J).B (Full_Composition_Exclusion)
then
declare
M : Code_Point_Sequence
:= Norms (J).Values (Canonical_Mapping).all;
begin
Composition_Data
(Normalization (M (1)).Composition.First,
Normalization (M (2)).Composition.Last) := J;
end;
end if;
end loop;
-- Pack groups: reuse groups with the same values.
for J in Groups'Range loop
for K in 0 .. J loop
if Normalization
(Code_Unit_32 (K) * 256 .. Code_Unit_32 (K) * 256 + 255)
= Normalization
(Code_Unit_32 (J) * 256 .. Code_Unit_32 (J) * 256 + 255)
then
Groups (J).Share := K;
Groups (K).Count := Groups (K).Count + 1;
exit;
end if;
end loop;
end loop;
-- Generate source code.
Put_File_Header
("Localization, Internationalization, Globalization for Ada",
2009,
2015);
Ada.Text_IO.New_Line;
-- GNAT GPL 2011: disabling of generation of elaboration code causes incorrect
-- code generation for normalization
--
-- Ada.Text_IO.Put_Line ("pragma Restrictions (No_Elaboration_Code);");
-- Ada.Text_IO.Put_Line
-- ("-- GNAT: enforce generation of preinitialized data section instead of");
-- Ada.Text_IO.Put_Line ("-- generation of elaboration code.");
-- Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line ("package Matreshka.Internals.Unicode.Ucd.Norms is");
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line (" pragma Preelaborate;");
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line
(" Decomposition_Data : aliased constant Code_Point_Sequence");
for J in 1 .. Decomposition_Data_Last loop
if J = 1 then
Ada.Text_IO.Put (" := (");
elsif (J - 1) mod 5 = 0 then
Ada.Text_IO.Put_Line (",");
Ada.Text_IO.Put (" ");
else
Ada.Text_IO.Put (", ");
end if;
Ada.Text_IO.Put (Code_Point_Ada_Image (Decomposition_Data (J)));
end loop;
Ada.Text_IO.Put_Line (");");
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line
(" Composition_Data : aliased constant Composition_Mapping (1 .. "
& Sequence_Count_Image (Composition_Data'Length (1))
& ", 1 .. "
& Sequence_Count_Image (Composition_Data'Length (2))
& ")");
for J in Composition_Data'Range (1) loop
if J = 1 then
Ada.Text_IO.Put (" := (");
else
Ada.Text_IO.Put_Line (",");
Ada.Text_IO.Put (" ");
end if;
Ada.Text_IO.Put (Sequence_Count_Image (J) & " => (");
declare
N : Natural := 0;
begin
for K in Composition_Data'Range (2) loop
if Composition_Data (J, K) /= 16#FFFF# then
Ada.Text_IO.Put
(Sequence_Count_Image (K)
& " => "
& Code_Point_Ada_Image (Composition_Data (J, K))
& ",");
case N mod 3 is
when 0 | 1 =>
Ada.Text_IO.Put (" ");
when 2 =>
Ada.Text_IO.Set_Col (16);
when others =>
raise Program_Error;
end case;
N := N + 1;
end if;
end loop;
Ada.Text_IO.Put ("others => 16#00FFFF#)");
end;
end loop;
Ada.Text_IO.Put_Line (");");
for J in Groups'Range loop
if not Generated (Groups (J).Share) then
declare
Default : Normalization_Mapping;
Current : Normalization_Mapping;
First : Second_Stage_Index;
Last : Second_Stage_Index;
First_Code : Code_Point;
Last_Code : Code_Point;
begin
-- Looking for most useful set of values, it will be used for
-- others selector for generate more compact code.
declare
type Value_Count_Pair is record
V : Normalization_Mapping;
C : Natural;
end record;
Counts : array (Positive range 1 .. 256) of Value_Count_Pair
:= (others => <>);
Last : Natural := 0;
Maximum : Natural := 0;
begin
for K in Second_Stage_Index loop
declare
C : constant Code_Point
:= Code_Unit_32 (J) * 256 + Code_Unit_32 (K);
R : Normalization_Mapping renames Normalization (C);
F : Boolean := False;
begin
-- Go throught known values and try to find the same
-- value.
for L in 1 .. Last loop
if Counts (L).V = R then
F := True;
Counts (L).C := Counts (L).C + 1;
if Maximum < Counts (L).C then
Maximum := Counts (L).C;
Default := Counts (L).V;
end if;
exit;
end if;
end loop;
-- If value is not found, then add it to the end of list.
if not F then
Last := Last + 1;
Counts (Last) := (R, 1);
end if;
end;
end loop;
end;
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line
(" Group_"
& First_Stage_Image (Groups (J).Share)
& " : aliased constant Normalization_Mapping_Second_Stage");
Ada.Text_IO.Put (" := (");
for K in Second_Stage_Index loop
declare
Code : constant Code_Point
:= Code_Unit_32 (J) * 256 + Code_Unit_32 (K);
begin
if K = Second_Stage_Index'First then
Current := Normalization (Code);
First := K;
Last := First;
First_Code := Code;
Last_Code := Code;
elsif Normalization (Code) = Current then
Last := K;
Last_Code := Code;
else
if Current /= Default then
if First /= Last then
Ada.Text_IO.Put_Line
("16#"
& Second_Stage_Image (First)
& "# .. 16#"
& Second_Stage_Image (Last)
& "# => -- "
& Code_Point_Image (First_Code)
& " .. "
& Code_Point_Image (Last_Code));
Ada.Text_IO.Set_Col (11);
Put (Current);
Ada.Text_IO.Put (',');
else
Ada.Text_IO.Put_Line
("16#"
& Second_Stage_Image (First)
& "# => -- "
& Code_Point_Image (First_Code));
Ada.Text_IO.Set_Col (11);
Put (Current);
Ada.Text_IO.Put (',');
end if;
Ada.Text_IO.New_Line;
Ada.Text_IO.Set_Col (10);
end if;
Current := Normalization (Code);
First := K;
Last := First;
First_Code := Code;
Last_Code := First_Code;
end if;
end;
end loop;
if Current /= Default then
if First /= Last then
Ada.Text_IO.Put_Line
("16#"
& Second_Stage_Image (First)
& "# .. 16#"
& Second_Stage_Image (Last)
& "# => -- "
& Code_Point_Image (First_Code)
& " .. "
& Code_Point_Image (Last_Code));
Ada.Text_IO.Set_Col (11);
Put (Current);
Ada.Text_IO.Put (',');
else
Ada.Text_IO.Put_Line
("16#"
& Second_Stage_Image (First)
& "# => -- "
& Code_Point_Image (First_Code));
Ada.Text_IO.Set_Col (11);
Put (Current);
Ada.Text_IO.Put (',');
end if;
Ada.Text_IO.New_Line;
Ada.Text_IO.Set_Col (10);
end if;
Ada.Text_IO.Put_Line ("others =>");
Ada.Text_IO.Set_Col (11);
Put (Default);
Ada.Text_IO.Put_Line (");");
Generated (J) := True;
end;
end if;
end loop;
declare
Default : First_Stage_Index := 0;
Maximum : Natural := 0;
N : Natural := 0;
begin
for J in Groups'Range loop
if Maximum < Groups (J).Count then
Maximum := Groups (J).Count;
Default := J;
end if;
end loop;
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line
(" Mapping : aliased constant Normalization_Mapping_First_Stage");
Ada.Text_IO.Put (" := (");
for J in Groups'Range loop
if Groups (J).Share /= Default then
Ada.Text_IO.Put
("16#"
& First_Stage_Image (J)
& "# => Group_"
& First_Stage_Image (Groups (J).Share)
& "'Access,");
case N mod 2 is
when 0 =>
Ada.Text_IO.Set_Col (41);
when 1 =>
Ada.Text_IO.New_Line;
Ada.Text_IO.Set_Col (10);
when others =>
raise Program_Error;
end case;
N := N + 1;
end if;
end loop;
Ada.Text_IO.Put_Line
("others => Group_" & First_Stage_Image (Default) & "'Access);");
end;
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line ("end Matreshka.Internals.Unicode.Ucd.Norms;");
end Gen_Norms;
| true |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Tools Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2009-2015, PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Ada.Text_IO;
with Matreshka.Internals.Unicode.Ucd;
with Put_File_Header;
with Ucd_Data;
with Utils;
procedure Gen_Norms is
use Matreshka.Internals.Unicode;
use Matreshka.Internals.Unicode.Ucd;
use Ucd_Data;
use Utils;
procedure Append_Mapping
(Mapping : Code_Point_Sequence;
First : out Sequence_Index;
Last : out Sequence_Count);
type Group_Info is record
Share : First_Stage_Index;
Count : Natural;
end record;
type Composition_Mapping_Access is access all Composition_Mapping;
Decomposition_Data : Code_Point_Sequence (Sequence_Index);
Decomposition_Data_Last : Sequence_Count := 0;
Composition_Data : Composition_Mapping_Access;
First_Index_Last : Sequence_Count := 0;
Last_Index_Last : Sequence_Count := 0;
Normalization : array (Code_Point) of Normalization_Mapping
:= (others =>
((others => (0, 0)),
(0, 0),
0,
(others => Yes),
None,
(others => False)));
Groups : array (First_Stage_Index) of Group_Info
:= (others => (0, 0));
Generated : array (First_Stage_Index) of Boolean := (others => False);
type Constant_String_Access is access constant String;
DT_Canonical_Image : aliased constant String := "Canonical";
DT_Compat_Image : aliased constant String := "Compat";
DT_Circle_Image : aliased constant String := "Circle";
DT_Final_Image : aliased constant String := "Final";
DT_Font_Image : aliased constant String := "Font";
DT_Fraction_Image : aliased constant String := "Fraction";
DT_Initial_Image : aliased constant String := "Initial";
DT_Isolated_Image : aliased constant String := "Isolated";
DT_Medial_Image : aliased constant String := "Medial";
DT_Narrow_Image : aliased constant String := "Narrow";
DT_No_Break_Image : aliased constant String := "No_Break";
DT_None_Image : aliased constant String := "None";
DT_Small_Image : aliased constant String := "Small";
DT_Square_Image : aliased constant String := "Square";
DT_Sub_Image : aliased constant String := "Sub";
DT_Super_Image : aliased constant String := "Super";
DT_Vertical_Image : aliased constant String := "Vertical";
DT_Wide_Image : aliased constant String := "Wide";
Decomposition_Type_Image : constant
array (Decomposition_Type) of Constant_String_Access
:= (Canonical => DT_Canonical_Image'Access,
Compat => DT_Compat_Image'Access,
Circle => DT_Circle_Image'Access,
Final => DT_Final_Image'Access,
Font => DT_Font_Image'Access,
Fraction => DT_Fraction_Image'Access,
Initial => DT_Initial_Image'Access,
Isolated => DT_Isolated_Image'Access,
Medial => DT_Medial_Image'Access,
Narrow => DT_Narrow_Image'Access,
No_Break => DT_No_Break_Image'Access,
None => DT_None_Image'Access,
Small => DT_Small_Image'Access,
Square => DT_Square_Image'Access,
Sub => DT_Sub_Image'Access,
Super => DT_Super_Image'Access,
Vertical => DT_Vertical_Image'Access,
Wide => DT_Wide_Image'Access);
NQC_No_Image : aliased constant String := "No";
NQC_Maybe_Image : aliased constant String := "Maybe";
NQC_Yes_Image : aliased constant String := "Yes";
Normalization_Quick_Check_Image : constant
array (Normalization_Quick_Check) of Constant_String_Access
:= (No => NQC_No_Image'Access,
Maybe => NQC_Maybe_Image'Access,
Yes => NQC_Yes_Image'Access);
BP_Composition_Exclusion_Image :
aliased constant String := "Composition_Exclusion";
BP_Full_Composition_Exclusion_Image :
aliased constant String := "Full_Composition_Exclusion";
BP_Expands_On_NFC_Image : aliased constant String := "Expands_On_NFC";
BP_Expands_On_NFD_Image : aliased constant String := "Expands_On_NFD";
BP_Expands_On_NFKC_Image : aliased constant String := "Expands_On_NFKC";
BP_Expands_On_NFKD_Image : aliased constant String := "Expands_On_NFKD";
Boolean_Properties_Image : constant
array (Not_Overridable_Boolean_Properties) of Constant_String_Access
:= (Composition_Exclusion => BP_Composition_Exclusion_Image'Access,
Expands_On_NFC => BP_Expands_On_NFC_Image'Access,
Expands_On_NFD => BP_Expands_On_NFD_Image'Access,
Expands_On_NFKC => BP_Expands_On_NFKC_Image'Access,
Expands_On_NFKD => BP_Expands_On_NFKD_Image'Access,
Full_Composition_Exclusion =>
BP_Full_Composition_Exclusion_Image'Access);
--------------------
-- Append_Mapping --
--------------------
procedure Append_Mapping
(Mapping : Code_Point_Sequence;
First : out Sequence_Index;
Last : out Sequence_Count)
is
begin
if Mapping'Length = 0 then
First := 1;
Last := 0;
end if;
for J in 1 .. Decomposition_Data_Last - Mapping'Length + 1 loop
if Decomposition_Data (J .. J + Mapping'Length - 1) = Mapping then
First := J;
Last := J + Mapping'Length - 1;
return;
end if;
end loop;
First := Decomposition_Data_Last + 1;
for J in Mapping'Range loop
Decomposition_Data_Last := Decomposition_Data_Last + 1;
Decomposition_Data (Decomposition_Data_Last) := Mapping (J);
end loop;
Last := Decomposition_Data_Last;
end Append_Mapping;
---------
-- Put --
---------
procedure Put (Item : Normalization_Mapping) is
use type Ada.Text_IO.Count;
Indent : Ada.Text_IO.Count := Ada.Text_IO.Col + 1;
Counts : array (Boolean) of Natural := (0, 0);
Default : Boolean;
N : Natural := 0;
begin
Ada.Text_IO.Put
("((("
& Sequence_Count_Image (Item.Decomposition (Canonical).First)
& ", "
& Sequence_Count_Image (Item.Decomposition (Canonical).Last)
& "), ("
& Sequence_Count_Image (Item.Decomposition (Compatibility).First)
& ", "
& Sequence_Count_Image (Item.Decomposition (Compatibility).Last)
& ")), ("
& Sequence_Count_Image (Item.Composition.First)
& ", "
& Sequence_Count_Image (Item.Composition.Last)
& "),"
& Canonical_Combining_Class'Image (Item.CCC)
& ", ("
& Normalization_Quick_Check_Image (Item.NQC (NFC)).all
& ", "
& Normalization_Quick_Check_Image (Item.NQC (NFD)).all
& ", "
& Normalization_Quick_Check_Image (Item.NQC (NFKC)).all
& ", "
& Normalization_Quick_Check_Image (Item.NQC (NFKD)).all
& "), "
& Decomposition_Type_Image (Item.DT).all
& ",");
Ada.Text_IO.Set_Col (Indent);
Ada.Text_IO.Put ('(');
for J in Item.B'Range loop
Counts (Item.B (J)) := Counts (Item.B (J)) + 1;
end loop;
Default := Counts (False) < Counts (True);
for J in Item.B'Range loop
if Item.B (J) /= Default then
N := N + 1;
if N = 1 then
Ada.Text_IO.Put (Boolean_Properties_Image (J).all);
else
Ada.Text_IO.Set_Col (Indent + 3);
Ada.Text_IO.Put ("| " & Boolean_Properties_Image (J).all);
end if;
end if;
end loop;
if N /= 0 then
if Ada.Text_IO.Col > 68 then
Ada.Text_IO.Set_Col (Indent + 6);
end if;
if not Default then
Ada.Text_IO.Put (" => True,");
else
Ada.Text_IO.Put (" => False,");
end if;
Ada.Text_IO.Set_Col (Indent + 1);
end if;
if Default then
Ada.Text_IO.Put ("others => True))");
else
Ada.Text_IO.Put ("others => False))");
end if;
end Put;
begin
Ada.Text_IO.Put_Line (Ada.Text_IO.Standard_Error, " ... norms");
-- Copy properties
for J in Code_Point loop
Normalization (J).CCC := Norms (J).CCC;
Normalization (J).NQC := Norms (J).NQC;
Normalization (J).DT := Norms (J).DT;
Normalization (J).B := Norms (J).B;
end loop;
-- Construct decomposition information.
for J in Code_Point loop
-- Hangul Syllables are decomposed algorithmically, thus they are
-- excluded from data construction here.
if Norms (J).DT /= None
and then J not in Hangul_Syllable_First .. Hangul_Syllable_Last
then
Append_Mapping
(Norms (J).Values (Compatibility).all,
Normalization (J).Decomposition (Compatibility).First,
Normalization (J).Decomposition (Compatibility).Last);
if Norms (J).DT = Canonical then
Append_Mapping
(Norms (J).Values (Canonical).all,
Normalization (J).Decomposition (Canonical).First,
Normalization (J).Decomposition (Canonical).Last);
end if;
end if;
end loop;
-- Construct composition information.
for J in Code_Point loop
if Norms (J).DT = Canonical
and then J not in Hangul_Syllable_First .. Hangul_Syllable_Last
and then not Norms (J).B (Full_Composition_Exclusion)
then
declare
M : Code_Point_Sequence := Norms (J).Values (Canonical_Mapping).all;
begin
if Normalization (M (1)).Composition.First = 0 then
First_Index_Last := First_Index_Last + 1;
Normalization (M (1)).Composition.First := First_Index_Last;
end if;
if Normalization (M (2)).Composition.Last = 0 then
Last_Index_Last := Last_Index_Last + 1;
Normalization (M (2)).Composition.Last := Last_Index_Last;
end if;
end;
end if;
end loop;
Composition_Data :=
new Composition_Mapping'
(1 .. First_Index_Last => (1 .. Last_Index_Last => 16#FFFF#));
for J in Code_Point loop
if Norms (J).DT = Canonical
and then J not in Hangul_Syllable_First .. Hangul_Syllable_Last
and then not Norms (J).B (Full_Composition_Exclusion)
then
declare
M : Code_Point_Sequence
:= Norms (J).Values (Canonical_Mapping).all;
begin
Composition_Data
(Normalization (M (1)).Composition.First,
Normalization (M (2)).Composition.Last) := J;
end;
end if;
end loop;
-- Pack groups: reuse groups with the same values.
for J in Groups'Range loop
for K in 0 .. J loop
if Normalization
(Code_Unit_32 (K) * 256 .. Code_Unit_32 (K) * 256 + 255)
= Normalization
(Code_Unit_32 (J) * 256 .. Code_Unit_32 (J) * 256 + 255)
then
Groups (J).Share := K;
Groups (K).Count := Groups (K).Count + 1;
exit;
end if;
end loop;
end loop;
-- Generate source code.
Put_File_Header
("Localization, Internationalization, Globalization for Ada",
2009,
2015);
Ada.Text_IO.New_Line;
-- GNAT GPL 2011: disabling of generation of elaboration code causes incorrect
-- code generation for normalization
--
-- Ada.Text_IO.Put_Line ("pragma Restrictions (No_Elaboration_Code);");
-- Ada.Text_IO.Put_Line
-- ("-- GNAT: enforce generation of preinitialized data section instead of");
-- Ada.Text_IO.Put_Line ("-- generation of elaboration code.");
-- Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line ("package Matreshka.Internals.Unicode.Ucd.Norms is");
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line (" pragma Preelaborate;");
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line
(" Decomposition_Data : aliased constant Code_Point_Sequence");
for J in 1 .. Decomposition_Data_Last loop
if J = 1 then
Ada.Text_IO.Put (" := (");
elsif (J - 1) mod 5 = 0 then
Ada.Text_IO.Put_Line (",");
Ada.Text_IO.Put (" ");
else
Ada.Text_IO.Put (", ");
end if;
Ada.Text_IO.Put (Code_Point_Ada_Image (Decomposition_Data (J)));
end loop;
Ada.Text_IO.Put_Line (");");
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line
(" Composition_Data : aliased constant Composition_Mapping (1 .. "
& Sequence_Count_Image (Composition_Data'Length (1))
& ", 1 .. "
& Sequence_Count_Image (Composition_Data'Length (2))
& ")");
for J in Composition_Data'Range (1) loop
if J = 1 then
Ada.Text_IO.Put (" := (");
else
Ada.Text_IO.Put_Line (",");
Ada.Text_IO.Put (" ");
end if;
Ada.Text_IO.Put (Sequence_Count_Image (J) & " => (");
declare
N : Natural := 0;
begin
for K in Composition_Data'Range (2) loop
if Composition_Data (J, K) /= 16#FFFF# then
Ada.Text_IO.Put
(Sequence_Count_Image (K)
& " => "
& Code_Point_Ada_Image (Composition_Data (J, K))
& ",");
case N mod 3 is
when 0 | 1 =>
Ada.Text_IO.Put (" ");
when 2 =>
Ada.Text_IO.Set_Col (16);
when others =>
raise Program_Error;
end case;
N := N + 1;
end if;
end loop;
Ada.Text_IO.Put ("others => 16#00FFFF#)");
end;
end loop;
Ada.Text_IO.Put_Line (");");
for J in Groups'Range loop
if not Generated (Groups (J).Share) then
declare
Default : Normalization_Mapping;
Current : Normalization_Mapping;
First : Second_Stage_Index;
Last : Second_Stage_Index;
First_Code : Code_Point;
Last_Code : Code_Point;
begin
-- Looking for most useful set of values, it will be used for
-- others selector for generate more compact code.
declare
type Value_Count_Pair is record
V : Normalization_Mapping;
C : Natural;
end record;
Counts : array (Positive range 1 .. 256) of Value_Count_Pair
:= (others => <>);
Last : Natural := 0;
Maximum : Natural := 0;
begin
for K in Second_Stage_Index loop
declare
C : constant Code_Point
:= Code_Unit_32 (J) * 256 + Code_Unit_32 (K);
R : Normalization_Mapping renames Normalization (C);
F : Boolean := False;
begin
-- Go throught known values and try to find the same
-- value.
for L in 1 .. Last loop
if Counts (L).V = R then
F := True;
Counts (L).C := Counts (L).C + 1;
if Maximum < Counts (L).C then
Maximum := Counts (L).C;
Default := Counts (L).V;
end if;
exit;
end if;
end loop;
-- If value is not found, then add it to the end of list.
if not F then
Last := Last + 1;
Counts (Last) := (R, 1);
end if;
end;
end loop;
end;
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line
(" Group_"
& First_Stage_Image (Groups (J).Share)
& " : aliased constant Normalization_Mapping_Second_Stage");
Ada.Text_IO.Put (" := (");
for K in Second_Stage_Index loop
declare
Code : constant Code_Point
:= Code_Unit_32 (J) * 256 + Code_Unit_32 (K);
begin
if K = Second_Stage_Index'First then
Current := Normalization (Code);
First := K;
Last := First;
First_Code := Code;
Last_Code := Code;
elsif Normalization (Code) = Current then
Last := K;
Last_Code := Code;
else
if Current /= Default then
if First /= Last then
Ada.Text_IO.Put_Line
("16#"
& Second_Stage_Image (First)
& "# .. 16#"
& Second_Stage_Image (Last)
& "# => -- "
& Code_Point_Image (First_Code)
& " .. "
& Code_Point_Image (Last_Code));
Ada.Text_IO.Set_Col (11);
Put (Current);
Ada.Text_IO.Put (',');
else
Ada.Text_IO.Put_Line
("16#"
& Second_Stage_Image (First)
& "# => -- "
& Code_Point_Image (First_Code));
Ada.Text_IO.Set_Col (11);
Put (Current);
Ada.Text_IO.Put (',');
end if;
Ada.Text_IO.New_Line;
Ada.Text_IO.Set_Col (10);
end if;
Current := Normalization (Code);
First := K;
Last := First;
First_Code := Code;
Last_Code := First_Code;
end if;
end;
end loop;
if Current /= Default then
if First /= Last then
Ada.Text_IO.Put_Line
("16#"
& Second_Stage_Image (First)
& "# .. 16#"
& Second_Stage_Image (Last)
& "# => -- "
& Code_Point_Image (First_Code)
& " .. "
& Code_Point_Image (Last_Code));
Ada.Text_IO.Set_Col (11);
Put (Current);
Ada.Text_IO.Put (',');
else
Ada.Text_IO.Put_Line
("16#"
& Second_Stage_Image (First)
& "# => -- "
& Code_Point_Image (First_Code));
Ada.Text_IO.Set_Col (11);
Put (Current);
Ada.Text_IO.Put (',');
end if;
Ada.Text_IO.New_Line;
Ada.Text_IO.Set_Col (10);
end if;
Ada.Text_IO.Put_Line ("others =>");
Ada.Text_IO.Set_Col (11);
Put (Default);
Ada.Text_IO.Put_Line (");");
Generated (J) := True;
end;
end if;
end loop;
declare
Default : First_Stage_Index := 0;
Maximum : Natural := 0;
N : Natural := 0;
begin
for J in Groups'Range loop
if Maximum < Groups (J).Count then
Maximum := Groups (J).Count;
Default := J;
end if;
end loop;
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line
(" Mapping : aliased constant Normalization_Mapping_First_Stage");
Ada.Text_IO.Put (" := (");
for J in Groups'Range loop
if Groups (J).Share /= Default then
Ada.Text_IO.Put
("16#"
& First_Stage_Image (J)
& "# => Group_"
& First_Stage_Image (Groups (J).Share)
& "'Access,");
case N mod 2 is
when 0 =>
Ada.Text_IO.Set_Col (41);
when 1 =>
Ada.Text_IO.New_Line;
Ada.Text_IO.Set_Col (10);
when others =>
raise Program_Error;
end case;
N := N + 1;
end if;
end loop;
Ada.Text_IO.Put_Line
("others => Group_" & First_Stage_Image (Default) & "'Access);");
end;
Ada.Text_IO.New_Line;
Ada.Text_IO.Put_Line ("end Matreshka.Internals.Unicode.Ucd.Norms;");
end Gen_Norms;
|
[
{
"context": "adb GAP library of id's Hans Ulrich Besche\n##\n\nID_GROUP_TREE.next[8].next[1].next[106]:=\nrec",
"end": 158,
"score": 0.9998721480369568,
"start": 140,
"tag": "NAME",
"value": "Hans Ulrich Besche"
}
] |
id3/id8.adb
|
hulpke/smallgrp
| 5 |
#############################################################################
##
#W id8.adb GAP library of id's Hans Ulrich Besche
##
ID_GROUP_TREE.next[8].next[1].next[106]:=
rec(
fp:= [ 705, 4305, 6405, 7005, 7305, 7605, 7905, 8205, 8505, 8805, 9105,
9405, 9705, 10005, 10305, 13905, 16005, 16305, 16605, 17805, 19005, 19905,
20505, 20805, 22005, 22305, 24405, 25305, 25605, 27105, 27405, 28905, 29205,
29805, 30105, 30405, 30705, 31305, 31605, 32205, 32505, 32805, 33405, 33705,
34005, 34305, 34605, 35805, 36105, 36405, 36705, 37005, 37305, 37605, 37905,
38205, 39405, 39705, 40005, 40305, 40605, 41205, 41805, 42105, 42405, 42705,
43005, 43305, 43605, 44205, 44505, 44805, 45105, 45405, 45705, 46305, 46605,
46905, 47205, 47505, 47805, 48105, 48405, 48705, 49005, 49305, 49605, 49905,
50205, 50505, 50805, 51105, 51405, 51705, 52005, 52305, 52605, 52905, 53205,
54405, 55305 ],
next:= [ rec(
fp:= [ 3 ],
next:= [ rec(
desc:= [ 106003, 302004, 302006, 302008, 211003, 305011, 208005,
217005, 219005, 308017, 220008 ],
fp:= [ 4, 14 ],
next:= [ 58188, 58190 ] ) ] ), rec(
fp:= [ 461, 464 ],
next:= [ rec(
desc:= [ 306014, 40608009 ],
fp:= [ 3, 15561 ],
next:= [ 78137, 78139 ] ), rec(
desc:= [ 305012, 214005, 305015, 305017, 40610011 ],
fp:= [ 2, 5122 ],
next:= [ 78141, 78135 ] ) ] ), rec(
fp:= [ 878 ],
next:= [ rec(
desc:= [ 115003 ],
fp:= [ 2, 12 ],
next:= [ 88970, 88971 ] ) ] ), rec(
fp:= [ 167, 168, 1026 ],
next:= [ rec(
fp:= [ 51684, 89199 ],
level:= 5,
next:= [ 92950, 92955 ] ), rec(
desc:= [ 105003 ],
fp:= [ 818, 1214 ],
next:= [ 92951, 92953 ] ), rec(
desc:= [ 105003 ],
fp:= [ 422, 818 ],
next:= [ 92956, 92957 ] ) ] ), rec(
fp:= [ 171 ],
next:= [ rec(
desc:= [ 105003 ],
fp:= [ 8, 414 ],
next:= [ 96527, 96534 ] ) ] ), rec(
fp:= [ 169 ],
next:= [ rec(
desc:= [ 109003 ],
fp:= [ 214, 412 ],
next:= [ rec(
desc:= [ 302006, 302008, 302010, 302012, 214002, 306014, 219006 ],
fp:= [ 34, 826 ],
next:= [ 100166, 100171 ] ), 100169 ] ) ] ), rec(
fp:= [ 170, 171 ],
next:= [ rec(
desc:= [ 108003 ],
fp:= [ 16, 214 ],
next:= [ 103455, 103459 ] ), rec(
fp:= [ 27093, 84646 ],
level:= 5,
next:= [ 103461, rec(
desc:= [ 108003 ],
fp:= [ 216, 414 ],
next:= [ 103467, 103463 ] ) ] ) ] ), rec(
fp:= [ 1024, 1026 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 8, 414 ],
next:= [ 106907, 106908 ] ), rec(
desc:= [ 106003 ],
fp:= [ 8, 414 ],
next:= [ 106911, 106912 ] ) ] ), rec(
fp:= [ 167, 168, 173, 174, 176, 1123 ],
next:= [ rec(
desc:= [ 104003 ],
fp:= [ 818, 1214 ],
next:= [ 110950, 110957 ] ), rec(
desc:= [ 104003 ],
fp:= [ 422, 818 ],
next:= [ 110958, 110948 ] ), rec(
desc:= [ 105003 ],
fp:= [ 416, 614 ],
next:= [ 110959, 110953 ] ), rec(
desc:= [ 104003 ],
fp:= [ 8, 414 ],
next:= [ 110961, 110956 ] ), rec(
desc:= [ 104003 ],
fp:= [ 18, 414 ],
next:= [ 110960, 110952 ] ), rec(
desc:= [ 104003 ],
fp:= [ 18, 414 ],
next:= [ 110951, 110947 ] ) ] ), rec(
fp:= [ 168, 173, 174, 176 ],
next:= [ rec(
desc:= [ 110011 ],
fp:= [ 16, 26, 818, 1214 ],
next:= [ 115231, 115236, 115239, rec(
desc:= [ 302004 ],
fp:= [ 1264, 36860 ],
next:= [ 115238, 115229 ] ) ] ), rec(
desc:= [ 302006 ],
fp:= [ 1584, 69500 ],
next:= [ 115233, 115242 ] ), rec(
desc:= [ 105003 ],
fp:= [ 20, 218, 416 ],
next:= [ 115240, 115230, 115232 ] ), rec(
desc:= [ 302004 ],
fp:= [ 1462, 1721 ],
next:= [ 115241, 115237 ] ) ] ), rec(
fp:= [ 165, 171, 174, 175 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 6, 214, 412 ],
next:= [ 119395, 119399, 119391 ] ), rec(
desc:= [ 106003 ],
fp:= [ 614, 812 ],
next:= [ rec(
desc:= [ 302006 ],
fp:= [ 1363, 46760 ],
next:= [ 119401, 119397 ] ), 119393 ] ), rec(
desc:= [ 106003 ],
fp:= [ 416, 812 ],
next:= [ 119390, 119394 ] ), rec(
desc:= [ 302008 ],
fp:= [ 1584, 69500 ],
next:= [ 119392, 119388 ] ) ] ), rec(
fp:= [ 165, 171, 172, 173, 174, 175 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 8, 612 ],
next:= [ 123510, 123518 ] ), rec(
desc:= [ 105003 ],
fp:= [ 616, 814 ],
next:= [ 123522, 123512 ] ), rec(
desc:= [ 105003 ],
fp:= [ 814, 1012 ],
next:= [ 123514, 123520 ] ), rec(
desc:= [ 302006, 110003, 210002 ],
fp:= [ 18, 216 ],
next:= [ 123521, 123517 ] ), rec(
desc:= [ 106003 ],
fp:= [ 616, 814 ],
next:= [ 123513, 123523 ] ), rec(
desc:= [ 106003 ],
fp:= [ 814, 1012 ],
next:= [ 123519, rec(
desc:= [ 109003, 302005, 302007, 212002 ],
fp:= [ 214, 412 ],
next:= [ 123515, 123511 ] ) ] ) ] ), rec(
fp:= [ 165, 171, 172, 175, 177 ],
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 1214, 1412 ],
next:= [ 127546, rec(
desc:= [ 302007 ],
fp:= [ 1287, 39800 ],
next:= [ 127552, 127554 ] ) ] ), rec(
desc:= [ 105003 ],
fp:= [ 814, 1012 ],
next:= [ 127548, 127558 ] ), rec(
desc:= [ 105003 ],
fp:= [ 12, 1012 ],
next:= [ 127550, 127556 ] ), rec(
desc:= [ 108003 ],
fp:= [ 814, 1012 ],
next:= [ rec(
desc:= [ 302005, 302007, 210002, 302011, 213002, 304011, 210004,
304015, 212004, 40308012 ],
fp:= [ 3, 7881 ],
next:= [ 127551, 127547 ] ), rec(
desc:= [ 302008 ],
fp:= [ 1485, 59600 ],
next:= [ rec(
desc:= [ 107003, 302006, 208002, 302009, 40306010 ],
fp:= [ 4, 7981 ],
next:= [ 127553, 127557 ] ), 127555 ] ) ] ), rec(
desc:= [ 106003 ],
fp:= [ 814, 1012 ],
next:= [ 127549, 127559 ] ) ] ), rec(
fp:= [ 170, 171, 172, 1021 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 216, 414, 612 ],
next:= [ 131612, 131609, 131613 ] ), rec(
desc:= [ 302007 ],
fp:= [ 1165, 26960 ],
next:= [ rec(
desc:= [ 209002 ],
fp:= [ 18, 414 ],
next:= [ 131620, 131615 ] ), rec(
desc:= [ 109003 ],
fp:= [ 416, 614 ],
next:= [ 131611, 131621 ] ) ] ), rec(
desc:= [ 107003 ],
fp:= [ 10, 812 ],
next:= [ 131614, 131617 ] ), rec(
desc:= [ 107003, 109003, 302006, 208002, 302009, 213002 ],
fp:= [ 16, 214 ],
next:= [ 131610, 131616 ] ) ] ), rec(
fp:= [ 180 ],
next:= [ rec(
desc:= [ 108005 ],
fp:= [ 16, 26 ],
next:= [ 135166, 135164 ] ) ] ), rec(
fp:= [ 1632 ],
next:= [ rec(
fp:= [ 43996, 88267 ],
level:= 5,
next:= [ 170857, 170858 ] ) ] ), rec(
fp:= [ 598, 608 ],
next:= [ rec(
fp:= [ 9441, 35945 ],
level:= 5,
next:= [ 192105, 192101 ] ), rec(
fp:= [ 58281, 87850 ],
level:= 5,
next:= [ 192091, 192095 ] ) ] ), rec(
fp:= [ 655 ],
next:= [ rec(
fp:= [ 13118, 18767 ],
level:= 5,
next:= [ 195680, 195684 ] ) ] ), rec(
fp:= [ 1627 ],
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 16, 412 ],
next:= [ 198257, 198261 ] ) ] ), rec(
fp:= [ 535 ],
next:= [ rec(
fp:= [ 11314, 49574 ],
level:= 5,
next:= [ 212255, 212258 ] ) ] ), rec(
fp:= [ 653, 818 ],
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 213, 411 ],
next:= [ 227611, 227605 ] ), rec(
desc:= [ 107003 ],
fp:= [ 215, 413 ],
next:= [ 227607, 227601 ] ) ] ), rec(
fp:= [ 611 ],
next:= [ rec(
fp:= [ 25988, 89451 ],
level:= 5,
next:= [ 240559, 240558 ] ) ] ), rec(
fp:= [ 658 ],
next:= [ rec(
fp:= [ 26908, 74619 ],
level:= 5,
next:= [ 249535, 249532 ] ) ] ), rec(
fp:= [ 666, 723 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 4, 14 ],
next:= [ 253441, 253449 ] ), rec(
fp:= [ 15475, 77244 ],
level:= 5,
next:= [ 253443, 253446 ] ) ] ), rec(
fp:= [ 665 ],
next:= [ rec(
desc:= [ 302009 ],
fp:= [ 54682, 80517 ],
next:= [ 267757, 267755 ] ) ] ), rec(
fp:= [ 681 ],
next:= [ rec(
desc:= [ 302015, 106003, 110003, 302006, 302008, 212002, 302013,
216002 ],
fp:= [ 2, 111 ],
next:= [ 271292, 271290 ] ) ] ), rec(
fp:= [ 637 ],
next:= [ rec(
fp:= [ 74159, 85553 ],
level:= 5,
next:= [ 297984, 297983 ] ) ] ), rec(
fp:= [ 653, 833 ],
next:= [ rec(
desc:= [ 117011 ],
fp:= [ 416, 812 ],
next:= [ 311202, 311199 ] ), rec(
desc:= [ 302006 ],
fp:= [ 841, 58261 ],
next:= [ 311205, 311200 ] ) ] ), rec(
fp:= [ 612 ],
next:= [ rec(
desc:= [ 114003 ],
fp:= [ 14, 212 ],
next:= [ 315435, 315437 ] ) ] ), rec(
fp:= [ 1001 ],
next:= [ rec(
desc:= [ 105003 ],
fp:= [ 1626, 2418 ],
next:= [ 328915, 328913 ] ) ] ), rec(
fp:= [ 1033, 1054, 1066, 1092 ],
next:= [ rec(
desc:= [ 302008, 312016, 111003, 302012, 213002, 305013, 218005 ],
fp:= [ 1, 11 ],
next:= [ 333149, 333133 ] ), rec(
fp:= [ 8079, 87949 ],
level:= 5,
next:= [ 333128, rec(
desc:= [ 302007, 302011, 212003, 40108012 ],
fp:= [ 1, 1921 ],
next:= [ 333153, 333137 ] ) ] ), rec(
desc:= [ 302008 ],
fp:= [ 26741, 32823 ],
next:= [ 333152, 333140 ] ), rec(
fp:= [ 24610, 85096 ],
level:= 5,
next:= [ 333127, 333134 ] ) ] ), rec(
fp:= [ 1091, 1128, 1181 ],
next:= [ rec(
fp:= [ 22125, 62259 ],
level:= 5,
next:= [ 361309, 361329 ] ), rec(
desc:= [ 302008, 302015, 116003, 216003 ],
fp:= [ 4, 212 ],
next:= [ 361304, 361302 ] ), rec(
fp:= [ 17016, 40041 ],
level:= 5,
next:= [ 361311, 361327 ] ) ] ), rec(
fp:= [ 1071, 1151, 1178 ],
next:= [ rec(
fp:= [ 53702, 84387 ],
level:= 5,
next:= [ rec(
desc:= [ 108003 ],
fp:= [ 10, 812 ],
next:= [ 367227, 367229 ] ), 367223 ] ), rec(
desc:= [ 109003 ],
fp:= [ 814, 1012 ],
next:= [ 367225, 367221 ] ), rec(
desc:= [ 108003 ],
fp:= [ 618, 816 ],
next:= [ 367214, 367210 ] ) ] ), rec(
fp:= [ 1408, 1455 ],
next:= [ rec(
fp:= [ 8961, 53352 ],
level:= 5,
next:= [ 379111, 379113 ] ), rec(
desc:= [ 302008 ],
fp:= [ 384, 48361 ],
next:= [ 379127, 379137 ] ) ] ), rec(
fp:= [ 1137 ],
next:= [ rec(
fp:= [ 48706, 62721 ],
level:= 5,
next:= [ 387500, 387496 ] ) ] ), rec(
fp:= [ 1493 ],
next:= [ rec(
fp:= [ 10986, 61635 ],
level:= 5,
next:= [ 394019, 394021 ] ) ] ), rec(
fp:= [ 1175, 1181, 1205, 1426 ],
next:= [ rec(
fp:= [ 34423, 60927, 88921 ],
level:= 5,
next:= [ 399792, 399790, rec(
desc:= [ 108003 ],
fp:= [ 20, 218 ],
next:= [ 399768, 399780 ] ) ] ), rec(
fp:= [ 39775, 41475 ],
level:= 5,
next:= [ 399784, 399774 ] ), rec(
fp:= [ 8146, 12753 ],
level:= 5,
next:= [ 399772, 399779 ] ), rec(
fp:= [ 14751, 64021 ],
level:= 5,
next:= [ 399765, 399789 ] ) ] ), rec(
fp:= [ 1188, 1286, 1380, 1405 ],
next:= [ rec(
fp:= [ 75189, 84754 ],
level:= 5,
next:= [ 415515, 415526 ] ), rec(
fp:= [ 79515, 98396 ],
level:= 5,
next:= [ 415516, 415539 ] ), rec(
fp:= [ 28773, 47654 ],
level:= 5,
next:= [ 415535, 415543 ] ), rec(
desc:= [ 302009 ],
fp:= [ 285, 38461 ],
next:= [ 415517, 415521 ] ) ] ), rec(
fp:= [ 1200, 1477 ],
next:= [ rec(
desc:= [ 302009 ],
fp:= [ 28462, 28641 ],
next:= [ 424436, 424448 ] ), rec(
fp:= [ 1723, 44564 ],
level:= 5,
next:= [ 424453, rec(
desc:= [ 302006 ],
fp:= [ 28641, 49223 ],
next:= [ 424461, 424441 ] ) ] ) ] ), rec(
fp:= [ 1037, 1245 ],
next:= [ rec(
desc:= [ 111011 ],
fp:= [ 8, 18 ],
next:= [ 440058, 440054 ] ), rec(
desc:= [ 106003 ],
fp:= [ 814, 1012 ],
next:= [ 440069, 440055 ] ) ] ), rec(
fp:= [ 1362 ],
next:= [ rec(
fp:= [ 21553, 45381 ],
level:= 5,
next:= [ 446839, 446831 ] ) ] ), rec(
fp:= [ 1056, 1352 ],
next:= [ rec(
desc:= [ 108003 ],
fp:= [ 816, 1212 ],
next:= [ 453307, 453315 ] ), rec(
desc:= [ 108003 ],
fp:= [ 16, 412 ],
next:= [ 453321, 453325 ] ) ] ), rec(
fp:= [ 1420, 1485 ],
next:= [ rec(
desc:= [ 302010 ],
fp:= [ 44881, 54682 ],
next:= [ 469721, 469725 ] ), rec(
desc:= [ 302008 ],
fp:= [ 28561, 38362 ],
next:= [ 469733, 469717 ] ) ] ), rec(
fp:= [ 1196, 1211 ],
next:= [ rec(
desc:= [ 108003 ],
fp:= [ 16, 214 ],
next:= [ 478416, 478412 ] ), rec(
fp:= [ 29058, 38977 ],
level:= 5,
next:= [ 478422, 478423 ] ) ] ), rec(
fp:= [ 1192, 1362 ],
next:= [ rec(
fp:= [ 35126, 97551 ],
level:= 5,
next:= [ 487626, 487619 ] ), rec(
fp:= [ 17745, 46351 ],
level:= 5,
next:= [ 487615, 487638 ] ) ] ), rec(
fp:= [ 1210, 1381, 1472 ],
next:= [ rec(
desc:= [ 302008 ],
fp:= [ 384, 48361 ],
next:= [ 496844, 496848 ] ), rec(
fp:= [ 26525, 49219 ],
level:= 5,
next:= [ 496867, 496859 ] ), rec(
desc:= [ 108003 ],
fp:= [ 8, 612 ],
next:= [ 496861, 496845 ] ) ] ), rec(
fp:= [ 1263, 1336, 1469, 1509 ],
next:= [ rec(
desc:= [ 302009 ],
fp:= [ 39323, 55833 ],
next:= [ 505624, 505604 ] ), rec(
desc:= [ 302009, 111003, 114003, 211002, 302012, 216002, 216003,
304011, 217004, 304018, 40509010 ],
fp:= [ 1, 1921 ],
next:= [ 505620, 505628 ] ), rec(
desc:= [ 302007, 303010, 306016, 40406007 ],
fp:= [ 1, 641 ],
next:= [ 505609, 505601 ] ), rec(
desc:= [ 302007 ],
fp:= [ 285, 38461 ],
next:= [ 505613, 505617 ] ) ] ), rec(
fp:= [ 1183, 1531 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 18, 216 ],
next:= [ 537656, 537660 ] ), rec(
desc:= [ 105003 ],
fp:= [ 218, 416 ],
next:= [ 537657, 537668 ] ) ] ), rec(
fp:= [ 1138, 1177, 1405 ],
next:= [ rec(
fp:= [ 3075, 76803 ],
level:= 5,
next:= [ 544858, 544835 ] ), rec(
desc:= [ 108003 ],
fp:= [ 420, 816 ],
next:= [ 544845, 544833 ] ), rec(
desc:= [ 108003 ],
fp:= [ 20, 218, 416 ],
next:= [ 544837, 544851, 544841 ] ) ] ), rec(
fp:= [ 1204 ],
next:= [ rec(
fp:= [ 16050, 39958 ],
level:= 5,
next:= [ 553905, 553890 ] ) ] ), rec(
fp:= [ 1290, 1326, 1448 ],
next:= [ rec(
desc:= [ 113011 ],
fp:= [ 8, 414 ],
next:= [ 562756, 562736 ] ), rec(
desc:= [ 106003 ],
fp:= [ 1216, 1414 ],
next:= [ 562763, 562759 ] ), rec(
desc:= [ 302006 ],
fp:= [ 28462, 38263 ],
next:= [ 562747, 562765 ] ) ] ), rec(
fp:= [ 1074, 1106, 1212, 1513 ],
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 816, 1212 ],
next:= [ 571704, 571690 ] ), rec(
desc:= [ 114011 ],
fp:= [ 24, 2014 ],
next:= [ 571712, 571706 ] ), rec(
desc:= [ 106003 ],
fp:= [ 12, 814 ],
next:= [ 571687, 571709 ] ), rec(
desc:= [ 107003 ],
fp:= [ 814, 1012 ],
next:= [ 571697, 571703 ] ) ] ), rec(
fp:= [ 1105, 1281, 1318, 1409 ],
next:= [ rec(
desc:= [ 302008 ],
fp:= [ 883, 80517 ],
next:= [ 580916, 580908 ] ), rec(
desc:= [ 302005 ],
fp:= [ 28363, 55833 ],
next:= [ 580917, 580905 ] ), rec(
fp:= [ 41049, 46411 ],
level:= 5,
next:= [ 580902, 580913 ] ), rec(
desc:= [ 302005 ],
fp:= [ 28561, 38541 ],
next:= [ 580909, 580897 ] ) ] ), rec(
fp:= [ 1097, 1326 ],
next:= [ rec(
desc:= [ 111011 ],
fp:= [ 24, 2014 ],
next:= [ 590016, 590002 ] ), rec(
fp:= [ 41982, 79877 ],
level:= 5,
next:= [ 590010, 590003 ] ) ] ), rec(
fp:= [ 1172 ],
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 20, 416 ],
next:= [ 598566, 598573 ] ) ] ), rec(
fp:= [ 1161, 1274, 1453 ],
next:= [ rec(
fp:= [ 1315, 14908 ],
level:= 5,
next:= [ 605158, 605168 ] ), rec(
fp:= [ 37649, 59310 ],
level:= 5,
next:= [ 605160, rec(
desc:= [ 108003 ],
fp:= [ 20, 218 ],
next:= [ 605169, 605156 ] ) ] ), rec(
desc:= [ 107003 ],
fp:= [ 420, 618 ],
next:= [ 605153, 605157 ] ) ] ), rec(
fp:= [ 1287, 1408 ],
next:= [ rec(
fp:= [ 2726, 51886 ],
level:= 5,
next:= [ 634802, 634818 ] ), rec(
fp:= [ 23946, 83251, 89778 ],
level:= 5,
next:= [ rec(
desc:= [ 302009 ],
fp:= [ 38263, 49223 ],
next:= [ 634807, 634822 ] ), 634806, 634829 ] ) ] ), rec(
fp:= [ 1289 ],
next:= [ rec(
fp:= [ 3193, 11826 ],
level:= 5,
next:= [ 643786, 643808 ] ) ] ), rec(
fp:= [ 1170, 1262, 1490 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 418, 814 ],
next:= [ 652514, 652512 ] ), rec(
desc:= [ 302007 ],
fp:= [ 8761, 18562 ],
next:= [ 652520, 652525 ] ), rec(
desc:= [ 105003 ],
fp:= [ 416, 812 ],
next:= [ 652516, 652532 ] ) ] ), rec(
fp:= [ 1192, 1485 ],
next:= [ rec(
fp:= [ 27417, 74284 ],
level:= 5,
next:= [ 661243, 661221 ] ), rec(
fp:= [ 7640, 74527 ],
level:= 5,
next:= [ 661230, 661241 ] ) ] ), rec(
fp:= [ 1248, 1471, 1485 ],
next:= [ rec(
desc:= [ 302009 ],
fp:= [ 44881, 54682, 55021 ],
next:= [ 670267, 670272, 670277 ] ), rec(
desc:= [ 302009 ],
fp:= [ 34981, 44782 ],
next:= [ 670292, 670283 ] ), rec(
desc:= [ 302009, 209002 ],
fp:= [ 416, 614 ],
next:= [ 670279, 670293 ] ) ] ), rec(
fp:= [ 1181, 1450 ],
next:= [ rec(
fp:= [ 88168, 99402 ],
level:= 5,
next:= [ 687806, 687790 ] ), rec(
fp:= [ 3087, 72803 ],
level:= 5,
next:= [ 687801, 687788 ] ) ] ), rec(
fp:= [ 1157, 1400, 1403 ],
next:= [ rec(
desc:= [ 302008 ],
fp:= [ 48441, 66341 ],
next:= [ 706139, 706140 ] ), rec(
desc:= [ 302008 ],
fp:= [ 582, 761 ],
next:= [ 706149, 706136 ] ), rec(
desc:= [ 108003 ],
fp:= [ 14, 212 ],
next:= [ 706153, 706160 ] ) ] ), rec(
fp:= [ 1199 ],
next:= [ rec(
fp:= [ 3193, 75630 ],
level:= 5,
next:= [ 715323, 715328 ] ) ] ), rec(
fp:= [ 1213, 1265 ],
next:= [ rec(
desc:= [ 302007 ],
fp:= [ 48521, 66421 ],
next:= [ 724625, 724621 ] ), rec(
desc:= [ 111011 ],
fp:= [ 8, 414 ],
next:= [ 724620, 724613 ] ) ] ), rec(
fp:= [ 1251, 1292 ],
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 618, 816 ],
next:= [ 733645, 733636 ] ), rec(
fp:= [ 35845, 47258 ],
level:= 5,
next:= [ 733658, 733647 ] ) ] ), rec(
fp:= [ 1432 ],
next:= [ rec(
desc:= [ 108003 ],
fp:= [ 414, 612 ],
next:= [ 742916, 742900 ] ) ] ), rec(
fp:= [ 1220, 1248 ],
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 814, 1012 ],
next:= [ 751908, 751901 ] ), rec(
fp:= [ 35845, 47258 ],
level:= 5,
next:= [ 751909, 751911 ] ) ] ), rec(
fp:= [ 1263, 1488, 1535 ],
next:= [ rec(
desc:= [ 113011 ],
fp:= [ 8, 414 ],
next:= [ 761195, 761203 ] ), rec(
desc:= [ 302006 ],
fp:= [ 38461, 48262 ],
next:= [ 761200, 761205 ] ), rec(
desc:= [ 302006 ],
fp:= [ 285, 38461 ],
next:= [ 761187, 761208 ] ) ] ), rec(
fp:= [ 1237, 1241, 1320, 1495, 1506, 1520, 1537 ],
next:= [ rec(
desc:= [ 302006 ],
fp:= [ 38442, 39323 ],
next:= [ 778685, rec(
desc:= [ 208003 ],
fp:= [ 814, 1012 ],
next:= [ 778691, 778692 ] ) ] ), rec(
desc:= [ 302006 ],
fp:= [ 38442, 39323 ],
next:= [ 778697, 778700 ] ), rec(
desc:= [ 302005 ],
fp:= [ 18661, 28462 ],
next:= [ 778693, 778703 ] ), rec(
desc:= [ 302005 ],
fp:= [ 384, 48361 ],
next:= [ 778707, 778696 ] ), rec(
desc:= [ 302008 ],
fp:= [ 77227, 88822 ],
next:= [ 778683, rec(
desc:= [ 207002 ],
fp:= [ 218, 416 ],
next:= [ 778704, 778713 ] ) ] ), rec(
desc:= [ 302008 ],
fp:= [ 77227, 88822, 89161 ],
next:= [ 778712, 778701, 778705 ] ), rec(
desc:= [ 302007 ],
fp:= [ 34981, 44782 ],
next:= [ 778687, 778709 ] ) ] ), rec(
fp:= [ 1201, 1448, 1495 ],
next:= [ rec(
desc:= [ 105003 ],
fp:= [ 222, 618 ],
next:= [ 787763, 787766 ] ), rec(
desc:= [ 105003 ],
fp:= [ 218, 614 ],
next:= [ 787743, 787765 ] ), rec(
desc:= [ 302007 ],
fp:= [ 77227, 93737 ],
next:= [ 787767, 787769 ] ) ] ), rec(
fp:= [ 1203, 1208, 1414, 1485 ],
next:= [ rec(
fp:= [ 3193, 11826 ],
level:= 5,
next:= [ 796624, 796608 ] ), rec(
fp:= [ 3193, 11826 ],
level:= 5,
next:= [ 796614, 796630 ] ), rec(
desc:= [ 107003 ],
fp:= [ 216, 414 ],
next:= [ 796628, 796625 ] ), rec(
fp:= [ 27962, 64478 ],
level:= 5,
next:= [ 796635, 796611 ] ) ] ), rec(
fp:= [ 1022, 1032, 1127 ],
next:= [ rec(
desc:= [ 108003 ],
fp:= [ 620, 1016 ],
next:= [ 804546, 804556 ] ), rec(
fp:= [ 6586, 57968 ],
level:= 5,
next:= [ 804552, 804544 ] ), rec(
fp:= [ 20108, 57235 ],
level:= 5,
next:= [ 804554, 804536 ] ) ] ), rec(
fp:= [ 1191 ],
next:= [ rec(
fp:= [ 43923, 46310 ],
level:= 5,
next:= [ 810968, 810976 ] ) ] ), rec(
fp:= [ 1569 ],
next:= [ rec(
desc:= [ 302009 ],
fp:= [ 42544, 62249 ],
next:= [ 819849, 819857 ] ) ] ), rec(
fp:= [ 1410, 1417, 1426, 1442, 1593 ],
next:= [ rec(
desc:= [ 302007, 111003, 211002 ],
fp:= [ 6, 412 ],
next:= [ 835194, 835184 ] ), rec(
desc:= [ 302007 ],
fp:= [ 18562, 55833 ],
next:= [ 835197, 835183 ] ), rec(
desc:= [ 302007, 313016, 109003, 112003, 302010, 213002, 217002,
304013, 218004 ],
fp:= [ 1, 11 ],
next:= [ 835188, 835196 ] ), rec(
desc:= [ 302007, 111003, 211002 ],
fp:= [ 6, 412 ],
next:= [ 835170, 835168 ] ), rec(
desc:= [ 302008, 108003, 208003 ],
fp:= [ 216, 414 ],
next:= [ 835174, 835190 ] ) ] ), rec(
fp:= [ 1406 ],
next:= [ rec(
fp:= [ 22299, 69166 ],
level:= 5,
next:= [ 843794, 843799 ] ) ] ), rec(
fp:= [ 1137, 1358, 1406, 1467, 1569 ],
next:= [ rec(
desc:= [ 302006 ],
fp:= [ 582, 761 ],
next:= [ 852826, 852840 ] ), rec(
desc:= [ 302010 ],
fp:= [ 643, 74581 ],
next:= [ 852832, 852819 ] ), rec(
desc:= [ 302008 ],
fp:= [ 582, 761 ],
next:= [ 852845, 852838 ] ), rec(
desc:= [ 302009 ],
fp:= [ 8464, 42643, 59153 ],
next:= [ 852818, 852843, 852842 ] ), rec(
desc:= [ 302007 ],
fp:= [ 42544, 62249 ],
next:= [ 852847, 852829 ] ) ] ), rec(
fp:= [ 1461 ],
next:= [ rec(
fp:= [ 44544, 54525 ],
level:= 5,
next:= [ 862013, 862030 ] ) ] ), rec(
fp:= [ 1455, 1462, 1569 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 214, 412 ],
next:= [ 871295, 871288 ] ), rec(
desc:= [ 106003 ],
fp:= [ 214, 412 ],
next:= [ 871307, 871289 ] ), rec(
desc:= [ 106003 ],
fp:= [ 2, 12 ],
next:= [ 871297, 871315 ] ) ] ), rec(
fp:= [ 1417, 1488 ],
next:= [ rec(
fp:= [ 507, 40863 ],
level:= 5,
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 2, 12 ],
next:= [ 880554, 880530 ] ), rec(
desc:= [ 108003 ],
fp:= [ 4, 212 ],
next:= [ 880556, 880532 ] ) ] ), rec(
fp:= [ 3296, 37125 ],
level:= 5,
next:= [ 880533, 880555 ] ) ] ), rec(
fp:= [ 1424, 1432, 1546 ],
next:= [ rec(
desc:= [ 302011 ],
fp:= [ 7296, 90447 ],
next:= [ 889737, 889740 ] ), rec(
fp:= [ 3893, 37722 ],
level:= 5,
next:= [ 889746, 889724 ] ), rec(
fp:= [ 451, 5512 ],
level:= 5,
next:= [ 889733, 889751 ] ) ] ), rec(
fp:= [ 1150 ],
next:= [ rec(
desc:= [ 108003 ],
fp:= [ 6, 412 ],
next:= [ 898988, 898982 ] ) ] ), rec(
fp:= [ 1413, 1561 ],
next:= [ rec(
desc:= [ 302006 ],
fp:= [ 483, 58261 ],
next:= [ 908174, 908149 ] ), rec(
desc:= [ 302007 ],
fp:= [ 35934, 42643 ],
next:= [ 908175, 908157 ] ) ] ), rec(
fp:= [ 1385, 1432, 1491 ],
next:= [ rec(
fp:= [ 17946, 29359 ],
level:= 5,
next:= [ 917404, 917407 ] ), rec(
desc:= [ 107003 ],
fp:= [ 4, 212 ],
next:= [ 917414, 917395 ] ), rec(
desc:= [ 107003 ],
fp:= [ 6, 412 ],
next:= [ 917393, 917405 ] ) ] ), rec(
fp:= [ 1410, 1493, 1562 ],
next:= [ rec(
desc:= [ 108003 ],
fp:= [ 2, 12 ],
next:= [ 926655, 926645 ] ), rec(
desc:= [ 108003 ],
fp:= [ 4, 212 ],
next:= [ 926658, 926642 ] ), rec(
desc:= [ 107003 ],
fp:= [ 2, 12 ],
next:= [ 926656, 926650 ] ) ] ), rec(
fp:= [ 1419 ],
next:= [ rec(
fp:= [ 26659, 92763 ],
level:= 5,
next:= [ 935593, 935574 ] ) ] ), rec(
fp:= [ 1494 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 6, 412 ],
next:= [ 944766, 944789 ] ) ] ), rec(
fp:= [ 1402, 1510 ],
next:= [ rec(
desc:= [ 302008 ],
fp:= [ 18562, 55833 ],
next:= [ 953926, 953933 ] ), rec(
fp:= [ 24854, 65150 ],
level:= 5,
next:= [ 953927, 953939 ] ) ] ), rec(
fp:= [ 1453 ],
next:= [ rec(
desc:= [ 302007 ],
fp:= [ 36113, 62603 ],
next:= [ 963166, 963181 ] ) ] ), rec(
fp:= [ 1260, 1344, 1398, 1490, 1498, 1534, 1571 ],
next:= [ rec(
desc:= [ 109011 ],
fp:= [ 8, 18, 414 ],
next:= [ 972322, 972324, 972328 ] ), rec(
desc:= [ 104003 ],
fp:= [ 416, 614 ],
next:= [ 972323, 972320 ] ), rec(
desc:= [ 104003 ],
fp:= [ 214, 412 ],
next:= [ 972333, 972330 ] ), rec(
desc:= [ 104003 ],
fp:= [ 6, 412 ],
next:= [ 972336, 972316 ] ), rec(
desc:= [ 104003 ],
fp:= [ 6, 412 ],
next:= [ 972318, 972319 ] ), rec(
desc:= [ 302005 ],
fp:= [ 5825, 45914, 62249 ],
next:= [ 972337, 972334, 972339 ] ), rec(
desc:= [ 104003 ],
fp:= [ 2, 12 ],
next:= [ 972345, 972335 ] ) ] ), rec(
fp:= [ 1504, 1522, 1534 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 6, 412 ],
next:= [ 981490, 981498 ] ), rec(
desc:= [ 106003 ],
fp:= [ 214, 412 ],
next:= [ 981495, 981487 ] ), rec(
desc:= [ 105003 ],
fp:= [ 214, 412 ],
next:= [ 981474, 981497 ] ) ] ), rec(
fp:= [ 1244, 1291, 1410, 1417 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 416, 614 ],
next:= [ 990402, 990400 ] ), rec(
desc:= [ 106003 ],
fp:= [ 614, 812 ],
next:= [ 990393, 990407 ] ), rec(
desc:= [ 302009 ],
fp:= [ 80547, 97057 ],
next:= [ rec(
desc:= [ 209002 ],
fp:= [ 6, 412 ],
next:= [ 990403, 990418 ] ), 990414 ] ), rec(
desc:= [ 302007 ],
fp:= [ 18562, 39323, 55833 ],
next:= [ 990421, 990409, 990404 ] ) ] ), rec(
fp:= [ 1387, 1530 ],
next:= [ rec(
desc:= [ 105003 ],
fp:= [ 6, 412 ],
next:= [ 999523, 999520 ] ), rec(
desc:= [ 106003 ],
fp:= [ 214, 412 ],
next:= [ 999511, 999508 ] ) ] ), rec(
fp:= [ 1146 ],
next:= [ rec(
fp:= [ 2018, 57103 ],
level:= 5,
next:= [ 1007805, 1007792 ] ) ] ), rec(
fp:= [ 1153 ],
next:= [ rec(
fp:= [ 14920, 46701 ],
level:= 5,
next:= [ 1014708, 1014714 ] ) ] ), rec(
fp:= [ 1189, 1289 ],
next:= [ rec(
fp:= [ 59524, 85500 ],
level:= 5,
next:= [ 1022354, 1022348 ] ), rec(
fp:= [ 44464, 89040 ],
level:= 5,
next:= [ 1022333, 1022352 ] ) ] ), rec(
fp:= [ 1091, 1170, 1237, 1317 ],
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 224, 620 ],
next:= [ 1029624, 1029616 ] ), rec(
desc:= [ 107003 ],
fp:= [ 218, 614 ],
next:= [ 1029632, 1029640 ] ), rec(
fp:= [ 5622, 11408, 21384 ],
level:= 5,
next:= [ 1029629, 1029642, 1029636 ] ), rec(
desc:= [ 113011 ],
fp:= [ 8, 414 ],
next:= [ 1029641, 1029645 ] ) ] ), rec(
fp:= [ 1701 ],
next:= [ rec(
fp:= [ 10974, 74040 ],
level:= 5,
next:= [ 1034244, 1034250 ] ) ] ), rec(
fp:= [ 1773 ],
next:= [ rec(
desc:= [ 302007, 305015, 40205007 ],
fp:= [ 2, 5762 ],
next:= [ 1050815, 1050832 ] ) ] ), rec(
fp:= [ 2002, 2044 ],
next:= [ rec(
fp:= [ 20622, 96071 ],
level:= 5,
next:= [ 1070142, 1070152 ] ), rec(
fp:= [ 20274, 63250 ],
level:= 5,
next:= [ 1070164, 1070138 ] ) ] ) ] );
|
15306
|
#############################################################################
##
#W id8.adb GAP library of id's <NAME>
##
ID_GROUP_TREE.next[8].next[1].next[106]:=
rec(
fp:= [ 705, 4305, 6405, 7005, 7305, 7605, 7905, 8205, 8505, 8805, 9105,
9405, 9705, 10005, 10305, 13905, 16005, 16305, 16605, 17805, 19005, 19905,
20505, 20805, 22005, 22305, 24405, 25305, 25605, 27105, 27405, 28905, 29205,
29805, 30105, 30405, 30705, 31305, 31605, 32205, 32505, 32805, 33405, 33705,
34005, 34305, 34605, 35805, 36105, 36405, 36705, 37005, 37305, 37605, 37905,
38205, 39405, 39705, 40005, 40305, 40605, 41205, 41805, 42105, 42405, 42705,
43005, 43305, 43605, 44205, 44505, 44805, 45105, 45405, 45705, 46305, 46605,
46905, 47205, 47505, 47805, 48105, 48405, 48705, 49005, 49305, 49605, 49905,
50205, 50505, 50805, 51105, 51405, 51705, 52005, 52305, 52605, 52905, 53205,
54405, 55305 ],
next:= [ rec(
fp:= [ 3 ],
next:= [ rec(
desc:= [ 106003, 302004, 302006, 302008, 211003, 305011, 208005,
217005, 219005, 308017, 220008 ],
fp:= [ 4, 14 ],
next:= [ 58188, 58190 ] ) ] ), rec(
fp:= [ 461, 464 ],
next:= [ rec(
desc:= [ 306014, 40608009 ],
fp:= [ 3, 15561 ],
next:= [ 78137, 78139 ] ), rec(
desc:= [ 305012, 214005, 305015, 305017, 40610011 ],
fp:= [ 2, 5122 ],
next:= [ 78141, 78135 ] ) ] ), rec(
fp:= [ 878 ],
next:= [ rec(
desc:= [ 115003 ],
fp:= [ 2, 12 ],
next:= [ 88970, 88971 ] ) ] ), rec(
fp:= [ 167, 168, 1026 ],
next:= [ rec(
fp:= [ 51684, 89199 ],
level:= 5,
next:= [ 92950, 92955 ] ), rec(
desc:= [ 105003 ],
fp:= [ 818, 1214 ],
next:= [ 92951, 92953 ] ), rec(
desc:= [ 105003 ],
fp:= [ 422, 818 ],
next:= [ 92956, 92957 ] ) ] ), rec(
fp:= [ 171 ],
next:= [ rec(
desc:= [ 105003 ],
fp:= [ 8, 414 ],
next:= [ 96527, 96534 ] ) ] ), rec(
fp:= [ 169 ],
next:= [ rec(
desc:= [ 109003 ],
fp:= [ 214, 412 ],
next:= [ rec(
desc:= [ 302006, 302008, 302010, 302012, 214002, 306014, 219006 ],
fp:= [ 34, 826 ],
next:= [ 100166, 100171 ] ), 100169 ] ) ] ), rec(
fp:= [ 170, 171 ],
next:= [ rec(
desc:= [ 108003 ],
fp:= [ 16, 214 ],
next:= [ 103455, 103459 ] ), rec(
fp:= [ 27093, 84646 ],
level:= 5,
next:= [ 103461, rec(
desc:= [ 108003 ],
fp:= [ 216, 414 ],
next:= [ 103467, 103463 ] ) ] ) ] ), rec(
fp:= [ 1024, 1026 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 8, 414 ],
next:= [ 106907, 106908 ] ), rec(
desc:= [ 106003 ],
fp:= [ 8, 414 ],
next:= [ 106911, 106912 ] ) ] ), rec(
fp:= [ 167, 168, 173, 174, 176, 1123 ],
next:= [ rec(
desc:= [ 104003 ],
fp:= [ 818, 1214 ],
next:= [ 110950, 110957 ] ), rec(
desc:= [ 104003 ],
fp:= [ 422, 818 ],
next:= [ 110958, 110948 ] ), rec(
desc:= [ 105003 ],
fp:= [ 416, 614 ],
next:= [ 110959, 110953 ] ), rec(
desc:= [ 104003 ],
fp:= [ 8, 414 ],
next:= [ 110961, 110956 ] ), rec(
desc:= [ 104003 ],
fp:= [ 18, 414 ],
next:= [ 110960, 110952 ] ), rec(
desc:= [ 104003 ],
fp:= [ 18, 414 ],
next:= [ 110951, 110947 ] ) ] ), rec(
fp:= [ 168, 173, 174, 176 ],
next:= [ rec(
desc:= [ 110011 ],
fp:= [ 16, 26, 818, 1214 ],
next:= [ 115231, 115236, 115239, rec(
desc:= [ 302004 ],
fp:= [ 1264, 36860 ],
next:= [ 115238, 115229 ] ) ] ), rec(
desc:= [ 302006 ],
fp:= [ 1584, 69500 ],
next:= [ 115233, 115242 ] ), rec(
desc:= [ 105003 ],
fp:= [ 20, 218, 416 ],
next:= [ 115240, 115230, 115232 ] ), rec(
desc:= [ 302004 ],
fp:= [ 1462, 1721 ],
next:= [ 115241, 115237 ] ) ] ), rec(
fp:= [ 165, 171, 174, 175 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 6, 214, 412 ],
next:= [ 119395, 119399, 119391 ] ), rec(
desc:= [ 106003 ],
fp:= [ 614, 812 ],
next:= [ rec(
desc:= [ 302006 ],
fp:= [ 1363, 46760 ],
next:= [ 119401, 119397 ] ), 119393 ] ), rec(
desc:= [ 106003 ],
fp:= [ 416, 812 ],
next:= [ 119390, 119394 ] ), rec(
desc:= [ 302008 ],
fp:= [ 1584, 69500 ],
next:= [ 119392, 119388 ] ) ] ), rec(
fp:= [ 165, 171, 172, 173, 174, 175 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 8, 612 ],
next:= [ 123510, 123518 ] ), rec(
desc:= [ 105003 ],
fp:= [ 616, 814 ],
next:= [ 123522, 123512 ] ), rec(
desc:= [ 105003 ],
fp:= [ 814, 1012 ],
next:= [ 123514, 123520 ] ), rec(
desc:= [ 302006, 110003, 210002 ],
fp:= [ 18, 216 ],
next:= [ 123521, 123517 ] ), rec(
desc:= [ 106003 ],
fp:= [ 616, 814 ],
next:= [ 123513, 123523 ] ), rec(
desc:= [ 106003 ],
fp:= [ 814, 1012 ],
next:= [ 123519, rec(
desc:= [ 109003, 302005, 302007, 212002 ],
fp:= [ 214, 412 ],
next:= [ 123515, 123511 ] ) ] ) ] ), rec(
fp:= [ 165, 171, 172, 175, 177 ],
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 1214, 1412 ],
next:= [ 127546, rec(
desc:= [ 302007 ],
fp:= [ 1287, 39800 ],
next:= [ 127552, 127554 ] ) ] ), rec(
desc:= [ 105003 ],
fp:= [ 814, 1012 ],
next:= [ 127548, 127558 ] ), rec(
desc:= [ 105003 ],
fp:= [ 12, 1012 ],
next:= [ 127550, 127556 ] ), rec(
desc:= [ 108003 ],
fp:= [ 814, 1012 ],
next:= [ rec(
desc:= [ 302005, 302007, 210002, 302011, 213002, 304011, 210004,
304015, 212004, 40308012 ],
fp:= [ 3, 7881 ],
next:= [ 127551, 127547 ] ), rec(
desc:= [ 302008 ],
fp:= [ 1485, 59600 ],
next:= [ rec(
desc:= [ 107003, 302006, 208002, 302009, 40306010 ],
fp:= [ 4, 7981 ],
next:= [ 127553, 127557 ] ), 127555 ] ) ] ), rec(
desc:= [ 106003 ],
fp:= [ 814, 1012 ],
next:= [ 127549, 127559 ] ) ] ), rec(
fp:= [ 170, 171, 172, 1021 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 216, 414, 612 ],
next:= [ 131612, 131609, 131613 ] ), rec(
desc:= [ 302007 ],
fp:= [ 1165, 26960 ],
next:= [ rec(
desc:= [ 209002 ],
fp:= [ 18, 414 ],
next:= [ 131620, 131615 ] ), rec(
desc:= [ 109003 ],
fp:= [ 416, 614 ],
next:= [ 131611, 131621 ] ) ] ), rec(
desc:= [ 107003 ],
fp:= [ 10, 812 ],
next:= [ 131614, 131617 ] ), rec(
desc:= [ 107003, 109003, 302006, 208002, 302009, 213002 ],
fp:= [ 16, 214 ],
next:= [ 131610, 131616 ] ) ] ), rec(
fp:= [ 180 ],
next:= [ rec(
desc:= [ 108005 ],
fp:= [ 16, 26 ],
next:= [ 135166, 135164 ] ) ] ), rec(
fp:= [ 1632 ],
next:= [ rec(
fp:= [ 43996, 88267 ],
level:= 5,
next:= [ 170857, 170858 ] ) ] ), rec(
fp:= [ 598, 608 ],
next:= [ rec(
fp:= [ 9441, 35945 ],
level:= 5,
next:= [ 192105, 192101 ] ), rec(
fp:= [ 58281, 87850 ],
level:= 5,
next:= [ 192091, 192095 ] ) ] ), rec(
fp:= [ 655 ],
next:= [ rec(
fp:= [ 13118, 18767 ],
level:= 5,
next:= [ 195680, 195684 ] ) ] ), rec(
fp:= [ 1627 ],
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 16, 412 ],
next:= [ 198257, 198261 ] ) ] ), rec(
fp:= [ 535 ],
next:= [ rec(
fp:= [ 11314, 49574 ],
level:= 5,
next:= [ 212255, 212258 ] ) ] ), rec(
fp:= [ 653, 818 ],
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 213, 411 ],
next:= [ 227611, 227605 ] ), rec(
desc:= [ 107003 ],
fp:= [ 215, 413 ],
next:= [ 227607, 227601 ] ) ] ), rec(
fp:= [ 611 ],
next:= [ rec(
fp:= [ 25988, 89451 ],
level:= 5,
next:= [ 240559, 240558 ] ) ] ), rec(
fp:= [ 658 ],
next:= [ rec(
fp:= [ 26908, 74619 ],
level:= 5,
next:= [ 249535, 249532 ] ) ] ), rec(
fp:= [ 666, 723 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 4, 14 ],
next:= [ 253441, 253449 ] ), rec(
fp:= [ 15475, 77244 ],
level:= 5,
next:= [ 253443, 253446 ] ) ] ), rec(
fp:= [ 665 ],
next:= [ rec(
desc:= [ 302009 ],
fp:= [ 54682, 80517 ],
next:= [ 267757, 267755 ] ) ] ), rec(
fp:= [ 681 ],
next:= [ rec(
desc:= [ 302015, 106003, 110003, 302006, 302008, 212002, 302013,
216002 ],
fp:= [ 2, 111 ],
next:= [ 271292, 271290 ] ) ] ), rec(
fp:= [ 637 ],
next:= [ rec(
fp:= [ 74159, 85553 ],
level:= 5,
next:= [ 297984, 297983 ] ) ] ), rec(
fp:= [ 653, 833 ],
next:= [ rec(
desc:= [ 117011 ],
fp:= [ 416, 812 ],
next:= [ 311202, 311199 ] ), rec(
desc:= [ 302006 ],
fp:= [ 841, 58261 ],
next:= [ 311205, 311200 ] ) ] ), rec(
fp:= [ 612 ],
next:= [ rec(
desc:= [ 114003 ],
fp:= [ 14, 212 ],
next:= [ 315435, 315437 ] ) ] ), rec(
fp:= [ 1001 ],
next:= [ rec(
desc:= [ 105003 ],
fp:= [ 1626, 2418 ],
next:= [ 328915, 328913 ] ) ] ), rec(
fp:= [ 1033, 1054, 1066, 1092 ],
next:= [ rec(
desc:= [ 302008, 312016, 111003, 302012, 213002, 305013, 218005 ],
fp:= [ 1, 11 ],
next:= [ 333149, 333133 ] ), rec(
fp:= [ 8079, 87949 ],
level:= 5,
next:= [ 333128, rec(
desc:= [ 302007, 302011, 212003, 40108012 ],
fp:= [ 1, 1921 ],
next:= [ 333153, 333137 ] ) ] ), rec(
desc:= [ 302008 ],
fp:= [ 26741, 32823 ],
next:= [ 333152, 333140 ] ), rec(
fp:= [ 24610, 85096 ],
level:= 5,
next:= [ 333127, 333134 ] ) ] ), rec(
fp:= [ 1091, 1128, 1181 ],
next:= [ rec(
fp:= [ 22125, 62259 ],
level:= 5,
next:= [ 361309, 361329 ] ), rec(
desc:= [ 302008, 302015, 116003, 216003 ],
fp:= [ 4, 212 ],
next:= [ 361304, 361302 ] ), rec(
fp:= [ 17016, 40041 ],
level:= 5,
next:= [ 361311, 361327 ] ) ] ), rec(
fp:= [ 1071, 1151, 1178 ],
next:= [ rec(
fp:= [ 53702, 84387 ],
level:= 5,
next:= [ rec(
desc:= [ 108003 ],
fp:= [ 10, 812 ],
next:= [ 367227, 367229 ] ), 367223 ] ), rec(
desc:= [ 109003 ],
fp:= [ 814, 1012 ],
next:= [ 367225, 367221 ] ), rec(
desc:= [ 108003 ],
fp:= [ 618, 816 ],
next:= [ 367214, 367210 ] ) ] ), rec(
fp:= [ 1408, 1455 ],
next:= [ rec(
fp:= [ 8961, 53352 ],
level:= 5,
next:= [ 379111, 379113 ] ), rec(
desc:= [ 302008 ],
fp:= [ 384, 48361 ],
next:= [ 379127, 379137 ] ) ] ), rec(
fp:= [ 1137 ],
next:= [ rec(
fp:= [ 48706, 62721 ],
level:= 5,
next:= [ 387500, 387496 ] ) ] ), rec(
fp:= [ 1493 ],
next:= [ rec(
fp:= [ 10986, 61635 ],
level:= 5,
next:= [ 394019, 394021 ] ) ] ), rec(
fp:= [ 1175, 1181, 1205, 1426 ],
next:= [ rec(
fp:= [ 34423, 60927, 88921 ],
level:= 5,
next:= [ 399792, 399790, rec(
desc:= [ 108003 ],
fp:= [ 20, 218 ],
next:= [ 399768, 399780 ] ) ] ), rec(
fp:= [ 39775, 41475 ],
level:= 5,
next:= [ 399784, 399774 ] ), rec(
fp:= [ 8146, 12753 ],
level:= 5,
next:= [ 399772, 399779 ] ), rec(
fp:= [ 14751, 64021 ],
level:= 5,
next:= [ 399765, 399789 ] ) ] ), rec(
fp:= [ 1188, 1286, 1380, 1405 ],
next:= [ rec(
fp:= [ 75189, 84754 ],
level:= 5,
next:= [ 415515, 415526 ] ), rec(
fp:= [ 79515, 98396 ],
level:= 5,
next:= [ 415516, 415539 ] ), rec(
fp:= [ 28773, 47654 ],
level:= 5,
next:= [ 415535, 415543 ] ), rec(
desc:= [ 302009 ],
fp:= [ 285, 38461 ],
next:= [ 415517, 415521 ] ) ] ), rec(
fp:= [ 1200, 1477 ],
next:= [ rec(
desc:= [ 302009 ],
fp:= [ 28462, 28641 ],
next:= [ 424436, 424448 ] ), rec(
fp:= [ 1723, 44564 ],
level:= 5,
next:= [ 424453, rec(
desc:= [ 302006 ],
fp:= [ 28641, 49223 ],
next:= [ 424461, 424441 ] ) ] ) ] ), rec(
fp:= [ 1037, 1245 ],
next:= [ rec(
desc:= [ 111011 ],
fp:= [ 8, 18 ],
next:= [ 440058, 440054 ] ), rec(
desc:= [ 106003 ],
fp:= [ 814, 1012 ],
next:= [ 440069, 440055 ] ) ] ), rec(
fp:= [ 1362 ],
next:= [ rec(
fp:= [ 21553, 45381 ],
level:= 5,
next:= [ 446839, 446831 ] ) ] ), rec(
fp:= [ 1056, 1352 ],
next:= [ rec(
desc:= [ 108003 ],
fp:= [ 816, 1212 ],
next:= [ 453307, 453315 ] ), rec(
desc:= [ 108003 ],
fp:= [ 16, 412 ],
next:= [ 453321, 453325 ] ) ] ), rec(
fp:= [ 1420, 1485 ],
next:= [ rec(
desc:= [ 302010 ],
fp:= [ 44881, 54682 ],
next:= [ 469721, 469725 ] ), rec(
desc:= [ 302008 ],
fp:= [ 28561, 38362 ],
next:= [ 469733, 469717 ] ) ] ), rec(
fp:= [ 1196, 1211 ],
next:= [ rec(
desc:= [ 108003 ],
fp:= [ 16, 214 ],
next:= [ 478416, 478412 ] ), rec(
fp:= [ 29058, 38977 ],
level:= 5,
next:= [ 478422, 478423 ] ) ] ), rec(
fp:= [ 1192, 1362 ],
next:= [ rec(
fp:= [ 35126, 97551 ],
level:= 5,
next:= [ 487626, 487619 ] ), rec(
fp:= [ 17745, 46351 ],
level:= 5,
next:= [ 487615, 487638 ] ) ] ), rec(
fp:= [ 1210, 1381, 1472 ],
next:= [ rec(
desc:= [ 302008 ],
fp:= [ 384, 48361 ],
next:= [ 496844, 496848 ] ), rec(
fp:= [ 26525, 49219 ],
level:= 5,
next:= [ 496867, 496859 ] ), rec(
desc:= [ 108003 ],
fp:= [ 8, 612 ],
next:= [ 496861, 496845 ] ) ] ), rec(
fp:= [ 1263, 1336, 1469, 1509 ],
next:= [ rec(
desc:= [ 302009 ],
fp:= [ 39323, 55833 ],
next:= [ 505624, 505604 ] ), rec(
desc:= [ 302009, 111003, 114003, 211002, 302012, 216002, 216003,
304011, 217004, 304018, 40509010 ],
fp:= [ 1, 1921 ],
next:= [ 505620, 505628 ] ), rec(
desc:= [ 302007, 303010, 306016, 40406007 ],
fp:= [ 1, 641 ],
next:= [ 505609, 505601 ] ), rec(
desc:= [ 302007 ],
fp:= [ 285, 38461 ],
next:= [ 505613, 505617 ] ) ] ), rec(
fp:= [ 1183, 1531 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 18, 216 ],
next:= [ 537656, 537660 ] ), rec(
desc:= [ 105003 ],
fp:= [ 218, 416 ],
next:= [ 537657, 537668 ] ) ] ), rec(
fp:= [ 1138, 1177, 1405 ],
next:= [ rec(
fp:= [ 3075, 76803 ],
level:= 5,
next:= [ 544858, 544835 ] ), rec(
desc:= [ 108003 ],
fp:= [ 420, 816 ],
next:= [ 544845, 544833 ] ), rec(
desc:= [ 108003 ],
fp:= [ 20, 218, 416 ],
next:= [ 544837, 544851, 544841 ] ) ] ), rec(
fp:= [ 1204 ],
next:= [ rec(
fp:= [ 16050, 39958 ],
level:= 5,
next:= [ 553905, 553890 ] ) ] ), rec(
fp:= [ 1290, 1326, 1448 ],
next:= [ rec(
desc:= [ 113011 ],
fp:= [ 8, 414 ],
next:= [ 562756, 562736 ] ), rec(
desc:= [ 106003 ],
fp:= [ 1216, 1414 ],
next:= [ 562763, 562759 ] ), rec(
desc:= [ 302006 ],
fp:= [ 28462, 38263 ],
next:= [ 562747, 562765 ] ) ] ), rec(
fp:= [ 1074, 1106, 1212, 1513 ],
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 816, 1212 ],
next:= [ 571704, 571690 ] ), rec(
desc:= [ 114011 ],
fp:= [ 24, 2014 ],
next:= [ 571712, 571706 ] ), rec(
desc:= [ 106003 ],
fp:= [ 12, 814 ],
next:= [ 571687, 571709 ] ), rec(
desc:= [ 107003 ],
fp:= [ 814, 1012 ],
next:= [ 571697, 571703 ] ) ] ), rec(
fp:= [ 1105, 1281, 1318, 1409 ],
next:= [ rec(
desc:= [ 302008 ],
fp:= [ 883, 80517 ],
next:= [ 580916, 580908 ] ), rec(
desc:= [ 302005 ],
fp:= [ 28363, 55833 ],
next:= [ 580917, 580905 ] ), rec(
fp:= [ 41049, 46411 ],
level:= 5,
next:= [ 580902, 580913 ] ), rec(
desc:= [ 302005 ],
fp:= [ 28561, 38541 ],
next:= [ 580909, 580897 ] ) ] ), rec(
fp:= [ 1097, 1326 ],
next:= [ rec(
desc:= [ 111011 ],
fp:= [ 24, 2014 ],
next:= [ 590016, 590002 ] ), rec(
fp:= [ 41982, 79877 ],
level:= 5,
next:= [ 590010, 590003 ] ) ] ), rec(
fp:= [ 1172 ],
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 20, 416 ],
next:= [ 598566, 598573 ] ) ] ), rec(
fp:= [ 1161, 1274, 1453 ],
next:= [ rec(
fp:= [ 1315, 14908 ],
level:= 5,
next:= [ 605158, 605168 ] ), rec(
fp:= [ 37649, 59310 ],
level:= 5,
next:= [ 605160, rec(
desc:= [ 108003 ],
fp:= [ 20, 218 ],
next:= [ 605169, 605156 ] ) ] ), rec(
desc:= [ 107003 ],
fp:= [ 420, 618 ],
next:= [ 605153, 605157 ] ) ] ), rec(
fp:= [ 1287, 1408 ],
next:= [ rec(
fp:= [ 2726, 51886 ],
level:= 5,
next:= [ 634802, 634818 ] ), rec(
fp:= [ 23946, 83251, 89778 ],
level:= 5,
next:= [ rec(
desc:= [ 302009 ],
fp:= [ 38263, 49223 ],
next:= [ 634807, 634822 ] ), 634806, 634829 ] ) ] ), rec(
fp:= [ 1289 ],
next:= [ rec(
fp:= [ 3193, 11826 ],
level:= 5,
next:= [ 643786, 643808 ] ) ] ), rec(
fp:= [ 1170, 1262, 1490 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 418, 814 ],
next:= [ 652514, 652512 ] ), rec(
desc:= [ 302007 ],
fp:= [ 8761, 18562 ],
next:= [ 652520, 652525 ] ), rec(
desc:= [ 105003 ],
fp:= [ 416, 812 ],
next:= [ 652516, 652532 ] ) ] ), rec(
fp:= [ 1192, 1485 ],
next:= [ rec(
fp:= [ 27417, 74284 ],
level:= 5,
next:= [ 661243, 661221 ] ), rec(
fp:= [ 7640, 74527 ],
level:= 5,
next:= [ 661230, 661241 ] ) ] ), rec(
fp:= [ 1248, 1471, 1485 ],
next:= [ rec(
desc:= [ 302009 ],
fp:= [ 44881, 54682, 55021 ],
next:= [ 670267, 670272, 670277 ] ), rec(
desc:= [ 302009 ],
fp:= [ 34981, 44782 ],
next:= [ 670292, 670283 ] ), rec(
desc:= [ 302009, 209002 ],
fp:= [ 416, 614 ],
next:= [ 670279, 670293 ] ) ] ), rec(
fp:= [ 1181, 1450 ],
next:= [ rec(
fp:= [ 88168, 99402 ],
level:= 5,
next:= [ 687806, 687790 ] ), rec(
fp:= [ 3087, 72803 ],
level:= 5,
next:= [ 687801, 687788 ] ) ] ), rec(
fp:= [ 1157, 1400, 1403 ],
next:= [ rec(
desc:= [ 302008 ],
fp:= [ 48441, 66341 ],
next:= [ 706139, 706140 ] ), rec(
desc:= [ 302008 ],
fp:= [ 582, 761 ],
next:= [ 706149, 706136 ] ), rec(
desc:= [ 108003 ],
fp:= [ 14, 212 ],
next:= [ 706153, 706160 ] ) ] ), rec(
fp:= [ 1199 ],
next:= [ rec(
fp:= [ 3193, 75630 ],
level:= 5,
next:= [ 715323, 715328 ] ) ] ), rec(
fp:= [ 1213, 1265 ],
next:= [ rec(
desc:= [ 302007 ],
fp:= [ 48521, 66421 ],
next:= [ 724625, 724621 ] ), rec(
desc:= [ 111011 ],
fp:= [ 8, 414 ],
next:= [ 724620, 724613 ] ) ] ), rec(
fp:= [ 1251, 1292 ],
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 618, 816 ],
next:= [ 733645, 733636 ] ), rec(
fp:= [ 35845, 47258 ],
level:= 5,
next:= [ 733658, 733647 ] ) ] ), rec(
fp:= [ 1432 ],
next:= [ rec(
desc:= [ 108003 ],
fp:= [ 414, 612 ],
next:= [ 742916, 742900 ] ) ] ), rec(
fp:= [ 1220, 1248 ],
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 814, 1012 ],
next:= [ 751908, 751901 ] ), rec(
fp:= [ 35845, 47258 ],
level:= 5,
next:= [ 751909, 751911 ] ) ] ), rec(
fp:= [ 1263, 1488, 1535 ],
next:= [ rec(
desc:= [ 113011 ],
fp:= [ 8, 414 ],
next:= [ 761195, 761203 ] ), rec(
desc:= [ 302006 ],
fp:= [ 38461, 48262 ],
next:= [ 761200, 761205 ] ), rec(
desc:= [ 302006 ],
fp:= [ 285, 38461 ],
next:= [ 761187, 761208 ] ) ] ), rec(
fp:= [ 1237, 1241, 1320, 1495, 1506, 1520, 1537 ],
next:= [ rec(
desc:= [ 302006 ],
fp:= [ 38442, 39323 ],
next:= [ 778685, rec(
desc:= [ 208003 ],
fp:= [ 814, 1012 ],
next:= [ 778691, 778692 ] ) ] ), rec(
desc:= [ 302006 ],
fp:= [ 38442, 39323 ],
next:= [ 778697, 778700 ] ), rec(
desc:= [ 302005 ],
fp:= [ 18661, 28462 ],
next:= [ 778693, 778703 ] ), rec(
desc:= [ 302005 ],
fp:= [ 384, 48361 ],
next:= [ 778707, 778696 ] ), rec(
desc:= [ 302008 ],
fp:= [ 77227, 88822 ],
next:= [ 778683, rec(
desc:= [ 207002 ],
fp:= [ 218, 416 ],
next:= [ 778704, 778713 ] ) ] ), rec(
desc:= [ 302008 ],
fp:= [ 77227, 88822, 89161 ],
next:= [ 778712, 778701, 778705 ] ), rec(
desc:= [ 302007 ],
fp:= [ 34981, 44782 ],
next:= [ 778687, 778709 ] ) ] ), rec(
fp:= [ 1201, 1448, 1495 ],
next:= [ rec(
desc:= [ 105003 ],
fp:= [ 222, 618 ],
next:= [ 787763, 787766 ] ), rec(
desc:= [ 105003 ],
fp:= [ 218, 614 ],
next:= [ 787743, 787765 ] ), rec(
desc:= [ 302007 ],
fp:= [ 77227, 93737 ],
next:= [ 787767, 787769 ] ) ] ), rec(
fp:= [ 1203, 1208, 1414, 1485 ],
next:= [ rec(
fp:= [ 3193, 11826 ],
level:= 5,
next:= [ 796624, 796608 ] ), rec(
fp:= [ 3193, 11826 ],
level:= 5,
next:= [ 796614, 796630 ] ), rec(
desc:= [ 107003 ],
fp:= [ 216, 414 ],
next:= [ 796628, 796625 ] ), rec(
fp:= [ 27962, 64478 ],
level:= 5,
next:= [ 796635, 796611 ] ) ] ), rec(
fp:= [ 1022, 1032, 1127 ],
next:= [ rec(
desc:= [ 108003 ],
fp:= [ 620, 1016 ],
next:= [ 804546, 804556 ] ), rec(
fp:= [ 6586, 57968 ],
level:= 5,
next:= [ 804552, 804544 ] ), rec(
fp:= [ 20108, 57235 ],
level:= 5,
next:= [ 804554, 804536 ] ) ] ), rec(
fp:= [ 1191 ],
next:= [ rec(
fp:= [ 43923, 46310 ],
level:= 5,
next:= [ 810968, 810976 ] ) ] ), rec(
fp:= [ 1569 ],
next:= [ rec(
desc:= [ 302009 ],
fp:= [ 42544, 62249 ],
next:= [ 819849, 819857 ] ) ] ), rec(
fp:= [ 1410, 1417, 1426, 1442, 1593 ],
next:= [ rec(
desc:= [ 302007, 111003, 211002 ],
fp:= [ 6, 412 ],
next:= [ 835194, 835184 ] ), rec(
desc:= [ 302007 ],
fp:= [ 18562, 55833 ],
next:= [ 835197, 835183 ] ), rec(
desc:= [ 302007, 313016, 109003, 112003, 302010, 213002, 217002,
304013, 218004 ],
fp:= [ 1, 11 ],
next:= [ 835188, 835196 ] ), rec(
desc:= [ 302007, 111003, 211002 ],
fp:= [ 6, 412 ],
next:= [ 835170, 835168 ] ), rec(
desc:= [ 302008, 108003, 208003 ],
fp:= [ 216, 414 ],
next:= [ 835174, 835190 ] ) ] ), rec(
fp:= [ 1406 ],
next:= [ rec(
fp:= [ 22299, 69166 ],
level:= 5,
next:= [ 843794, 843799 ] ) ] ), rec(
fp:= [ 1137, 1358, 1406, 1467, 1569 ],
next:= [ rec(
desc:= [ 302006 ],
fp:= [ 582, 761 ],
next:= [ 852826, 852840 ] ), rec(
desc:= [ 302010 ],
fp:= [ 643, 74581 ],
next:= [ 852832, 852819 ] ), rec(
desc:= [ 302008 ],
fp:= [ 582, 761 ],
next:= [ 852845, 852838 ] ), rec(
desc:= [ 302009 ],
fp:= [ 8464, 42643, 59153 ],
next:= [ 852818, 852843, 852842 ] ), rec(
desc:= [ 302007 ],
fp:= [ 42544, 62249 ],
next:= [ 852847, 852829 ] ) ] ), rec(
fp:= [ 1461 ],
next:= [ rec(
fp:= [ 44544, 54525 ],
level:= 5,
next:= [ 862013, 862030 ] ) ] ), rec(
fp:= [ 1455, 1462, 1569 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 214, 412 ],
next:= [ 871295, 871288 ] ), rec(
desc:= [ 106003 ],
fp:= [ 214, 412 ],
next:= [ 871307, 871289 ] ), rec(
desc:= [ 106003 ],
fp:= [ 2, 12 ],
next:= [ 871297, 871315 ] ) ] ), rec(
fp:= [ 1417, 1488 ],
next:= [ rec(
fp:= [ 507, 40863 ],
level:= 5,
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 2, 12 ],
next:= [ 880554, 880530 ] ), rec(
desc:= [ 108003 ],
fp:= [ 4, 212 ],
next:= [ 880556, 880532 ] ) ] ), rec(
fp:= [ 3296, 37125 ],
level:= 5,
next:= [ 880533, 880555 ] ) ] ), rec(
fp:= [ 1424, 1432, 1546 ],
next:= [ rec(
desc:= [ 302011 ],
fp:= [ 7296, 90447 ],
next:= [ 889737, 889740 ] ), rec(
fp:= [ 3893, 37722 ],
level:= 5,
next:= [ 889746, 889724 ] ), rec(
fp:= [ 451, 5512 ],
level:= 5,
next:= [ 889733, 889751 ] ) ] ), rec(
fp:= [ 1150 ],
next:= [ rec(
desc:= [ 108003 ],
fp:= [ 6, 412 ],
next:= [ 898988, 898982 ] ) ] ), rec(
fp:= [ 1413, 1561 ],
next:= [ rec(
desc:= [ 302006 ],
fp:= [ 483, 58261 ],
next:= [ 908174, 908149 ] ), rec(
desc:= [ 302007 ],
fp:= [ 35934, 42643 ],
next:= [ 908175, 908157 ] ) ] ), rec(
fp:= [ 1385, 1432, 1491 ],
next:= [ rec(
fp:= [ 17946, 29359 ],
level:= 5,
next:= [ 917404, 917407 ] ), rec(
desc:= [ 107003 ],
fp:= [ 4, 212 ],
next:= [ 917414, 917395 ] ), rec(
desc:= [ 107003 ],
fp:= [ 6, 412 ],
next:= [ 917393, 917405 ] ) ] ), rec(
fp:= [ 1410, 1493, 1562 ],
next:= [ rec(
desc:= [ 108003 ],
fp:= [ 2, 12 ],
next:= [ 926655, 926645 ] ), rec(
desc:= [ 108003 ],
fp:= [ 4, 212 ],
next:= [ 926658, 926642 ] ), rec(
desc:= [ 107003 ],
fp:= [ 2, 12 ],
next:= [ 926656, 926650 ] ) ] ), rec(
fp:= [ 1419 ],
next:= [ rec(
fp:= [ 26659, 92763 ],
level:= 5,
next:= [ 935593, 935574 ] ) ] ), rec(
fp:= [ 1494 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 6, 412 ],
next:= [ 944766, 944789 ] ) ] ), rec(
fp:= [ 1402, 1510 ],
next:= [ rec(
desc:= [ 302008 ],
fp:= [ 18562, 55833 ],
next:= [ 953926, 953933 ] ), rec(
fp:= [ 24854, 65150 ],
level:= 5,
next:= [ 953927, 953939 ] ) ] ), rec(
fp:= [ 1453 ],
next:= [ rec(
desc:= [ 302007 ],
fp:= [ 36113, 62603 ],
next:= [ 963166, 963181 ] ) ] ), rec(
fp:= [ 1260, 1344, 1398, 1490, 1498, 1534, 1571 ],
next:= [ rec(
desc:= [ 109011 ],
fp:= [ 8, 18, 414 ],
next:= [ 972322, 972324, 972328 ] ), rec(
desc:= [ 104003 ],
fp:= [ 416, 614 ],
next:= [ 972323, 972320 ] ), rec(
desc:= [ 104003 ],
fp:= [ 214, 412 ],
next:= [ 972333, 972330 ] ), rec(
desc:= [ 104003 ],
fp:= [ 6, 412 ],
next:= [ 972336, 972316 ] ), rec(
desc:= [ 104003 ],
fp:= [ 6, 412 ],
next:= [ 972318, 972319 ] ), rec(
desc:= [ 302005 ],
fp:= [ 5825, 45914, 62249 ],
next:= [ 972337, 972334, 972339 ] ), rec(
desc:= [ 104003 ],
fp:= [ 2, 12 ],
next:= [ 972345, 972335 ] ) ] ), rec(
fp:= [ 1504, 1522, 1534 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 6, 412 ],
next:= [ 981490, 981498 ] ), rec(
desc:= [ 106003 ],
fp:= [ 214, 412 ],
next:= [ 981495, 981487 ] ), rec(
desc:= [ 105003 ],
fp:= [ 214, 412 ],
next:= [ 981474, 981497 ] ) ] ), rec(
fp:= [ 1244, 1291, 1410, 1417 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 416, 614 ],
next:= [ 990402, 990400 ] ), rec(
desc:= [ 106003 ],
fp:= [ 614, 812 ],
next:= [ 990393, 990407 ] ), rec(
desc:= [ 302009 ],
fp:= [ 80547, 97057 ],
next:= [ rec(
desc:= [ 209002 ],
fp:= [ 6, 412 ],
next:= [ 990403, 990418 ] ), 990414 ] ), rec(
desc:= [ 302007 ],
fp:= [ 18562, 39323, 55833 ],
next:= [ 990421, 990409, 990404 ] ) ] ), rec(
fp:= [ 1387, 1530 ],
next:= [ rec(
desc:= [ 105003 ],
fp:= [ 6, 412 ],
next:= [ 999523, 999520 ] ), rec(
desc:= [ 106003 ],
fp:= [ 214, 412 ],
next:= [ 999511, 999508 ] ) ] ), rec(
fp:= [ 1146 ],
next:= [ rec(
fp:= [ 2018, 57103 ],
level:= 5,
next:= [ 1007805, 1007792 ] ) ] ), rec(
fp:= [ 1153 ],
next:= [ rec(
fp:= [ 14920, 46701 ],
level:= 5,
next:= [ 1014708, 1014714 ] ) ] ), rec(
fp:= [ 1189, 1289 ],
next:= [ rec(
fp:= [ 59524, 85500 ],
level:= 5,
next:= [ 1022354, 1022348 ] ), rec(
fp:= [ 44464, 89040 ],
level:= 5,
next:= [ 1022333, 1022352 ] ) ] ), rec(
fp:= [ 1091, 1170, 1237, 1317 ],
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 224, 620 ],
next:= [ 1029624, 1029616 ] ), rec(
desc:= [ 107003 ],
fp:= [ 218, 614 ],
next:= [ 1029632, 1029640 ] ), rec(
fp:= [ 5622, 11408, 21384 ],
level:= 5,
next:= [ 1029629, 1029642, 1029636 ] ), rec(
desc:= [ 113011 ],
fp:= [ 8, 414 ],
next:= [ 1029641, 1029645 ] ) ] ), rec(
fp:= [ 1701 ],
next:= [ rec(
fp:= [ 10974, 74040 ],
level:= 5,
next:= [ 1034244, 1034250 ] ) ] ), rec(
fp:= [ 1773 ],
next:= [ rec(
desc:= [ 302007, 305015, 40205007 ],
fp:= [ 2, 5762 ],
next:= [ 1050815, 1050832 ] ) ] ), rec(
fp:= [ 2002, 2044 ],
next:= [ rec(
fp:= [ 20622, 96071 ],
level:= 5,
next:= [ 1070142, 1070152 ] ), rec(
fp:= [ 20274, 63250 ],
level:= 5,
next:= [ 1070164, 1070138 ] ) ] ) ] );
| true |
#############################################################################
##
#W id8.adb GAP library of id's PI:NAME:<NAME>END_PI
##
ID_GROUP_TREE.next[8].next[1].next[106]:=
rec(
fp:= [ 705, 4305, 6405, 7005, 7305, 7605, 7905, 8205, 8505, 8805, 9105,
9405, 9705, 10005, 10305, 13905, 16005, 16305, 16605, 17805, 19005, 19905,
20505, 20805, 22005, 22305, 24405, 25305, 25605, 27105, 27405, 28905, 29205,
29805, 30105, 30405, 30705, 31305, 31605, 32205, 32505, 32805, 33405, 33705,
34005, 34305, 34605, 35805, 36105, 36405, 36705, 37005, 37305, 37605, 37905,
38205, 39405, 39705, 40005, 40305, 40605, 41205, 41805, 42105, 42405, 42705,
43005, 43305, 43605, 44205, 44505, 44805, 45105, 45405, 45705, 46305, 46605,
46905, 47205, 47505, 47805, 48105, 48405, 48705, 49005, 49305, 49605, 49905,
50205, 50505, 50805, 51105, 51405, 51705, 52005, 52305, 52605, 52905, 53205,
54405, 55305 ],
next:= [ rec(
fp:= [ 3 ],
next:= [ rec(
desc:= [ 106003, 302004, 302006, 302008, 211003, 305011, 208005,
217005, 219005, 308017, 220008 ],
fp:= [ 4, 14 ],
next:= [ 58188, 58190 ] ) ] ), rec(
fp:= [ 461, 464 ],
next:= [ rec(
desc:= [ 306014, 40608009 ],
fp:= [ 3, 15561 ],
next:= [ 78137, 78139 ] ), rec(
desc:= [ 305012, 214005, 305015, 305017, 40610011 ],
fp:= [ 2, 5122 ],
next:= [ 78141, 78135 ] ) ] ), rec(
fp:= [ 878 ],
next:= [ rec(
desc:= [ 115003 ],
fp:= [ 2, 12 ],
next:= [ 88970, 88971 ] ) ] ), rec(
fp:= [ 167, 168, 1026 ],
next:= [ rec(
fp:= [ 51684, 89199 ],
level:= 5,
next:= [ 92950, 92955 ] ), rec(
desc:= [ 105003 ],
fp:= [ 818, 1214 ],
next:= [ 92951, 92953 ] ), rec(
desc:= [ 105003 ],
fp:= [ 422, 818 ],
next:= [ 92956, 92957 ] ) ] ), rec(
fp:= [ 171 ],
next:= [ rec(
desc:= [ 105003 ],
fp:= [ 8, 414 ],
next:= [ 96527, 96534 ] ) ] ), rec(
fp:= [ 169 ],
next:= [ rec(
desc:= [ 109003 ],
fp:= [ 214, 412 ],
next:= [ rec(
desc:= [ 302006, 302008, 302010, 302012, 214002, 306014, 219006 ],
fp:= [ 34, 826 ],
next:= [ 100166, 100171 ] ), 100169 ] ) ] ), rec(
fp:= [ 170, 171 ],
next:= [ rec(
desc:= [ 108003 ],
fp:= [ 16, 214 ],
next:= [ 103455, 103459 ] ), rec(
fp:= [ 27093, 84646 ],
level:= 5,
next:= [ 103461, rec(
desc:= [ 108003 ],
fp:= [ 216, 414 ],
next:= [ 103467, 103463 ] ) ] ) ] ), rec(
fp:= [ 1024, 1026 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 8, 414 ],
next:= [ 106907, 106908 ] ), rec(
desc:= [ 106003 ],
fp:= [ 8, 414 ],
next:= [ 106911, 106912 ] ) ] ), rec(
fp:= [ 167, 168, 173, 174, 176, 1123 ],
next:= [ rec(
desc:= [ 104003 ],
fp:= [ 818, 1214 ],
next:= [ 110950, 110957 ] ), rec(
desc:= [ 104003 ],
fp:= [ 422, 818 ],
next:= [ 110958, 110948 ] ), rec(
desc:= [ 105003 ],
fp:= [ 416, 614 ],
next:= [ 110959, 110953 ] ), rec(
desc:= [ 104003 ],
fp:= [ 8, 414 ],
next:= [ 110961, 110956 ] ), rec(
desc:= [ 104003 ],
fp:= [ 18, 414 ],
next:= [ 110960, 110952 ] ), rec(
desc:= [ 104003 ],
fp:= [ 18, 414 ],
next:= [ 110951, 110947 ] ) ] ), rec(
fp:= [ 168, 173, 174, 176 ],
next:= [ rec(
desc:= [ 110011 ],
fp:= [ 16, 26, 818, 1214 ],
next:= [ 115231, 115236, 115239, rec(
desc:= [ 302004 ],
fp:= [ 1264, 36860 ],
next:= [ 115238, 115229 ] ) ] ), rec(
desc:= [ 302006 ],
fp:= [ 1584, 69500 ],
next:= [ 115233, 115242 ] ), rec(
desc:= [ 105003 ],
fp:= [ 20, 218, 416 ],
next:= [ 115240, 115230, 115232 ] ), rec(
desc:= [ 302004 ],
fp:= [ 1462, 1721 ],
next:= [ 115241, 115237 ] ) ] ), rec(
fp:= [ 165, 171, 174, 175 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 6, 214, 412 ],
next:= [ 119395, 119399, 119391 ] ), rec(
desc:= [ 106003 ],
fp:= [ 614, 812 ],
next:= [ rec(
desc:= [ 302006 ],
fp:= [ 1363, 46760 ],
next:= [ 119401, 119397 ] ), 119393 ] ), rec(
desc:= [ 106003 ],
fp:= [ 416, 812 ],
next:= [ 119390, 119394 ] ), rec(
desc:= [ 302008 ],
fp:= [ 1584, 69500 ],
next:= [ 119392, 119388 ] ) ] ), rec(
fp:= [ 165, 171, 172, 173, 174, 175 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 8, 612 ],
next:= [ 123510, 123518 ] ), rec(
desc:= [ 105003 ],
fp:= [ 616, 814 ],
next:= [ 123522, 123512 ] ), rec(
desc:= [ 105003 ],
fp:= [ 814, 1012 ],
next:= [ 123514, 123520 ] ), rec(
desc:= [ 302006, 110003, 210002 ],
fp:= [ 18, 216 ],
next:= [ 123521, 123517 ] ), rec(
desc:= [ 106003 ],
fp:= [ 616, 814 ],
next:= [ 123513, 123523 ] ), rec(
desc:= [ 106003 ],
fp:= [ 814, 1012 ],
next:= [ 123519, rec(
desc:= [ 109003, 302005, 302007, 212002 ],
fp:= [ 214, 412 ],
next:= [ 123515, 123511 ] ) ] ) ] ), rec(
fp:= [ 165, 171, 172, 175, 177 ],
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 1214, 1412 ],
next:= [ 127546, rec(
desc:= [ 302007 ],
fp:= [ 1287, 39800 ],
next:= [ 127552, 127554 ] ) ] ), rec(
desc:= [ 105003 ],
fp:= [ 814, 1012 ],
next:= [ 127548, 127558 ] ), rec(
desc:= [ 105003 ],
fp:= [ 12, 1012 ],
next:= [ 127550, 127556 ] ), rec(
desc:= [ 108003 ],
fp:= [ 814, 1012 ],
next:= [ rec(
desc:= [ 302005, 302007, 210002, 302011, 213002, 304011, 210004,
304015, 212004, 40308012 ],
fp:= [ 3, 7881 ],
next:= [ 127551, 127547 ] ), rec(
desc:= [ 302008 ],
fp:= [ 1485, 59600 ],
next:= [ rec(
desc:= [ 107003, 302006, 208002, 302009, 40306010 ],
fp:= [ 4, 7981 ],
next:= [ 127553, 127557 ] ), 127555 ] ) ] ), rec(
desc:= [ 106003 ],
fp:= [ 814, 1012 ],
next:= [ 127549, 127559 ] ) ] ), rec(
fp:= [ 170, 171, 172, 1021 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 216, 414, 612 ],
next:= [ 131612, 131609, 131613 ] ), rec(
desc:= [ 302007 ],
fp:= [ 1165, 26960 ],
next:= [ rec(
desc:= [ 209002 ],
fp:= [ 18, 414 ],
next:= [ 131620, 131615 ] ), rec(
desc:= [ 109003 ],
fp:= [ 416, 614 ],
next:= [ 131611, 131621 ] ) ] ), rec(
desc:= [ 107003 ],
fp:= [ 10, 812 ],
next:= [ 131614, 131617 ] ), rec(
desc:= [ 107003, 109003, 302006, 208002, 302009, 213002 ],
fp:= [ 16, 214 ],
next:= [ 131610, 131616 ] ) ] ), rec(
fp:= [ 180 ],
next:= [ rec(
desc:= [ 108005 ],
fp:= [ 16, 26 ],
next:= [ 135166, 135164 ] ) ] ), rec(
fp:= [ 1632 ],
next:= [ rec(
fp:= [ 43996, 88267 ],
level:= 5,
next:= [ 170857, 170858 ] ) ] ), rec(
fp:= [ 598, 608 ],
next:= [ rec(
fp:= [ 9441, 35945 ],
level:= 5,
next:= [ 192105, 192101 ] ), rec(
fp:= [ 58281, 87850 ],
level:= 5,
next:= [ 192091, 192095 ] ) ] ), rec(
fp:= [ 655 ],
next:= [ rec(
fp:= [ 13118, 18767 ],
level:= 5,
next:= [ 195680, 195684 ] ) ] ), rec(
fp:= [ 1627 ],
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 16, 412 ],
next:= [ 198257, 198261 ] ) ] ), rec(
fp:= [ 535 ],
next:= [ rec(
fp:= [ 11314, 49574 ],
level:= 5,
next:= [ 212255, 212258 ] ) ] ), rec(
fp:= [ 653, 818 ],
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 213, 411 ],
next:= [ 227611, 227605 ] ), rec(
desc:= [ 107003 ],
fp:= [ 215, 413 ],
next:= [ 227607, 227601 ] ) ] ), rec(
fp:= [ 611 ],
next:= [ rec(
fp:= [ 25988, 89451 ],
level:= 5,
next:= [ 240559, 240558 ] ) ] ), rec(
fp:= [ 658 ],
next:= [ rec(
fp:= [ 26908, 74619 ],
level:= 5,
next:= [ 249535, 249532 ] ) ] ), rec(
fp:= [ 666, 723 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 4, 14 ],
next:= [ 253441, 253449 ] ), rec(
fp:= [ 15475, 77244 ],
level:= 5,
next:= [ 253443, 253446 ] ) ] ), rec(
fp:= [ 665 ],
next:= [ rec(
desc:= [ 302009 ],
fp:= [ 54682, 80517 ],
next:= [ 267757, 267755 ] ) ] ), rec(
fp:= [ 681 ],
next:= [ rec(
desc:= [ 302015, 106003, 110003, 302006, 302008, 212002, 302013,
216002 ],
fp:= [ 2, 111 ],
next:= [ 271292, 271290 ] ) ] ), rec(
fp:= [ 637 ],
next:= [ rec(
fp:= [ 74159, 85553 ],
level:= 5,
next:= [ 297984, 297983 ] ) ] ), rec(
fp:= [ 653, 833 ],
next:= [ rec(
desc:= [ 117011 ],
fp:= [ 416, 812 ],
next:= [ 311202, 311199 ] ), rec(
desc:= [ 302006 ],
fp:= [ 841, 58261 ],
next:= [ 311205, 311200 ] ) ] ), rec(
fp:= [ 612 ],
next:= [ rec(
desc:= [ 114003 ],
fp:= [ 14, 212 ],
next:= [ 315435, 315437 ] ) ] ), rec(
fp:= [ 1001 ],
next:= [ rec(
desc:= [ 105003 ],
fp:= [ 1626, 2418 ],
next:= [ 328915, 328913 ] ) ] ), rec(
fp:= [ 1033, 1054, 1066, 1092 ],
next:= [ rec(
desc:= [ 302008, 312016, 111003, 302012, 213002, 305013, 218005 ],
fp:= [ 1, 11 ],
next:= [ 333149, 333133 ] ), rec(
fp:= [ 8079, 87949 ],
level:= 5,
next:= [ 333128, rec(
desc:= [ 302007, 302011, 212003, 40108012 ],
fp:= [ 1, 1921 ],
next:= [ 333153, 333137 ] ) ] ), rec(
desc:= [ 302008 ],
fp:= [ 26741, 32823 ],
next:= [ 333152, 333140 ] ), rec(
fp:= [ 24610, 85096 ],
level:= 5,
next:= [ 333127, 333134 ] ) ] ), rec(
fp:= [ 1091, 1128, 1181 ],
next:= [ rec(
fp:= [ 22125, 62259 ],
level:= 5,
next:= [ 361309, 361329 ] ), rec(
desc:= [ 302008, 302015, 116003, 216003 ],
fp:= [ 4, 212 ],
next:= [ 361304, 361302 ] ), rec(
fp:= [ 17016, 40041 ],
level:= 5,
next:= [ 361311, 361327 ] ) ] ), rec(
fp:= [ 1071, 1151, 1178 ],
next:= [ rec(
fp:= [ 53702, 84387 ],
level:= 5,
next:= [ rec(
desc:= [ 108003 ],
fp:= [ 10, 812 ],
next:= [ 367227, 367229 ] ), 367223 ] ), rec(
desc:= [ 109003 ],
fp:= [ 814, 1012 ],
next:= [ 367225, 367221 ] ), rec(
desc:= [ 108003 ],
fp:= [ 618, 816 ],
next:= [ 367214, 367210 ] ) ] ), rec(
fp:= [ 1408, 1455 ],
next:= [ rec(
fp:= [ 8961, 53352 ],
level:= 5,
next:= [ 379111, 379113 ] ), rec(
desc:= [ 302008 ],
fp:= [ 384, 48361 ],
next:= [ 379127, 379137 ] ) ] ), rec(
fp:= [ 1137 ],
next:= [ rec(
fp:= [ 48706, 62721 ],
level:= 5,
next:= [ 387500, 387496 ] ) ] ), rec(
fp:= [ 1493 ],
next:= [ rec(
fp:= [ 10986, 61635 ],
level:= 5,
next:= [ 394019, 394021 ] ) ] ), rec(
fp:= [ 1175, 1181, 1205, 1426 ],
next:= [ rec(
fp:= [ 34423, 60927, 88921 ],
level:= 5,
next:= [ 399792, 399790, rec(
desc:= [ 108003 ],
fp:= [ 20, 218 ],
next:= [ 399768, 399780 ] ) ] ), rec(
fp:= [ 39775, 41475 ],
level:= 5,
next:= [ 399784, 399774 ] ), rec(
fp:= [ 8146, 12753 ],
level:= 5,
next:= [ 399772, 399779 ] ), rec(
fp:= [ 14751, 64021 ],
level:= 5,
next:= [ 399765, 399789 ] ) ] ), rec(
fp:= [ 1188, 1286, 1380, 1405 ],
next:= [ rec(
fp:= [ 75189, 84754 ],
level:= 5,
next:= [ 415515, 415526 ] ), rec(
fp:= [ 79515, 98396 ],
level:= 5,
next:= [ 415516, 415539 ] ), rec(
fp:= [ 28773, 47654 ],
level:= 5,
next:= [ 415535, 415543 ] ), rec(
desc:= [ 302009 ],
fp:= [ 285, 38461 ],
next:= [ 415517, 415521 ] ) ] ), rec(
fp:= [ 1200, 1477 ],
next:= [ rec(
desc:= [ 302009 ],
fp:= [ 28462, 28641 ],
next:= [ 424436, 424448 ] ), rec(
fp:= [ 1723, 44564 ],
level:= 5,
next:= [ 424453, rec(
desc:= [ 302006 ],
fp:= [ 28641, 49223 ],
next:= [ 424461, 424441 ] ) ] ) ] ), rec(
fp:= [ 1037, 1245 ],
next:= [ rec(
desc:= [ 111011 ],
fp:= [ 8, 18 ],
next:= [ 440058, 440054 ] ), rec(
desc:= [ 106003 ],
fp:= [ 814, 1012 ],
next:= [ 440069, 440055 ] ) ] ), rec(
fp:= [ 1362 ],
next:= [ rec(
fp:= [ 21553, 45381 ],
level:= 5,
next:= [ 446839, 446831 ] ) ] ), rec(
fp:= [ 1056, 1352 ],
next:= [ rec(
desc:= [ 108003 ],
fp:= [ 816, 1212 ],
next:= [ 453307, 453315 ] ), rec(
desc:= [ 108003 ],
fp:= [ 16, 412 ],
next:= [ 453321, 453325 ] ) ] ), rec(
fp:= [ 1420, 1485 ],
next:= [ rec(
desc:= [ 302010 ],
fp:= [ 44881, 54682 ],
next:= [ 469721, 469725 ] ), rec(
desc:= [ 302008 ],
fp:= [ 28561, 38362 ],
next:= [ 469733, 469717 ] ) ] ), rec(
fp:= [ 1196, 1211 ],
next:= [ rec(
desc:= [ 108003 ],
fp:= [ 16, 214 ],
next:= [ 478416, 478412 ] ), rec(
fp:= [ 29058, 38977 ],
level:= 5,
next:= [ 478422, 478423 ] ) ] ), rec(
fp:= [ 1192, 1362 ],
next:= [ rec(
fp:= [ 35126, 97551 ],
level:= 5,
next:= [ 487626, 487619 ] ), rec(
fp:= [ 17745, 46351 ],
level:= 5,
next:= [ 487615, 487638 ] ) ] ), rec(
fp:= [ 1210, 1381, 1472 ],
next:= [ rec(
desc:= [ 302008 ],
fp:= [ 384, 48361 ],
next:= [ 496844, 496848 ] ), rec(
fp:= [ 26525, 49219 ],
level:= 5,
next:= [ 496867, 496859 ] ), rec(
desc:= [ 108003 ],
fp:= [ 8, 612 ],
next:= [ 496861, 496845 ] ) ] ), rec(
fp:= [ 1263, 1336, 1469, 1509 ],
next:= [ rec(
desc:= [ 302009 ],
fp:= [ 39323, 55833 ],
next:= [ 505624, 505604 ] ), rec(
desc:= [ 302009, 111003, 114003, 211002, 302012, 216002, 216003,
304011, 217004, 304018, 40509010 ],
fp:= [ 1, 1921 ],
next:= [ 505620, 505628 ] ), rec(
desc:= [ 302007, 303010, 306016, 40406007 ],
fp:= [ 1, 641 ],
next:= [ 505609, 505601 ] ), rec(
desc:= [ 302007 ],
fp:= [ 285, 38461 ],
next:= [ 505613, 505617 ] ) ] ), rec(
fp:= [ 1183, 1531 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 18, 216 ],
next:= [ 537656, 537660 ] ), rec(
desc:= [ 105003 ],
fp:= [ 218, 416 ],
next:= [ 537657, 537668 ] ) ] ), rec(
fp:= [ 1138, 1177, 1405 ],
next:= [ rec(
fp:= [ 3075, 76803 ],
level:= 5,
next:= [ 544858, 544835 ] ), rec(
desc:= [ 108003 ],
fp:= [ 420, 816 ],
next:= [ 544845, 544833 ] ), rec(
desc:= [ 108003 ],
fp:= [ 20, 218, 416 ],
next:= [ 544837, 544851, 544841 ] ) ] ), rec(
fp:= [ 1204 ],
next:= [ rec(
fp:= [ 16050, 39958 ],
level:= 5,
next:= [ 553905, 553890 ] ) ] ), rec(
fp:= [ 1290, 1326, 1448 ],
next:= [ rec(
desc:= [ 113011 ],
fp:= [ 8, 414 ],
next:= [ 562756, 562736 ] ), rec(
desc:= [ 106003 ],
fp:= [ 1216, 1414 ],
next:= [ 562763, 562759 ] ), rec(
desc:= [ 302006 ],
fp:= [ 28462, 38263 ],
next:= [ 562747, 562765 ] ) ] ), rec(
fp:= [ 1074, 1106, 1212, 1513 ],
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 816, 1212 ],
next:= [ 571704, 571690 ] ), rec(
desc:= [ 114011 ],
fp:= [ 24, 2014 ],
next:= [ 571712, 571706 ] ), rec(
desc:= [ 106003 ],
fp:= [ 12, 814 ],
next:= [ 571687, 571709 ] ), rec(
desc:= [ 107003 ],
fp:= [ 814, 1012 ],
next:= [ 571697, 571703 ] ) ] ), rec(
fp:= [ 1105, 1281, 1318, 1409 ],
next:= [ rec(
desc:= [ 302008 ],
fp:= [ 883, 80517 ],
next:= [ 580916, 580908 ] ), rec(
desc:= [ 302005 ],
fp:= [ 28363, 55833 ],
next:= [ 580917, 580905 ] ), rec(
fp:= [ 41049, 46411 ],
level:= 5,
next:= [ 580902, 580913 ] ), rec(
desc:= [ 302005 ],
fp:= [ 28561, 38541 ],
next:= [ 580909, 580897 ] ) ] ), rec(
fp:= [ 1097, 1326 ],
next:= [ rec(
desc:= [ 111011 ],
fp:= [ 24, 2014 ],
next:= [ 590016, 590002 ] ), rec(
fp:= [ 41982, 79877 ],
level:= 5,
next:= [ 590010, 590003 ] ) ] ), rec(
fp:= [ 1172 ],
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 20, 416 ],
next:= [ 598566, 598573 ] ) ] ), rec(
fp:= [ 1161, 1274, 1453 ],
next:= [ rec(
fp:= [ 1315, 14908 ],
level:= 5,
next:= [ 605158, 605168 ] ), rec(
fp:= [ 37649, 59310 ],
level:= 5,
next:= [ 605160, rec(
desc:= [ 108003 ],
fp:= [ 20, 218 ],
next:= [ 605169, 605156 ] ) ] ), rec(
desc:= [ 107003 ],
fp:= [ 420, 618 ],
next:= [ 605153, 605157 ] ) ] ), rec(
fp:= [ 1287, 1408 ],
next:= [ rec(
fp:= [ 2726, 51886 ],
level:= 5,
next:= [ 634802, 634818 ] ), rec(
fp:= [ 23946, 83251, 89778 ],
level:= 5,
next:= [ rec(
desc:= [ 302009 ],
fp:= [ 38263, 49223 ],
next:= [ 634807, 634822 ] ), 634806, 634829 ] ) ] ), rec(
fp:= [ 1289 ],
next:= [ rec(
fp:= [ 3193, 11826 ],
level:= 5,
next:= [ 643786, 643808 ] ) ] ), rec(
fp:= [ 1170, 1262, 1490 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 418, 814 ],
next:= [ 652514, 652512 ] ), rec(
desc:= [ 302007 ],
fp:= [ 8761, 18562 ],
next:= [ 652520, 652525 ] ), rec(
desc:= [ 105003 ],
fp:= [ 416, 812 ],
next:= [ 652516, 652532 ] ) ] ), rec(
fp:= [ 1192, 1485 ],
next:= [ rec(
fp:= [ 27417, 74284 ],
level:= 5,
next:= [ 661243, 661221 ] ), rec(
fp:= [ 7640, 74527 ],
level:= 5,
next:= [ 661230, 661241 ] ) ] ), rec(
fp:= [ 1248, 1471, 1485 ],
next:= [ rec(
desc:= [ 302009 ],
fp:= [ 44881, 54682, 55021 ],
next:= [ 670267, 670272, 670277 ] ), rec(
desc:= [ 302009 ],
fp:= [ 34981, 44782 ],
next:= [ 670292, 670283 ] ), rec(
desc:= [ 302009, 209002 ],
fp:= [ 416, 614 ],
next:= [ 670279, 670293 ] ) ] ), rec(
fp:= [ 1181, 1450 ],
next:= [ rec(
fp:= [ 88168, 99402 ],
level:= 5,
next:= [ 687806, 687790 ] ), rec(
fp:= [ 3087, 72803 ],
level:= 5,
next:= [ 687801, 687788 ] ) ] ), rec(
fp:= [ 1157, 1400, 1403 ],
next:= [ rec(
desc:= [ 302008 ],
fp:= [ 48441, 66341 ],
next:= [ 706139, 706140 ] ), rec(
desc:= [ 302008 ],
fp:= [ 582, 761 ],
next:= [ 706149, 706136 ] ), rec(
desc:= [ 108003 ],
fp:= [ 14, 212 ],
next:= [ 706153, 706160 ] ) ] ), rec(
fp:= [ 1199 ],
next:= [ rec(
fp:= [ 3193, 75630 ],
level:= 5,
next:= [ 715323, 715328 ] ) ] ), rec(
fp:= [ 1213, 1265 ],
next:= [ rec(
desc:= [ 302007 ],
fp:= [ 48521, 66421 ],
next:= [ 724625, 724621 ] ), rec(
desc:= [ 111011 ],
fp:= [ 8, 414 ],
next:= [ 724620, 724613 ] ) ] ), rec(
fp:= [ 1251, 1292 ],
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 618, 816 ],
next:= [ 733645, 733636 ] ), rec(
fp:= [ 35845, 47258 ],
level:= 5,
next:= [ 733658, 733647 ] ) ] ), rec(
fp:= [ 1432 ],
next:= [ rec(
desc:= [ 108003 ],
fp:= [ 414, 612 ],
next:= [ 742916, 742900 ] ) ] ), rec(
fp:= [ 1220, 1248 ],
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 814, 1012 ],
next:= [ 751908, 751901 ] ), rec(
fp:= [ 35845, 47258 ],
level:= 5,
next:= [ 751909, 751911 ] ) ] ), rec(
fp:= [ 1263, 1488, 1535 ],
next:= [ rec(
desc:= [ 113011 ],
fp:= [ 8, 414 ],
next:= [ 761195, 761203 ] ), rec(
desc:= [ 302006 ],
fp:= [ 38461, 48262 ],
next:= [ 761200, 761205 ] ), rec(
desc:= [ 302006 ],
fp:= [ 285, 38461 ],
next:= [ 761187, 761208 ] ) ] ), rec(
fp:= [ 1237, 1241, 1320, 1495, 1506, 1520, 1537 ],
next:= [ rec(
desc:= [ 302006 ],
fp:= [ 38442, 39323 ],
next:= [ 778685, rec(
desc:= [ 208003 ],
fp:= [ 814, 1012 ],
next:= [ 778691, 778692 ] ) ] ), rec(
desc:= [ 302006 ],
fp:= [ 38442, 39323 ],
next:= [ 778697, 778700 ] ), rec(
desc:= [ 302005 ],
fp:= [ 18661, 28462 ],
next:= [ 778693, 778703 ] ), rec(
desc:= [ 302005 ],
fp:= [ 384, 48361 ],
next:= [ 778707, 778696 ] ), rec(
desc:= [ 302008 ],
fp:= [ 77227, 88822 ],
next:= [ 778683, rec(
desc:= [ 207002 ],
fp:= [ 218, 416 ],
next:= [ 778704, 778713 ] ) ] ), rec(
desc:= [ 302008 ],
fp:= [ 77227, 88822, 89161 ],
next:= [ 778712, 778701, 778705 ] ), rec(
desc:= [ 302007 ],
fp:= [ 34981, 44782 ],
next:= [ 778687, 778709 ] ) ] ), rec(
fp:= [ 1201, 1448, 1495 ],
next:= [ rec(
desc:= [ 105003 ],
fp:= [ 222, 618 ],
next:= [ 787763, 787766 ] ), rec(
desc:= [ 105003 ],
fp:= [ 218, 614 ],
next:= [ 787743, 787765 ] ), rec(
desc:= [ 302007 ],
fp:= [ 77227, 93737 ],
next:= [ 787767, 787769 ] ) ] ), rec(
fp:= [ 1203, 1208, 1414, 1485 ],
next:= [ rec(
fp:= [ 3193, 11826 ],
level:= 5,
next:= [ 796624, 796608 ] ), rec(
fp:= [ 3193, 11826 ],
level:= 5,
next:= [ 796614, 796630 ] ), rec(
desc:= [ 107003 ],
fp:= [ 216, 414 ],
next:= [ 796628, 796625 ] ), rec(
fp:= [ 27962, 64478 ],
level:= 5,
next:= [ 796635, 796611 ] ) ] ), rec(
fp:= [ 1022, 1032, 1127 ],
next:= [ rec(
desc:= [ 108003 ],
fp:= [ 620, 1016 ],
next:= [ 804546, 804556 ] ), rec(
fp:= [ 6586, 57968 ],
level:= 5,
next:= [ 804552, 804544 ] ), rec(
fp:= [ 20108, 57235 ],
level:= 5,
next:= [ 804554, 804536 ] ) ] ), rec(
fp:= [ 1191 ],
next:= [ rec(
fp:= [ 43923, 46310 ],
level:= 5,
next:= [ 810968, 810976 ] ) ] ), rec(
fp:= [ 1569 ],
next:= [ rec(
desc:= [ 302009 ],
fp:= [ 42544, 62249 ],
next:= [ 819849, 819857 ] ) ] ), rec(
fp:= [ 1410, 1417, 1426, 1442, 1593 ],
next:= [ rec(
desc:= [ 302007, 111003, 211002 ],
fp:= [ 6, 412 ],
next:= [ 835194, 835184 ] ), rec(
desc:= [ 302007 ],
fp:= [ 18562, 55833 ],
next:= [ 835197, 835183 ] ), rec(
desc:= [ 302007, 313016, 109003, 112003, 302010, 213002, 217002,
304013, 218004 ],
fp:= [ 1, 11 ],
next:= [ 835188, 835196 ] ), rec(
desc:= [ 302007, 111003, 211002 ],
fp:= [ 6, 412 ],
next:= [ 835170, 835168 ] ), rec(
desc:= [ 302008, 108003, 208003 ],
fp:= [ 216, 414 ],
next:= [ 835174, 835190 ] ) ] ), rec(
fp:= [ 1406 ],
next:= [ rec(
fp:= [ 22299, 69166 ],
level:= 5,
next:= [ 843794, 843799 ] ) ] ), rec(
fp:= [ 1137, 1358, 1406, 1467, 1569 ],
next:= [ rec(
desc:= [ 302006 ],
fp:= [ 582, 761 ],
next:= [ 852826, 852840 ] ), rec(
desc:= [ 302010 ],
fp:= [ 643, 74581 ],
next:= [ 852832, 852819 ] ), rec(
desc:= [ 302008 ],
fp:= [ 582, 761 ],
next:= [ 852845, 852838 ] ), rec(
desc:= [ 302009 ],
fp:= [ 8464, 42643, 59153 ],
next:= [ 852818, 852843, 852842 ] ), rec(
desc:= [ 302007 ],
fp:= [ 42544, 62249 ],
next:= [ 852847, 852829 ] ) ] ), rec(
fp:= [ 1461 ],
next:= [ rec(
fp:= [ 44544, 54525 ],
level:= 5,
next:= [ 862013, 862030 ] ) ] ), rec(
fp:= [ 1455, 1462, 1569 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 214, 412 ],
next:= [ 871295, 871288 ] ), rec(
desc:= [ 106003 ],
fp:= [ 214, 412 ],
next:= [ 871307, 871289 ] ), rec(
desc:= [ 106003 ],
fp:= [ 2, 12 ],
next:= [ 871297, 871315 ] ) ] ), rec(
fp:= [ 1417, 1488 ],
next:= [ rec(
fp:= [ 507, 40863 ],
level:= 5,
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 2, 12 ],
next:= [ 880554, 880530 ] ), rec(
desc:= [ 108003 ],
fp:= [ 4, 212 ],
next:= [ 880556, 880532 ] ) ] ), rec(
fp:= [ 3296, 37125 ],
level:= 5,
next:= [ 880533, 880555 ] ) ] ), rec(
fp:= [ 1424, 1432, 1546 ],
next:= [ rec(
desc:= [ 302011 ],
fp:= [ 7296, 90447 ],
next:= [ 889737, 889740 ] ), rec(
fp:= [ 3893, 37722 ],
level:= 5,
next:= [ 889746, 889724 ] ), rec(
fp:= [ 451, 5512 ],
level:= 5,
next:= [ 889733, 889751 ] ) ] ), rec(
fp:= [ 1150 ],
next:= [ rec(
desc:= [ 108003 ],
fp:= [ 6, 412 ],
next:= [ 898988, 898982 ] ) ] ), rec(
fp:= [ 1413, 1561 ],
next:= [ rec(
desc:= [ 302006 ],
fp:= [ 483, 58261 ],
next:= [ 908174, 908149 ] ), rec(
desc:= [ 302007 ],
fp:= [ 35934, 42643 ],
next:= [ 908175, 908157 ] ) ] ), rec(
fp:= [ 1385, 1432, 1491 ],
next:= [ rec(
fp:= [ 17946, 29359 ],
level:= 5,
next:= [ 917404, 917407 ] ), rec(
desc:= [ 107003 ],
fp:= [ 4, 212 ],
next:= [ 917414, 917395 ] ), rec(
desc:= [ 107003 ],
fp:= [ 6, 412 ],
next:= [ 917393, 917405 ] ) ] ), rec(
fp:= [ 1410, 1493, 1562 ],
next:= [ rec(
desc:= [ 108003 ],
fp:= [ 2, 12 ],
next:= [ 926655, 926645 ] ), rec(
desc:= [ 108003 ],
fp:= [ 4, 212 ],
next:= [ 926658, 926642 ] ), rec(
desc:= [ 107003 ],
fp:= [ 2, 12 ],
next:= [ 926656, 926650 ] ) ] ), rec(
fp:= [ 1419 ],
next:= [ rec(
fp:= [ 26659, 92763 ],
level:= 5,
next:= [ 935593, 935574 ] ) ] ), rec(
fp:= [ 1494 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 6, 412 ],
next:= [ 944766, 944789 ] ) ] ), rec(
fp:= [ 1402, 1510 ],
next:= [ rec(
desc:= [ 302008 ],
fp:= [ 18562, 55833 ],
next:= [ 953926, 953933 ] ), rec(
fp:= [ 24854, 65150 ],
level:= 5,
next:= [ 953927, 953939 ] ) ] ), rec(
fp:= [ 1453 ],
next:= [ rec(
desc:= [ 302007 ],
fp:= [ 36113, 62603 ],
next:= [ 963166, 963181 ] ) ] ), rec(
fp:= [ 1260, 1344, 1398, 1490, 1498, 1534, 1571 ],
next:= [ rec(
desc:= [ 109011 ],
fp:= [ 8, 18, 414 ],
next:= [ 972322, 972324, 972328 ] ), rec(
desc:= [ 104003 ],
fp:= [ 416, 614 ],
next:= [ 972323, 972320 ] ), rec(
desc:= [ 104003 ],
fp:= [ 214, 412 ],
next:= [ 972333, 972330 ] ), rec(
desc:= [ 104003 ],
fp:= [ 6, 412 ],
next:= [ 972336, 972316 ] ), rec(
desc:= [ 104003 ],
fp:= [ 6, 412 ],
next:= [ 972318, 972319 ] ), rec(
desc:= [ 302005 ],
fp:= [ 5825, 45914, 62249 ],
next:= [ 972337, 972334, 972339 ] ), rec(
desc:= [ 104003 ],
fp:= [ 2, 12 ],
next:= [ 972345, 972335 ] ) ] ), rec(
fp:= [ 1504, 1522, 1534 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 6, 412 ],
next:= [ 981490, 981498 ] ), rec(
desc:= [ 106003 ],
fp:= [ 214, 412 ],
next:= [ 981495, 981487 ] ), rec(
desc:= [ 105003 ],
fp:= [ 214, 412 ],
next:= [ 981474, 981497 ] ) ] ), rec(
fp:= [ 1244, 1291, 1410, 1417 ],
next:= [ rec(
desc:= [ 106003 ],
fp:= [ 416, 614 ],
next:= [ 990402, 990400 ] ), rec(
desc:= [ 106003 ],
fp:= [ 614, 812 ],
next:= [ 990393, 990407 ] ), rec(
desc:= [ 302009 ],
fp:= [ 80547, 97057 ],
next:= [ rec(
desc:= [ 209002 ],
fp:= [ 6, 412 ],
next:= [ 990403, 990418 ] ), 990414 ] ), rec(
desc:= [ 302007 ],
fp:= [ 18562, 39323, 55833 ],
next:= [ 990421, 990409, 990404 ] ) ] ), rec(
fp:= [ 1387, 1530 ],
next:= [ rec(
desc:= [ 105003 ],
fp:= [ 6, 412 ],
next:= [ 999523, 999520 ] ), rec(
desc:= [ 106003 ],
fp:= [ 214, 412 ],
next:= [ 999511, 999508 ] ) ] ), rec(
fp:= [ 1146 ],
next:= [ rec(
fp:= [ 2018, 57103 ],
level:= 5,
next:= [ 1007805, 1007792 ] ) ] ), rec(
fp:= [ 1153 ],
next:= [ rec(
fp:= [ 14920, 46701 ],
level:= 5,
next:= [ 1014708, 1014714 ] ) ] ), rec(
fp:= [ 1189, 1289 ],
next:= [ rec(
fp:= [ 59524, 85500 ],
level:= 5,
next:= [ 1022354, 1022348 ] ), rec(
fp:= [ 44464, 89040 ],
level:= 5,
next:= [ 1022333, 1022352 ] ) ] ), rec(
fp:= [ 1091, 1170, 1237, 1317 ],
next:= [ rec(
desc:= [ 107003 ],
fp:= [ 224, 620 ],
next:= [ 1029624, 1029616 ] ), rec(
desc:= [ 107003 ],
fp:= [ 218, 614 ],
next:= [ 1029632, 1029640 ] ), rec(
fp:= [ 5622, 11408, 21384 ],
level:= 5,
next:= [ 1029629, 1029642, 1029636 ] ), rec(
desc:= [ 113011 ],
fp:= [ 8, 414 ],
next:= [ 1029641, 1029645 ] ) ] ), rec(
fp:= [ 1701 ],
next:= [ rec(
fp:= [ 10974, 74040 ],
level:= 5,
next:= [ 1034244, 1034250 ] ) ] ), rec(
fp:= [ 1773 ],
next:= [ rec(
desc:= [ 302007, 305015, 40205007 ],
fp:= [ 2, 5762 ],
next:= [ 1050815, 1050832 ] ) ] ), rec(
fp:= [ 2002, 2044 ],
next:= [ rec(
fp:= [ 20622, 96071 ],
level:= 5,
next:= [ 1070142, 1070152 ] ), rec(
fp:= [ 20274, 63250 ],
level:= 5,
next:= [ 1070164, 1070138 ] ) ] ) ] );
|
[
{
"context": " --\n-- * Richard Wai (ANNEXI-STRAYLINE) ",
"end": 1044,
"score": 0.9997677803039551,
"start": 1033,
"tag": "NAME",
"value": "Richard Wai"
}
] |
scheduling-report_unavailable_subsystems.adb
|
annexi-strayline/AURA
| 13 |
------------------------------------------------------------------------------
-- --
-- Ada User Repository Annex (AURA) --
-- ANNEXI-STRAYLINE Reference Implementation --
-- --
-- Command Line Interface --
-- --
-- ------------------------------------------------------------------------ --
-- --
-- Copyright (C) 2020, ANNEXI-STRAYLINE Trans-Human Ltd. --
-- All rights reserved. --
-- --
-- Original Contributors: --
-- * Richard Wai (ANNEXI-STRAYLINE) --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- --
-- * Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A --
-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with Registrar.Dependency_Maps;
separate (Scheduling)
procedure Report_Unavailable_Subsystems
(Unavailable_Subsystems: in Registrar.Subsystems.Subsystem_Sets.Set)
is
Verbose_Output: constant Boolean := Parameters.Output_Style = Verbose;
use type Unit_Names.Unit_Name;
package UBS renames Registrar.Subsystems.UBS;
procedure Dump_Dependency_Trace
(Target: Registrar.Subsystems.Subsystem)
is begin
-- First collect a map of all units
-- Iterate over Target's reverse dependencies, and scan the
-- dependencies of each unit of each dependent subsystem,
-- dumping the specfic unit withs of units in the target subsystem
Dependent_Subsystems_Iteration:
for Dep_Subsys_Name of
Registrar.Queries.Dependent_Subsystems (Target.Name)
loop
UI.Put_Empty_Tag;
Put_Line (" Subsystem "
& Dep_Subsys_Name.To_UTF8_String
& " has dependent units:");
declare
-- First collect a map with a key for each unit name that is a
-- member of the dependent subsystem, and then inserting all
-- reverse dependencies of each of those units that is a member
-- of the Target subsystem
use Registrar.Subsystems;
use Registrar.Library_Units;
Subsys_Units: constant Library_Unit_Sets.Set
:= Registrar.Queries.Subsystem_Library_Units
(Subsystem'(Name => Dep_Subsys_Name, others => <>));
Target_Rev_Deps: Registrar.Dependency_Maps.Map;
begin
-- For each unit of this subsystem, check for any reverse
-- dependencies that are members of Target. If we find that,
-- we output that information
for Unit of Subsys_Units loop
declare
Unit_Deps: constant Unit_Names.Sets.Set
:= Registrar.Queries.Unit_Dependencies (Unit.Name);
Target_Deps: Unit_Names.Sets.Set;
begin
for Name of Unit_Deps loop
if Name.Subsystem_Name = Target.Name then
Target_Deps.Insert (Name);
end if;
end loop;
if not Target_Deps.Is_Empty then
UI.Put_Empty_Tag;
Put_Line (" - "
& Unit.Name.To_UTF8_String
& " withs:");
for Target_Unit_Name of Target_Deps loop
UI.Put_Empty_Tag;
Put_Line (" -> "
& Target_Unit_Name.To_UTF8_String);
end loop;
end if;
end;
end loop;
end;
New_Line;
end loop Dependent_Subsystems_Iteration;
end Dump_Dependency_Trace;
begin
-- Note that this is always called following a failed Checkout_Cycle,
-- which has already alerted the user that subsystems could not be
-- checked-out
for Subsys of Unavailable_Subsystems loop
UI.Put_Fail_Tag;
Put_Line (' '
& Subsys.Name.To_UTF8_String
& ": "
& UBS.To_String (Subsys.Aquisition_Failure));
if Verbose_Output then
Dump_Dependency_Trace (Subsys);
end if;
end loop;
if not Verbose_Output then
UI.Put_Info_Tag;
Put_Line (" Use -v to see dependency details of missing subsystems.");
end if;
end Report_Unavailable_Subsystems;
|
13417
|
------------------------------------------------------------------------------
-- --
-- Ada User Repository Annex (AURA) --
-- ANNEXI-STRAYLINE Reference Implementation --
-- --
-- Command Line Interface --
-- --
-- ------------------------------------------------------------------------ --
-- --
-- Copyright (C) 2020, ANNEXI-STRAYLINE Trans-Human Ltd. --
-- All rights reserved. --
-- --
-- Original Contributors: --
-- * <NAME> (ANNEXI-STRAYLINE) --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- --
-- * Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A --
-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with Registrar.Dependency_Maps;
separate (Scheduling)
procedure Report_Unavailable_Subsystems
(Unavailable_Subsystems: in Registrar.Subsystems.Subsystem_Sets.Set)
is
Verbose_Output: constant Boolean := Parameters.Output_Style = Verbose;
use type Unit_Names.Unit_Name;
package UBS renames Registrar.Subsystems.UBS;
procedure Dump_Dependency_Trace
(Target: Registrar.Subsystems.Subsystem)
is begin
-- First collect a map of all units
-- Iterate over Target's reverse dependencies, and scan the
-- dependencies of each unit of each dependent subsystem,
-- dumping the specfic unit withs of units in the target subsystem
Dependent_Subsystems_Iteration:
for Dep_Subsys_Name of
Registrar.Queries.Dependent_Subsystems (Target.Name)
loop
UI.Put_Empty_Tag;
Put_Line (" Subsystem "
& Dep_Subsys_Name.To_UTF8_String
& " has dependent units:");
declare
-- First collect a map with a key for each unit name that is a
-- member of the dependent subsystem, and then inserting all
-- reverse dependencies of each of those units that is a member
-- of the Target subsystem
use Registrar.Subsystems;
use Registrar.Library_Units;
Subsys_Units: constant Library_Unit_Sets.Set
:= Registrar.Queries.Subsystem_Library_Units
(Subsystem'(Name => Dep_Subsys_Name, others => <>));
Target_Rev_Deps: Registrar.Dependency_Maps.Map;
begin
-- For each unit of this subsystem, check for any reverse
-- dependencies that are members of Target. If we find that,
-- we output that information
for Unit of Subsys_Units loop
declare
Unit_Deps: constant Unit_Names.Sets.Set
:= Registrar.Queries.Unit_Dependencies (Unit.Name);
Target_Deps: Unit_Names.Sets.Set;
begin
for Name of Unit_Deps loop
if Name.Subsystem_Name = Target.Name then
Target_Deps.Insert (Name);
end if;
end loop;
if not Target_Deps.Is_Empty then
UI.Put_Empty_Tag;
Put_Line (" - "
& Unit.Name.To_UTF8_String
& " withs:");
for Target_Unit_Name of Target_Deps loop
UI.Put_Empty_Tag;
Put_Line (" -> "
& Target_Unit_Name.To_UTF8_String);
end loop;
end if;
end;
end loop;
end;
New_Line;
end loop Dependent_Subsystems_Iteration;
end Dump_Dependency_Trace;
begin
-- Note that this is always called following a failed Checkout_Cycle,
-- which has already alerted the user that subsystems could not be
-- checked-out
for Subsys of Unavailable_Subsystems loop
UI.Put_Fail_Tag;
Put_Line (' '
& Subsys.Name.To_UTF8_String
& ": "
& UBS.To_String (Subsys.Aquisition_Failure));
if Verbose_Output then
Dump_Dependency_Trace (Subsys);
end if;
end loop;
if not Verbose_Output then
UI.Put_Info_Tag;
Put_Line (" Use -v to see dependency details of missing subsystems.");
end if;
end Report_Unavailable_Subsystems;
| true |
------------------------------------------------------------------------------
-- --
-- Ada User Repository Annex (AURA) --
-- ANNEXI-STRAYLINE Reference Implementation --
-- --
-- Command Line Interface --
-- --
-- ------------------------------------------------------------------------ --
-- --
-- Copyright (C) 2020, ANNEXI-STRAYLINE Trans-Human Ltd. --
-- All rights reserved. --
-- --
-- Original Contributors: --
-- * PI:NAME:<NAME>END_PI (ANNEXI-STRAYLINE) --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- --
-- * Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A --
-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with Registrar.Dependency_Maps;
separate (Scheduling)
procedure Report_Unavailable_Subsystems
(Unavailable_Subsystems: in Registrar.Subsystems.Subsystem_Sets.Set)
is
Verbose_Output: constant Boolean := Parameters.Output_Style = Verbose;
use type Unit_Names.Unit_Name;
package UBS renames Registrar.Subsystems.UBS;
procedure Dump_Dependency_Trace
(Target: Registrar.Subsystems.Subsystem)
is begin
-- First collect a map of all units
-- Iterate over Target's reverse dependencies, and scan the
-- dependencies of each unit of each dependent subsystem,
-- dumping the specfic unit withs of units in the target subsystem
Dependent_Subsystems_Iteration:
for Dep_Subsys_Name of
Registrar.Queries.Dependent_Subsystems (Target.Name)
loop
UI.Put_Empty_Tag;
Put_Line (" Subsystem "
& Dep_Subsys_Name.To_UTF8_String
& " has dependent units:");
declare
-- First collect a map with a key for each unit name that is a
-- member of the dependent subsystem, and then inserting all
-- reverse dependencies of each of those units that is a member
-- of the Target subsystem
use Registrar.Subsystems;
use Registrar.Library_Units;
Subsys_Units: constant Library_Unit_Sets.Set
:= Registrar.Queries.Subsystem_Library_Units
(Subsystem'(Name => Dep_Subsys_Name, others => <>));
Target_Rev_Deps: Registrar.Dependency_Maps.Map;
begin
-- For each unit of this subsystem, check for any reverse
-- dependencies that are members of Target. If we find that,
-- we output that information
for Unit of Subsys_Units loop
declare
Unit_Deps: constant Unit_Names.Sets.Set
:= Registrar.Queries.Unit_Dependencies (Unit.Name);
Target_Deps: Unit_Names.Sets.Set;
begin
for Name of Unit_Deps loop
if Name.Subsystem_Name = Target.Name then
Target_Deps.Insert (Name);
end if;
end loop;
if not Target_Deps.Is_Empty then
UI.Put_Empty_Tag;
Put_Line (" - "
& Unit.Name.To_UTF8_String
& " withs:");
for Target_Unit_Name of Target_Deps loop
UI.Put_Empty_Tag;
Put_Line (" -> "
& Target_Unit_Name.To_UTF8_String);
end loop;
end if;
end;
end loop;
end;
New_Line;
end loop Dependent_Subsystems_Iteration;
end Dump_Dependency_Trace;
begin
-- Note that this is always called following a failed Checkout_Cycle,
-- which has already alerted the user that subsystems could not be
-- checked-out
for Subsys of Unavailable_Subsystems loop
UI.Put_Fail_Tag;
Put_Line (' '
& Subsys.Name.To_UTF8_String
& ": "
& UBS.To_String (Subsys.Aquisition_Failure));
if Verbose_Output then
Dump_Dependency_Trace (Subsys);
end if;
end loop;
if not Verbose_Output then
UI.Put_Info_Tag;
Put_Line (" Use -v to see dependency details of missing subsystems.");
end if;
end Report_Unavailable_Subsystems;
|
[
{
"context": "nts\n-- Copyright (C) 2009, 2010, 2011, 2012, 2014 Stephane Carrez\n-- Written by Stephane Carrez (Stephane.Carrez@g",
"end": 185,
"score": 0.9998710751533508,
"start": 170,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "0, 2011, 2012, 2014 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under",
"end": 216,
"score": 0.9998865127563477,
"start": 201,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "4 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under the Apache License, Versio",
"end": 243,
"score": 0.9999272227287292,
"start": 218,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
src/asf-components-html-factory.adb
|
Letractively/ada-asf
| 0 |
-----------------------------------------------------------------------
-- html-factory -- Factory for HTML UI Components
-- Copyright (C) 2009, 2010, 2011, 2012, 2014 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with ASF.Components.Base;
with ASF.Components.Html.Text;
with ASF.Components.Html.Lists;
with ASF.Components.Html.Links;
with ASF.Components.Html.Panels;
with ASF.Components.Html.Forms;
with ASF.Components.Html.Pages;
with ASF.Components.Html.Selects;
with ASF.Components.Html.Messages;
with ASF.Views.Nodes;
package body ASF.Components.Html.Factory is
use ASF.Components.Base;
function Create_Body return UIComponent_Access;
function Create_Doctype return UIComponent_Access;
function Create_Head return UIComponent_Access;
function Create_Output return UIComponent_Access;
function Create_Output_Label return UIComponent_Access;
function Create_Output_Link return UIComponent_Access;
function Create_Output_Format return UIComponent_Access;
function Create_List return UIComponent_Access;
function Create_PanelGroup return UIComponent_Access;
function Create_Form return UIComponent_Access;
function Create_Input_File return UIComponent_Access;
function Create_Input_Hidden return UIComponent_Access;
function Create_Input_Text return UIComponent_Access;
function Create_Input_Textarea return UIComponent_Access;
function Create_Command return UIComponent_Access;
function Create_Message return UIComponent_Access;
function Create_Messages return UIComponent_Access;
function Create_SelectOne return UIComponent_Access;
function Create_SelectOneRadio return UIComponent_Access;
function Create_SelectBooleanCheckbox return UIComponent_Access;
-- Create an UIInput secret component
function Create_Input_Secret return ASF.Components.Base.UIComponent_Access;
-- ------------------------------
-- Create an UIBody component
-- ------------------------------
function Create_Body return UIComponent_Access is
begin
return new ASF.Components.Html.Pages.UIBody;
end Create_Body;
-- ------------------------------
-- Create an UIDoctype component
-- ------------------------------
function Create_Doctype return UIComponent_Access is
begin
return new ASF.Components.Html.Pages.UIDoctype;
end Create_Doctype;
-- ------------------------------
-- Create an UIHead component
-- ------------------------------
function Create_Head return UIComponent_Access is
begin
return new ASF.Components.Html.Pages.UIHead;
end Create_Head;
-- ------------------------------
-- Create an UIOutput component
-- ------------------------------
function Create_Output return UIComponent_Access is
begin
return new ASF.Components.Html.Text.UIOutput;
end Create_Output;
-- ------------------------------
-- Create an UIOutputLabel component
-- ------------------------------
function Create_Output_Label return UIComponent_Access is
begin
return new ASF.Components.Html.Text.UIOutputLabel;
end Create_Output_Label;
-- ------------------------------
-- Create an UIOutputLink component
-- ------------------------------
function Create_Output_Link return UIComponent_Access is
begin
return new ASF.Components.Html.Links.UIOutputLink;
end Create_Output_Link;
-- ------------------------------
-- Create an UIOutput component
-- ------------------------------
function Create_Output_Format return UIComponent_Access is
begin
return new ASF.Components.Html.Text.UIOutputFormat;
end Create_Output_Format;
-- ------------------------------
-- Create an UIList component
-- ------------------------------
function Create_List return UIComponent_Access is
begin
return new ASF.Components.Html.Lists.UIList;
end Create_List;
-- ------------------------------
-- Create an UIPanelGroup component
-- ------------------------------
function Create_PanelGroup return UIComponent_Access is
begin
return new ASF.Components.Html.Panels.UIPanelGroup;
end Create_PanelGroup;
-- ------------------------------
-- Create an UIForm component
-- ------------------------------
function Create_Form return UIComponent_Access is
begin
return new ASF.Components.Html.Forms.UIForm;
end Create_Form;
-- ------------------------------
-- Create an UIInput_Hidden component
-- ------------------------------
function Create_Input_Hidden return UIComponent_Access is
begin
return new ASF.Components.Html.Forms.UIInput_Hidden;
end Create_Input_Hidden;
-- ------------------------------
-- Create an UIInput component
-- ------------------------------
function Create_Input_Text return UIComponent_Access is
begin
return new ASF.Components.Html.Forms.UIInput;
end Create_Input_Text;
-- ------------------------------
-- Create an UIInput secret component
-- ------------------------------
function Create_Input_Secret return ASF.Components.Base.UIComponent_Access is
Result : constant Html.Forms.UIInput_Access := new ASF.Components.Html.Forms.UIInput;
begin
Result.Set_Secret (True);
return Result.all'Access;
end Create_Input_Secret;
-- ------------------------------
-- Create an UIInputTextarea component
-- ------------------------------
function Create_Input_Textarea return UIComponent_Access is
begin
return new ASF.Components.Html.Forms.UIInputTextarea;
end Create_Input_Textarea;
-- ------------------------------
-- Create an UIInput_File component
-- ------------------------------
function Create_Input_File return UIComponent_Access is
begin
return new ASF.Components.Html.Forms.UIInput_File;
end Create_Input_File;
-- ------------------------------
-- Create an UICommand component
-- ------------------------------
function Create_Command return UIComponent_Access is
begin
return new ASF.Components.Html.Forms.UICommand;
end Create_Command;
-- ------------------------------
-- Create an UIMessage component
-- ------------------------------
function Create_Message return UIComponent_Access is
begin
return new ASF.Components.Html.Messages.UIMessage;
end Create_Message;
-- ------------------------------
-- Create an UIMessages component
-- ------------------------------
function Create_Messages return UIComponent_Access is
begin
return new ASF.Components.Html.Messages.UIMessages;
end Create_Messages;
-- ------------------------------
-- Create an UISelectOne component
-- ------------------------------
function Create_SelectOne return UIComponent_Access is
begin
return new ASF.Components.Html.Selects.UISelectOne;
end Create_SelectOne;
-- ------------------------------
-- Create an UISelectOneRadio component
-- ------------------------------
function Create_SelectOneRadio return UIComponent_Access is
begin
return new ASF.Components.Html.Selects.UISelectOneRadio;
end Create_SelectOneRadio;
-- ------------------------------
-- Create an UISelectBoolean component
-- ------------------------------
function Create_SelectBooleanCheckbox return UIComponent_Access is
begin
return new ASF.Components.Html.Selects.UISelectBoolean;
end Create_SelectBooleanCheckbox;
use ASF.Views.Nodes;
URI : aliased constant String := "http://java.sun.com/jsf/html";
BODY_TAG : aliased constant String := "body";
COMMAND_BUTTON_TAG : aliased constant String := "commandButton";
DOCTYPE_TAG : aliased constant String := "doctype";
FORM_TAG : aliased constant String := "form";
HEAD_TAG : aliased constant String := "head";
INPUT_FILE_TAG : aliased constant String := "inputFile";
INPUT_HIDDEN_TAG : aliased constant String := "inputHidden";
INPUT_SECRET_TAG : aliased constant String := "inputSecret";
INPUT_TEXT_TAG : aliased constant String := "inputText";
INPUT_TEXTAREA_TAG : aliased constant String := "inputTextarea";
LIST_TAG : aliased constant String := "list";
MESSAGE_TAG : aliased constant String := "message";
MESSAGES_TAG : aliased constant String := "messages";
OUTPUT_FORMAT_TAG : aliased constant String := "outputFormat";
OUTPUT_LABEL_TAG : aliased constant String := "outputLabel";
OUTPUT_LINK_TAG : aliased constant String := "outputLink";
OUTPUT_TEXT_TAG : aliased constant String := "outputText";
PANEL_GROUP_TAG : aliased constant String := "panelGroup";
SELECT_BOOLEAN_TAG : aliased constant String := "selectBooleanCheckbox";
SELECT_ONE_MENU_TAG : aliased constant String := "selectOneMenu";
SELECT_ONE_RADIO_TAG : aliased constant String := "selectOneRadio";
Html_Bindings : aliased constant ASF.Factory.Binding_Array
:= (1 => (Name => BODY_TAG'Access,
Component => Create_Body'Access,
Tag => Create_Component_Node'Access),
2 => (Name => COMMAND_BUTTON_TAG'Access,
Component => Create_Command'Access,
Tag => Create_Component_Node'Access),
3 => (Name => DOCTYPE_TAG'Access,
Component => Create_Doctype'Access,
Tag => Create_Component_Node'Access),
4 => (Name => FORM_TAG'Access,
Component => Create_Form'Access,
Tag => Create_Component_Node'Access),
5 => (Name => HEAD_TAG'Access,
Component => Create_Head'Access,
Tag => Create_Component_Node'Access),
6 => (Name => INPUT_FILE_TAG'Access,
Component => Create_Input_File'Access,
Tag => Create_Component_Node'Access),
7 => (Name => INPUT_HIDDEN_TAG'Access,
Component => Create_Input_Hidden'Access,
Tag => Create_Component_Node'Access),
8 => (Name => INPUT_SECRET_TAG'Access,
Component => Create_Input_Secret'Access,
Tag => Create_Component_Node'Access),
9 => (Name => INPUT_TEXT_TAG'Access,
Component => Create_Input_Text'Access,
Tag => Create_Component_Node'Access),
10 => (Name => INPUT_TEXTAREA_TAG'Access,
Component => Create_Input_Textarea'Access,
Tag => Create_Component_Node'Access),
11 => (Name => LIST_TAG'Access,
Component => Create_List'Access,
Tag => Create_Component_Node'Access),
12 => (Name => MESSAGE_TAG'Access,
Component => Create_Message'Access,
Tag => Create_Component_Node'Access),
13 => (Name => MESSAGES_TAG'Access,
Component => Create_Messages'Access,
Tag => Create_Component_Node'Access),
14 => (Name => OUTPUT_FORMAT_TAG'Access,
Component => Create_Output_Format'Access,
Tag => Create_Component_Node'Access),
15 => (Name => OUTPUT_LABEL_TAG'Access,
Component => Create_Output_Label'Access,
Tag => Create_Component_Node'Access),
16 => (Name => OUTPUT_LINK_TAG'Access,
Component => Create_Output_Link'Access,
Tag => Create_Component_Node'Access),
17 => (Name => OUTPUT_TEXT_TAG'Access,
Component => Create_Output'Access,
Tag => Create_Component_Node'Access),
18 => (Name => PANEL_GROUP_TAG'Access,
Component => Create_PanelGroup'Access,
Tag => Create_Component_Node'Access),
19 => (Name => SELECT_BOOLEAN_TAG'Access,
Component => Create_SelectBooleanCheckbox'Access,
Tag => Create_Component_Node'Access),
20 => (Name => SELECT_ONE_MENU_TAG'Access,
Component => Create_SelectOne'Access,
Tag => Create_Component_Node'Access),
21 => (Name => SELECT_ONE_RADIO_TAG'Access,
Component => Create_SelectOneRadio'Access,
Tag => Create_Component_Node'Access)
);
Html_Factory : aliased constant ASF.Factory.Factory_Bindings
:= (URI => URI'Access, Bindings => Html_Bindings'Access);
-- ------------------------------
-- Get the HTML component factory.
-- ------------------------------
function Definition return ASF.Factory.Factory_Bindings_Access is
begin
return Html_Factory'Access;
end Definition;
end ASF.Components.Html.Factory;
|
21602
|
-----------------------------------------------------------------------
-- html-factory -- Factory for HTML UI Components
-- Copyright (C) 2009, 2010, 2011, 2012, 2014 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with ASF.Components.Base;
with ASF.Components.Html.Text;
with ASF.Components.Html.Lists;
with ASF.Components.Html.Links;
with ASF.Components.Html.Panels;
with ASF.Components.Html.Forms;
with ASF.Components.Html.Pages;
with ASF.Components.Html.Selects;
with ASF.Components.Html.Messages;
with ASF.Views.Nodes;
package body ASF.Components.Html.Factory is
use ASF.Components.Base;
function Create_Body return UIComponent_Access;
function Create_Doctype return UIComponent_Access;
function Create_Head return UIComponent_Access;
function Create_Output return UIComponent_Access;
function Create_Output_Label return UIComponent_Access;
function Create_Output_Link return UIComponent_Access;
function Create_Output_Format return UIComponent_Access;
function Create_List return UIComponent_Access;
function Create_PanelGroup return UIComponent_Access;
function Create_Form return UIComponent_Access;
function Create_Input_File return UIComponent_Access;
function Create_Input_Hidden return UIComponent_Access;
function Create_Input_Text return UIComponent_Access;
function Create_Input_Textarea return UIComponent_Access;
function Create_Command return UIComponent_Access;
function Create_Message return UIComponent_Access;
function Create_Messages return UIComponent_Access;
function Create_SelectOne return UIComponent_Access;
function Create_SelectOneRadio return UIComponent_Access;
function Create_SelectBooleanCheckbox return UIComponent_Access;
-- Create an UIInput secret component
function Create_Input_Secret return ASF.Components.Base.UIComponent_Access;
-- ------------------------------
-- Create an UIBody component
-- ------------------------------
function Create_Body return UIComponent_Access is
begin
return new ASF.Components.Html.Pages.UIBody;
end Create_Body;
-- ------------------------------
-- Create an UIDoctype component
-- ------------------------------
function Create_Doctype return UIComponent_Access is
begin
return new ASF.Components.Html.Pages.UIDoctype;
end Create_Doctype;
-- ------------------------------
-- Create an UIHead component
-- ------------------------------
function Create_Head return UIComponent_Access is
begin
return new ASF.Components.Html.Pages.UIHead;
end Create_Head;
-- ------------------------------
-- Create an UIOutput component
-- ------------------------------
function Create_Output return UIComponent_Access is
begin
return new ASF.Components.Html.Text.UIOutput;
end Create_Output;
-- ------------------------------
-- Create an UIOutputLabel component
-- ------------------------------
function Create_Output_Label return UIComponent_Access is
begin
return new ASF.Components.Html.Text.UIOutputLabel;
end Create_Output_Label;
-- ------------------------------
-- Create an UIOutputLink component
-- ------------------------------
function Create_Output_Link return UIComponent_Access is
begin
return new ASF.Components.Html.Links.UIOutputLink;
end Create_Output_Link;
-- ------------------------------
-- Create an UIOutput component
-- ------------------------------
function Create_Output_Format return UIComponent_Access is
begin
return new ASF.Components.Html.Text.UIOutputFormat;
end Create_Output_Format;
-- ------------------------------
-- Create an UIList component
-- ------------------------------
function Create_List return UIComponent_Access is
begin
return new ASF.Components.Html.Lists.UIList;
end Create_List;
-- ------------------------------
-- Create an UIPanelGroup component
-- ------------------------------
function Create_PanelGroup return UIComponent_Access is
begin
return new ASF.Components.Html.Panels.UIPanelGroup;
end Create_PanelGroup;
-- ------------------------------
-- Create an UIForm component
-- ------------------------------
function Create_Form return UIComponent_Access is
begin
return new ASF.Components.Html.Forms.UIForm;
end Create_Form;
-- ------------------------------
-- Create an UIInput_Hidden component
-- ------------------------------
function Create_Input_Hidden return UIComponent_Access is
begin
return new ASF.Components.Html.Forms.UIInput_Hidden;
end Create_Input_Hidden;
-- ------------------------------
-- Create an UIInput component
-- ------------------------------
function Create_Input_Text return UIComponent_Access is
begin
return new ASF.Components.Html.Forms.UIInput;
end Create_Input_Text;
-- ------------------------------
-- Create an UIInput secret component
-- ------------------------------
function Create_Input_Secret return ASF.Components.Base.UIComponent_Access is
Result : constant Html.Forms.UIInput_Access := new ASF.Components.Html.Forms.UIInput;
begin
Result.Set_Secret (True);
return Result.all'Access;
end Create_Input_Secret;
-- ------------------------------
-- Create an UIInputTextarea component
-- ------------------------------
function Create_Input_Textarea return UIComponent_Access is
begin
return new ASF.Components.Html.Forms.UIInputTextarea;
end Create_Input_Textarea;
-- ------------------------------
-- Create an UIInput_File component
-- ------------------------------
function Create_Input_File return UIComponent_Access is
begin
return new ASF.Components.Html.Forms.UIInput_File;
end Create_Input_File;
-- ------------------------------
-- Create an UICommand component
-- ------------------------------
function Create_Command return UIComponent_Access is
begin
return new ASF.Components.Html.Forms.UICommand;
end Create_Command;
-- ------------------------------
-- Create an UIMessage component
-- ------------------------------
function Create_Message return UIComponent_Access is
begin
return new ASF.Components.Html.Messages.UIMessage;
end Create_Message;
-- ------------------------------
-- Create an UIMessages component
-- ------------------------------
function Create_Messages return UIComponent_Access is
begin
return new ASF.Components.Html.Messages.UIMessages;
end Create_Messages;
-- ------------------------------
-- Create an UISelectOne component
-- ------------------------------
function Create_SelectOne return UIComponent_Access is
begin
return new ASF.Components.Html.Selects.UISelectOne;
end Create_SelectOne;
-- ------------------------------
-- Create an UISelectOneRadio component
-- ------------------------------
function Create_SelectOneRadio return UIComponent_Access is
begin
return new ASF.Components.Html.Selects.UISelectOneRadio;
end Create_SelectOneRadio;
-- ------------------------------
-- Create an UISelectBoolean component
-- ------------------------------
function Create_SelectBooleanCheckbox return UIComponent_Access is
begin
return new ASF.Components.Html.Selects.UISelectBoolean;
end Create_SelectBooleanCheckbox;
use ASF.Views.Nodes;
URI : aliased constant String := "http://java.sun.com/jsf/html";
BODY_TAG : aliased constant String := "body";
COMMAND_BUTTON_TAG : aliased constant String := "commandButton";
DOCTYPE_TAG : aliased constant String := "doctype";
FORM_TAG : aliased constant String := "form";
HEAD_TAG : aliased constant String := "head";
INPUT_FILE_TAG : aliased constant String := "inputFile";
INPUT_HIDDEN_TAG : aliased constant String := "inputHidden";
INPUT_SECRET_TAG : aliased constant String := "inputSecret";
INPUT_TEXT_TAG : aliased constant String := "inputText";
INPUT_TEXTAREA_TAG : aliased constant String := "inputTextarea";
LIST_TAG : aliased constant String := "list";
MESSAGE_TAG : aliased constant String := "message";
MESSAGES_TAG : aliased constant String := "messages";
OUTPUT_FORMAT_TAG : aliased constant String := "outputFormat";
OUTPUT_LABEL_TAG : aliased constant String := "outputLabel";
OUTPUT_LINK_TAG : aliased constant String := "outputLink";
OUTPUT_TEXT_TAG : aliased constant String := "outputText";
PANEL_GROUP_TAG : aliased constant String := "panelGroup";
SELECT_BOOLEAN_TAG : aliased constant String := "selectBooleanCheckbox";
SELECT_ONE_MENU_TAG : aliased constant String := "selectOneMenu";
SELECT_ONE_RADIO_TAG : aliased constant String := "selectOneRadio";
Html_Bindings : aliased constant ASF.Factory.Binding_Array
:= (1 => (Name => BODY_TAG'Access,
Component => Create_Body'Access,
Tag => Create_Component_Node'Access),
2 => (Name => COMMAND_BUTTON_TAG'Access,
Component => Create_Command'Access,
Tag => Create_Component_Node'Access),
3 => (Name => DOCTYPE_TAG'Access,
Component => Create_Doctype'Access,
Tag => Create_Component_Node'Access),
4 => (Name => FORM_TAG'Access,
Component => Create_Form'Access,
Tag => Create_Component_Node'Access),
5 => (Name => HEAD_TAG'Access,
Component => Create_Head'Access,
Tag => Create_Component_Node'Access),
6 => (Name => INPUT_FILE_TAG'Access,
Component => Create_Input_File'Access,
Tag => Create_Component_Node'Access),
7 => (Name => INPUT_HIDDEN_TAG'Access,
Component => Create_Input_Hidden'Access,
Tag => Create_Component_Node'Access),
8 => (Name => INPUT_SECRET_TAG'Access,
Component => Create_Input_Secret'Access,
Tag => Create_Component_Node'Access),
9 => (Name => INPUT_TEXT_TAG'Access,
Component => Create_Input_Text'Access,
Tag => Create_Component_Node'Access),
10 => (Name => INPUT_TEXTAREA_TAG'Access,
Component => Create_Input_Textarea'Access,
Tag => Create_Component_Node'Access),
11 => (Name => LIST_TAG'Access,
Component => Create_List'Access,
Tag => Create_Component_Node'Access),
12 => (Name => MESSAGE_TAG'Access,
Component => Create_Message'Access,
Tag => Create_Component_Node'Access),
13 => (Name => MESSAGES_TAG'Access,
Component => Create_Messages'Access,
Tag => Create_Component_Node'Access),
14 => (Name => OUTPUT_FORMAT_TAG'Access,
Component => Create_Output_Format'Access,
Tag => Create_Component_Node'Access),
15 => (Name => OUTPUT_LABEL_TAG'Access,
Component => Create_Output_Label'Access,
Tag => Create_Component_Node'Access),
16 => (Name => OUTPUT_LINK_TAG'Access,
Component => Create_Output_Link'Access,
Tag => Create_Component_Node'Access),
17 => (Name => OUTPUT_TEXT_TAG'Access,
Component => Create_Output'Access,
Tag => Create_Component_Node'Access),
18 => (Name => PANEL_GROUP_TAG'Access,
Component => Create_PanelGroup'Access,
Tag => Create_Component_Node'Access),
19 => (Name => SELECT_BOOLEAN_TAG'Access,
Component => Create_SelectBooleanCheckbox'Access,
Tag => Create_Component_Node'Access),
20 => (Name => SELECT_ONE_MENU_TAG'Access,
Component => Create_SelectOne'Access,
Tag => Create_Component_Node'Access),
21 => (Name => SELECT_ONE_RADIO_TAG'Access,
Component => Create_SelectOneRadio'Access,
Tag => Create_Component_Node'Access)
);
Html_Factory : aliased constant ASF.Factory.Factory_Bindings
:= (URI => URI'Access, Bindings => Html_Bindings'Access);
-- ------------------------------
-- Get the HTML component factory.
-- ------------------------------
function Definition return ASF.Factory.Factory_Bindings_Access is
begin
return Html_Factory'Access;
end Definition;
end ASF.Components.Html.Factory;
| true |
-----------------------------------------------------------------------
-- html-factory -- Factory for HTML UI Components
-- Copyright (C) 2009, 2010, 2011, 2012, 2014 PI:NAME:<NAME>END_PI
-- Written by PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with ASF.Components.Base;
with ASF.Components.Html.Text;
with ASF.Components.Html.Lists;
with ASF.Components.Html.Links;
with ASF.Components.Html.Panels;
with ASF.Components.Html.Forms;
with ASF.Components.Html.Pages;
with ASF.Components.Html.Selects;
with ASF.Components.Html.Messages;
with ASF.Views.Nodes;
package body ASF.Components.Html.Factory is
use ASF.Components.Base;
function Create_Body return UIComponent_Access;
function Create_Doctype return UIComponent_Access;
function Create_Head return UIComponent_Access;
function Create_Output return UIComponent_Access;
function Create_Output_Label return UIComponent_Access;
function Create_Output_Link return UIComponent_Access;
function Create_Output_Format return UIComponent_Access;
function Create_List return UIComponent_Access;
function Create_PanelGroup return UIComponent_Access;
function Create_Form return UIComponent_Access;
function Create_Input_File return UIComponent_Access;
function Create_Input_Hidden return UIComponent_Access;
function Create_Input_Text return UIComponent_Access;
function Create_Input_Textarea return UIComponent_Access;
function Create_Command return UIComponent_Access;
function Create_Message return UIComponent_Access;
function Create_Messages return UIComponent_Access;
function Create_SelectOne return UIComponent_Access;
function Create_SelectOneRadio return UIComponent_Access;
function Create_SelectBooleanCheckbox return UIComponent_Access;
-- Create an UIInput secret component
function Create_Input_Secret return ASF.Components.Base.UIComponent_Access;
-- ------------------------------
-- Create an UIBody component
-- ------------------------------
function Create_Body return UIComponent_Access is
begin
return new ASF.Components.Html.Pages.UIBody;
end Create_Body;
-- ------------------------------
-- Create an UIDoctype component
-- ------------------------------
function Create_Doctype return UIComponent_Access is
begin
return new ASF.Components.Html.Pages.UIDoctype;
end Create_Doctype;
-- ------------------------------
-- Create an UIHead component
-- ------------------------------
function Create_Head return UIComponent_Access is
begin
return new ASF.Components.Html.Pages.UIHead;
end Create_Head;
-- ------------------------------
-- Create an UIOutput component
-- ------------------------------
function Create_Output return UIComponent_Access is
begin
return new ASF.Components.Html.Text.UIOutput;
end Create_Output;
-- ------------------------------
-- Create an UIOutputLabel component
-- ------------------------------
function Create_Output_Label return UIComponent_Access is
begin
return new ASF.Components.Html.Text.UIOutputLabel;
end Create_Output_Label;
-- ------------------------------
-- Create an UIOutputLink component
-- ------------------------------
function Create_Output_Link return UIComponent_Access is
begin
return new ASF.Components.Html.Links.UIOutputLink;
end Create_Output_Link;
-- ------------------------------
-- Create an UIOutput component
-- ------------------------------
function Create_Output_Format return UIComponent_Access is
begin
return new ASF.Components.Html.Text.UIOutputFormat;
end Create_Output_Format;
-- ------------------------------
-- Create an UIList component
-- ------------------------------
function Create_List return UIComponent_Access is
begin
return new ASF.Components.Html.Lists.UIList;
end Create_List;
-- ------------------------------
-- Create an UIPanelGroup component
-- ------------------------------
function Create_PanelGroup return UIComponent_Access is
begin
return new ASF.Components.Html.Panels.UIPanelGroup;
end Create_PanelGroup;
-- ------------------------------
-- Create an UIForm component
-- ------------------------------
function Create_Form return UIComponent_Access is
begin
return new ASF.Components.Html.Forms.UIForm;
end Create_Form;
-- ------------------------------
-- Create an UIInput_Hidden component
-- ------------------------------
function Create_Input_Hidden return UIComponent_Access is
begin
return new ASF.Components.Html.Forms.UIInput_Hidden;
end Create_Input_Hidden;
-- ------------------------------
-- Create an UIInput component
-- ------------------------------
function Create_Input_Text return UIComponent_Access is
begin
return new ASF.Components.Html.Forms.UIInput;
end Create_Input_Text;
-- ------------------------------
-- Create an UIInput secret component
-- ------------------------------
function Create_Input_Secret return ASF.Components.Base.UIComponent_Access is
Result : constant Html.Forms.UIInput_Access := new ASF.Components.Html.Forms.UIInput;
begin
Result.Set_Secret (True);
return Result.all'Access;
end Create_Input_Secret;
-- ------------------------------
-- Create an UIInputTextarea component
-- ------------------------------
function Create_Input_Textarea return UIComponent_Access is
begin
return new ASF.Components.Html.Forms.UIInputTextarea;
end Create_Input_Textarea;
-- ------------------------------
-- Create an UIInput_File component
-- ------------------------------
function Create_Input_File return UIComponent_Access is
begin
return new ASF.Components.Html.Forms.UIInput_File;
end Create_Input_File;
-- ------------------------------
-- Create an UICommand component
-- ------------------------------
function Create_Command return UIComponent_Access is
begin
return new ASF.Components.Html.Forms.UICommand;
end Create_Command;
-- ------------------------------
-- Create an UIMessage component
-- ------------------------------
function Create_Message return UIComponent_Access is
begin
return new ASF.Components.Html.Messages.UIMessage;
end Create_Message;
-- ------------------------------
-- Create an UIMessages component
-- ------------------------------
function Create_Messages return UIComponent_Access is
begin
return new ASF.Components.Html.Messages.UIMessages;
end Create_Messages;
-- ------------------------------
-- Create an UISelectOne component
-- ------------------------------
function Create_SelectOne return UIComponent_Access is
begin
return new ASF.Components.Html.Selects.UISelectOne;
end Create_SelectOne;
-- ------------------------------
-- Create an UISelectOneRadio component
-- ------------------------------
function Create_SelectOneRadio return UIComponent_Access is
begin
return new ASF.Components.Html.Selects.UISelectOneRadio;
end Create_SelectOneRadio;
-- ------------------------------
-- Create an UISelectBoolean component
-- ------------------------------
function Create_SelectBooleanCheckbox return UIComponent_Access is
begin
return new ASF.Components.Html.Selects.UISelectBoolean;
end Create_SelectBooleanCheckbox;
use ASF.Views.Nodes;
URI : aliased constant String := "http://java.sun.com/jsf/html";
BODY_TAG : aliased constant String := "body";
COMMAND_BUTTON_TAG : aliased constant String := "commandButton";
DOCTYPE_TAG : aliased constant String := "doctype";
FORM_TAG : aliased constant String := "form";
HEAD_TAG : aliased constant String := "head";
INPUT_FILE_TAG : aliased constant String := "inputFile";
INPUT_HIDDEN_TAG : aliased constant String := "inputHidden";
INPUT_SECRET_TAG : aliased constant String := "inputSecret";
INPUT_TEXT_TAG : aliased constant String := "inputText";
INPUT_TEXTAREA_TAG : aliased constant String := "inputTextarea";
LIST_TAG : aliased constant String := "list";
MESSAGE_TAG : aliased constant String := "message";
MESSAGES_TAG : aliased constant String := "messages";
OUTPUT_FORMAT_TAG : aliased constant String := "outputFormat";
OUTPUT_LABEL_TAG : aliased constant String := "outputLabel";
OUTPUT_LINK_TAG : aliased constant String := "outputLink";
OUTPUT_TEXT_TAG : aliased constant String := "outputText";
PANEL_GROUP_TAG : aliased constant String := "panelGroup";
SELECT_BOOLEAN_TAG : aliased constant String := "selectBooleanCheckbox";
SELECT_ONE_MENU_TAG : aliased constant String := "selectOneMenu";
SELECT_ONE_RADIO_TAG : aliased constant String := "selectOneRadio";
Html_Bindings : aliased constant ASF.Factory.Binding_Array
:= (1 => (Name => BODY_TAG'Access,
Component => Create_Body'Access,
Tag => Create_Component_Node'Access),
2 => (Name => COMMAND_BUTTON_TAG'Access,
Component => Create_Command'Access,
Tag => Create_Component_Node'Access),
3 => (Name => DOCTYPE_TAG'Access,
Component => Create_Doctype'Access,
Tag => Create_Component_Node'Access),
4 => (Name => FORM_TAG'Access,
Component => Create_Form'Access,
Tag => Create_Component_Node'Access),
5 => (Name => HEAD_TAG'Access,
Component => Create_Head'Access,
Tag => Create_Component_Node'Access),
6 => (Name => INPUT_FILE_TAG'Access,
Component => Create_Input_File'Access,
Tag => Create_Component_Node'Access),
7 => (Name => INPUT_HIDDEN_TAG'Access,
Component => Create_Input_Hidden'Access,
Tag => Create_Component_Node'Access),
8 => (Name => INPUT_SECRET_TAG'Access,
Component => Create_Input_Secret'Access,
Tag => Create_Component_Node'Access),
9 => (Name => INPUT_TEXT_TAG'Access,
Component => Create_Input_Text'Access,
Tag => Create_Component_Node'Access),
10 => (Name => INPUT_TEXTAREA_TAG'Access,
Component => Create_Input_Textarea'Access,
Tag => Create_Component_Node'Access),
11 => (Name => LIST_TAG'Access,
Component => Create_List'Access,
Tag => Create_Component_Node'Access),
12 => (Name => MESSAGE_TAG'Access,
Component => Create_Message'Access,
Tag => Create_Component_Node'Access),
13 => (Name => MESSAGES_TAG'Access,
Component => Create_Messages'Access,
Tag => Create_Component_Node'Access),
14 => (Name => OUTPUT_FORMAT_TAG'Access,
Component => Create_Output_Format'Access,
Tag => Create_Component_Node'Access),
15 => (Name => OUTPUT_LABEL_TAG'Access,
Component => Create_Output_Label'Access,
Tag => Create_Component_Node'Access),
16 => (Name => OUTPUT_LINK_TAG'Access,
Component => Create_Output_Link'Access,
Tag => Create_Component_Node'Access),
17 => (Name => OUTPUT_TEXT_TAG'Access,
Component => Create_Output'Access,
Tag => Create_Component_Node'Access),
18 => (Name => PANEL_GROUP_TAG'Access,
Component => Create_PanelGroup'Access,
Tag => Create_Component_Node'Access),
19 => (Name => SELECT_BOOLEAN_TAG'Access,
Component => Create_SelectBooleanCheckbox'Access,
Tag => Create_Component_Node'Access),
20 => (Name => SELECT_ONE_MENU_TAG'Access,
Component => Create_SelectOne'Access,
Tag => Create_Component_Node'Access),
21 => (Name => SELECT_ONE_RADIO_TAG'Access,
Component => Create_SelectOneRadio'Access,
Tag => Create_Component_Node'Access)
);
Html_Factory : aliased constant ASF.Factory.Factory_Bindings
:= (URI => URI'Access, Bindings => Html_Bindings'Access);
-- ------------------------------
-- Get the HTML component factory.
-- ------------------------------
function Definition return ASF.Factory.Factory_Bindings_Access is
begin
return Html_Factory'Access;
end Definition;
end ASF.Components.Html.Factory;
|
[
{
"context": "---------------------------\n-- Copyright (c) 2014, Natacha Porté --\n-- ",
"end": 115,
"score": 0.9998511075973511,
"start": 102,
"tag": "NAME",
"value": "Natacha Porté"
}
] |
tests/natools-s_expressions-cache_tests.adb
|
faelys/natools
| 0 |
------------------------------------------------------------------------------
-- Copyright (c) 2014, Natacha Porté --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
with System.Storage_Pools;
with GNAT.Debug_Pools;
with Natools.S_Expressions.Atom_Buffers;
with Natools.S_Expressions.Caches;
with Natools.S_Expressions.Generic_Caches;
with Natools.S_Expressions.Lockable.Tests;
with Natools.S_Expressions.Parsers;
with Natools.S_Expressions.Printers;
with Natools.S_Expressions.Test_Tools;
package body Natools.S_Expressions.Cache_Tests is
Pool : GNAT.Debug_Pools.Debug_Pool;
package Debug_Caches is new Generic_Caches
(System.Storage_Pools.Root_Storage_Pool'Class (Pool),
System.Storage_Pools.Root_Storage_Pool'Class (Pool),
System.Storage_Pools.Root_Storage_Pool'Class (Pool));
procedure Inject_Test (Printer : in out Printers.Printer'Class);
-- Inject test S-expression into Pr
function Canonical_Test return Atom;
-- Return canonical encoding of test S-expression above
------------------------
-- Helper Subprograms --
------------------------
function Canonical_Test return Atom is
begin
return To_Atom ("5:begin(()(4:head4:tail))3:end");
end Canonical_Test;
procedure Inject_Test (Printer : in out Printers.Printer'Class) is
begin
Printer.Append_Atom (To_Atom ("begin"));
Printer.Open_List;
Printer.Open_List;
Printer.Close_List;
Printer.Open_List;
Printer.Append_Atom (To_Atom ("head"));
Printer.Append_Atom (To_Atom ("tail"));
Printer.Close_List;
Printer.Close_List;
Printer.Append_Atom (To_Atom ("end"));
end Inject_Test;
-------------------------
-- Complete Test Suite --
-------------------------
procedure All_Tests (Report : in out NT.Reporter'Class) is
begin
Default_Instantiation (Report);
Debug_Instantiation (Report);
Descriptor_Interface (Report);
Lockable_Interface (Report);
Replayable_Interface (Report);
Duplication (Report);
end All_Tests;
-----------------------
-- Inidividual Tests --
-----------------------
procedure Debug_Instantiation (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Debug instantiation");
Buffer : Atom_Buffers.Atom_Buffer;
procedure Put (S : in String);
procedure Put_Line (S : in String);
procedure Flush;
procedure Info_Pool;
procedure Put (S : in String) is
begin
Buffer.Append (To_Atom (S));
end Put;
procedure Put_Line (S : in String) is
begin
Test.Info (To_String (Buffer.Data) & S);
Buffer.Soft_Reset;
end Put_Line;
procedure Flush is
begin
if Buffer.Length > 0 then
Test.Info (To_String (Buffer.Data));
end if;
Buffer.Hard_Reset;
end Flush;
procedure Info_Pool is
procedure Print_Info is new GNAT.Debug_Pools.Print_Info;
begin
Print_Info (Pool);
Flush;
end Info_Pool;
begin
declare
Cache, Deep, Shallow : Debug_Caches.Reference;
begin
declare
Empty_Cursor : Debug_Caches.Cursor := Deep.First;
Event : Events.Event;
begin
Event := Empty_Cursor.Current_Event;
if Event /= Events.End_Of_Input then
Test.Fail ("Unexpected Empty_Cursor.Current_Event "
& Events.Event'Image (Event)
& " (expected End_Of_Input)");
end if;
Test_Tools.Next_And_Check
(Test, Empty_Cursor, Events.End_Of_Input, 0);
end;
Inject_Test (Cache);
declare
First : Debug_Caches.Cursor := Cache.First;
Output : aliased Test_Tools.Memory_Stream;
Pr : Printers.Canonical (Output'Access);
begin
Output.Set_Expected (Canonical_Test);
Printers.Transfer (First, Pr);
Output.Check_Stream (Test);
end;
Deep := Cache.Duplicate;
Shallow := Deep;
Deep.Append_Atom (To_Atom ("more"));
declare
Other : Debug_Caches.Cursor := Deep.First;
Output : aliased Test_Tools.Memory_Stream;
Pr : Printers.Canonical (Output'Access);
begin
Output.Set_Expected (Canonical_Test & To_Atom ("4:more"));
Printers.Transfer (Other, Pr);
Output.Check_Stream (Test);
end;
declare
Second : Debug_Caches.Cursor := Cache.First;
Output : aliased Test_Tools.Memory_Stream;
Pr : Printers.Canonical (Output'Access);
begin
Output.Set_Expected (Canonical_Test);
Printers.Transfer (Second, Pr);
Output.Check_Stream (Test);
end;
declare
Second_Other : Debug_Caches.Cursor := Shallow.First;
Output : aliased Test_Tools.Memory_Stream;
Pr : Printers.Canonical (Output'Access);
begin
Output.Set_Expected (Canonical_Test & To_Atom ("4:more"));
Printers.Transfer (Second_Other, Pr);
Output.Check_Stream (Test);
end;
end;
Info_Pool;
exception
when Error : others => Test.Report_Exception (Error);
end Debug_Instantiation;
procedure Default_Instantiation (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Default instantiation");
begin
declare
Cache, Deep, Shallow : Caches.Reference;
begin
declare
Empty_Cursor : Caches.Cursor := Deep.First;
Event : Events.Event;
begin
Event := Empty_Cursor.Current_Event;
if Event /= Events.End_Of_Input then
Test.Fail ("Unexpected Empty_Cursor.Current_Event "
& Events.Event'Image (Event)
& " (expected End_Of_Input)");
end if;
Test_Tools.Next_And_Check
(Test, Empty_Cursor, Events.End_Of_Input, 0);
end;
Inject_Test (Cache);
declare
First : Caches.Cursor := Cache.First;
Output : aliased Test_Tools.Memory_Stream;
Pr : Printers.Canonical (Output'Access);
begin
Output.Set_Expected (Canonical_Test);
Printers.Transfer (First, Pr);
Output.Check_Stream (Test);
end;
Deep := Cache.Duplicate;
Shallow := Deep;
Deep.Append_Atom (To_Atom ("more"));
declare
Other : Caches.Cursor := Deep.First;
Output : aliased Test_Tools.Memory_Stream;
Pr : Printers.Canonical (Output'Access);
begin
Output.Set_Expected (Canonical_Test & To_Atom ("4:more"));
Printers.Transfer (Other, Pr);
Output.Check_Stream (Test);
end;
declare
Second : Caches.Cursor := Cache.First;
Output : aliased Test_Tools.Memory_Stream;
Pr : Printers.Canonical (Output'Access);
begin
Output.Set_Expected (Canonical_Test);
Printers.Transfer (Second, Pr);
Output.Check_Stream (Test);
end;
declare
Second_Other : Caches.Cursor := Shallow.First;
Output : aliased Test_Tools.Memory_Stream;
Pr : Printers.Canonical (Output'Access);
begin
Output.Set_Expected (Canonical_Test & To_Atom ("4:more"));
Printers.Transfer (Second_Other, Pr);
Output.Check_Stream (Test);
end;
end;
exception
when Error : others => Test.Report_Exception (Error);
end Default_Instantiation;
procedure Descriptor_Interface (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Descriptor insterface");
begin
declare
Cache : Caches.Reference;
First, Second : Caches.Cursor;
begin
Cache.Append_Atom (To_Atom ("begin"));
Cache.Open_List;
Cache.Append_Atom (To_Atom ("command"));
Cache.Open_List;
Cache.Append_Atom (To_Atom ("first"));
Cache.Append_Atom (To_Atom ("second"));
Cache.Close_List;
Cache.Close_List;
Cache.Append_Atom (To_Atom ("end"));
First := Cache.First;
Second := First;
Test_Tools.Test_Atom_Accessors (Test, First, To_Atom ("begin"), 0);
Test_Tools.Test_Atom_Accessors (Test, Second, To_Atom ("begin"), 0);
Test_Tools.Next_And_Check (Test, First, Events.Open_List, 1);
Test_Tools.Test_Atom_Accessor_Exceptions (Test, First);
Test_Tools.Next_And_Check (Test, First, To_Atom ("command"), 1);
Test_Tools.Next_And_Check (Test, First, Events.Open_List, 2);
Test_Tools.Next_And_Check (Test, Second, Events.Open_List, 1);
Test_Tools.Next_And_Check (Test, First, To_Atom ("first"), 2);
Test_Tools.Next_And_Check (Test, Second, To_Atom ("command"), 1);
Test_Tools.Next_And_Check (Test, First, To_Atom ("second"), 2);
Test_Tools.Next_And_Check (Test, First, Events.Close_List, 1);
Test_Tools.Next_And_Check (Test, Second, Events.Open_List, 2);
Test_Tools.Next_And_Check (Test, Second, To_Atom ("first"), 2);
Test_Tools.Next_And_Check (Test, Second, To_Atom ("second"), 2);
Test_Tools.Next_And_Check (Test, First, Events.Close_List, 0);
Test_Tools.Next_And_Check (Test, Second, Events.Close_List, 1);
Test_Tools.Test_Atom_Accessor_Exceptions (Test, Second);
Test_Tools.Next_And_Check (Test, Second, Events.Close_List, 0);
Test_Tools.Next_And_Check (Test, Second, To_Atom ("end"), 0);
Test_Tools.Next_And_Check (Test, First, To_Atom ("end"), 0);
Test_Tools.Next_And_Check (Test, First, Events.End_Of_Input, 0);
Test_Tools.Next_And_Check (Test, Second, Events.End_Of_Input, 0);
end;
exception
when Error : others => Test.Report_Exception (Error);
end Descriptor_Interface;
procedure Duplication (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Duplication of general descriptor");
begin
Full_Duplication :
declare
Input : aliased Test_Tools.Memory_Stream;
Parser : Parsers.Stream_Parser (Input'Access);
begin
Input.Set_Data (Lockable.Tests.Test_Expression);
Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 1);
declare
Image : Caches.Cursor := Caches.Move (Parser);
begin
Lockable.Tests.Test_Interface (Test, Image);
end;
end Full_Duplication;
Partial_Duplication :
declare
Input : aliased Test_Tools.Memory_Stream;
Parser : Parsers.Stream_Parser (Input'Access);
Copy : Caches.Cursor;
begin
Input.Set_Data (To_Atom
("(first_part (command-1) (command-2 arg-1 arg-2) end)"
& "(second_part (command-3 arg-3) final)"));
Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 1);
Test_Tools.Next_And_Check (Test, Parser, To_Atom ("first_part"), 1);
Copy := Caches.Move (Parser);
Test_Tools.Test_Atom_Accessors
(Test, Copy, To_Atom ("first_part"), 0);
Test_Tools.Next_And_Check (Test, Copy, Events.Open_List, 1);
Test_Tools.Next_And_Check (Test, Copy, To_Atom ("command-1"), 1);
Test_Tools.Next_And_Check (Test, Copy, Events.Close_List, 0);
Test_Tools.Next_And_Check (Test, Copy, Events.Open_List, 1);
Test_Tools.Next_And_Check (Test, Copy, To_Atom ("command-2"), 1);
Test_Tools.Next_And_Check (Test, Copy, To_Atom ("arg-1"), 1);
Test_Tools.Next_And_Check (Test, Copy, To_Atom ("arg-2"), 1);
Test_Tools.Next_And_Check (Test, Copy, Events.Close_List, 0);
Test_Tools.Next_And_Check (Test, Copy, To_Atom ("end"), 0);
Test_Tools.Next_And_Check (Test, Copy, Events.End_Of_Input, 0);
Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 1);
Test_Tools.Next_And_Check (Test, Parser, To_Atom ("second_part"), 1);
Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 2);
Test_Tools.Next_And_Check (Test, Parser, To_Atom ("command-3"), 2);
Test_Tools.Next_And_Check (Test, Parser, To_Atom ("arg-3"), 2);
Test_Tools.Next_And_Check (Test, Parser, Events.Close_List, 1);
Test_Tools.Next_And_Check (Test, Parser, To_Atom ("final"), 1);
Test_Tools.Next_And_Check (Test, Parser, Events.Close_List, 0);
end Partial_Duplication;
exception
when Error : others => Test.Report_Exception (Error);
end Duplication;
procedure Lockable_Interface (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Lockable.Descriptor insterface");
begin
declare
Cache : Caches.Reference;
begin
declare
Input : aliased Test_Tools.Memory_Stream;
Parser : Parsers.Stream_Parser (Input'Access);
begin
Input.Set_Data (Lockable.Tests.Test_Expression);
Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 1);
Printers.Transfer (Parser, Cache);
end;
declare
Cursor : Caches.Cursor := Cache.First;
begin
Lockable.Tests.Test_Interface (Test, Cursor);
end;
end;
exception
when Error : others => Test.Report_Exception (Error);
end Lockable_Interface;
procedure Replayable_Interface (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Replayable.Descriptor insterface");
begin
declare
Cache : Caches.Reference;
First, Second : Caches.Cursor;
begin
Cache.Append_Atom (To_Atom ("begin"));
Cache.Open_List;
Cache.Append_Atom (To_Atom ("command"));
Cache.Open_List;
Cache.Append_Atom (To_Atom ("first"));
Cache.Append_Atom (To_Atom ("second"));
Cache.Close_List;
Cache.Close_List;
Cache.Append_Atom (To_Atom ("end"));
First := Cache.First;
Test_Tools.Test_Atom_Accessors (Test, First, To_Atom ("begin"), 0);
Test_Tools.Next_And_Check (Test, First, Events.Open_List, 1);
Test_Tools.Test_Atom_Accessor_Exceptions (Test, First);
Test_Tools.Next_And_Check (Test, First, To_Atom ("command"), 1);
Second := First.Duplicate;
Test_Tools.Next_And_Check (Test, First, Events.Open_List, 2);
Test_Tools.Next_And_Check (Test, First, To_Atom ("first"), 2);
Test_Tools.Next_And_Check (Test, First, To_Atom ("second"), 2);
Test_Tools.Next_And_Check (Test, First, Events.Close_List, 1);
Test_Tools.Next_And_Check (Test, Second, Events.Open_List, 2);
Test_Tools.Next_And_Check (Test, Second, To_Atom ("first"), 2);
Test_Tools.Next_And_Check (Test, Second, To_Atom ("second"), 2);
Test_Tools.Next_And_Check (Test, First, Events.Close_List, 0);
Test_Tools.Next_And_Check (Test, Second, Events.Close_List, 1);
Test_Tools.Test_Atom_Accessor_Exceptions (Test, Second);
Test_Tools.Next_And_Check (Test, Second, Events.Close_List, 0);
Test_Tools.Next_And_Check (Test, Second, To_Atom ("end"), 0);
Test_Tools.Next_And_Check (Test, First, To_Atom ("end"), 0);
Test_Tools.Next_And_Check (Test, First, Events.End_Of_Input, 0);
Test_Tools.Next_And_Check (Test, Second, Events.End_Of_Input, 0);
end;
exception
when Error : others => Test.Report_Exception (Error);
end Replayable_Interface;
end Natools.S_Expressions.Cache_Tests;
|
7771
|
------------------------------------------------------------------------------
-- Copyright (c) 2014, <NAME> --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
with System.Storage_Pools;
with GNAT.Debug_Pools;
with Natools.S_Expressions.Atom_Buffers;
with Natools.S_Expressions.Caches;
with Natools.S_Expressions.Generic_Caches;
with Natools.S_Expressions.Lockable.Tests;
with Natools.S_Expressions.Parsers;
with Natools.S_Expressions.Printers;
with Natools.S_Expressions.Test_Tools;
package body Natools.S_Expressions.Cache_Tests is
Pool : GNAT.Debug_Pools.Debug_Pool;
package Debug_Caches is new Generic_Caches
(System.Storage_Pools.Root_Storage_Pool'Class (Pool),
System.Storage_Pools.Root_Storage_Pool'Class (Pool),
System.Storage_Pools.Root_Storage_Pool'Class (Pool));
procedure Inject_Test (Printer : in out Printers.Printer'Class);
-- Inject test S-expression into Pr
function Canonical_Test return Atom;
-- Return canonical encoding of test S-expression above
------------------------
-- Helper Subprograms --
------------------------
function Canonical_Test return Atom is
begin
return To_Atom ("5:begin(()(4:head4:tail))3:end");
end Canonical_Test;
procedure Inject_Test (Printer : in out Printers.Printer'Class) is
begin
Printer.Append_Atom (To_Atom ("begin"));
Printer.Open_List;
Printer.Open_List;
Printer.Close_List;
Printer.Open_List;
Printer.Append_Atom (To_Atom ("head"));
Printer.Append_Atom (To_Atom ("tail"));
Printer.Close_List;
Printer.Close_List;
Printer.Append_Atom (To_Atom ("end"));
end Inject_Test;
-------------------------
-- Complete Test Suite --
-------------------------
procedure All_Tests (Report : in out NT.Reporter'Class) is
begin
Default_Instantiation (Report);
Debug_Instantiation (Report);
Descriptor_Interface (Report);
Lockable_Interface (Report);
Replayable_Interface (Report);
Duplication (Report);
end All_Tests;
-----------------------
-- Inidividual Tests --
-----------------------
procedure Debug_Instantiation (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Debug instantiation");
Buffer : Atom_Buffers.Atom_Buffer;
procedure Put (S : in String);
procedure Put_Line (S : in String);
procedure Flush;
procedure Info_Pool;
procedure Put (S : in String) is
begin
Buffer.Append (To_Atom (S));
end Put;
procedure Put_Line (S : in String) is
begin
Test.Info (To_String (Buffer.Data) & S);
Buffer.Soft_Reset;
end Put_Line;
procedure Flush is
begin
if Buffer.Length > 0 then
Test.Info (To_String (Buffer.Data));
end if;
Buffer.Hard_Reset;
end Flush;
procedure Info_Pool is
procedure Print_Info is new GNAT.Debug_Pools.Print_Info;
begin
Print_Info (Pool);
Flush;
end Info_Pool;
begin
declare
Cache, Deep, Shallow : Debug_Caches.Reference;
begin
declare
Empty_Cursor : Debug_Caches.Cursor := Deep.First;
Event : Events.Event;
begin
Event := Empty_Cursor.Current_Event;
if Event /= Events.End_Of_Input then
Test.Fail ("Unexpected Empty_Cursor.Current_Event "
& Events.Event'Image (Event)
& " (expected End_Of_Input)");
end if;
Test_Tools.Next_And_Check
(Test, Empty_Cursor, Events.End_Of_Input, 0);
end;
Inject_Test (Cache);
declare
First : Debug_Caches.Cursor := Cache.First;
Output : aliased Test_Tools.Memory_Stream;
Pr : Printers.Canonical (Output'Access);
begin
Output.Set_Expected (Canonical_Test);
Printers.Transfer (First, Pr);
Output.Check_Stream (Test);
end;
Deep := Cache.Duplicate;
Shallow := Deep;
Deep.Append_Atom (To_Atom ("more"));
declare
Other : Debug_Caches.Cursor := Deep.First;
Output : aliased Test_Tools.Memory_Stream;
Pr : Printers.Canonical (Output'Access);
begin
Output.Set_Expected (Canonical_Test & To_Atom ("4:more"));
Printers.Transfer (Other, Pr);
Output.Check_Stream (Test);
end;
declare
Second : Debug_Caches.Cursor := Cache.First;
Output : aliased Test_Tools.Memory_Stream;
Pr : Printers.Canonical (Output'Access);
begin
Output.Set_Expected (Canonical_Test);
Printers.Transfer (Second, Pr);
Output.Check_Stream (Test);
end;
declare
Second_Other : Debug_Caches.Cursor := Shallow.First;
Output : aliased Test_Tools.Memory_Stream;
Pr : Printers.Canonical (Output'Access);
begin
Output.Set_Expected (Canonical_Test & To_Atom ("4:more"));
Printers.Transfer (Second_Other, Pr);
Output.Check_Stream (Test);
end;
end;
Info_Pool;
exception
when Error : others => Test.Report_Exception (Error);
end Debug_Instantiation;
procedure Default_Instantiation (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Default instantiation");
begin
declare
Cache, Deep, Shallow : Caches.Reference;
begin
declare
Empty_Cursor : Caches.Cursor := Deep.First;
Event : Events.Event;
begin
Event := Empty_Cursor.Current_Event;
if Event /= Events.End_Of_Input then
Test.Fail ("Unexpected Empty_Cursor.Current_Event "
& Events.Event'Image (Event)
& " (expected End_Of_Input)");
end if;
Test_Tools.Next_And_Check
(Test, Empty_Cursor, Events.End_Of_Input, 0);
end;
Inject_Test (Cache);
declare
First : Caches.Cursor := Cache.First;
Output : aliased Test_Tools.Memory_Stream;
Pr : Printers.Canonical (Output'Access);
begin
Output.Set_Expected (Canonical_Test);
Printers.Transfer (First, Pr);
Output.Check_Stream (Test);
end;
Deep := Cache.Duplicate;
Shallow := Deep;
Deep.Append_Atom (To_Atom ("more"));
declare
Other : Caches.Cursor := Deep.First;
Output : aliased Test_Tools.Memory_Stream;
Pr : Printers.Canonical (Output'Access);
begin
Output.Set_Expected (Canonical_Test & To_Atom ("4:more"));
Printers.Transfer (Other, Pr);
Output.Check_Stream (Test);
end;
declare
Second : Caches.Cursor := Cache.First;
Output : aliased Test_Tools.Memory_Stream;
Pr : Printers.Canonical (Output'Access);
begin
Output.Set_Expected (Canonical_Test);
Printers.Transfer (Second, Pr);
Output.Check_Stream (Test);
end;
declare
Second_Other : Caches.Cursor := Shallow.First;
Output : aliased Test_Tools.Memory_Stream;
Pr : Printers.Canonical (Output'Access);
begin
Output.Set_Expected (Canonical_Test & To_Atom ("4:more"));
Printers.Transfer (Second_Other, Pr);
Output.Check_Stream (Test);
end;
end;
exception
when Error : others => Test.Report_Exception (Error);
end Default_Instantiation;
procedure Descriptor_Interface (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Descriptor insterface");
begin
declare
Cache : Caches.Reference;
First, Second : Caches.Cursor;
begin
Cache.Append_Atom (To_Atom ("begin"));
Cache.Open_List;
Cache.Append_Atom (To_Atom ("command"));
Cache.Open_List;
Cache.Append_Atom (To_Atom ("first"));
Cache.Append_Atom (To_Atom ("second"));
Cache.Close_List;
Cache.Close_List;
Cache.Append_Atom (To_Atom ("end"));
First := Cache.First;
Second := First;
Test_Tools.Test_Atom_Accessors (Test, First, To_Atom ("begin"), 0);
Test_Tools.Test_Atom_Accessors (Test, Second, To_Atom ("begin"), 0);
Test_Tools.Next_And_Check (Test, First, Events.Open_List, 1);
Test_Tools.Test_Atom_Accessor_Exceptions (Test, First);
Test_Tools.Next_And_Check (Test, First, To_Atom ("command"), 1);
Test_Tools.Next_And_Check (Test, First, Events.Open_List, 2);
Test_Tools.Next_And_Check (Test, Second, Events.Open_List, 1);
Test_Tools.Next_And_Check (Test, First, To_Atom ("first"), 2);
Test_Tools.Next_And_Check (Test, Second, To_Atom ("command"), 1);
Test_Tools.Next_And_Check (Test, First, To_Atom ("second"), 2);
Test_Tools.Next_And_Check (Test, First, Events.Close_List, 1);
Test_Tools.Next_And_Check (Test, Second, Events.Open_List, 2);
Test_Tools.Next_And_Check (Test, Second, To_Atom ("first"), 2);
Test_Tools.Next_And_Check (Test, Second, To_Atom ("second"), 2);
Test_Tools.Next_And_Check (Test, First, Events.Close_List, 0);
Test_Tools.Next_And_Check (Test, Second, Events.Close_List, 1);
Test_Tools.Test_Atom_Accessor_Exceptions (Test, Second);
Test_Tools.Next_And_Check (Test, Second, Events.Close_List, 0);
Test_Tools.Next_And_Check (Test, Second, To_Atom ("end"), 0);
Test_Tools.Next_And_Check (Test, First, To_Atom ("end"), 0);
Test_Tools.Next_And_Check (Test, First, Events.End_Of_Input, 0);
Test_Tools.Next_And_Check (Test, Second, Events.End_Of_Input, 0);
end;
exception
when Error : others => Test.Report_Exception (Error);
end Descriptor_Interface;
procedure Duplication (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Duplication of general descriptor");
begin
Full_Duplication :
declare
Input : aliased Test_Tools.Memory_Stream;
Parser : Parsers.Stream_Parser (Input'Access);
begin
Input.Set_Data (Lockable.Tests.Test_Expression);
Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 1);
declare
Image : Caches.Cursor := Caches.Move (Parser);
begin
Lockable.Tests.Test_Interface (Test, Image);
end;
end Full_Duplication;
Partial_Duplication :
declare
Input : aliased Test_Tools.Memory_Stream;
Parser : Parsers.Stream_Parser (Input'Access);
Copy : Caches.Cursor;
begin
Input.Set_Data (To_Atom
("(first_part (command-1) (command-2 arg-1 arg-2) end)"
& "(second_part (command-3 arg-3) final)"));
Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 1);
Test_Tools.Next_And_Check (Test, Parser, To_Atom ("first_part"), 1);
Copy := Caches.Move (Parser);
Test_Tools.Test_Atom_Accessors
(Test, Copy, To_Atom ("first_part"), 0);
Test_Tools.Next_And_Check (Test, Copy, Events.Open_List, 1);
Test_Tools.Next_And_Check (Test, Copy, To_Atom ("command-1"), 1);
Test_Tools.Next_And_Check (Test, Copy, Events.Close_List, 0);
Test_Tools.Next_And_Check (Test, Copy, Events.Open_List, 1);
Test_Tools.Next_And_Check (Test, Copy, To_Atom ("command-2"), 1);
Test_Tools.Next_And_Check (Test, Copy, To_Atom ("arg-1"), 1);
Test_Tools.Next_And_Check (Test, Copy, To_Atom ("arg-2"), 1);
Test_Tools.Next_And_Check (Test, Copy, Events.Close_List, 0);
Test_Tools.Next_And_Check (Test, Copy, To_Atom ("end"), 0);
Test_Tools.Next_And_Check (Test, Copy, Events.End_Of_Input, 0);
Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 1);
Test_Tools.Next_And_Check (Test, Parser, To_Atom ("second_part"), 1);
Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 2);
Test_Tools.Next_And_Check (Test, Parser, To_Atom ("command-3"), 2);
Test_Tools.Next_And_Check (Test, Parser, To_Atom ("arg-3"), 2);
Test_Tools.Next_And_Check (Test, Parser, Events.Close_List, 1);
Test_Tools.Next_And_Check (Test, Parser, To_Atom ("final"), 1);
Test_Tools.Next_And_Check (Test, Parser, Events.Close_List, 0);
end Partial_Duplication;
exception
when Error : others => Test.Report_Exception (Error);
end Duplication;
procedure Lockable_Interface (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Lockable.Descriptor insterface");
begin
declare
Cache : Caches.Reference;
begin
declare
Input : aliased Test_Tools.Memory_Stream;
Parser : Parsers.Stream_Parser (Input'Access);
begin
Input.Set_Data (Lockable.Tests.Test_Expression);
Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 1);
Printers.Transfer (Parser, Cache);
end;
declare
Cursor : Caches.Cursor := Cache.First;
begin
Lockable.Tests.Test_Interface (Test, Cursor);
end;
end;
exception
when Error : others => Test.Report_Exception (Error);
end Lockable_Interface;
procedure Replayable_Interface (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Replayable.Descriptor insterface");
begin
declare
Cache : Caches.Reference;
First, Second : Caches.Cursor;
begin
Cache.Append_Atom (To_Atom ("begin"));
Cache.Open_List;
Cache.Append_Atom (To_Atom ("command"));
Cache.Open_List;
Cache.Append_Atom (To_Atom ("first"));
Cache.Append_Atom (To_Atom ("second"));
Cache.Close_List;
Cache.Close_List;
Cache.Append_Atom (To_Atom ("end"));
First := Cache.First;
Test_Tools.Test_Atom_Accessors (Test, First, To_Atom ("begin"), 0);
Test_Tools.Next_And_Check (Test, First, Events.Open_List, 1);
Test_Tools.Test_Atom_Accessor_Exceptions (Test, First);
Test_Tools.Next_And_Check (Test, First, To_Atom ("command"), 1);
Second := First.Duplicate;
Test_Tools.Next_And_Check (Test, First, Events.Open_List, 2);
Test_Tools.Next_And_Check (Test, First, To_Atom ("first"), 2);
Test_Tools.Next_And_Check (Test, First, To_Atom ("second"), 2);
Test_Tools.Next_And_Check (Test, First, Events.Close_List, 1);
Test_Tools.Next_And_Check (Test, Second, Events.Open_List, 2);
Test_Tools.Next_And_Check (Test, Second, To_Atom ("first"), 2);
Test_Tools.Next_And_Check (Test, Second, To_Atom ("second"), 2);
Test_Tools.Next_And_Check (Test, First, Events.Close_List, 0);
Test_Tools.Next_And_Check (Test, Second, Events.Close_List, 1);
Test_Tools.Test_Atom_Accessor_Exceptions (Test, Second);
Test_Tools.Next_And_Check (Test, Second, Events.Close_List, 0);
Test_Tools.Next_And_Check (Test, Second, To_Atom ("end"), 0);
Test_Tools.Next_And_Check (Test, First, To_Atom ("end"), 0);
Test_Tools.Next_And_Check (Test, First, Events.End_Of_Input, 0);
Test_Tools.Next_And_Check (Test, Second, Events.End_Of_Input, 0);
end;
exception
when Error : others => Test.Report_Exception (Error);
end Replayable_Interface;
end Natools.S_Expressions.Cache_Tests;
| true |
------------------------------------------------------------------------------
-- Copyright (c) 2014, PI:NAME:<NAME>END_PI --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
with System.Storage_Pools;
with GNAT.Debug_Pools;
with Natools.S_Expressions.Atom_Buffers;
with Natools.S_Expressions.Caches;
with Natools.S_Expressions.Generic_Caches;
with Natools.S_Expressions.Lockable.Tests;
with Natools.S_Expressions.Parsers;
with Natools.S_Expressions.Printers;
with Natools.S_Expressions.Test_Tools;
package body Natools.S_Expressions.Cache_Tests is
Pool : GNAT.Debug_Pools.Debug_Pool;
package Debug_Caches is new Generic_Caches
(System.Storage_Pools.Root_Storage_Pool'Class (Pool),
System.Storage_Pools.Root_Storage_Pool'Class (Pool),
System.Storage_Pools.Root_Storage_Pool'Class (Pool));
procedure Inject_Test (Printer : in out Printers.Printer'Class);
-- Inject test S-expression into Pr
function Canonical_Test return Atom;
-- Return canonical encoding of test S-expression above
------------------------
-- Helper Subprograms --
------------------------
function Canonical_Test return Atom is
begin
return To_Atom ("5:begin(()(4:head4:tail))3:end");
end Canonical_Test;
procedure Inject_Test (Printer : in out Printers.Printer'Class) is
begin
Printer.Append_Atom (To_Atom ("begin"));
Printer.Open_List;
Printer.Open_List;
Printer.Close_List;
Printer.Open_List;
Printer.Append_Atom (To_Atom ("head"));
Printer.Append_Atom (To_Atom ("tail"));
Printer.Close_List;
Printer.Close_List;
Printer.Append_Atom (To_Atom ("end"));
end Inject_Test;
-------------------------
-- Complete Test Suite --
-------------------------
procedure All_Tests (Report : in out NT.Reporter'Class) is
begin
Default_Instantiation (Report);
Debug_Instantiation (Report);
Descriptor_Interface (Report);
Lockable_Interface (Report);
Replayable_Interface (Report);
Duplication (Report);
end All_Tests;
-----------------------
-- Inidividual Tests --
-----------------------
procedure Debug_Instantiation (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Debug instantiation");
Buffer : Atom_Buffers.Atom_Buffer;
procedure Put (S : in String);
procedure Put_Line (S : in String);
procedure Flush;
procedure Info_Pool;
procedure Put (S : in String) is
begin
Buffer.Append (To_Atom (S));
end Put;
procedure Put_Line (S : in String) is
begin
Test.Info (To_String (Buffer.Data) & S);
Buffer.Soft_Reset;
end Put_Line;
procedure Flush is
begin
if Buffer.Length > 0 then
Test.Info (To_String (Buffer.Data));
end if;
Buffer.Hard_Reset;
end Flush;
procedure Info_Pool is
procedure Print_Info is new GNAT.Debug_Pools.Print_Info;
begin
Print_Info (Pool);
Flush;
end Info_Pool;
begin
declare
Cache, Deep, Shallow : Debug_Caches.Reference;
begin
declare
Empty_Cursor : Debug_Caches.Cursor := Deep.First;
Event : Events.Event;
begin
Event := Empty_Cursor.Current_Event;
if Event /= Events.End_Of_Input then
Test.Fail ("Unexpected Empty_Cursor.Current_Event "
& Events.Event'Image (Event)
& " (expected End_Of_Input)");
end if;
Test_Tools.Next_And_Check
(Test, Empty_Cursor, Events.End_Of_Input, 0);
end;
Inject_Test (Cache);
declare
First : Debug_Caches.Cursor := Cache.First;
Output : aliased Test_Tools.Memory_Stream;
Pr : Printers.Canonical (Output'Access);
begin
Output.Set_Expected (Canonical_Test);
Printers.Transfer (First, Pr);
Output.Check_Stream (Test);
end;
Deep := Cache.Duplicate;
Shallow := Deep;
Deep.Append_Atom (To_Atom ("more"));
declare
Other : Debug_Caches.Cursor := Deep.First;
Output : aliased Test_Tools.Memory_Stream;
Pr : Printers.Canonical (Output'Access);
begin
Output.Set_Expected (Canonical_Test & To_Atom ("4:more"));
Printers.Transfer (Other, Pr);
Output.Check_Stream (Test);
end;
declare
Second : Debug_Caches.Cursor := Cache.First;
Output : aliased Test_Tools.Memory_Stream;
Pr : Printers.Canonical (Output'Access);
begin
Output.Set_Expected (Canonical_Test);
Printers.Transfer (Second, Pr);
Output.Check_Stream (Test);
end;
declare
Second_Other : Debug_Caches.Cursor := Shallow.First;
Output : aliased Test_Tools.Memory_Stream;
Pr : Printers.Canonical (Output'Access);
begin
Output.Set_Expected (Canonical_Test & To_Atom ("4:more"));
Printers.Transfer (Second_Other, Pr);
Output.Check_Stream (Test);
end;
end;
Info_Pool;
exception
when Error : others => Test.Report_Exception (Error);
end Debug_Instantiation;
procedure Default_Instantiation (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Default instantiation");
begin
declare
Cache, Deep, Shallow : Caches.Reference;
begin
declare
Empty_Cursor : Caches.Cursor := Deep.First;
Event : Events.Event;
begin
Event := Empty_Cursor.Current_Event;
if Event /= Events.End_Of_Input then
Test.Fail ("Unexpected Empty_Cursor.Current_Event "
& Events.Event'Image (Event)
& " (expected End_Of_Input)");
end if;
Test_Tools.Next_And_Check
(Test, Empty_Cursor, Events.End_Of_Input, 0);
end;
Inject_Test (Cache);
declare
First : Caches.Cursor := Cache.First;
Output : aliased Test_Tools.Memory_Stream;
Pr : Printers.Canonical (Output'Access);
begin
Output.Set_Expected (Canonical_Test);
Printers.Transfer (First, Pr);
Output.Check_Stream (Test);
end;
Deep := Cache.Duplicate;
Shallow := Deep;
Deep.Append_Atom (To_Atom ("more"));
declare
Other : Caches.Cursor := Deep.First;
Output : aliased Test_Tools.Memory_Stream;
Pr : Printers.Canonical (Output'Access);
begin
Output.Set_Expected (Canonical_Test & To_Atom ("4:more"));
Printers.Transfer (Other, Pr);
Output.Check_Stream (Test);
end;
declare
Second : Caches.Cursor := Cache.First;
Output : aliased Test_Tools.Memory_Stream;
Pr : Printers.Canonical (Output'Access);
begin
Output.Set_Expected (Canonical_Test);
Printers.Transfer (Second, Pr);
Output.Check_Stream (Test);
end;
declare
Second_Other : Caches.Cursor := Shallow.First;
Output : aliased Test_Tools.Memory_Stream;
Pr : Printers.Canonical (Output'Access);
begin
Output.Set_Expected (Canonical_Test & To_Atom ("4:more"));
Printers.Transfer (Second_Other, Pr);
Output.Check_Stream (Test);
end;
end;
exception
when Error : others => Test.Report_Exception (Error);
end Default_Instantiation;
procedure Descriptor_Interface (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Descriptor insterface");
begin
declare
Cache : Caches.Reference;
First, Second : Caches.Cursor;
begin
Cache.Append_Atom (To_Atom ("begin"));
Cache.Open_List;
Cache.Append_Atom (To_Atom ("command"));
Cache.Open_List;
Cache.Append_Atom (To_Atom ("first"));
Cache.Append_Atom (To_Atom ("second"));
Cache.Close_List;
Cache.Close_List;
Cache.Append_Atom (To_Atom ("end"));
First := Cache.First;
Second := First;
Test_Tools.Test_Atom_Accessors (Test, First, To_Atom ("begin"), 0);
Test_Tools.Test_Atom_Accessors (Test, Second, To_Atom ("begin"), 0);
Test_Tools.Next_And_Check (Test, First, Events.Open_List, 1);
Test_Tools.Test_Atom_Accessor_Exceptions (Test, First);
Test_Tools.Next_And_Check (Test, First, To_Atom ("command"), 1);
Test_Tools.Next_And_Check (Test, First, Events.Open_List, 2);
Test_Tools.Next_And_Check (Test, Second, Events.Open_List, 1);
Test_Tools.Next_And_Check (Test, First, To_Atom ("first"), 2);
Test_Tools.Next_And_Check (Test, Second, To_Atom ("command"), 1);
Test_Tools.Next_And_Check (Test, First, To_Atom ("second"), 2);
Test_Tools.Next_And_Check (Test, First, Events.Close_List, 1);
Test_Tools.Next_And_Check (Test, Second, Events.Open_List, 2);
Test_Tools.Next_And_Check (Test, Second, To_Atom ("first"), 2);
Test_Tools.Next_And_Check (Test, Second, To_Atom ("second"), 2);
Test_Tools.Next_And_Check (Test, First, Events.Close_List, 0);
Test_Tools.Next_And_Check (Test, Second, Events.Close_List, 1);
Test_Tools.Test_Atom_Accessor_Exceptions (Test, Second);
Test_Tools.Next_And_Check (Test, Second, Events.Close_List, 0);
Test_Tools.Next_And_Check (Test, Second, To_Atom ("end"), 0);
Test_Tools.Next_And_Check (Test, First, To_Atom ("end"), 0);
Test_Tools.Next_And_Check (Test, First, Events.End_Of_Input, 0);
Test_Tools.Next_And_Check (Test, Second, Events.End_Of_Input, 0);
end;
exception
when Error : others => Test.Report_Exception (Error);
end Descriptor_Interface;
procedure Duplication (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Duplication of general descriptor");
begin
Full_Duplication :
declare
Input : aliased Test_Tools.Memory_Stream;
Parser : Parsers.Stream_Parser (Input'Access);
begin
Input.Set_Data (Lockable.Tests.Test_Expression);
Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 1);
declare
Image : Caches.Cursor := Caches.Move (Parser);
begin
Lockable.Tests.Test_Interface (Test, Image);
end;
end Full_Duplication;
Partial_Duplication :
declare
Input : aliased Test_Tools.Memory_Stream;
Parser : Parsers.Stream_Parser (Input'Access);
Copy : Caches.Cursor;
begin
Input.Set_Data (To_Atom
("(first_part (command-1) (command-2 arg-1 arg-2) end)"
& "(second_part (command-3 arg-3) final)"));
Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 1);
Test_Tools.Next_And_Check (Test, Parser, To_Atom ("first_part"), 1);
Copy := Caches.Move (Parser);
Test_Tools.Test_Atom_Accessors
(Test, Copy, To_Atom ("first_part"), 0);
Test_Tools.Next_And_Check (Test, Copy, Events.Open_List, 1);
Test_Tools.Next_And_Check (Test, Copy, To_Atom ("command-1"), 1);
Test_Tools.Next_And_Check (Test, Copy, Events.Close_List, 0);
Test_Tools.Next_And_Check (Test, Copy, Events.Open_List, 1);
Test_Tools.Next_And_Check (Test, Copy, To_Atom ("command-2"), 1);
Test_Tools.Next_And_Check (Test, Copy, To_Atom ("arg-1"), 1);
Test_Tools.Next_And_Check (Test, Copy, To_Atom ("arg-2"), 1);
Test_Tools.Next_And_Check (Test, Copy, Events.Close_List, 0);
Test_Tools.Next_And_Check (Test, Copy, To_Atom ("end"), 0);
Test_Tools.Next_And_Check (Test, Copy, Events.End_Of_Input, 0);
Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 1);
Test_Tools.Next_And_Check (Test, Parser, To_Atom ("second_part"), 1);
Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 2);
Test_Tools.Next_And_Check (Test, Parser, To_Atom ("command-3"), 2);
Test_Tools.Next_And_Check (Test, Parser, To_Atom ("arg-3"), 2);
Test_Tools.Next_And_Check (Test, Parser, Events.Close_List, 1);
Test_Tools.Next_And_Check (Test, Parser, To_Atom ("final"), 1);
Test_Tools.Next_And_Check (Test, Parser, Events.Close_List, 0);
end Partial_Duplication;
exception
when Error : others => Test.Report_Exception (Error);
end Duplication;
procedure Lockable_Interface (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Lockable.Descriptor insterface");
begin
declare
Cache : Caches.Reference;
begin
declare
Input : aliased Test_Tools.Memory_Stream;
Parser : Parsers.Stream_Parser (Input'Access);
begin
Input.Set_Data (Lockable.Tests.Test_Expression);
Test_Tools.Next_And_Check (Test, Parser, Events.Open_List, 1);
Printers.Transfer (Parser, Cache);
end;
declare
Cursor : Caches.Cursor := Cache.First;
begin
Lockable.Tests.Test_Interface (Test, Cursor);
end;
end;
exception
when Error : others => Test.Report_Exception (Error);
end Lockable_Interface;
procedure Replayable_Interface (Report : in out NT.Reporter'Class) is
Test : NT.Test := Report.Item ("Replayable.Descriptor insterface");
begin
declare
Cache : Caches.Reference;
First, Second : Caches.Cursor;
begin
Cache.Append_Atom (To_Atom ("begin"));
Cache.Open_List;
Cache.Append_Atom (To_Atom ("command"));
Cache.Open_List;
Cache.Append_Atom (To_Atom ("first"));
Cache.Append_Atom (To_Atom ("second"));
Cache.Close_List;
Cache.Close_List;
Cache.Append_Atom (To_Atom ("end"));
First := Cache.First;
Test_Tools.Test_Atom_Accessors (Test, First, To_Atom ("begin"), 0);
Test_Tools.Next_And_Check (Test, First, Events.Open_List, 1);
Test_Tools.Test_Atom_Accessor_Exceptions (Test, First);
Test_Tools.Next_And_Check (Test, First, To_Atom ("command"), 1);
Second := First.Duplicate;
Test_Tools.Next_And_Check (Test, First, Events.Open_List, 2);
Test_Tools.Next_And_Check (Test, First, To_Atom ("first"), 2);
Test_Tools.Next_And_Check (Test, First, To_Atom ("second"), 2);
Test_Tools.Next_And_Check (Test, First, Events.Close_List, 1);
Test_Tools.Next_And_Check (Test, Second, Events.Open_List, 2);
Test_Tools.Next_And_Check (Test, Second, To_Atom ("first"), 2);
Test_Tools.Next_And_Check (Test, Second, To_Atom ("second"), 2);
Test_Tools.Next_And_Check (Test, First, Events.Close_List, 0);
Test_Tools.Next_And_Check (Test, Second, Events.Close_List, 1);
Test_Tools.Test_Atom_Accessor_Exceptions (Test, Second);
Test_Tools.Next_And_Check (Test, Second, Events.Close_List, 0);
Test_Tools.Next_And_Check (Test, Second, To_Atom ("end"), 0);
Test_Tools.Next_And_Check (Test, First, To_Atom ("end"), 0);
Test_Tools.Next_And_Check (Test, First, Events.End_Of_Input, 0);
Test_Tools.Next_And_Check (Test, Second, Events.End_Of_Input, 0);
end;
exception
when Error : others => Test.Report_Exception (Error);
end Replayable_Interface;
end Natools.S_Expressions.Cache_Tests;
|
[
{
"context": "-- SPDX-FileCopyrightText: 2020 Max Reznik <[email protected]>\n--\n-- SPDX-License-Identifi",
"end": 43,
"score": 0.9998540282249451,
"start": 33,
"tag": "NAME",
"value": "Max Reznik"
},
{
"context": "-- SPDX-FileCopyrightText: 2020 Max Reznik <[email protected]>\n--\n-- SPDX-License-Identifier: MIT\n------------",
"end": 63,
"score": 0.9999297261238098,
"start": 45,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
sources/acme.adb
|
reznikmm/acme-ada
| 3 |
-- SPDX-FileCopyrightText: 2020 Max Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
----------------------------------------------------------------
with Ada.Text_IO;
with Ada.Wide_Wide_Text_IO;
with GNAT.SHA256;
with AWS.Client;
with AWS.Default;
with AWS.Messages;
with AWS.Response;
with JWS;
with JWS.RS256; pragma Unreferenced (JWS.RS256); -- Enable RS256
with JWS.To_Base_64_URL;
with League.Calendars.ISO_8601;
with League.JSON.Arrays;
with League.JSON.Documents;
with League.JSON.Values;
package body ACME is
function "+" (V : Wide_Wide_String) return League.Strings.Universal_String
renames League.Strings.To_Universal_String;
function "-" (V : Wide_Wide_String) return League.JSON.Values.JSON_Value
is (League.JSON.Values.To_JSON_Value (+V));
function "-" (V : League.Strings.Universal_String)
return League.JSON.Values.JSON_Value
is (League.JSON.Values.To_JSON_Value (V));
User_Agent : constant String := AWS.Default.User_Agent &
" acme-ada 0.0.1";
procedure Get_Nonce
(Self : in out Context'Class;
Nonce : out League.Strings.Universal_String);
------------------------
-- Challenge_Complete --
------------------------
procedure Challenge_Complete
(Self : in out Context'Class;
Account_URL : League.Strings.Universal_String;
Private_Key : League.Stream_Element_Vectors.Stream_Element_Vector;
Challenge : ACME.Challenge)
is
URL : constant League.Strings.Universal_String := Challenge.URL;
Nonce : League.Strings.Universal_String;
JWT : JWS.JSON_Web_Signature;
Header : JWS.JOSE_Header;
Result : AWS.Response.Data;
begin
Self.Get_Nonce (Nonce);
Ada.Wide_Wide_Text_IO.Put ("Nonce=");
Ada.Wide_Wide_Text_IO.Put_Line (Nonce.To_Wide_Wide_String);
Header.Set_Algorithm (+"RS256");
Header.Insert (+"nonce", -Nonce);
Header.Insert (+"url", -URL);
Header.Insert (+"kid", -Account_URL);
JWT.Create
(Header => Header,
Payload => League.JSON.Objects.Empty_JSON_Object.
To_JSON_Document.To_JSON.To_Stream_Element_Array,
Secret => Private_Key.To_Stream_Element_Array);
Ada.Wide_Wide_Text_IO.Put_Line
(JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_Wide_Wide_String);
Result := AWS.Client.Post
(URL => URL.To_UTF_8_String,
Data => JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_UTF_8_String,
Content_Type => "application/jose+json",
User_Agent => User_Agent);
Ada.Text_IO.Put_Line (AWS.Response.Status_Code (Result)'Img);
Ada.Text_IO.Put_Line
(AWS.Response.Message_Body (Result));
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
if AWS.Response.Has_Header (Result, "Replay-Nonce") then
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
end Challenge_Complete;
----------------------
-- Challenge_Status --
----------------------
procedure Challenge_Status
(Self : in out Context'Class;
Account_URL : League.Strings.Universal_String;
Private_Key : League.Stream_Element_Vectors.Stream_Element_Vector;
Challenge : ACME.Challenge;
Status : out League.Strings.Universal_String)
is
URL : constant League.Strings.Universal_String := Challenge.URL;
Doc : League.JSON.Documents.JSON_Document;
Nonce : League.Strings.Universal_String;
JWT : JWS.JSON_Web_Signature;
Header : JWS.JOSE_Header;
Result : AWS.Response.Data;
begin
Self.Get_Nonce (Nonce);
Ada.Wide_Wide_Text_IO.Put ("Nonce=");
Ada.Wide_Wide_Text_IO.Put_Line (Nonce.To_Wide_Wide_String);
Header.Set_Algorithm (+"RS256");
Header.Insert (+"nonce", -Nonce);
Header.Insert (+"url", -URL);
Header.Insert (+"kid", -Account_URL);
JWT.Create
(Header => Header,
Payload => (1 .. 0 => <>),
Secret => Private_Key.To_Stream_Element_Array);
Result := AWS.Client.Post
(URL => URL.To_UTF_8_String,
Data => JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_UTF_8_String,
Content_Type => "application/jose+json",
User_Agent => User_Agent);
Ada.Text_IO.Put_Line (AWS.Response.Status_Code (Result)'Img);
Ada.Text_IO.Put_Line
(AWS.Response.Message_Body (Result));
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
if AWS.Response.Has_Header (Result, "Replay-Nonce") then
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
Doc := League.JSON.Documents.From_JSON
(AWS.Response.Message_Body (Result));
Status := Doc.To_JSON_Object.Value (+"status").To_String;
end Challenge_Status;
--------------------
-- Create_Account --
--------------------
procedure Create_Account
(Self : in out Context'Class;
Public_Key : League.JSON.Objects.JSON_Object;
Private_Key : League.Stream_Element_Vectors.Stream_Element_Vector;
Contact : League.String_Vectors.Universal_String_Vector;
TOS_Agreed : Boolean := True;
Only_Existing : Boolean := False;
Account_URL : out League.Strings.Universal_String)
is
URL : constant League.Strings.Universal_String :=
Self.Directory.Value (+"newAccount").To_String;
Account : League.JSON.Objects.JSON_Object;
Nonce : League.Strings.Universal_String;
Meta : constant League.JSON.Objects.JSON_Object :=
Self.Directory.Value (+"meta").To_Object;
JWT : JWS.JSON_Web_Signature;
Header : JWS.JOSE_Header;
Result : AWS.Response.Data;
begin
Self.Get_Nonce (Nonce);
Ada.Wide_Wide_Text_IO.Put ("Nonce=");
Ada.Wide_Wide_Text_IO.Put_Line (Nonce.To_Wide_Wide_String);
if not Contact.Is_Empty then
declare
List : League.JSON.Arrays.JSON_Array;
begin
for J in 1 .. Contact.Length loop
List.Append (-Contact (J));
end loop;
Account.Insert (+"contact", List.To_JSON_Value);
end;
end if;
if Meta.Contains (+"termsOfService") then
Account.Insert
(+"termsOfServiceAgreed",
League.JSON.Values.To_JSON_Value (TOS_Agreed));
end if;
if Only_Existing then
Account.Insert
(+"onlyReturnExisting",
League.JSON.Values.To_JSON_Value (True));
end if;
Header.Set_Algorithm (+"RS256");
Header.Insert (+"nonce", -Nonce);
Header.Insert (+"url", -URL);
Header.Insert (+"jwk", Public_Key.To_JSON_Value);
JWT.Create
(Header => Header,
Payload => Account.To_JSON_Document.To_JSON.To_Stream_Element_Array,
Secret => Private_Key.To_Stream_Element_Array);
Result := AWS.Client.Post
(URL => URL.To_UTF_8_String,
Data => JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_UTF_8_String,
Content_Type => "application/jose+json",
User_Agent => User_Agent);
Ada.Text_IO.Put_Line (AWS.Response.Status_Code (Result)'Img);
Ada.Text_IO.Put_Line
(AWS.Response.Message_Body (Result));
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
Account_URL := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Location", 1));
if AWS.Response.Has_Header (Result, "Replay-Nonce") then
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
end Create_Account;
------------------
-- Create_Order --
------------------
procedure Create_Order
(Self : in out Context'Class;
Account_URL : League.Strings.Universal_String;
Private_Key : League.Stream_Element_Vectors.Stream_Element_Vector;
DNS_Id_List : League.String_Vectors.Universal_String_Vector;
Not_Before : Optional_Date_Time := (Is_Set => False);
Not_After : Optional_Date_Time := (Is_Set => False);
Auth_List : out League.String_Vectors.Universal_String_Vector;
Finalize : out League.Strings.Universal_String;
Order_URL : out League.Strings.Universal_String)
is
Format : constant League.Strings.Universal_String :=
+"yyyy-MM-ddTHH:mm:ss+04:00Z";
URL : constant League.Strings.Universal_String :=
Self.Directory.Value (+"newOrder").To_String;
Doc : League.JSON.Documents.JSON_Document;
Order : League.JSON.Objects.JSON_Object;
Nonce : League.Strings.Universal_String;
JWT : JWS.JSON_Web_Signature;
Header : JWS.JOSE_Header;
Result : AWS.Response.Data;
List : League.JSON.Arrays.JSON_Array;
begin
Self.Get_Nonce (Nonce);
Ada.Wide_Wide_Text_IO.Put ("Nonce=");
Ada.Wide_Wide_Text_IO.Put_Line (Nonce.To_Wide_Wide_String);
Header.Set_Algorithm (+"RS256");
Header.Insert (+"nonce", -Nonce);
Header.Insert (+"url", -URL);
Header.Insert (+"kid", -Account_URL);
for J in 1 .. DNS_Id_List.Length loop
declare
DNS : League.JSON.Objects.JSON_Object;
begin
DNS.Insert (+"type", -"dns");
DNS.Insert (+"value", -DNS_Id_List (J));
List.Append (DNS.To_JSON_Value);
end;
end loop;
Order.Insert (+"identifiers", List.To_JSON_Value);
if Not_Before.Is_Set then
Order.Insert
(+"notBefore",
-League.Calendars.ISO_8601.Image (Format, Not_Before.Value));
end if;
if Not_After.Is_Set then
Order.Insert
(+"notAfter",
-League.Calendars.ISO_8601.Image (Format, Not_After.Value));
end if;
JWT.Create
(Header => Header,
Payload => Order.To_JSON_Document.To_JSON.To_Stream_Element_Array,
Secret => Private_Key.To_Stream_Element_Array);
Ada.Wide_Wide_Text_IO.Put_Line
(JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_Wide_Wide_String);
Result := AWS.Client.Post
(URL => URL.To_UTF_8_String,
Data => JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_UTF_8_String,
Content_Type => "application/jose+json",
User_Agent => User_Agent);
Ada.Text_IO.Put_Line (AWS.Response.Status_Code (Result)'Img);
Ada.Text_IO.Put_Line
(AWS.Response.Message_Body (Result));
Doc := League.JSON.Documents.From_JSON
(AWS.Response.Message_Body (Result));
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
Order := Doc.To_JSON_Object;
declare
Vector : constant League.JSON.Arrays.JSON_Array :=
Order.Value (+"authorizations").To_Array;
begin
for J in 1 .. Vector.Length loop
Auth_List.Append (Vector (J).To_String);
end loop;
end;
Finalize := Order.Value (+"finalize").To_String;
Order_URL := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Location", 1));
if AWS.Response.Has_Header (Result, "Replay-Nonce") then
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
end Create_Order;
--------------------
-- Finalize_Order --
--------------------
procedure Finalize_Order
(Self : in out Context'Class;
Account_URL : League.Strings.Universal_String;
Private_Key : League.Stream_Element_Vectors.Stream_Element_Vector;
Finalize : League.Strings.Universal_String;
CSR : League.Stream_Element_Vectors.Stream_Element_Vector)
is
URL : constant League.Strings.Universal_String := Finalize;
Object : League.JSON.Objects.JSON_Object;
Nonce : League.Strings.Universal_String;
JWT : JWS.JSON_Web_Signature;
Header : JWS.JOSE_Header;
Result : AWS.Response.Data;
begin
Self.Get_Nonce (Nonce);
Ada.Wide_Wide_Text_IO.Put ("Nonce=");
Ada.Wide_Wide_Text_IO.Put_Line (Nonce.To_Wide_Wide_String);
Header.Set_Algorithm (+"RS256");
Header.Insert (+"nonce", -Nonce);
Header.Insert (+"url", -URL);
Header.Insert (+"kid", -Account_URL);
Object.Insert (+"csr", -JWS.To_Base_64_URL (CSR));
JWT.Create
(Header => Header,
Payload => Object.To_JSON_Document.To_JSON.To_Stream_Element_Array,
Secret => Private_Key.To_Stream_Element_Array);
Ada.Wide_Wide_Text_IO.Put_Line
(JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_Wide_Wide_String);
Result := AWS.Client.Post
(URL => URL.To_UTF_8_String,
Data => JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_UTF_8_String,
Content_Type => "application/jose+json",
User_Agent => User_Agent);
Ada.Text_IO.Put_Line (AWS.Response.Status_Code (Result)'Img);
Ada.Text_IO.Put_Line
(AWS.Response.Message_Body (Result));
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
if AWS.Response.Has_Header (Result, "Replay-Nonce") then
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
end Finalize_Order;
-----------------------
-- Get_Authorization --
-----------------------
procedure Get_Challenges
(Self : in out Context'Class;
Account_URL : League.Strings.Universal_String;
Private_Key : League.Stream_Element_Vectors.Stream_Element_Vector;
Auth_URL : League.Strings.Universal_String;
HTTP : out Challenge;
DNS : out Challenge)
is
URL : constant League.Strings.Universal_String := Auth_URL;
Doc : League.JSON.Documents.JSON_Document;
Auth : League.JSON.Objects.JSON_Object;
Nonce : League.Strings.Universal_String;
JWT : JWS.JSON_Web_Signature;
Header : JWS.JOSE_Header;
Result : AWS.Response.Data;
begin
Self.Get_Nonce (Nonce);
Ada.Wide_Wide_Text_IO.Put ("Nonce=");
Ada.Wide_Wide_Text_IO.Put_Line (Nonce.To_Wide_Wide_String);
Header.Set_Algorithm (+"RS256");
Header.Insert (+"nonce", -Nonce);
Header.Insert (+"url", -URL);
Header.Insert (+"kid", -Account_URL);
JWT.Create
(Header => Header,
Payload => (1 .. 0 => <>),
Secret => Private_Key.To_Stream_Element_Array);
Result := AWS.Client.Post
(URL => URL.To_UTF_8_String,
Data => JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_UTF_8_String,
Content_Type => "application/jose+json",
User_Agent => User_Agent);
Ada.Text_IO.Put_Line (AWS.Response.Status_Code (Result)'Img);
Ada.Text_IO.Put_Line
(AWS.Response.Message_Body (Result));
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
Doc := League.JSON.Documents.From_JSON
(AWS.Response.Message_Body (Result));
Auth := Doc.To_JSON_Object;
declare
Vector : constant League.JSON.Arrays.JSON_Array :=
Auth.Value (+"challenges").To_Array;
begin
for J in 1 .. Vector.Length loop
declare
use type League.Strings.Universal_String;
Item : constant League.JSON.Objects.JSON_Object :=
Vector (J).To_Object;
begin
if Item.Value (+"type").To_String = +"http-01" then
HTTP.URL := Item.Value (+"url").To_String;
HTTP.Token := Item.Value (+"token").To_String;
elsif Item.Value (+"type").To_String = +"dns-01" then
DNS.URL := Item.Value (+"url").To_String;
DNS.Token := Item.Value (+"token").To_String;
end if;
end;
end loop;
end;
if AWS.Response.Has_Header (Result, "Replay-Nonce") then
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
end Get_Challenges;
procedure Get_Certificate
(Self : in out Context'Class;
Account_URL : League.Strings.Universal_String;
Private_Key : League.Stream_Element_Vectors.Stream_Element_Vector;
Certificate : League.Strings.Universal_String;
Text : out League.Strings.Universal_String)
is
URL : constant League.Strings.Universal_String := Certificate;
Nonce : League.Strings.Universal_String;
JWT : JWS.JSON_Web_Signature;
Header : JWS.JOSE_Header;
Headers : AWS.Client.Header_List;
Result : AWS.Response.Data;
begin
Self.Get_Nonce (Nonce);
Header.Set_Algorithm (+"RS256");
Header.Insert (+"nonce", -Nonce);
Header.Insert (+"url", -URL);
Header.Insert (+"kid", -Account_URL);
JWT.Create
(Header => Header,
Payload => (1 .. 0 => <>),
Secret => Private_Key.To_Stream_Element_Array);
Headers.Add ("Accept", "application/pem-certificate-chain");
Result := AWS.Client.Post
(URL => URL.To_UTF_8_String,
Data => JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_UTF_8_String,
Content_Type => "application/jose+json",
Headers => Headers,
User_Agent => User_Agent);
Ada.Text_IO.Put_Line (AWS.Response.Status_Code (Result)'Img);
Ada.Text_IO.Put_Line
(AWS.Response.Message_Body (Result));
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
if AWS.Response.Has_Header (Result, "Replay-Nonce") then
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
Text := League.Strings.From_UTF_8_String
(AWS.Response.Message_Body (Result));
end Get_Certificate;
---------------
-- Get_Nonce --
---------------
procedure Get_Nonce
(Self : in out Context'Class;
Nonce : out League.Strings.Universal_String)
is
Result : AWS.Response.Data;
URL : League.Strings.Universal_String;
begin
if Self.Nonce.Is_Empty then
URL := Self.Directory.Value (+"newNonce").To_String;
Result := AWS.Client.Head
(URL => URL.To_UTF_8_String,
User_Agent => User_Agent);
pragma Assert (AWS.Response.Has_Header (Result, "Replay-Nonce"));
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
Nonce := Self.Nonce;
end Get_Nonce;
procedure Get_Order_Status
(Self : in out Context'Class;
Account_URL : League.Strings.Universal_String;
Private_Key : League.Stream_Element_Vectors.Stream_Element_Vector;
Order_URL : League.Strings.Universal_String;
Certificate : out League.Strings.Universal_String;
Status : out League.Strings.Universal_String)
is
URL : constant League.Strings.Universal_String := Order_URL;
Doc : League.JSON.Documents.JSON_Document;
Nonce : League.Strings.Universal_String;
JWT : JWS.JSON_Web_Signature;
Header : JWS.JOSE_Header;
Result : AWS.Response.Data;
begin
Self.Get_Nonce (Nonce);
Header.Set_Algorithm (+"RS256");
Header.Insert (+"nonce", -Nonce);
Header.Insert (+"url", -URL);
Header.Insert (+"kid", -Account_URL);
JWT.Create
(Header => Header,
Payload => (1 .. 0 => <>),
Secret => Private_Key.To_Stream_Element_Array);
Result := AWS.Client.Post
(URL => URL.To_UTF_8_String,
Data => JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_UTF_8_String,
Content_Type => "application/jose+json",
User_Agent => User_Agent);
Ada.Text_IO.Put_Line (AWS.Response.Status_Code (Result)'Img);
Ada.Text_IO.Put_Line
(AWS.Response.Message_Body (Result));
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
if AWS.Response.Has_Header (Result, "Replay-Nonce") then
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
Doc := League.JSON.Documents.From_JSON
(AWS.Response.Message_Body (Result));
Status := Doc.To_JSON_Object.Value (+"status").To_String;
Certificate := Doc.To_JSON_Object.Value (+"certificate").To_String;
end Get_Order_Status;
----------------
-- Initialize --
----------------
procedure Initialize
(Self : in out Context'Class;
Directory_URL : League.Strings.Universal_String;
Terms_Of_Service : out League.Strings.Universal_String)
is
Doc : League.JSON.Documents.JSON_Document;
Meta : League.JSON.Objects.JSON_Object;
Result : AWS.Response.Data;
URL : constant League.Strings.Universal_String := Directory_URL;
begin
Result := AWS.Client.Get
(URL => URL.To_UTF_8_String,
Follow_Redirection => True,
User_Agent => User_Agent);
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
Doc := League.JSON.Documents.From_JSON
(AWS.Response.Message_Body (Result));
Self.Directory := Doc.To_JSON_Object;
pragma Assert (Self.Directory.Contains (+"newNonce"));
pragma Assert (Self.Directory.Contains (+"newAccount"));
pragma Assert (Self.Directory.Contains (+"newOrder"));
pragma Assert (Self.Directory.Contains (+"revokeCert"));
pragma Assert (Self.Directory.Contains (+"keyChange"));
Meta := Self.Directory.Value (+"meta").To_Object;
Terms_Of_Service := Meta.Value (+"termsOfService").To_String;
end Initialize;
-----------------------
-- Key_Authorization --
-----------------------
function Key_Authorization
(Token : League.Strings.Universal_String;
Public_Key : League.JSON.Objects.JSON_Object)
return League.Strings.Universal_String
is
SHA256 : constant GNAT.SHA256.Binary_Message_Digest :=
GNAT.SHA256.Digest (JWS.Thumbprint (Public_Key));
Vector : League.Stream_Element_Vectors.Stream_Element_Vector;
Result : League.Strings.Universal_String;
begin
Vector.Append (SHA256);
Result.Append (Token);
Result.Append ('.');
Result.Append (JWS.To_Base_64_URL (Vector));
return Result;
end Key_Authorization;
end ACME;
|
26962
|
-- SPDX-FileCopyrightText: 2020 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
----------------------------------------------------------------
with Ada.Text_IO;
with Ada.Wide_Wide_Text_IO;
with GNAT.SHA256;
with AWS.Client;
with AWS.Default;
with AWS.Messages;
with AWS.Response;
with JWS;
with JWS.RS256; pragma Unreferenced (JWS.RS256); -- Enable RS256
with JWS.To_Base_64_URL;
with League.Calendars.ISO_8601;
with League.JSON.Arrays;
with League.JSON.Documents;
with League.JSON.Values;
package body ACME is
function "+" (V : Wide_Wide_String) return League.Strings.Universal_String
renames League.Strings.To_Universal_String;
function "-" (V : Wide_Wide_String) return League.JSON.Values.JSON_Value
is (League.JSON.Values.To_JSON_Value (+V));
function "-" (V : League.Strings.Universal_String)
return League.JSON.Values.JSON_Value
is (League.JSON.Values.To_JSON_Value (V));
User_Agent : constant String := AWS.Default.User_Agent &
" acme-ada 0.0.1";
procedure Get_Nonce
(Self : in out Context'Class;
Nonce : out League.Strings.Universal_String);
------------------------
-- Challenge_Complete --
------------------------
procedure Challenge_Complete
(Self : in out Context'Class;
Account_URL : League.Strings.Universal_String;
Private_Key : League.Stream_Element_Vectors.Stream_Element_Vector;
Challenge : ACME.Challenge)
is
URL : constant League.Strings.Universal_String := Challenge.URL;
Nonce : League.Strings.Universal_String;
JWT : JWS.JSON_Web_Signature;
Header : JWS.JOSE_Header;
Result : AWS.Response.Data;
begin
Self.Get_Nonce (Nonce);
Ada.Wide_Wide_Text_IO.Put ("Nonce=");
Ada.Wide_Wide_Text_IO.Put_Line (Nonce.To_Wide_Wide_String);
Header.Set_Algorithm (+"RS256");
Header.Insert (+"nonce", -Nonce);
Header.Insert (+"url", -URL);
Header.Insert (+"kid", -Account_URL);
JWT.Create
(Header => Header,
Payload => League.JSON.Objects.Empty_JSON_Object.
To_JSON_Document.To_JSON.To_Stream_Element_Array,
Secret => Private_Key.To_Stream_Element_Array);
Ada.Wide_Wide_Text_IO.Put_Line
(JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_Wide_Wide_String);
Result := AWS.Client.Post
(URL => URL.To_UTF_8_String,
Data => JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_UTF_8_String,
Content_Type => "application/jose+json",
User_Agent => User_Agent);
Ada.Text_IO.Put_Line (AWS.Response.Status_Code (Result)'Img);
Ada.Text_IO.Put_Line
(AWS.Response.Message_Body (Result));
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
if AWS.Response.Has_Header (Result, "Replay-Nonce") then
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
end Challenge_Complete;
----------------------
-- Challenge_Status --
----------------------
procedure Challenge_Status
(Self : in out Context'Class;
Account_URL : League.Strings.Universal_String;
Private_Key : League.Stream_Element_Vectors.Stream_Element_Vector;
Challenge : ACME.Challenge;
Status : out League.Strings.Universal_String)
is
URL : constant League.Strings.Universal_String := Challenge.URL;
Doc : League.JSON.Documents.JSON_Document;
Nonce : League.Strings.Universal_String;
JWT : JWS.JSON_Web_Signature;
Header : JWS.JOSE_Header;
Result : AWS.Response.Data;
begin
Self.Get_Nonce (Nonce);
Ada.Wide_Wide_Text_IO.Put ("Nonce=");
Ada.Wide_Wide_Text_IO.Put_Line (Nonce.To_Wide_Wide_String);
Header.Set_Algorithm (+"RS256");
Header.Insert (+"nonce", -Nonce);
Header.Insert (+"url", -URL);
Header.Insert (+"kid", -Account_URL);
JWT.Create
(Header => Header,
Payload => (1 .. 0 => <>),
Secret => Private_Key.To_Stream_Element_Array);
Result := AWS.Client.Post
(URL => URL.To_UTF_8_String,
Data => JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_UTF_8_String,
Content_Type => "application/jose+json",
User_Agent => User_Agent);
Ada.Text_IO.Put_Line (AWS.Response.Status_Code (Result)'Img);
Ada.Text_IO.Put_Line
(AWS.Response.Message_Body (Result));
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
if AWS.Response.Has_Header (Result, "Replay-Nonce") then
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
Doc := League.JSON.Documents.From_JSON
(AWS.Response.Message_Body (Result));
Status := Doc.To_JSON_Object.Value (+"status").To_String;
end Challenge_Status;
--------------------
-- Create_Account --
--------------------
procedure Create_Account
(Self : in out Context'Class;
Public_Key : League.JSON.Objects.JSON_Object;
Private_Key : League.Stream_Element_Vectors.Stream_Element_Vector;
Contact : League.String_Vectors.Universal_String_Vector;
TOS_Agreed : Boolean := True;
Only_Existing : Boolean := False;
Account_URL : out League.Strings.Universal_String)
is
URL : constant League.Strings.Universal_String :=
Self.Directory.Value (+"newAccount").To_String;
Account : League.JSON.Objects.JSON_Object;
Nonce : League.Strings.Universal_String;
Meta : constant League.JSON.Objects.JSON_Object :=
Self.Directory.Value (+"meta").To_Object;
JWT : JWS.JSON_Web_Signature;
Header : JWS.JOSE_Header;
Result : AWS.Response.Data;
begin
Self.Get_Nonce (Nonce);
Ada.Wide_Wide_Text_IO.Put ("Nonce=");
Ada.Wide_Wide_Text_IO.Put_Line (Nonce.To_Wide_Wide_String);
if not Contact.Is_Empty then
declare
List : League.JSON.Arrays.JSON_Array;
begin
for J in 1 .. Contact.Length loop
List.Append (-Contact (J));
end loop;
Account.Insert (+"contact", List.To_JSON_Value);
end;
end if;
if Meta.Contains (+"termsOfService") then
Account.Insert
(+"termsOfServiceAgreed",
League.JSON.Values.To_JSON_Value (TOS_Agreed));
end if;
if Only_Existing then
Account.Insert
(+"onlyReturnExisting",
League.JSON.Values.To_JSON_Value (True));
end if;
Header.Set_Algorithm (+"RS256");
Header.Insert (+"nonce", -Nonce);
Header.Insert (+"url", -URL);
Header.Insert (+"jwk", Public_Key.To_JSON_Value);
JWT.Create
(Header => Header,
Payload => Account.To_JSON_Document.To_JSON.To_Stream_Element_Array,
Secret => Private_Key.To_Stream_Element_Array);
Result := AWS.Client.Post
(URL => URL.To_UTF_8_String,
Data => JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_UTF_8_String,
Content_Type => "application/jose+json",
User_Agent => User_Agent);
Ada.Text_IO.Put_Line (AWS.Response.Status_Code (Result)'Img);
Ada.Text_IO.Put_Line
(AWS.Response.Message_Body (Result));
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
Account_URL := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Location", 1));
if AWS.Response.Has_Header (Result, "Replay-Nonce") then
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
end Create_Account;
------------------
-- Create_Order --
------------------
procedure Create_Order
(Self : in out Context'Class;
Account_URL : League.Strings.Universal_String;
Private_Key : League.Stream_Element_Vectors.Stream_Element_Vector;
DNS_Id_List : League.String_Vectors.Universal_String_Vector;
Not_Before : Optional_Date_Time := (Is_Set => False);
Not_After : Optional_Date_Time := (Is_Set => False);
Auth_List : out League.String_Vectors.Universal_String_Vector;
Finalize : out League.Strings.Universal_String;
Order_URL : out League.Strings.Universal_String)
is
Format : constant League.Strings.Universal_String :=
+"yyyy-MM-ddTHH:mm:ss+04:00Z";
URL : constant League.Strings.Universal_String :=
Self.Directory.Value (+"newOrder").To_String;
Doc : League.JSON.Documents.JSON_Document;
Order : League.JSON.Objects.JSON_Object;
Nonce : League.Strings.Universal_String;
JWT : JWS.JSON_Web_Signature;
Header : JWS.JOSE_Header;
Result : AWS.Response.Data;
List : League.JSON.Arrays.JSON_Array;
begin
Self.Get_Nonce (Nonce);
Ada.Wide_Wide_Text_IO.Put ("Nonce=");
Ada.Wide_Wide_Text_IO.Put_Line (Nonce.To_Wide_Wide_String);
Header.Set_Algorithm (+"RS256");
Header.Insert (+"nonce", -Nonce);
Header.Insert (+"url", -URL);
Header.Insert (+"kid", -Account_URL);
for J in 1 .. DNS_Id_List.Length loop
declare
DNS : League.JSON.Objects.JSON_Object;
begin
DNS.Insert (+"type", -"dns");
DNS.Insert (+"value", -DNS_Id_List (J));
List.Append (DNS.To_JSON_Value);
end;
end loop;
Order.Insert (+"identifiers", List.To_JSON_Value);
if Not_Before.Is_Set then
Order.Insert
(+"notBefore",
-League.Calendars.ISO_8601.Image (Format, Not_Before.Value));
end if;
if Not_After.Is_Set then
Order.Insert
(+"notAfter",
-League.Calendars.ISO_8601.Image (Format, Not_After.Value));
end if;
JWT.Create
(Header => Header,
Payload => Order.To_JSON_Document.To_JSON.To_Stream_Element_Array,
Secret => Private_Key.To_Stream_Element_Array);
Ada.Wide_Wide_Text_IO.Put_Line
(JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_Wide_Wide_String);
Result := AWS.Client.Post
(URL => URL.To_UTF_8_String,
Data => JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_UTF_8_String,
Content_Type => "application/jose+json",
User_Agent => User_Agent);
Ada.Text_IO.Put_Line (AWS.Response.Status_Code (Result)'Img);
Ada.Text_IO.Put_Line
(AWS.Response.Message_Body (Result));
Doc := League.JSON.Documents.From_JSON
(AWS.Response.Message_Body (Result));
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
Order := Doc.To_JSON_Object;
declare
Vector : constant League.JSON.Arrays.JSON_Array :=
Order.Value (+"authorizations").To_Array;
begin
for J in 1 .. Vector.Length loop
Auth_List.Append (Vector (J).To_String);
end loop;
end;
Finalize := Order.Value (+"finalize").To_String;
Order_URL := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Location", 1));
if AWS.Response.Has_Header (Result, "Replay-Nonce") then
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
end Create_Order;
--------------------
-- Finalize_Order --
--------------------
procedure Finalize_Order
(Self : in out Context'Class;
Account_URL : League.Strings.Universal_String;
Private_Key : League.Stream_Element_Vectors.Stream_Element_Vector;
Finalize : League.Strings.Universal_String;
CSR : League.Stream_Element_Vectors.Stream_Element_Vector)
is
URL : constant League.Strings.Universal_String := Finalize;
Object : League.JSON.Objects.JSON_Object;
Nonce : League.Strings.Universal_String;
JWT : JWS.JSON_Web_Signature;
Header : JWS.JOSE_Header;
Result : AWS.Response.Data;
begin
Self.Get_Nonce (Nonce);
Ada.Wide_Wide_Text_IO.Put ("Nonce=");
Ada.Wide_Wide_Text_IO.Put_Line (Nonce.To_Wide_Wide_String);
Header.Set_Algorithm (+"RS256");
Header.Insert (+"nonce", -Nonce);
Header.Insert (+"url", -URL);
Header.Insert (+"kid", -Account_URL);
Object.Insert (+"csr", -JWS.To_Base_64_URL (CSR));
JWT.Create
(Header => Header,
Payload => Object.To_JSON_Document.To_JSON.To_Stream_Element_Array,
Secret => Private_Key.To_Stream_Element_Array);
Ada.Wide_Wide_Text_IO.Put_Line
(JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_Wide_Wide_String);
Result := AWS.Client.Post
(URL => URL.To_UTF_8_String,
Data => JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_UTF_8_String,
Content_Type => "application/jose+json",
User_Agent => User_Agent);
Ada.Text_IO.Put_Line (AWS.Response.Status_Code (Result)'Img);
Ada.Text_IO.Put_Line
(AWS.Response.Message_Body (Result));
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
if AWS.Response.Has_Header (Result, "Replay-Nonce") then
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
end Finalize_Order;
-----------------------
-- Get_Authorization --
-----------------------
procedure Get_Challenges
(Self : in out Context'Class;
Account_URL : League.Strings.Universal_String;
Private_Key : League.Stream_Element_Vectors.Stream_Element_Vector;
Auth_URL : League.Strings.Universal_String;
HTTP : out Challenge;
DNS : out Challenge)
is
URL : constant League.Strings.Universal_String := Auth_URL;
Doc : League.JSON.Documents.JSON_Document;
Auth : League.JSON.Objects.JSON_Object;
Nonce : League.Strings.Universal_String;
JWT : JWS.JSON_Web_Signature;
Header : JWS.JOSE_Header;
Result : AWS.Response.Data;
begin
Self.Get_Nonce (Nonce);
Ada.Wide_Wide_Text_IO.Put ("Nonce=");
Ada.Wide_Wide_Text_IO.Put_Line (Nonce.To_Wide_Wide_String);
Header.Set_Algorithm (+"RS256");
Header.Insert (+"nonce", -Nonce);
Header.Insert (+"url", -URL);
Header.Insert (+"kid", -Account_URL);
JWT.Create
(Header => Header,
Payload => (1 .. 0 => <>),
Secret => Private_Key.To_Stream_Element_Array);
Result := AWS.Client.Post
(URL => URL.To_UTF_8_String,
Data => JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_UTF_8_String,
Content_Type => "application/jose+json",
User_Agent => User_Agent);
Ada.Text_IO.Put_Line (AWS.Response.Status_Code (Result)'Img);
Ada.Text_IO.Put_Line
(AWS.Response.Message_Body (Result));
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
Doc := League.JSON.Documents.From_JSON
(AWS.Response.Message_Body (Result));
Auth := Doc.To_JSON_Object;
declare
Vector : constant League.JSON.Arrays.JSON_Array :=
Auth.Value (+"challenges").To_Array;
begin
for J in 1 .. Vector.Length loop
declare
use type League.Strings.Universal_String;
Item : constant League.JSON.Objects.JSON_Object :=
Vector (J).To_Object;
begin
if Item.Value (+"type").To_String = +"http-01" then
HTTP.URL := Item.Value (+"url").To_String;
HTTP.Token := Item.Value (+"token").To_String;
elsif Item.Value (+"type").To_String = +"dns-01" then
DNS.URL := Item.Value (+"url").To_String;
DNS.Token := Item.Value (+"token").To_String;
end if;
end;
end loop;
end;
if AWS.Response.Has_Header (Result, "Replay-Nonce") then
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
end Get_Challenges;
procedure Get_Certificate
(Self : in out Context'Class;
Account_URL : League.Strings.Universal_String;
Private_Key : League.Stream_Element_Vectors.Stream_Element_Vector;
Certificate : League.Strings.Universal_String;
Text : out League.Strings.Universal_String)
is
URL : constant League.Strings.Universal_String := Certificate;
Nonce : League.Strings.Universal_String;
JWT : JWS.JSON_Web_Signature;
Header : JWS.JOSE_Header;
Headers : AWS.Client.Header_List;
Result : AWS.Response.Data;
begin
Self.Get_Nonce (Nonce);
Header.Set_Algorithm (+"RS256");
Header.Insert (+"nonce", -Nonce);
Header.Insert (+"url", -URL);
Header.Insert (+"kid", -Account_URL);
JWT.Create
(Header => Header,
Payload => (1 .. 0 => <>),
Secret => Private_Key.To_Stream_Element_Array);
Headers.Add ("Accept", "application/pem-certificate-chain");
Result := AWS.Client.Post
(URL => URL.To_UTF_8_String,
Data => JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_UTF_8_String,
Content_Type => "application/jose+json",
Headers => Headers,
User_Agent => User_Agent);
Ada.Text_IO.Put_Line (AWS.Response.Status_Code (Result)'Img);
Ada.Text_IO.Put_Line
(AWS.Response.Message_Body (Result));
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
if AWS.Response.Has_Header (Result, "Replay-Nonce") then
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
Text := League.Strings.From_UTF_8_String
(AWS.Response.Message_Body (Result));
end Get_Certificate;
---------------
-- Get_Nonce --
---------------
procedure Get_Nonce
(Self : in out Context'Class;
Nonce : out League.Strings.Universal_String)
is
Result : AWS.Response.Data;
URL : League.Strings.Universal_String;
begin
if Self.Nonce.Is_Empty then
URL := Self.Directory.Value (+"newNonce").To_String;
Result := AWS.Client.Head
(URL => URL.To_UTF_8_String,
User_Agent => User_Agent);
pragma Assert (AWS.Response.Has_Header (Result, "Replay-Nonce"));
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
Nonce := Self.Nonce;
end Get_Nonce;
procedure Get_Order_Status
(Self : in out Context'Class;
Account_URL : League.Strings.Universal_String;
Private_Key : League.Stream_Element_Vectors.Stream_Element_Vector;
Order_URL : League.Strings.Universal_String;
Certificate : out League.Strings.Universal_String;
Status : out League.Strings.Universal_String)
is
URL : constant League.Strings.Universal_String := Order_URL;
Doc : League.JSON.Documents.JSON_Document;
Nonce : League.Strings.Universal_String;
JWT : JWS.JSON_Web_Signature;
Header : JWS.JOSE_Header;
Result : AWS.Response.Data;
begin
Self.Get_Nonce (Nonce);
Header.Set_Algorithm (+"RS256");
Header.Insert (+"nonce", -Nonce);
Header.Insert (+"url", -URL);
Header.Insert (+"kid", -Account_URL);
JWT.Create
(Header => Header,
Payload => (1 .. 0 => <>),
Secret => Private_Key.To_Stream_Element_Array);
Result := AWS.Client.Post
(URL => URL.To_UTF_8_String,
Data => JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_UTF_8_String,
Content_Type => "application/jose+json",
User_Agent => User_Agent);
Ada.Text_IO.Put_Line (AWS.Response.Status_Code (Result)'Img);
Ada.Text_IO.Put_Line
(AWS.Response.Message_Body (Result));
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
if AWS.Response.Has_Header (Result, "Replay-Nonce") then
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
Doc := League.JSON.Documents.From_JSON
(AWS.Response.Message_Body (Result));
Status := Doc.To_JSON_Object.Value (+"status").To_String;
Certificate := Doc.To_JSON_Object.Value (+"certificate").To_String;
end Get_Order_Status;
----------------
-- Initialize --
----------------
procedure Initialize
(Self : in out Context'Class;
Directory_URL : League.Strings.Universal_String;
Terms_Of_Service : out League.Strings.Universal_String)
is
Doc : League.JSON.Documents.JSON_Document;
Meta : League.JSON.Objects.JSON_Object;
Result : AWS.Response.Data;
URL : constant League.Strings.Universal_String := Directory_URL;
begin
Result := AWS.Client.Get
(URL => URL.To_UTF_8_String,
Follow_Redirection => True,
User_Agent => User_Agent);
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
Doc := League.JSON.Documents.From_JSON
(AWS.Response.Message_Body (Result));
Self.Directory := Doc.To_JSON_Object;
pragma Assert (Self.Directory.Contains (+"newNonce"));
pragma Assert (Self.Directory.Contains (+"newAccount"));
pragma Assert (Self.Directory.Contains (+"newOrder"));
pragma Assert (Self.Directory.Contains (+"revokeCert"));
pragma Assert (Self.Directory.Contains (+"keyChange"));
Meta := Self.Directory.Value (+"meta").To_Object;
Terms_Of_Service := Meta.Value (+"termsOfService").To_String;
end Initialize;
-----------------------
-- Key_Authorization --
-----------------------
function Key_Authorization
(Token : League.Strings.Universal_String;
Public_Key : League.JSON.Objects.JSON_Object)
return League.Strings.Universal_String
is
SHA256 : constant GNAT.SHA256.Binary_Message_Digest :=
GNAT.SHA256.Digest (JWS.Thumbprint (Public_Key));
Vector : League.Stream_Element_Vectors.Stream_Element_Vector;
Result : League.Strings.Universal_String;
begin
Vector.Append (SHA256);
Result.Append (Token);
Result.Append ('.');
Result.Append (JWS.To_Base_64_URL (Vector));
return Result;
end Key_Authorization;
end ACME;
| true |
-- SPDX-FileCopyrightText: 2020 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>
--
-- SPDX-License-Identifier: MIT
----------------------------------------------------------------
with Ada.Text_IO;
with Ada.Wide_Wide_Text_IO;
with GNAT.SHA256;
with AWS.Client;
with AWS.Default;
with AWS.Messages;
with AWS.Response;
with JWS;
with JWS.RS256; pragma Unreferenced (JWS.RS256); -- Enable RS256
with JWS.To_Base_64_URL;
with League.Calendars.ISO_8601;
with League.JSON.Arrays;
with League.JSON.Documents;
with League.JSON.Values;
package body ACME is
function "+" (V : Wide_Wide_String) return League.Strings.Universal_String
renames League.Strings.To_Universal_String;
function "-" (V : Wide_Wide_String) return League.JSON.Values.JSON_Value
is (League.JSON.Values.To_JSON_Value (+V));
function "-" (V : League.Strings.Universal_String)
return League.JSON.Values.JSON_Value
is (League.JSON.Values.To_JSON_Value (V));
User_Agent : constant String := AWS.Default.User_Agent &
" acme-ada 0.0.1";
procedure Get_Nonce
(Self : in out Context'Class;
Nonce : out League.Strings.Universal_String);
------------------------
-- Challenge_Complete --
------------------------
procedure Challenge_Complete
(Self : in out Context'Class;
Account_URL : League.Strings.Universal_String;
Private_Key : League.Stream_Element_Vectors.Stream_Element_Vector;
Challenge : ACME.Challenge)
is
URL : constant League.Strings.Universal_String := Challenge.URL;
Nonce : League.Strings.Universal_String;
JWT : JWS.JSON_Web_Signature;
Header : JWS.JOSE_Header;
Result : AWS.Response.Data;
begin
Self.Get_Nonce (Nonce);
Ada.Wide_Wide_Text_IO.Put ("Nonce=");
Ada.Wide_Wide_Text_IO.Put_Line (Nonce.To_Wide_Wide_String);
Header.Set_Algorithm (+"RS256");
Header.Insert (+"nonce", -Nonce);
Header.Insert (+"url", -URL);
Header.Insert (+"kid", -Account_URL);
JWT.Create
(Header => Header,
Payload => League.JSON.Objects.Empty_JSON_Object.
To_JSON_Document.To_JSON.To_Stream_Element_Array,
Secret => Private_Key.To_Stream_Element_Array);
Ada.Wide_Wide_Text_IO.Put_Line
(JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_Wide_Wide_String);
Result := AWS.Client.Post
(URL => URL.To_UTF_8_String,
Data => JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_UTF_8_String,
Content_Type => "application/jose+json",
User_Agent => User_Agent);
Ada.Text_IO.Put_Line (AWS.Response.Status_Code (Result)'Img);
Ada.Text_IO.Put_Line
(AWS.Response.Message_Body (Result));
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
if AWS.Response.Has_Header (Result, "Replay-Nonce") then
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
end Challenge_Complete;
----------------------
-- Challenge_Status --
----------------------
procedure Challenge_Status
(Self : in out Context'Class;
Account_URL : League.Strings.Universal_String;
Private_Key : League.Stream_Element_Vectors.Stream_Element_Vector;
Challenge : ACME.Challenge;
Status : out League.Strings.Universal_String)
is
URL : constant League.Strings.Universal_String := Challenge.URL;
Doc : League.JSON.Documents.JSON_Document;
Nonce : League.Strings.Universal_String;
JWT : JWS.JSON_Web_Signature;
Header : JWS.JOSE_Header;
Result : AWS.Response.Data;
begin
Self.Get_Nonce (Nonce);
Ada.Wide_Wide_Text_IO.Put ("Nonce=");
Ada.Wide_Wide_Text_IO.Put_Line (Nonce.To_Wide_Wide_String);
Header.Set_Algorithm (+"RS256");
Header.Insert (+"nonce", -Nonce);
Header.Insert (+"url", -URL);
Header.Insert (+"kid", -Account_URL);
JWT.Create
(Header => Header,
Payload => (1 .. 0 => <>),
Secret => Private_Key.To_Stream_Element_Array);
Result := AWS.Client.Post
(URL => URL.To_UTF_8_String,
Data => JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_UTF_8_String,
Content_Type => "application/jose+json",
User_Agent => User_Agent);
Ada.Text_IO.Put_Line (AWS.Response.Status_Code (Result)'Img);
Ada.Text_IO.Put_Line
(AWS.Response.Message_Body (Result));
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
if AWS.Response.Has_Header (Result, "Replay-Nonce") then
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
Doc := League.JSON.Documents.From_JSON
(AWS.Response.Message_Body (Result));
Status := Doc.To_JSON_Object.Value (+"status").To_String;
end Challenge_Status;
--------------------
-- Create_Account --
--------------------
procedure Create_Account
(Self : in out Context'Class;
Public_Key : League.JSON.Objects.JSON_Object;
Private_Key : League.Stream_Element_Vectors.Stream_Element_Vector;
Contact : League.String_Vectors.Universal_String_Vector;
TOS_Agreed : Boolean := True;
Only_Existing : Boolean := False;
Account_URL : out League.Strings.Universal_String)
is
URL : constant League.Strings.Universal_String :=
Self.Directory.Value (+"newAccount").To_String;
Account : League.JSON.Objects.JSON_Object;
Nonce : League.Strings.Universal_String;
Meta : constant League.JSON.Objects.JSON_Object :=
Self.Directory.Value (+"meta").To_Object;
JWT : JWS.JSON_Web_Signature;
Header : JWS.JOSE_Header;
Result : AWS.Response.Data;
begin
Self.Get_Nonce (Nonce);
Ada.Wide_Wide_Text_IO.Put ("Nonce=");
Ada.Wide_Wide_Text_IO.Put_Line (Nonce.To_Wide_Wide_String);
if not Contact.Is_Empty then
declare
List : League.JSON.Arrays.JSON_Array;
begin
for J in 1 .. Contact.Length loop
List.Append (-Contact (J));
end loop;
Account.Insert (+"contact", List.To_JSON_Value);
end;
end if;
if Meta.Contains (+"termsOfService") then
Account.Insert
(+"termsOfServiceAgreed",
League.JSON.Values.To_JSON_Value (TOS_Agreed));
end if;
if Only_Existing then
Account.Insert
(+"onlyReturnExisting",
League.JSON.Values.To_JSON_Value (True));
end if;
Header.Set_Algorithm (+"RS256");
Header.Insert (+"nonce", -Nonce);
Header.Insert (+"url", -URL);
Header.Insert (+"jwk", Public_Key.To_JSON_Value);
JWT.Create
(Header => Header,
Payload => Account.To_JSON_Document.To_JSON.To_Stream_Element_Array,
Secret => Private_Key.To_Stream_Element_Array);
Result := AWS.Client.Post
(URL => URL.To_UTF_8_String,
Data => JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_UTF_8_String,
Content_Type => "application/jose+json",
User_Agent => User_Agent);
Ada.Text_IO.Put_Line (AWS.Response.Status_Code (Result)'Img);
Ada.Text_IO.Put_Line
(AWS.Response.Message_Body (Result));
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
Account_URL := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Location", 1));
if AWS.Response.Has_Header (Result, "Replay-Nonce") then
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
end Create_Account;
------------------
-- Create_Order --
------------------
procedure Create_Order
(Self : in out Context'Class;
Account_URL : League.Strings.Universal_String;
Private_Key : League.Stream_Element_Vectors.Stream_Element_Vector;
DNS_Id_List : League.String_Vectors.Universal_String_Vector;
Not_Before : Optional_Date_Time := (Is_Set => False);
Not_After : Optional_Date_Time := (Is_Set => False);
Auth_List : out League.String_Vectors.Universal_String_Vector;
Finalize : out League.Strings.Universal_String;
Order_URL : out League.Strings.Universal_String)
is
Format : constant League.Strings.Universal_String :=
+"yyyy-MM-ddTHH:mm:ss+04:00Z";
URL : constant League.Strings.Universal_String :=
Self.Directory.Value (+"newOrder").To_String;
Doc : League.JSON.Documents.JSON_Document;
Order : League.JSON.Objects.JSON_Object;
Nonce : League.Strings.Universal_String;
JWT : JWS.JSON_Web_Signature;
Header : JWS.JOSE_Header;
Result : AWS.Response.Data;
List : League.JSON.Arrays.JSON_Array;
begin
Self.Get_Nonce (Nonce);
Ada.Wide_Wide_Text_IO.Put ("Nonce=");
Ada.Wide_Wide_Text_IO.Put_Line (Nonce.To_Wide_Wide_String);
Header.Set_Algorithm (+"RS256");
Header.Insert (+"nonce", -Nonce);
Header.Insert (+"url", -URL);
Header.Insert (+"kid", -Account_URL);
for J in 1 .. DNS_Id_List.Length loop
declare
DNS : League.JSON.Objects.JSON_Object;
begin
DNS.Insert (+"type", -"dns");
DNS.Insert (+"value", -DNS_Id_List (J));
List.Append (DNS.To_JSON_Value);
end;
end loop;
Order.Insert (+"identifiers", List.To_JSON_Value);
if Not_Before.Is_Set then
Order.Insert
(+"notBefore",
-League.Calendars.ISO_8601.Image (Format, Not_Before.Value));
end if;
if Not_After.Is_Set then
Order.Insert
(+"notAfter",
-League.Calendars.ISO_8601.Image (Format, Not_After.Value));
end if;
JWT.Create
(Header => Header,
Payload => Order.To_JSON_Document.To_JSON.To_Stream_Element_Array,
Secret => Private_Key.To_Stream_Element_Array);
Ada.Wide_Wide_Text_IO.Put_Line
(JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_Wide_Wide_String);
Result := AWS.Client.Post
(URL => URL.To_UTF_8_String,
Data => JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_UTF_8_String,
Content_Type => "application/jose+json",
User_Agent => User_Agent);
Ada.Text_IO.Put_Line (AWS.Response.Status_Code (Result)'Img);
Ada.Text_IO.Put_Line
(AWS.Response.Message_Body (Result));
Doc := League.JSON.Documents.From_JSON
(AWS.Response.Message_Body (Result));
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
Order := Doc.To_JSON_Object;
declare
Vector : constant League.JSON.Arrays.JSON_Array :=
Order.Value (+"authorizations").To_Array;
begin
for J in 1 .. Vector.Length loop
Auth_List.Append (Vector (J).To_String);
end loop;
end;
Finalize := Order.Value (+"finalize").To_String;
Order_URL := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Location", 1));
if AWS.Response.Has_Header (Result, "Replay-Nonce") then
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
end Create_Order;
--------------------
-- Finalize_Order --
--------------------
procedure Finalize_Order
(Self : in out Context'Class;
Account_URL : League.Strings.Universal_String;
Private_Key : League.Stream_Element_Vectors.Stream_Element_Vector;
Finalize : League.Strings.Universal_String;
CSR : League.Stream_Element_Vectors.Stream_Element_Vector)
is
URL : constant League.Strings.Universal_String := Finalize;
Object : League.JSON.Objects.JSON_Object;
Nonce : League.Strings.Universal_String;
JWT : JWS.JSON_Web_Signature;
Header : JWS.JOSE_Header;
Result : AWS.Response.Data;
begin
Self.Get_Nonce (Nonce);
Ada.Wide_Wide_Text_IO.Put ("Nonce=");
Ada.Wide_Wide_Text_IO.Put_Line (Nonce.To_Wide_Wide_String);
Header.Set_Algorithm (+"RS256");
Header.Insert (+"nonce", -Nonce);
Header.Insert (+"url", -URL);
Header.Insert (+"kid", -Account_URL);
Object.Insert (+"csr", -JWS.To_Base_64_URL (CSR));
JWT.Create
(Header => Header,
Payload => Object.To_JSON_Document.To_JSON.To_Stream_Element_Array,
Secret => Private_Key.To_Stream_Element_Array);
Ada.Wide_Wide_Text_IO.Put_Line
(JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_Wide_Wide_String);
Result := AWS.Client.Post
(URL => URL.To_UTF_8_String,
Data => JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_UTF_8_String,
Content_Type => "application/jose+json",
User_Agent => User_Agent);
Ada.Text_IO.Put_Line (AWS.Response.Status_Code (Result)'Img);
Ada.Text_IO.Put_Line
(AWS.Response.Message_Body (Result));
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
if AWS.Response.Has_Header (Result, "Replay-Nonce") then
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
end Finalize_Order;
-----------------------
-- Get_Authorization --
-----------------------
procedure Get_Challenges
(Self : in out Context'Class;
Account_URL : League.Strings.Universal_String;
Private_Key : League.Stream_Element_Vectors.Stream_Element_Vector;
Auth_URL : League.Strings.Universal_String;
HTTP : out Challenge;
DNS : out Challenge)
is
URL : constant League.Strings.Universal_String := Auth_URL;
Doc : League.JSON.Documents.JSON_Document;
Auth : League.JSON.Objects.JSON_Object;
Nonce : League.Strings.Universal_String;
JWT : JWS.JSON_Web_Signature;
Header : JWS.JOSE_Header;
Result : AWS.Response.Data;
begin
Self.Get_Nonce (Nonce);
Ada.Wide_Wide_Text_IO.Put ("Nonce=");
Ada.Wide_Wide_Text_IO.Put_Line (Nonce.To_Wide_Wide_String);
Header.Set_Algorithm (+"RS256");
Header.Insert (+"nonce", -Nonce);
Header.Insert (+"url", -URL);
Header.Insert (+"kid", -Account_URL);
JWT.Create
(Header => Header,
Payload => (1 .. 0 => <>),
Secret => Private_Key.To_Stream_Element_Array);
Result := AWS.Client.Post
(URL => URL.To_UTF_8_String,
Data => JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_UTF_8_String,
Content_Type => "application/jose+json",
User_Agent => User_Agent);
Ada.Text_IO.Put_Line (AWS.Response.Status_Code (Result)'Img);
Ada.Text_IO.Put_Line
(AWS.Response.Message_Body (Result));
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
Doc := League.JSON.Documents.From_JSON
(AWS.Response.Message_Body (Result));
Auth := Doc.To_JSON_Object;
declare
Vector : constant League.JSON.Arrays.JSON_Array :=
Auth.Value (+"challenges").To_Array;
begin
for J in 1 .. Vector.Length loop
declare
use type League.Strings.Universal_String;
Item : constant League.JSON.Objects.JSON_Object :=
Vector (J).To_Object;
begin
if Item.Value (+"type").To_String = +"http-01" then
HTTP.URL := Item.Value (+"url").To_String;
HTTP.Token := Item.Value (+"token").To_String;
elsif Item.Value (+"type").To_String = +"dns-01" then
DNS.URL := Item.Value (+"url").To_String;
DNS.Token := Item.Value (+"token").To_String;
end if;
end;
end loop;
end;
if AWS.Response.Has_Header (Result, "Replay-Nonce") then
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
end Get_Challenges;
procedure Get_Certificate
(Self : in out Context'Class;
Account_URL : League.Strings.Universal_String;
Private_Key : League.Stream_Element_Vectors.Stream_Element_Vector;
Certificate : League.Strings.Universal_String;
Text : out League.Strings.Universal_String)
is
URL : constant League.Strings.Universal_String := Certificate;
Nonce : League.Strings.Universal_String;
JWT : JWS.JSON_Web_Signature;
Header : JWS.JOSE_Header;
Headers : AWS.Client.Header_List;
Result : AWS.Response.Data;
begin
Self.Get_Nonce (Nonce);
Header.Set_Algorithm (+"RS256");
Header.Insert (+"nonce", -Nonce);
Header.Insert (+"url", -URL);
Header.Insert (+"kid", -Account_URL);
JWT.Create
(Header => Header,
Payload => (1 .. 0 => <>),
Secret => Private_Key.To_Stream_Element_Array);
Headers.Add ("Accept", "application/pem-certificate-chain");
Result := AWS.Client.Post
(URL => URL.To_UTF_8_String,
Data => JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_UTF_8_String,
Content_Type => "application/jose+json",
Headers => Headers,
User_Agent => User_Agent);
Ada.Text_IO.Put_Line (AWS.Response.Status_Code (Result)'Img);
Ada.Text_IO.Put_Line
(AWS.Response.Message_Body (Result));
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
if AWS.Response.Has_Header (Result, "Replay-Nonce") then
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
Text := League.Strings.From_UTF_8_String
(AWS.Response.Message_Body (Result));
end Get_Certificate;
---------------
-- Get_Nonce --
---------------
procedure Get_Nonce
(Self : in out Context'Class;
Nonce : out League.Strings.Universal_String)
is
Result : AWS.Response.Data;
URL : League.Strings.Universal_String;
begin
if Self.Nonce.Is_Empty then
URL := Self.Directory.Value (+"newNonce").To_String;
Result := AWS.Client.Head
(URL => URL.To_UTF_8_String,
User_Agent => User_Agent);
pragma Assert (AWS.Response.Has_Header (Result, "Replay-Nonce"));
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
Nonce := Self.Nonce;
end Get_Nonce;
procedure Get_Order_Status
(Self : in out Context'Class;
Account_URL : League.Strings.Universal_String;
Private_Key : League.Stream_Element_Vectors.Stream_Element_Vector;
Order_URL : League.Strings.Universal_String;
Certificate : out League.Strings.Universal_String;
Status : out League.Strings.Universal_String)
is
URL : constant League.Strings.Universal_String := Order_URL;
Doc : League.JSON.Documents.JSON_Document;
Nonce : League.Strings.Universal_String;
JWT : JWS.JSON_Web_Signature;
Header : JWS.JOSE_Header;
Result : AWS.Response.Data;
begin
Self.Get_Nonce (Nonce);
Header.Set_Algorithm (+"RS256");
Header.Insert (+"nonce", -Nonce);
Header.Insert (+"url", -URL);
Header.Insert (+"kid", -Account_URL);
JWT.Create
(Header => Header,
Payload => (1 .. 0 => <>),
Secret => Private_Key.To_Stream_Element_Array);
Result := AWS.Client.Post
(URL => URL.To_UTF_8_String,
Data => JWT.Flattened_Serialization.
To_JSON_Document.To_JSON.To_UTF_8_String,
Content_Type => "application/jose+json",
User_Agent => User_Agent);
Ada.Text_IO.Put_Line (AWS.Response.Status_Code (Result)'Img);
Ada.Text_IO.Put_Line
(AWS.Response.Message_Body (Result));
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
if AWS.Response.Has_Header (Result, "Replay-Nonce") then
Self.Nonce := League.Strings.From_UTF_8_String
(AWS.Response.Header (Result, "Replay-Nonce", 1));
end if;
Doc := League.JSON.Documents.From_JSON
(AWS.Response.Message_Body (Result));
Status := Doc.To_JSON_Object.Value (+"status").To_String;
Certificate := Doc.To_JSON_Object.Value (+"certificate").To_String;
end Get_Order_Status;
----------------
-- Initialize --
----------------
procedure Initialize
(Self : in out Context'Class;
Directory_URL : League.Strings.Universal_String;
Terms_Of_Service : out League.Strings.Universal_String)
is
Doc : League.JSON.Documents.JSON_Document;
Meta : League.JSON.Objects.JSON_Object;
Result : AWS.Response.Data;
URL : constant League.Strings.Universal_String := Directory_URL;
begin
Result := AWS.Client.Get
(URL => URL.To_UTF_8_String,
Follow_Redirection => True,
User_Agent => User_Agent);
pragma Assert
(AWS.Response.Status_Code (Result) in AWS.Messages.Success);
Doc := League.JSON.Documents.From_JSON
(AWS.Response.Message_Body (Result));
Self.Directory := Doc.To_JSON_Object;
pragma Assert (Self.Directory.Contains (+"newNonce"));
pragma Assert (Self.Directory.Contains (+"newAccount"));
pragma Assert (Self.Directory.Contains (+"newOrder"));
pragma Assert (Self.Directory.Contains (+"revokeCert"));
pragma Assert (Self.Directory.Contains (+"keyChange"));
Meta := Self.Directory.Value (+"meta").To_Object;
Terms_Of_Service := Meta.Value (+"termsOfService").To_String;
end Initialize;
-----------------------
-- Key_Authorization --
-----------------------
function Key_Authorization
(Token : League.Strings.Universal_String;
Public_Key : League.JSON.Objects.JSON_Object)
return League.Strings.Universal_String
is
SHA256 : constant GNAT.SHA256.Binary_Message_Digest :=
GNAT.SHA256.Digest (JWS.Thumbprint (Public_Key));
Vector : League.Stream_Element_Vectors.Stream_Element_Vector;
Result : League.Strings.Universal_String;
begin
Vector.Append (SHA256);
Result.Append (Token);
Result.Append ('.');
Result.Append (JWS.To_Base_64_URL (Vector));
return Result;
end Key_Authorization;
end ACME;
|
[
{
"context": " --\n-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --\n-- All rig",
"end": 829,
"score": 0.9998860359191895,
"start": 816,
"tag": "NAME",
"value": "Vadim Godunko"
},
{
"context": " --\n-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --\n-- All rights reserved. ",
"end": 849,
"score": 0.9999328851699829,
"start": 831,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
source/amf/uml/amf-internals-tables-umldi_metamodel.adb
|
svn2github/matreshka
| 24 |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
package body AMF.Internals.Tables.UMLDI_Metamodel is
--------------------
-- MM_UMLDI_UMLDI --
--------------------
function MM_UMLDI_UMLDI return AMF.Internals.CMOF_Element is
begin
return Base + 96;
end MM_UMLDI_UMLDI;
--------------------------------------------------------------
-- MC_UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind --
--------------------------------------------------------------
function MC_UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind return AMF.Internals.CMOF_Element is
begin
return Base + 272;
end MC_UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind;
----------------------------------------------
-- MC_UMLDI_UML_Inherited_State_Border_Kind --
----------------------------------------------
function MC_UMLDI_UML_Inherited_State_Border_Kind return AMF.Internals.CMOF_Element is
begin
return Base + 275;
end MC_UMLDI_UML_Inherited_State_Border_Kind;
-------------------------------------------
-- MC_UMLDI_UML_Interaction_Diagram_Kind --
-------------------------------------------
function MC_UMLDI_UML_Interaction_Diagram_Kind return AMF.Internals.CMOF_Element is
begin
return Base + 281;
end MC_UMLDI_UML_Interaction_Diagram_Kind;
-----------------------------------------------
-- MC_UMLDI_UML_Interaction_Table_Label_Kind --
-----------------------------------------------
function MC_UMLDI_UML_Interaction_Table_Label_Kind return AMF.Internals.CMOF_Element is
begin
return Base + 293;
end MC_UMLDI_UML_Interaction_Table_Label_Kind;
---------------------------------------------
-- MC_UMLDI_UML_Navigability_Notation_Kind --
---------------------------------------------
function MC_UMLDI_UML_Navigability_Notation_Kind return AMF.Internals.CMOF_Element is
begin
return Base + 309;
end MC_UMLDI_UML_Navigability_Notation_Kind;
-----------------------------------
-- MC_UMLDI_UML_Activity_Diagram --
-----------------------------------
function MC_UMLDI_UML_Activity_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 1;
end MC_UMLDI_UML_Activity_Diagram;
----------------------------------------
-- MC_UMLDI_UML_Association_End_Label --
----------------------------------------
function MC_UMLDI_UML_Association_End_Label return AMF.Internals.CMOF_Element is
begin
return Base + 2;
end MC_UMLDI_UML_Association_End_Label;
---------------------------------------------------------
-- MC_UMLDI_UML_Association_Or_Connector_Or_Link_Shape --
---------------------------------------------------------
function MC_UMLDI_UML_Association_Or_Connector_Or_Link_Shape return AMF.Internals.CMOF_Element is
begin
return Base + 3;
end MC_UMLDI_UML_Association_Or_Connector_Or_Link_Shape;
-----------------------------------
-- MC_UMLDI_UML_Behavior_Diagram --
-----------------------------------
function MC_UMLDI_UML_Behavior_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 4;
end MC_UMLDI_UML_Behavior_Diagram;
--------------------------------
-- MC_UMLDI_UML_Class_Diagram --
--------------------------------
function MC_UMLDI_UML_Class_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 5;
end MC_UMLDI_UML_Class_Diagram;
-------------------------------------------------------
-- MC_UMLDI_UML_Class_Or_Composite_Structure_Diagram --
-------------------------------------------------------
function MC_UMLDI_UML_Class_Or_Composite_Structure_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 6;
end MC_UMLDI_UML_Class_Or_Composite_Structure_Diagram;
-----------------------------------
-- MC_UMLDI_UML_Classifier_Shape --
-----------------------------------
function MC_UMLDI_UML_Classifier_Shape return AMF.Internals.CMOF_Element is
begin
return Base + 7;
end MC_UMLDI_UML_Classifier_Shape;
------------------------------
-- MC_UMLDI_UML_Compartment --
------------------------------
function MC_UMLDI_UML_Compartment return AMF.Internals.CMOF_Element is
begin
return Base + 8;
end MC_UMLDI_UML_Compartment;
----------------------------------------
-- MC_UMLDI_UML_Compartmentable_Shape --
----------------------------------------
function MC_UMLDI_UML_Compartmentable_Shape return AMF.Internals.CMOF_Element is
begin
return Base + 9;
end MC_UMLDI_UML_Compartmentable_Shape;
------------------------------------
-- MC_UMLDI_UML_Component_Diagram --
------------------------------------
function MC_UMLDI_UML_Component_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 10;
end MC_UMLDI_UML_Component_Diagram;
----------------------------------------------
-- MC_UMLDI_UML_Composite_Structure_Diagram --
----------------------------------------------
function MC_UMLDI_UML_Composite_Structure_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 11;
end MC_UMLDI_UML_Composite_Structure_Diagram;
-------------------------------------
-- MC_UMLDI_UML_Deployment_Diagram --
-------------------------------------
function MC_UMLDI_UML_Deployment_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 12;
end MC_UMLDI_UML_Deployment_Diagram;
--------------------------
-- MC_UMLDI_UML_Diagram --
--------------------------
function MC_UMLDI_UML_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 13;
end MC_UMLDI_UML_Diagram;
----------------------------------
-- MC_UMLDI_UML_Diagram_Element --
----------------------------------
function MC_UMLDI_UML_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 14;
end MC_UMLDI_UML_Diagram_Element;
-----------------------
-- MC_UMLDI_UML_Edge --
-----------------------
function MC_UMLDI_UML_Edge return AMF.Internals.CMOF_Element is
begin
return Base + 15;
end MC_UMLDI_UML_Edge;
--------------------------------------
-- MC_UMLDI_UML_Interaction_Diagram --
--------------------------------------
function MC_UMLDI_UML_Interaction_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 16;
end MC_UMLDI_UML_Interaction_Diagram;
------------------------------------------
-- MC_UMLDI_UML_Interaction_Table_Label --
------------------------------------------
function MC_UMLDI_UML_Interaction_Table_Label return AMF.Internals.CMOF_Element is
begin
return Base + 17;
end MC_UMLDI_UML_Interaction_Table_Label;
--------------------------------
-- MC_UMLDI_UML_Keyword_Label --
--------------------------------
function MC_UMLDI_UML_Keyword_Label return AMF.Internals.CMOF_Element is
begin
return Base + 18;
end MC_UMLDI_UML_Keyword_Label;
------------------------
-- MC_UMLDI_UML_Label --
------------------------
function MC_UMLDI_UML_Label return AMF.Internals.CMOF_Element is
begin
return Base + 19;
end MC_UMLDI_UML_Label;
-------------------------------------
-- MC_UMLDI_UML_Multiplicity_Label --
-------------------------------------
function MC_UMLDI_UML_Multiplicity_Label return AMF.Internals.CMOF_Element is
begin
return Base + 20;
end MC_UMLDI_UML_Multiplicity_Label;
-----------------------------
-- MC_UMLDI_UML_Name_Label --
-----------------------------
function MC_UMLDI_UML_Name_Label return AMF.Internals.CMOF_Element is
begin
return Base + 21;
end MC_UMLDI_UML_Name_Label;
---------------------------------
-- MC_UMLDI_UML_Object_Diagram --
---------------------------------
function MC_UMLDI_UML_Object_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 22;
end MC_UMLDI_UML_Object_Diagram;
----------------------------------
-- MC_UMLDI_UML_Package_Diagram --
----------------------------------
function MC_UMLDI_UML_Package_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 23;
end MC_UMLDI_UML_Package_Diagram;
----------------------------------
-- MC_UMLDI_UML_Profile_Diagram --
----------------------------------
function MC_UMLDI_UML_Profile_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 24;
end MC_UMLDI_UML_Profile_Diagram;
----------------------------------
-- MC_UMLDI_UML_Redefines_Label --
----------------------------------
function MC_UMLDI_UML_Redefines_Label return AMF.Internals.CMOF_Element is
begin
return Base + 25;
end MC_UMLDI_UML_Redefines_Label;
------------------------
-- MC_UMLDI_UML_Shape --
------------------------
function MC_UMLDI_UML_Shape return AMF.Internals.CMOF_Element is
begin
return Base + 26;
end MC_UMLDI_UML_Shape;
----------------------------------------
-- MC_UMLDI_UML_State_Machine_Diagram --
----------------------------------------
function MC_UMLDI_UML_State_Machine_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 27;
end MC_UMLDI_UML_State_Machine_Diagram;
------------------------------
-- MC_UMLDI_UML_State_Shape --
------------------------------
function MC_UMLDI_UML_State_Shape return AMF.Internals.CMOF_Element is
begin
return Base + 28;
end MC_UMLDI_UML_State_Shape;
--------------------------------------------------
-- MC_UMLDI_UML_Stereotype_Property_Value_Label --
--------------------------------------------------
function MC_UMLDI_UML_Stereotype_Property_Value_Label return AMF.Internals.CMOF_Element is
begin
return Base + 29;
end MC_UMLDI_UML_Stereotype_Property_Value_Label;
------------------------------------
-- MC_UMLDI_UML_Structure_Diagram --
------------------------------------
function MC_UMLDI_UML_Structure_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 30;
end MC_UMLDI_UML_Structure_Diagram;
------------------------
-- MC_UMLDI_UML_Style --
------------------------
function MC_UMLDI_UML_Style return AMF.Internals.CMOF_Element is
begin
return Base + 31;
end MC_UMLDI_UML_Style;
--------------------------------------
-- MC_UMLDI_UML_Typed_Element_Label --
--------------------------------------
function MC_UMLDI_UML_Typed_Element_Label return AMF.Internals.CMOF_Element is
begin
return Base + 32;
end MC_UMLDI_UML_Typed_Element_Label;
-----------------------------------
-- MC_UMLDI_UML_Use_Case_Diagram --
-----------------------------------
function MC_UMLDI_UML_Use_Case_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 33;
end MC_UMLDI_UML_Use_Case_Diagram;
-----------------------------------------------------
-- MP_UMLDI_UML_Activity_Diagram_Is_Activity_Frame --
-----------------------------------------------------
function MP_UMLDI_UML_Activity_Diagram_Is_Activity_Frame return AMF.Internals.CMOF_Element is
begin
return Base + 39;
end MP_UMLDI_UML_Activity_Diagram_Is_Activity_Frame;
-----------------------------------------------------------------------
-- MP_UMLDI_UML_Activity_Diagram_Model_Element_A_Uml_Diagram_Element --
-----------------------------------------------------------------------
function MP_UMLDI_UML_Activity_Diagram_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 40;
end MP_UMLDI_UML_Activity_Diagram_Model_Element_A_Uml_Diagram_Element;
----------------------------------------------------------------------------
-- MP_UMLDI_UML_Association_End_Label_Model_Element_A_Uml_Diagram_Element --
----------------------------------------------------------------------------
function MP_UMLDI_UML_Association_End_Label_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 41;
end MP_UMLDI_UML_Association_End_Label_Model_Element_A_Uml_Diagram_Element;
--------------------------------------------------------------
-- MP_UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind --
--------------------------------------------------------------
function MP_UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind return AMF.Internals.CMOF_Element is
begin
return Base + 42;
end MP_UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind;
-----------------------------------------------------------------------
-- MP_UMLDI_UML_Behavior_Diagram_Model_Element_A_Uml_Diagram_Element --
-----------------------------------------------------------------------
function MP_UMLDI_UML_Behavior_Diagram_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 43;
end MP_UMLDI_UML_Behavior_Diagram_Model_Element_A_Uml_Diagram_Element;
--------------------------------------------------------------------------------
-- MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Is_Association_Dot_Shown --
--------------------------------------------------------------------------------
function MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Is_Association_Dot_Shown return AMF.Internals.CMOF_Element is
begin
return Base + 44;
end MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Is_Association_Dot_Shown;
-----------------------------------------------------------------------------
-- MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Navigability_Notation --
-----------------------------------------------------------------------------
function MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Navigability_Notation return AMF.Internals.CMOF_Element is
begin
return Base + 45;
end MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Navigability_Notation;
---------------------------------------------------------------------------------
-- MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Non_Navigability_Notation --
---------------------------------------------------------------------------------
function MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Non_Navigability_Notation return AMF.Internals.CMOF_Element is
begin
return Base + 46;
end MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Non_Navigability_Notation;
---------------------------------------------------
-- MP_UMLDI_UML_Classifier_Shape_Is_Double_Sided --
---------------------------------------------------
function MP_UMLDI_UML_Classifier_Shape_Is_Double_Sided return AMF.Internals.CMOF_Element is
begin
return Base + 47;
end MP_UMLDI_UML_Classifier_Shape_Is_Double_Sided;
------------------------------------------------------------
-- MP_UMLDI_UML_Classifier_Shape_Is_Indent_For_Visibility --
------------------------------------------------------------
function MP_UMLDI_UML_Classifier_Shape_Is_Indent_For_Visibility return AMF.Internals.CMOF_Element is
begin
return Base + 48;
end MP_UMLDI_UML_Classifier_Shape_Is_Indent_For_Visibility;
-----------------------------------------------------------------------
-- MP_UMLDI_UML_Classifier_Shape_Model_Element_A_Uml_Diagram_Element --
-----------------------------------------------------------------------
function MP_UMLDI_UML_Classifier_Shape_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 49;
end MP_UMLDI_UML_Classifier_Shape_Model_Element_A_Uml_Diagram_Element;
--------------------------------------------------------------------------
-- MP_UMLDI_UML_Compartment_Element_In_Compartment_A_Owning_Compartment --
--------------------------------------------------------------------------
function MP_UMLDI_UML_Compartment_Element_In_Compartment_A_Owning_Compartment return AMF.Internals.CMOF_Element is
begin
return Base + 34;
end MP_UMLDI_UML_Compartment_Element_In_Compartment_A_Owning_Compartment;
--------------------------------------------------------------------------
-- MP_UMLDI_UML_Compartmentable_Shape_Compartment_A_Compartmented_Shape --
--------------------------------------------------------------------------
function MP_UMLDI_UML_Compartmentable_Shape_Compartment_A_Compartmented_Shape return AMF.Internals.CMOF_Element is
begin
return Base + 35;
end MP_UMLDI_UML_Compartmentable_Shape_Compartment_A_Compartmented_Shape;
---------------------------------------------------
-- MP_UMLDI_UML_Diagram_Heading_A_Headed_Diagram --
---------------------------------------------------
function MP_UMLDI_UML_Diagram_Heading_A_Headed_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 50;
end MP_UMLDI_UML_Diagram_Heading_A_Headed_Diagram;
-----------------------------------
-- MP_UMLDI_UML_Diagram_Is_Frame --
-----------------------------------
function MP_UMLDI_UML_Diagram_Is_Frame return AMF.Internals.CMOF_Element is
begin
return Base + 51;
end MP_UMLDI_UML_Diagram_Is_Frame;
---------------------------------
-- MP_UMLDI_UML_Diagram_Is_Iso --
---------------------------------
function MP_UMLDI_UML_Diagram_Is_Iso return AMF.Internals.CMOF_Element is
begin
return Base + 52;
end MP_UMLDI_UML_Diagram_Is_Iso;
------------------------------------------
-- MP_UMLDI_UML_Diagram_Element_Is_Icon --
------------------------------------------
function MP_UMLDI_UML_Diagram_Element_Is_Icon return AMF.Internals.CMOF_Element is
begin
return Base + 53;
end MP_UMLDI_UML_Diagram_Element_Is_Icon;
---------------------------------------------------------------
-- MP_UMLDI_UML_Diagram_Element_Local_Style_A_Styled_Element --
---------------------------------------------------------------
function MP_UMLDI_UML_Diagram_Element_Local_Style_A_Styled_Element return AMF.Internals.CMOF_Element is
begin
return Base + 54;
end MP_UMLDI_UML_Diagram_Element_Local_Style_A_Styled_Element;
----------------------------------------------------------------------
-- MP_UMLDI_UML_Diagram_Element_Model_Element_A_Uml_Diagram_Element --
----------------------------------------------------------------------
function MP_UMLDI_UML_Diagram_Element_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 36;
end MP_UMLDI_UML_Diagram_Element_Model_Element_A_Uml_Diagram_Element;
-----------------------------------------------------------------------------------
-- MP_UMLDI_UML_Diagram_Element_Owned_Element_UML_Diagram_Element_Owning_Element --
-----------------------------------------------------------------------------------
function MP_UMLDI_UML_Diagram_Element_Owned_Element_UML_Diagram_Element_Owning_Element return AMF.Internals.CMOF_Element is
begin
return Base + 37;
end MP_UMLDI_UML_Diagram_Element_Owned_Element_UML_Diagram_Element_Owning_Element;
-----------------------------------------------------------------------------------
-- MP_UMLDI_UML_Diagram_Element_Owning_Element_UML_Diagram_Element_Owned_Element --
-----------------------------------------------------------------------------------
function MP_UMLDI_UML_Diagram_Element_Owning_Element_UML_Diagram_Element_Owned_Element return AMF.Internals.CMOF_Element is
begin
return Base + 55;
end MP_UMLDI_UML_Diagram_Element_Owning_Element_UML_Diagram_Element_Owned_Element;
----------------------------------------------------------------
-- MP_UMLDI_UML_Diagram_Element_Shared_Style_A_Styled_Element --
----------------------------------------------------------------
function MP_UMLDI_UML_Diagram_Element_Shared_Style_A_Styled_Element return AMF.Internals.CMOF_Element is
begin
return Base + 56;
end MP_UMLDI_UML_Diagram_Element_Shared_Style_A_Styled_Element;
--------------------------------------------
-- MP_UMLDI_UML_Edge_Source_A_Source_Edge --
--------------------------------------------
function MP_UMLDI_UML_Edge_Source_A_Source_Edge return AMF.Internals.CMOF_Element is
begin
return Base + 57;
end MP_UMLDI_UML_Edge_Source_A_Source_Edge;
--------------------------------------------
-- MP_UMLDI_UML_Edge_Target_A_Target_Edge --
--------------------------------------------
function MP_UMLDI_UML_Edge_Target_A_Target_Edge return AMF.Internals.CMOF_Element is
begin
return Base + 58;
end MP_UMLDI_UML_Edge_Target_A_Target_Edge;
-------------------------------------------
-- MP_UMLDI_UML_Interaction_Diagram_Kind --
-------------------------------------------
function MP_UMLDI_UML_Interaction_Diagram_Kind return AMF.Internals.CMOF_Element is
begin
return Base + 59;
end MP_UMLDI_UML_Interaction_Diagram_Kind;
--------------------------------------------------------------------------
-- MP_UMLDI_UML_Interaction_Diagram_Model_Element_A_Uml_Diagram_Element --
--------------------------------------------------------------------------
function MP_UMLDI_UML_Interaction_Diagram_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 60;
end MP_UMLDI_UML_Interaction_Diagram_Model_Element_A_Uml_Diagram_Element;
-----------------------------------------------
-- MP_UMLDI_UML_Interaction_Table_Label_Kind --
-----------------------------------------------
function MP_UMLDI_UML_Interaction_Table_Label_Kind return AMF.Internals.CMOF_Element is
begin
return Base + 61;
end MP_UMLDI_UML_Interaction_Table_Label_Kind;
-----------------------------
-- MP_UMLDI_UML_Label_Text --
-----------------------------
function MP_UMLDI_UML_Label_Text return AMF.Internals.CMOF_Element is
begin
return Base + 62;
end MP_UMLDI_UML_Label_Text;
-------------------------------------------------------------------------
-- MP_UMLDI_UML_Multiplicity_Label_Model_Element_A_Uml_Diagram_Element --
-------------------------------------------------------------------------
function MP_UMLDI_UML_Multiplicity_Label_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 63;
end MP_UMLDI_UML_Multiplicity_Label_Model_Element_A_Uml_Diagram_Element;
----------------------------------------------------------------
-- MP_UMLDI_UML_Name_Label_Mode_Element_A_Uml_Diagram_Element --
----------------------------------------------------------------
function MP_UMLDI_UML_Name_Label_Mode_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 64;
end MP_UMLDI_UML_Name_Label_Mode_Element_A_Uml_Diagram_Element;
----------------------------------------------------------------------
-- MP_UMLDI_UML_Redefines_Label_Model_Element_A_Uml_Diagram_Element --
----------------------------------------------------------------------
function MP_UMLDI_UML_Redefines_Label_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 65;
end MP_UMLDI_UML_Redefines_Label_Model_Element_A_Uml_Diagram_Element;
---------------------------------------------------------------
-- MP_UMLDI_UML_State_Machine_Diagram_Inherited_State_Border --
---------------------------------------------------------------
function MP_UMLDI_UML_State_Machine_Diagram_Inherited_State_Border return AMF.Internals.CMOF_Element is
begin
return Base + 66;
end MP_UMLDI_UML_State_Machine_Diagram_Inherited_State_Border;
---------------------------------------------------------------
-- MP_UMLDI_UML_State_Machine_Diagram_Is_Collapse_State_Icon --
---------------------------------------------------------------
function MP_UMLDI_UML_State_Machine_Diagram_Is_Collapse_State_Icon return AMF.Internals.CMOF_Element is
begin
return Base + 67;
end MP_UMLDI_UML_State_Machine_Diagram_Is_Collapse_State_Icon;
---------------------------------------------------------------
-- MP_UMLDI_UML_State_Machine_Diagram_Is_Transition_Oriented --
---------------------------------------------------------------
function MP_UMLDI_UML_State_Machine_Diagram_Is_Transition_Oriented return AMF.Internals.CMOF_Element is
begin
return Base + 68;
end MP_UMLDI_UML_State_Machine_Diagram_Is_Transition_Oriented;
----------------------------------------------------------------------------
-- MP_UMLDI_UML_State_Machine_Diagram_Model_Element_A_Uml_Diagram_Element --
----------------------------------------------------------------------------
function MP_UMLDI_UML_State_Machine_Diagram_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 69;
end MP_UMLDI_UML_State_Machine_Diagram_Model_Element_A_Uml_Diagram_Element;
----------------------------------------
-- MP_UMLDI_UML_State_Shape_Is_Tabbed --
----------------------------------------
function MP_UMLDI_UML_State_Shape_Is_Tabbed return AMF.Internals.CMOF_Element is
begin
return Base + 70;
end MP_UMLDI_UML_State_Shape_Is_Tabbed;
------------------------------------------------------------------
-- MP_UMLDI_UML_State_Shape_Model_Element_A_Uml_Diagram_Element --
------------------------------------------------------------------
function MP_UMLDI_UML_State_Shape_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 38;
end MP_UMLDI_UML_State_Shape_Model_Element_A_Uml_Diagram_Element;
--------------------------------------------------------------------------------------
-- MP_UMLDI_UML_Stereotype_Property_Value_Label_Model_Element_A_Uml_Diagram_Element --
--------------------------------------------------------------------------------------
function MP_UMLDI_UML_Stereotype_Property_Value_Label_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 71;
end MP_UMLDI_UML_Stereotype_Property_Value_Label_Model_Element_A_Uml_Diagram_Element;
-------------------------------------------------------------------------------------------------------
-- MP_UMLDI_UML_Stereotype_Property_Value_Label_Stereotyped_Element_A_Label_Showing_Stereotype_Value --
-------------------------------------------------------------------------------------------------------
function MP_UMLDI_UML_Stereotype_Property_Value_Label_Stereotyped_Element_A_Label_Showing_Stereotype_Value return AMF.Internals.CMOF_Element is
begin
return Base + 72;
end MP_UMLDI_UML_Stereotype_Property_Value_Label_Stereotyped_Element_A_Label_Showing_Stereotype_Value;
----------------------------------
-- MP_UMLDI_UML_Style_Font_Name --
----------------------------------
function MP_UMLDI_UML_Style_Font_Name return AMF.Internals.CMOF_Element is
begin
return Base + 73;
end MP_UMLDI_UML_Style_Font_Name;
----------------------------------
-- MP_UMLDI_UML_Style_Font_Size --
----------------------------------
function MP_UMLDI_UML_Style_Font_Size return AMF.Internals.CMOF_Element is
begin
return Base + 74;
end MP_UMLDI_UML_Style_Font_Size;
-----------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Activity_Diagram_Model_Element --
-----------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Activity_Diagram_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 97;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Activity_Diagram_Model_Element;
----------------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Association_End_Label_Model_Element --
----------------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Association_End_Label_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 98;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Association_End_Label_Model_Element;
-----------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Behavior_Diagram_Model_Element --
-----------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Behavior_Diagram_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 99;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Behavior_Diagram_Model_Element;
-----------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Classifier_Shape_Model_Element --
-----------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Classifier_Shape_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 100;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Classifier_Shape_Model_Element;
--------------------------------------------------------------------------
-- MP_UMLDI_A_Owning_Compartment_UML_Compartment_Element_In_Compartment --
--------------------------------------------------------------------------
function MP_UMLDI_A_Owning_Compartment_UML_Compartment_Element_In_Compartment return AMF.Internals.CMOF_Element is
begin
return Base + 101;
end MP_UMLDI_A_Owning_Compartment_UML_Compartment_Element_In_Compartment;
--------------------------------------------------------------------------
-- MP_UMLDI_A_Compartmented_Shape_UML_Compartmentable_Shape_Compartment --
--------------------------------------------------------------------------
function MP_UMLDI_A_Compartmented_Shape_UML_Compartmentable_Shape_Compartment return AMF.Internals.CMOF_Element is
begin
return Base + 103;
end MP_UMLDI_A_Compartmented_Shape_UML_Compartmentable_Shape_Compartment;
---------------------------------------------------------------
-- MP_UMLDI_A_Styled_Element_UML_Diagram_Element_Local_Style --
---------------------------------------------------------------
function MP_UMLDI_A_Styled_Element_UML_Diagram_Element_Local_Style return AMF.Internals.CMOF_Element is
begin
return Base + 104;
end MP_UMLDI_A_Styled_Element_UML_Diagram_Element_Local_Style;
----------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Diagram_Element_Model_Element --
----------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Diagram_Element_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 105;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Diagram_Element_Model_Element;
----------------------------------------------------------------
-- MP_UMLDI_A_Styled_Element_UML_Diagram_Element_Shared_Style --
----------------------------------------------------------------
function MP_UMLDI_A_Styled_Element_UML_Diagram_Element_Shared_Style return AMF.Internals.CMOF_Element is
begin
return Base + 106;
end MP_UMLDI_A_Styled_Element_UML_Diagram_Element_Shared_Style;
---------------------------------------------------
-- MP_UMLDI_A_Headed_Diagram_UML_Diagram_Heading --
---------------------------------------------------
function MP_UMLDI_A_Headed_Diagram_UML_Diagram_Heading return AMF.Internals.CMOF_Element is
begin
return Base + 107;
end MP_UMLDI_A_Headed_Diagram_UML_Diagram_Heading;
--------------------------------------------
-- MP_UMLDI_A_Source_Edge_UML_Edge_Source --
--------------------------------------------
function MP_UMLDI_A_Source_Edge_UML_Edge_Source return AMF.Internals.CMOF_Element is
begin
return Base + 108;
end MP_UMLDI_A_Source_Edge_UML_Edge_Source;
--------------------------------------------
-- MP_UMLDI_A_Target_Edge_UML_Edge_Target --
--------------------------------------------
function MP_UMLDI_A_Target_Edge_UML_Edge_Target return AMF.Internals.CMOF_Element is
begin
return Base + 109;
end MP_UMLDI_A_Target_Edge_UML_Edge_Target;
--------------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Interaction_Diagram_Model_Element --
--------------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Interaction_Diagram_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 110;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Interaction_Diagram_Model_Element;
-------------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Multiplicity_Label_Model_Element --
-------------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Multiplicity_Label_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 111;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Multiplicity_Label_Model_Element;
----------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Name_Label_Mode_Element --
----------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Name_Label_Mode_Element return AMF.Internals.CMOF_Element is
begin
return Base + 112;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Name_Label_Mode_Element;
----------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Redefines_Label_Model_Element --
----------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Redefines_Label_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 113;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Redefines_Label_Model_Element;
----------------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_State_Machine_Diagram_Model_Element --
----------------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_State_Machine_Diagram_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 114;
end MP_UMLDI_A_Uml_Diagram_Element_UML_State_Machine_Diagram_Model_Element;
------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_State_Shape_Model_Element --
------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_State_Shape_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 115;
end MP_UMLDI_A_Uml_Diagram_Element_UML_State_Shape_Model_Element;
--------------------------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Stereotype_Property_Value_Label_Model_Element --
--------------------------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Stereotype_Property_Value_Label_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 116;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Stereotype_Property_Value_Label_Model_Element;
-------------------------------------------------------------------------------------------------------
-- MP_UMLDI_A_Label_Showing_Stereotype_Value_UML_Stereotype_Property_Value_Label_Stereotyped_Element --
-------------------------------------------------------------------------------------------------------
function MP_UMLDI_A_Label_Showing_Stereotype_Value_UML_Stereotype_Property_Value_Label_Stereotyped_Element return AMF.Internals.CMOF_Element is
begin
return Base + 117;
end MP_UMLDI_A_Label_Showing_Stereotype_Value_UML_Stereotype_Property_Value_Label_Stereotyped_Element;
---------------------------------------------------------------------
-- MA_UMLDI_UML_Activity_Diagram_Model_Element_Uml_Diagram_Element --
---------------------------------------------------------------------
function MA_UMLDI_UML_Activity_Diagram_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 75;
end MA_UMLDI_UML_Activity_Diagram_Model_Element_Uml_Diagram_Element;
--------------------------------------------------------------------------
-- MA_UMLDI_UML_Association_End_Label_Model_Element_Uml_Diagram_Element --
--------------------------------------------------------------------------
function MA_UMLDI_UML_Association_End_Label_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 76;
end MA_UMLDI_UML_Association_End_Label_Model_Element_Uml_Diagram_Element;
---------------------------------------------------------------------
-- MA_UMLDI_UML_Behavior_Diagram_Model_Element_Uml_Diagram_Element --
---------------------------------------------------------------------
function MA_UMLDI_UML_Behavior_Diagram_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 77;
end MA_UMLDI_UML_Behavior_Diagram_Model_Element_Uml_Diagram_Element;
---------------------------------------------------------------------
-- MA_UMLDI_UML_Classifier_Shape_Model_Element_Uml_Diagram_Element --
---------------------------------------------------------------------
function MA_UMLDI_UML_Classifier_Shape_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 78;
end MA_UMLDI_UML_Classifier_Shape_Model_Element_Uml_Diagram_Element;
------------------------------------------------------------------------
-- MA_UMLDI_UML_Compartment_Element_In_Compartment_Owning_Compartment --
------------------------------------------------------------------------
function MA_UMLDI_UML_Compartment_Element_In_Compartment_Owning_Compartment return AMF.Internals.CMOF_Element is
begin
return Base + 79;
end MA_UMLDI_UML_Compartment_Element_In_Compartment_Owning_Compartment;
------------------------------------------------------------------------
-- MA_UMLDI_UML_Compartmentable_Shape_Compartment_Compartmented_Shape --
------------------------------------------------------------------------
function MA_UMLDI_UML_Compartmentable_Shape_Compartment_Compartmented_Shape return AMF.Internals.CMOF_Element is
begin
return Base + 80;
end MA_UMLDI_UML_Compartmentable_Shape_Compartment_Compartmented_Shape;
-------------------------------------------------------------
-- MA_UMLDI_UML_Diagram_Element_Local_Style_Styled_Element --
-------------------------------------------------------------
function MA_UMLDI_UML_Diagram_Element_Local_Style_Styled_Element return AMF.Internals.CMOF_Element is
begin
return Base + 81;
end MA_UMLDI_UML_Diagram_Element_Local_Style_Styled_Element;
--------------------------------------------------------------------
-- MA_UMLDI_UML_Diagram_Element_Model_Element_Uml_Diagram_Element --
--------------------------------------------------------------------
function MA_UMLDI_UML_Diagram_Element_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 82;
end MA_UMLDI_UML_Diagram_Element_Model_Element_Uml_Diagram_Element;
---------------------------------------------------------------
-- MA_UMLDI_UML_Diagram_Element_Owned_Element_Owning_Element --
---------------------------------------------------------------
function MA_UMLDI_UML_Diagram_Element_Owned_Element_Owning_Element return AMF.Internals.CMOF_Element is
begin
return Base + 83;
end MA_UMLDI_UML_Diagram_Element_Owned_Element_Owning_Element;
--------------------------------------------------------------
-- MA_UMLDI_UML_Diagram_Element_Shared_Style_Styled_Element --
--------------------------------------------------------------
function MA_UMLDI_UML_Diagram_Element_Shared_Style_Styled_Element return AMF.Internals.CMOF_Element is
begin
return Base + 84;
end MA_UMLDI_UML_Diagram_Element_Shared_Style_Styled_Element;
-------------------------------------------------
-- MA_UMLDI_UML_Diagram_Heading_Headed_Diagram --
-------------------------------------------------
function MA_UMLDI_UML_Diagram_Heading_Headed_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 85;
end MA_UMLDI_UML_Diagram_Heading_Headed_Diagram;
------------------------------------------
-- MA_UMLDI_UML_Edge_Source_Source_Edge --
------------------------------------------
function MA_UMLDI_UML_Edge_Source_Source_Edge return AMF.Internals.CMOF_Element is
begin
return Base + 86;
end MA_UMLDI_UML_Edge_Source_Source_Edge;
------------------------------------------
-- MA_UMLDI_UML_Edge_Target_Target_Edge --
------------------------------------------
function MA_UMLDI_UML_Edge_Target_Target_Edge return AMF.Internals.CMOF_Element is
begin
return Base + 87;
end MA_UMLDI_UML_Edge_Target_Target_Edge;
------------------------------------------------------------------------
-- MA_UMLDI_UML_Interaction_Diagram_Model_Element_Uml_Diagram_Element --
------------------------------------------------------------------------
function MA_UMLDI_UML_Interaction_Diagram_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 88;
end MA_UMLDI_UML_Interaction_Diagram_Model_Element_Uml_Diagram_Element;
-----------------------------------------------------------------------
-- MA_UMLDI_UML_Multiplicity_Label_Model_Element_Uml_Diagram_Element --
-----------------------------------------------------------------------
function MA_UMLDI_UML_Multiplicity_Label_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 89;
end MA_UMLDI_UML_Multiplicity_Label_Model_Element_Uml_Diagram_Element;
--------------------------------------------------------------
-- MA_UMLDI_UML_Name_Label_Mode_Element_Uml_Diagram_Element --
--------------------------------------------------------------
function MA_UMLDI_UML_Name_Label_Mode_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 90;
end MA_UMLDI_UML_Name_Label_Mode_Element_Uml_Diagram_Element;
--------------------------------------------------------------------
-- MA_UMLDI_UML_Redefines_Label_Model_Element_Uml_Diagram_Element --
--------------------------------------------------------------------
function MA_UMLDI_UML_Redefines_Label_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 91;
end MA_UMLDI_UML_Redefines_Label_Model_Element_Uml_Diagram_Element;
--------------------------------------------------------------------------
-- MA_UMLDI_UML_State_Machine_Diagram_Model_Element_Uml_Diagram_Element --
--------------------------------------------------------------------------
function MA_UMLDI_UML_State_Machine_Diagram_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 92;
end MA_UMLDI_UML_State_Machine_Diagram_Model_Element_Uml_Diagram_Element;
----------------------------------------------------------------
-- MA_UMLDI_UML_State_Shape_Model_Element_Uml_Diagram_Element --
----------------------------------------------------------------
function MA_UMLDI_UML_State_Shape_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 93;
end MA_UMLDI_UML_State_Shape_Model_Element_Uml_Diagram_Element;
------------------------------------------------------------------------------------
-- MA_UMLDI_UML_Stereotype_Property_Value_Label_Model_Element_Uml_Diagram_Element --
------------------------------------------------------------------------------------
function MA_UMLDI_UML_Stereotype_Property_Value_Label_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 94;
end MA_UMLDI_UML_Stereotype_Property_Value_Label_Model_Element_Uml_Diagram_Element;
-----------------------------------------------------------------------------------------------------
-- MA_UMLDI_UML_Stereotype_Property_Value_Label_Stereotyped_Element_Label_Showing_Stereotype_Value --
-----------------------------------------------------------------------------------------------------
function MA_UMLDI_UML_Stereotype_Property_Value_Label_Stereotyped_Element_Label_Showing_Stereotype_Value return AMF.Internals.CMOF_Element is
begin
return Base + 95;
end MA_UMLDI_UML_Stereotype_Property_Value_Label_Stereotyped_Element_Label_Showing_Stereotype_Value;
--------------
-- MB_UMLDI --
--------------
function MB_UMLDI return AMF.Internals.AMF_Element is
begin
return Base;
end MB_UMLDI;
--------------
-- MB_UMLDI --
--------------
function ML_UMLDI return AMF.Internals.AMF_Element is
begin
return Base + 319;
end ML_UMLDI;
end AMF.Internals.Tables.UMLDI_Metamodel;
|
16192
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
package body AMF.Internals.Tables.UMLDI_Metamodel is
--------------------
-- MM_UMLDI_UMLDI --
--------------------
function MM_UMLDI_UMLDI return AMF.Internals.CMOF_Element is
begin
return Base + 96;
end MM_UMLDI_UMLDI;
--------------------------------------------------------------
-- MC_UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind --
--------------------------------------------------------------
function MC_UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind return AMF.Internals.CMOF_Element is
begin
return Base + 272;
end MC_UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind;
----------------------------------------------
-- MC_UMLDI_UML_Inherited_State_Border_Kind --
----------------------------------------------
function MC_UMLDI_UML_Inherited_State_Border_Kind return AMF.Internals.CMOF_Element is
begin
return Base + 275;
end MC_UMLDI_UML_Inherited_State_Border_Kind;
-------------------------------------------
-- MC_UMLDI_UML_Interaction_Diagram_Kind --
-------------------------------------------
function MC_UMLDI_UML_Interaction_Diagram_Kind return AMF.Internals.CMOF_Element is
begin
return Base + 281;
end MC_UMLDI_UML_Interaction_Diagram_Kind;
-----------------------------------------------
-- MC_UMLDI_UML_Interaction_Table_Label_Kind --
-----------------------------------------------
function MC_UMLDI_UML_Interaction_Table_Label_Kind return AMF.Internals.CMOF_Element is
begin
return Base + 293;
end MC_UMLDI_UML_Interaction_Table_Label_Kind;
---------------------------------------------
-- MC_UMLDI_UML_Navigability_Notation_Kind --
---------------------------------------------
function MC_UMLDI_UML_Navigability_Notation_Kind return AMF.Internals.CMOF_Element is
begin
return Base + 309;
end MC_UMLDI_UML_Navigability_Notation_Kind;
-----------------------------------
-- MC_UMLDI_UML_Activity_Diagram --
-----------------------------------
function MC_UMLDI_UML_Activity_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 1;
end MC_UMLDI_UML_Activity_Diagram;
----------------------------------------
-- MC_UMLDI_UML_Association_End_Label --
----------------------------------------
function MC_UMLDI_UML_Association_End_Label return AMF.Internals.CMOF_Element is
begin
return Base + 2;
end MC_UMLDI_UML_Association_End_Label;
---------------------------------------------------------
-- MC_UMLDI_UML_Association_Or_Connector_Or_Link_Shape --
---------------------------------------------------------
function MC_UMLDI_UML_Association_Or_Connector_Or_Link_Shape return AMF.Internals.CMOF_Element is
begin
return Base + 3;
end MC_UMLDI_UML_Association_Or_Connector_Or_Link_Shape;
-----------------------------------
-- MC_UMLDI_UML_Behavior_Diagram --
-----------------------------------
function MC_UMLDI_UML_Behavior_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 4;
end MC_UMLDI_UML_Behavior_Diagram;
--------------------------------
-- MC_UMLDI_UML_Class_Diagram --
--------------------------------
function MC_UMLDI_UML_Class_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 5;
end MC_UMLDI_UML_Class_Diagram;
-------------------------------------------------------
-- MC_UMLDI_UML_Class_Or_Composite_Structure_Diagram --
-------------------------------------------------------
function MC_UMLDI_UML_Class_Or_Composite_Structure_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 6;
end MC_UMLDI_UML_Class_Or_Composite_Structure_Diagram;
-----------------------------------
-- MC_UMLDI_UML_Classifier_Shape --
-----------------------------------
function MC_UMLDI_UML_Classifier_Shape return AMF.Internals.CMOF_Element is
begin
return Base + 7;
end MC_UMLDI_UML_Classifier_Shape;
------------------------------
-- MC_UMLDI_UML_Compartment --
------------------------------
function MC_UMLDI_UML_Compartment return AMF.Internals.CMOF_Element is
begin
return Base + 8;
end MC_UMLDI_UML_Compartment;
----------------------------------------
-- MC_UMLDI_UML_Compartmentable_Shape --
----------------------------------------
function MC_UMLDI_UML_Compartmentable_Shape return AMF.Internals.CMOF_Element is
begin
return Base + 9;
end MC_UMLDI_UML_Compartmentable_Shape;
------------------------------------
-- MC_UMLDI_UML_Component_Diagram --
------------------------------------
function MC_UMLDI_UML_Component_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 10;
end MC_UMLDI_UML_Component_Diagram;
----------------------------------------------
-- MC_UMLDI_UML_Composite_Structure_Diagram --
----------------------------------------------
function MC_UMLDI_UML_Composite_Structure_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 11;
end MC_UMLDI_UML_Composite_Structure_Diagram;
-------------------------------------
-- MC_UMLDI_UML_Deployment_Diagram --
-------------------------------------
function MC_UMLDI_UML_Deployment_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 12;
end MC_UMLDI_UML_Deployment_Diagram;
--------------------------
-- MC_UMLDI_UML_Diagram --
--------------------------
function MC_UMLDI_UML_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 13;
end MC_UMLDI_UML_Diagram;
----------------------------------
-- MC_UMLDI_UML_Diagram_Element --
----------------------------------
function MC_UMLDI_UML_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 14;
end MC_UMLDI_UML_Diagram_Element;
-----------------------
-- MC_UMLDI_UML_Edge --
-----------------------
function MC_UMLDI_UML_Edge return AMF.Internals.CMOF_Element is
begin
return Base + 15;
end MC_UMLDI_UML_Edge;
--------------------------------------
-- MC_UMLDI_UML_Interaction_Diagram --
--------------------------------------
function MC_UMLDI_UML_Interaction_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 16;
end MC_UMLDI_UML_Interaction_Diagram;
------------------------------------------
-- MC_UMLDI_UML_Interaction_Table_Label --
------------------------------------------
function MC_UMLDI_UML_Interaction_Table_Label return AMF.Internals.CMOF_Element is
begin
return Base + 17;
end MC_UMLDI_UML_Interaction_Table_Label;
--------------------------------
-- MC_UMLDI_UML_Keyword_Label --
--------------------------------
function MC_UMLDI_UML_Keyword_Label return AMF.Internals.CMOF_Element is
begin
return Base + 18;
end MC_UMLDI_UML_Keyword_Label;
------------------------
-- MC_UMLDI_UML_Label --
------------------------
function MC_UMLDI_UML_Label return AMF.Internals.CMOF_Element is
begin
return Base + 19;
end MC_UMLDI_UML_Label;
-------------------------------------
-- MC_UMLDI_UML_Multiplicity_Label --
-------------------------------------
function MC_UMLDI_UML_Multiplicity_Label return AMF.Internals.CMOF_Element is
begin
return Base + 20;
end MC_UMLDI_UML_Multiplicity_Label;
-----------------------------
-- MC_UMLDI_UML_Name_Label --
-----------------------------
function MC_UMLDI_UML_Name_Label return AMF.Internals.CMOF_Element is
begin
return Base + 21;
end MC_UMLDI_UML_Name_Label;
---------------------------------
-- MC_UMLDI_UML_Object_Diagram --
---------------------------------
function MC_UMLDI_UML_Object_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 22;
end MC_UMLDI_UML_Object_Diagram;
----------------------------------
-- MC_UMLDI_UML_Package_Diagram --
----------------------------------
function MC_UMLDI_UML_Package_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 23;
end MC_UMLDI_UML_Package_Diagram;
----------------------------------
-- MC_UMLDI_UML_Profile_Diagram --
----------------------------------
function MC_UMLDI_UML_Profile_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 24;
end MC_UMLDI_UML_Profile_Diagram;
----------------------------------
-- MC_UMLDI_UML_Redefines_Label --
----------------------------------
function MC_UMLDI_UML_Redefines_Label return AMF.Internals.CMOF_Element is
begin
return Base + 25;
end MC_UMLDI_UML_Redefines_Label;
------------------------
-- MC_UMLDI_UML_Shape --
------------------------
function MC_UMLDI_UML_Shape return AMF.Internals.CMOF_Element is
begin
return Base + 26;
end MC_UMLDI_UML_Shape;
----------------------------------------
-- MC_UMLDI_UML_State_Machine_Diagram --
----------------------------------------
function MC_UMLDI_UML_State_Machine_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 27;
end MC_UMLDI_UML_State_Machine_Diagram;
------------------------------
-- MC_UMLDI_UML_State_Shape --
------------------------------
function MC_UMLDI_UML_State_Shape return AMF.Internals.CMOF_Element is
begin
return Base + 28;
end MC_UMLDI_UML_State_Shape;
--------------------------------------------------
-- MC_UMLDI_UML_Stereotype_Property_Value_Label --
--------------------------------------------------
function MC_UMLDI_UML_Stereotype_Property_Value_Label return AMF.Internals.CMOF_Element is
begin
return Base + 29;
end MC_UMLDI_UML_Stereotype_Property_Value_Label;
------------------------------------
-- MC_UMLDI_UML_Structure_Diagram --
------------------------------------
function MC_UMLDI_UML_Structure_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 30;
end MC_UMLDI_UML_Structure_Diagram;
------------------------
-- MC_UMLDI_UML_Style --
------------------------
function MC_UMLDI_UML_Style return AMF.Internals.CMOF_Element is
begin
return Base + 31;
end MC_UMLDI_UML_Style;
--------------------------------------
-- MC_UMLDI_UML_Typed_Element_Label --
--------------------------------------
function MC_UMLDI_UML_Typed_Element_Label return AMF.Internals.CMOF_Element is
begin
return Base + 32;
end MC_UMLDI_UML_Typed_Element_Label;
-----------------------------------
-- MC_UMLDI_UML_Use_Case_Diagram --
-----------------------------------
function MC_UMLDI_UML_Use_Case_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 33;
end MC_UMLDI_UML_Use_Case_Diagram;
-----------------------------------------------------
-- MP_UMLDI_UML_Activity_Diagram_Is_Activity_Frame --
-----------------------------------------------------
function MP_UMLDI_UML_Activity_Diagram_Is_Activity_Frame return AMF.Internals.CMOF_Element is
begin
return Base + 39;
end MP_UMLDI_UML_Activity_Diagram_Is_Activity_Frame;
-----------------------------------------------------------------------
-- MP_UMLDI_UML_Activity_Diagram_Model_Element_A_Uml_Diagram_Element --
-----------------------------------------------------------------------
function MP_UMLDI_UML_Activity_Diagram_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 40;
end MP_UMLDI_UML_Activity_Diagram_Model_Element_A_Uml_Diagram_Element;
----------------------------------------------------------------------------
-- MP_UMLDI_UML_Association_End_Label_Model_Element_A_Uml_Diagram_Element --
----------------------------------------------------------------------------
function MP_UMLDI_UML_Association_End_Label_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 41;
end MP_UMLDI_UML_Association_End_Label_Model_Element_A_Uml_Diagram_Element;
--------------------------------------------------------------
-- MP_UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind --
--------------------------------------------------------------
function MP_UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind return AMF.Internals.CMOF_Element is
begin
return Base + 42;
end MP_UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind;
-----------------------------------------------------------------------
-- MP_UMLDI_UML_Behavior_Diagram_Model_Element_A_Uml_Diagram_Element --
-----------------------------------------------------------------------
function MP_UMLDI_UML_Behavior_Diagram_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 43;
end MP_UMLDI_UML_Behavior_Diagram_Model_Element_A_Uml_Diagram_Element;
--------------------------------------------------------------------------------
-- MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Is_Association_Dot_Shown --
--------------------------------------------------------------------------------
function MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Is_Association_Dot_Shown return AMF.Internals.CMOF_Element is
begin
return Base + 44;
end MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Is_Association_Dot_Shown;
-----------------------------------------------------------------------------
-- MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Navigability_Notation --
-----------------------------------------------------------------------------
function MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Navigability_Notation return AMF.Internals.CMOF_Element is
begin
return Base + 45;
end MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Navigability_Notation;
---------------------------------------------------------------------------------
-- MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Non_Navigability_Notation --
---------------------------------------------------------------------------------
function MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Non_Navigability_Notation return AMF.Internals.CMOF_Element is
begin
return Base + 46;
end MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Non_Navigability_Notation;
---------------------------------------------------
-- MP_UMLDI_UML_Classifier_Shape_Is_Double_Sided --
---------------------------------------------------
function MP_UMLDI_UML_Classifier_Shape_Is_Double_Sided return AMF.Internals.CMOF_Element is
begin
return Base + 47;
end MP_UMLDI_UML_Classifier_Shape_Is_Double_Sided;
------------------------------------------------------------
-- MP_UMLDI_UML_Classifier_Shape_Is_Indent_For_Visibility --
------------------------------------------------------------
function MP_UMLDI_UML_Classifier_Shape_Is_Indent_For_Visibility return AMF.Internals.CMOF_Element is
begin
return Base + 48;
end MP_UMLDI_UML_Classifier_Shape_Is_Indent_For_Visibility;
-----------------------------------------------------------------------
-- MP_UMLDI_UML_Classifier_Shape_Model_Element_A_Uml_Diagram_Element --
-----------------------------------------------------------------------
function MP_UMLDI_UML_Classifier_Shape_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 49;
end MP_UMLDI_UML_Classifier_Shape_Model_Element_A_Uml_Diagram_Element;
--------------------------------------------------------------------------
-- MP_UMLDI_UML_Compartment_Element_In_Compartment_A_Owning_Compartment --
--------------------------------------------------------------------------
function MP_UMLDI_UML_Compartment_Element_In_Compartment_A_Owning_Compartment return AMF.Internals.CMOF_Element is
begin
return Base + 34;
end MP_UMLDI_UML_Compartment_Element_In_Compartment_A_Owning_Compartment;
--------------------------------------------------------------------------
-- MP_UMLDI_UML_Compartmentable_Shape_Compartment_A_Compartmented_Shape --
--------------------------------------------------------------------------
function MP_UMLDI_UML_Compartmentable_Shape_Compartment_A_Compartmented_Shape return AMF.Internals.CMOF_Element is
begin
return Base + 35;
end MP_UMLDI_UML_Compartmentable_Shape_Compartment_A_Compartmented_Shape;
---------------------------------------------------
-- MP_UMLDI_UML_Diagram_Heading_A_Headed_Diagram --
---------------------------------------------------
function MP_UMLDI_UML_Diagram_Heading_A_Headed_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 50;
end MP_UMLDI_UML_Diagram_Heading_A_Headed_Diagram;
-----------------------------------
-- MP_UMLDI_UML_Diagram_Is_Frame --
-----------------------------------
function MP_UMLDI_UML_Diagram_Is_Frame return AMF.Internals.CMOF_Element is
begin
return Base + 51;
end MP_UMLDI_UML_Diagram_Is_Frame;
---------------------------------
-- MP_UMLDI_UML_Diagram_Is_Iso --
---------------------------------
function MP_UMLDI_UML_Diagram_Is_Iso return AMF.Internals.CMOF_Element is
begin
return Base + 52;
end MP_UMLDI_UML_Diagram_Is_Iso;
------------------------------------------
-- MP_UMLDI_UML_Diagram_Element_Is_Icon --
------------------------------------------
function MP_UMLDI_UML_Diagram_Element_Is_Icon return AMF.Internals.CMOF_Element is
begin
return Base + 53;
end MP_UMLDI_UML_Diagram_Element_Is_Icon;
---------------------------------------------------------------
-- MP_UMLDI_UML_Diagram_Element_Local_Style_A_Styled_Element --
---------------------------------------------------------------
function MP_UMLDI_UML_Diagram_Element_Local_Style_A_Styled_Element return AMF.Internals.CMOF_Element is
begin
return Base + 54;
end MP_UMLDI_UML_Diagram_Element_Local_Style_A_Styled_Element;
----------------------------------------------------------------------
-- MP_UMLDI_UML_Diagram_Element_Model_Element_A_Uml_Diagram_Element --
----------------------------------------------------------------------
function MP_UMLDI_UML_Diagram_Element_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 36;
end MP_UMLDI_UML_Diagram_Element_Model_Element_A_Uml_Diagram_Element;
-----------------------------------------------------------------------------------
-- MP_UMLDI_UML_Diagram_Element_Owned_Element_UML_Diagram_Element_Owning_Element --
-----------------------------------------------------------------------------------
function MP_UMLDI_UML_Diagram_Element_Owned_Element_UML_Diagram_Element_Owning_Element return AMF.Internals.CMOF_Element is
begin
return Base + 37;
end MP_UMLDI_UML_Diagram_Element_Owned_Element_UML_Diagram_Element_Owning_Element;
-----------------------------------------------------------------------------------
-- MP_UMLDI_UML_Diagram_Element_Owning_Element_UML_Diagram_Element_Owned_Element --
-----------------------------------------------------------------------------------
function MP_UMLDI_UML_Diagram_Element_Owning_Element_UML_Diagram_Element_Owned_Element return AMF.Internals.CMOF_Element is
begin
return Base + 55;
end MP_UMLDI_UML_Diagram_Element_Owning_Element_UML_Diagram_Element_Owned_Element;
----------------------------------------------------------------
-- MP_UMLDI_UML_Diagram_Element_Shared_Style_A_Styled_Element --
----------------------------------------------------------------
function MP_UMLDI_UML_Diagram_Element_Shared_Style_A_Styled_Element return AMF.Internals.CMOF_Element is
begin
return Base + 56;
end MP_UMLDI_UML_Diagram_Element_Shared_Style_A_Styled_Element;
--------------------------------------------
-- MP_UMLDI_UML_Edge_Source_A_Source_Edge --
--------------------------------------------
function MP_UMLDI_UML_Edge_Source_A_Source_Edge return AMF.Internals.CMOF_Element is
begin
return Base + 57;
end MP_UMLDI_UML_Edge_Source_A_Source_Edge;
--------------------------------------------
-- MP_UMLDI_UML_Edge_Target_A_Target_Edge --
--------------------------------------------
function MP_UMLDI_UML_Edge_Target_A_Target_Edge return AMF.Internals.CMOF_Element is
begin
return Base + 58;
end MP_UMLDI_UML_Edge_Target_A_Target_Edge;
-------------------------------------------
-- MP_UMLDI_UML_Interaction_Diagram_Kind --
-------------------------------------------
function MP_UMLDI_UML_Interaction_Diagram_Kind return AMF.Internals.CMOF_Element is
begin
return Base + 59;
end MP_UMLDI_UML_Interaction_Diagram_Kind;
--------------------------------------------------------------------------
-- MP_UMLDI_UML_Interaction_Diagram_Model_Element_A_Uml_Diagram_Element --
--------------------------------------------------------------------------
function MP_UMLDI_UML_Interaction_Diagram_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 60;
end MP_UMLDI_UML_Interaction_Diagram_Model_Element_A_Uml_Diagram_Element;
-----------------------------------------------
-- MP_UMLDI_UML_Interaction_Table_Label_Kind --
-----------------------------------------------
function MP_UMLDI_UML_Interaction_Table_Label_Kind return AMF.Internals.CMOF_Element is
begin
return Base + 61;
end MP_UMLDI_UML_Interaction_Table_Label_Kind;
-----------------------------
-- MP_UMLDI_UML_Label_Text --
-----------------------------
function MP_UMLDI_UML_Label_Text return AMF.Internals.CMOF_Element is
begin
return Base + 62;
end MP_UMLDI_UML_Label_Text;
-------------------------------------------------------------------------
-- MP_UMLDI_UML_Multiplicity_Label_Model_Element_A_Uml_Diagram_Element --
-------------------------------------------------------------------------
function MP_UMLDI_UML_Multiplicity_Label_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 63;
end MP_UMLDI_UML_Multiplicity_Label_Model_Element_A_Uml_Diagram_Element;
----------------------------------------------------------------
-- MP_UMLDI_UML_Name_Label_Mode_Element_A_Uml_Diagram_Element --
----------------------------------------------------------------
function MP_UMLDI_UML_Name_Label_Mode_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 64;
end MP_UMLDI_UML_Name_Label_Mode_Element_A_Uml_Diagram_Element;
----------------------------------------------------------------------
-- MP_UMLDI_UML_Redefines_Label_Model_Element_A_Uml_Diagram_Element --
----------------------------------------------------------------------
function MP_UMLDI_UML_Redefines_Label_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 65;
end MP_UMLDI_UML_Redefines_Label_Model_Element_A_Uml_Diagram_Element;
---------------------------------------------------------------
-- MP_UMLDI_UML_State_Machine_Diagram_Inherited_State_Border --
---------------------------------------------------------------
function MP_UMLDI_UML_State_Machine_Diagram_Inherited_State_Border return AMF.Internals.CMOF_Element is
begin
return Base + 66;
end MP_UMLDI_UML_State_Machine_Diagram_Inherited_State_Border;
---------------------------------------------------------------
-- MP_UMLDI_UML_State_Machine_Diagram_Is_Collapse_State_Icon --
---------------------------------------------------------------
function MP_UMLDI_UML_State_Machine_Diagram_Is_Collapse_State_Icon return AMF.Internals.CMOF_Element is
begin
return Base + 67;
end MP_UMLDI_UML_State_Machine_Diagram_Is_Collapse_State_Icon;
---------------------------------------------------------------
-- MP_UMLDI_UML_State_Machine_Diagram_Is_Transition_Oriented --
---------------------------------------------------------------
function MP_UMLDI_UML_State_Machine_Diagram_Is_Transition_Oriented return AMF.Internals.CMOF_Element is
begin
return Base + 68;
end MP_UMLDI_UML_State_Machine_Diagram_Is_Transition_Oriented;
----------------------------------------------------------------------------
-- MP_UMLDI_UML_State_Machine_Diagram_Model_Element_A_Uml_Diagram_Element --
----------------------------------------------------------------------------
function MP_UMLDI_UML_State_Machine_Diagram_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 69;
end MP_UMLDI_UML_State_Machine_Diagram_Model_Element_A_Uml_Diagram_Element;
----------------------------------------
-- MP_UMLDI_UML_State_Shape_Is_Tabbed --
----------------------------------------
function MP_UMLDI_UML_State_Shape_Is_Tabbed return AMF.Internals.CMOF_Element is
begin
return Base + 70;
end MP_UMLDI_UML_State_Shape_Is_Tabbed;
------------------------------------------------------------------
-- MP_UMLDI_UML_State_Shape_Model_Element_A_Uml_Diagram_Element --
------------------------------------------------------------------
function MP_UMLDI_UML_State_Shape_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 38;
end MP_UMLDI_UML_State_Shape_Model_Element_A_Uml_Diagram_Element;
--------------------------------------------------------------------------------------
-- MP_UMLDI_UML_Stereotype_Property_Value_Label_Model_Element_A_Uml_Diagram_Element --
--------------------------------------------------------------------------------------
function MP_UMLDI_UML_Stereotype_Property_Value_Label_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 71;
end MP_UMLDI_UML_Stereotype_Property_Value_Label_Model_Element_A_Uml_Diagram_Element;
-------------------------------------------------------------------------------------------------------
-- MP_UMLDI_UML_Stereotype_Property_Value_Label_Stereotyped_Element_A_Label_Showing_Stereotype_Value --
-------------------------------------------------------------------------------------------------------
function MP_UMLDI_UML_Stereotype_Property_Value_Label_Stereotyped_Element_A_Label_Showing_Stereotype_Value return AMF.Internals.CMOF_Element is
begin
return Base + 72;
end MP_UMLDI_UML_Stereotype_Property_Value_Label_Stereotyped_Element_A_Label_Showing_Stereotype_Value;
----------------------------------
-- MP_UMLDI_UML_Style_Font_Name --
----------------------------------
function MP_UMLDI_UML_Style_Font_Name return AMF.Internals.CMOF_Element is
begin
return Base + 73;
end MP_UMLDI_UML_Style_Font_Name;
----------------------------------
-- MP_UMLDI_UML_Style_Font_Size --
----------------------------------
function MP_UMLDI_UML_Style_Font_Size return AMF.Internals.CMOF_Element is
begin
return Base + 74;
end MP_UMLDI_UML_Style_Font_Size;
-----------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Activity_Diagram_Model_Element --
-----------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Activity_Diagram_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 97;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Activity_Diagram_Model_Element;
----------------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Association_End_Label_Model_Element --
----------------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Association_End_Label_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 98;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Association_End_Label_Model_Element;
-----------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Behavior_Diagram_Model_Element --
-----------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Behavior_Diagram_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 99;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Behavior_Diagram_Model_Element;
-----------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Classifier_Shape_Model_Element --
-----------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Classifier_Shape_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 100;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Classifier_Shape_Model_Element;
--------------------------------------------------------------------------
-- MP_UMLDI_A_Owning_Compartment_UML_Compartment_Element_In_Compartment --
--------------------------------------------------------------------------
function MP_UMLDI_A_Owning_Compartment_UML_Compartment_Element_In_Compartment return AMF.Internals.CMOF_Element is
begin
return Base + 101;
end MP_UMLDI_A_Owning_Compartment_UML_Compartment_Element_In_Compartment;
--------------------------------------------------------------------------
-- MP_UMLDI_A_Compartmented_Shape_UML_Compartmentable_Shape_Compartment --
--------------------------------------------------------------------------
function MP_UMLDI_A_Compartmented_Shape_UML_Compartmentable_Shape_Compartment return AMF.Internals.CMOF_Element is
begin
return Base + 103;
end MP_UMLDI_A_Compartmented_Shape_UML_Compartmentable_Shape_Compartment;
---------------------------------------------------------------
-- MP_UMLDI_A_Styled_Element_UML_Diagram_Element_Local_Style --
---------------------------------------------------------------
function MP_UMLDI_A_Styled_Element_UML_Diagram_Element_Local_Style return AMF.Internals.CMOF_Element is
begin
return Base + 104;
end MP_UMLDI_A_Styled_Element_UML_Diagram_Element_Local_Style;
----------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Diagram_Element_Model_Element --
----------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Diagram_Element_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 105;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Diagram_Element_Model_Element;
----------------------------------------------------------------
-- MP_UMLDI_A_Styled_Element_UML_Diagram_Element_Shared_Style --
----------------------------------------------------------------
function MP_UMLDI_A_Styled_Element_UML_Diagram_Element_Shared_Style return AMF.Internals.CMOF_Element is
begin
return Base + 106;
end MP_UMLDI_A_Styled_Element_UML_Diagram_Element_Shared_Style;
---------------------------------------------------
-- MP_UMLDI_A_Headed_Diagram_UML_Diagram_Heading --
---------------------------------------------------
function MP_UMLDI_A_Headed_Diagram_UML_Diagram_Heading return AMF.Internals.CMOF_Element is
begin
return Base + 107;
end MP_UMLDI_A_Headed_Diagram_UML_Diagram_Heading;
--------------------------------------------
-- MP_UMLDI_A_Source_Edge_UML_Edge_Source --
--------------------------------------------
function MP_UMLDI_A_Source_Edge_UML_Edge_Source return AMF.Internals.CMOF_Element is
begin
return Base + 108;
end MP_UMLDI_A_Source_Edge_UML_Edge_Source;
--------------------------------------------
-- MP_UMLDI_A_Target_Edge_UML_Edge_Target --
--------------------------------------------
function MP_UMLDI_A_Target_Edge_UML_Edge_Target return AMF.Internals.CMOF_Element is
begin
return Base + 109;
end MP_UMLDI_A_Target_Edge_UML_Edge_Target;
--------------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Interaction_Diagram_Model_Element --
--------------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Interaction_Diagram_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 110;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Interaction_Diagram_Model_Element;
-------------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Multiplicity_Label_Model_Element --
-------------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Multiplicity_Label_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 111;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Multiplicity_Label_Model_Element;
----------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Name_Label_Mode_Element --
----------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Name_Label_Mode_Element return AMF.Internals.CMOF_Element is
begin
return Base + 112;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Name_Label_Mode_Element;
----------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Redefines_Label_Model_Element --
----------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Redefines_Label_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 113;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Redefines_Label_Model_Element;
----------------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_State_Machine_Diagram_Model_Element --
----------------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_State_Machine_Diagram_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 114;
end MP_UMLDI_A_Uml_Diagram_Element_UML_State_Machine_Diagram_Model_Element;
------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_State_Shape_Model_Element --
------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_State_Shape_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 115;
end MP_UMLDI_A_Uml_Diagram_Element_UML_State_Shape_Model_Element;
--------------------------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Stereotype_Property_Value_Label_Model_Element --
--------------------------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Stereotype_Property_Value_Label_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 116;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Stereotype_Property_Value_Label_Model_Element;
-------------------------------------------------------------------------------------------------------
-- MP_UMLDI_A_Label_Showing_Stereotype_Value_UML_Stereotype_Property_Value_Label_Stereotyped_Element --
-------------------------------------------------------------------------------------------------------
function MP_UMLDI_A_Label_Showing_Stereotype_Value_UML_Stereotype_Property_Value_Label_Stereotyped_Element return AMF.Internals.CMOF_Element is
begin
return Base + 117;
end MP_UMLDI_A_Label_Showing_Stereotype_Value_UML_Stereotype_Property_Value_Label_Stereotyped_Element;
---------------------------------------------------------------------
-- MA_UMLDI_UML_Activity_Diagram_Model_Element_Uml_Diagram_Element --
---------------------------------------------------------------------
function MA_UMLDI_UML_Activity_Diagram_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 75;
end MA_UMLDI_UML_Activity_Diagram_Model_Element_Uml_Diagram_Element;
--------------------------------------------------------------------------
-- MA_UMLDI_UML_Association_End_Label_Model_Element_Uml_Diagram_Element --
--------------------------------------------------------------------------
function MA_UMLDI_UML_Association_End_Label_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 76;
end MA_UMLDI_UML_Association_End_Label_Model_Element_Uml_Diagram_Element;
---------------------------------------------------------------------
-- MA_UMLDI_UML_Behavior_Diagram_Model_Element_Uml_Diagram_Element --
---------------------------------------------------------------------
function MA_UMLDI_UML_Behavior_Diagram_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 77;
end MA_UMLDI_UML_Behavior_Diagram_Model_Element_Uml_Diagram_Element;
---------------------------------------------------------------------
-- MA_UMLDI_UML_Classifier_Shape_Model_Element_Uml_Diagram_Element --
---------------------------------------------------------------------
function MA_UMLDI_UML_Classifier_Shape_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 78;
end MA_UMLDI_UML_Classifier_Shape_Model_Element_Uml_Diagram_Element;
------------------------------------------------------------------------
-- MA_UMLDI_UML_Compartment_Element_In_Compartment_Owning_Compartment --
------------------------------------------------------------------------
function MA_UMLDI_UML_Compartment_Element_In_Compartment_Owning_Compartment return AMF.Internals.CMOF_Element is
begin
return Base + 79;
end MA_UMLDI_UML_Compartment_Element_In_Compartment_Owning_Compartment;
------------------------------------------------------------------------
-- MA_UMLDI_UML_Compartmentable_Shape_Compartment_Compartmented_Shape --
------------------------------------------------------------------------
function MA_UMLDI_UML_Compartmentable_Shape_Compartment_Compartmented_Shape return AMF.Internals.CMOF_Element is
begin
return Base + 80;
end MA_UMLDI_UML_Compartmentable_Shape_Compartment_Compartmented_Shape;
-------------------------------------------------------------
-- MA_UMLDI_UML_Diagram_Element_Local_Style_Styled_Element --
-------------------------------------------------------------
function MA_UMLDI_UML_Diagram_Element_Local_Style_Styled_Element return AMF.Internals.CMOF_Element is
begin
return Base + 81;
end MA_UMLDI_UML_Diagram_Element_Local_Style_Styled_Element;
--------------------------------------------------------------------
-- MA_UMLDI_UML_Diagram_Element_Model_Element_Uml_Diagram_Element --
--------------------------------------------------------------------
function MA_UMLDI_UML_Diagram_Element_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 82;
end MA_UMLDI_UML_Diagram_Element_Model_Element_Uml_Diagram_Element;
---------------------------------------------------------------
-- MA_UMLDI_UML_Diagram_Element_Owned_Element_Owning_Element --
---------------------------------------------------------------
function MA_UMLDI_UML_Diagram_Element_Owned_Element_Owning_Element return AMF.Internals.CMOF_Element is
begin
return Base + 83;
end MA_UMLDI_UML_Diagram_Element_Owned_Element_Owning_Element;
--------------------------------------------------------------
-- MA_UMLDI_UML_Diagram_Element_Shared_Style_Styled_Element --
--------------------------------------------------------------
function MA_UMLDI_UML_Diagram_Element_Shared_Style_Styled_Element return AMF.Internals.CMOF_Element is
begin
return Base + 84;
end MA_UMLDI_UML_Diagram_Element_Shared_Style_Styled_Element;
-------------------------------------------------
-- MA_UMLDI_UML_Diagram_Heading_Headed_Diagram --
-------------------------------------------------
function MA_UMLDI_UML_Diagram_Heading_Headed_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 85;
end MA_UMLDI_UML_Diagram_Heading_Headed_Diagram;
------------------------------------------
-- MA_UMLDI_UML_Edge_Source_Source_Edge --
------------------------------------------
function MA_UMLDI_UML_Edge_Source_Source_Edge return AMF.Internals.CMOF_Element is
begin
return Base + 86;
end MA_UMLDI_UML_Edge_Source_Source_Edge;
------------------------------------------
-- MA_UMLDI_UML_Edge_Target_Target_Edge --
------------------------------------------
function MA_UMLDI_UML_Edge_Target_Target_Edge return AMF.Internals.CMOF_Element is
begin
return Base + 87;
end MA_UMLDI_UML_Edge_Target_Target_Edge;
------------------------------------------------------------------------
-- MA_UMLDI_UML_Interaction_Diagram_Model_Element_Uml_Diagram_Element --
------------------------------------------------------------------------
function MA_UMLDI_UML_Interaction_Diagram_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 88;
end MA_UMLDI_UML_Interaction_Diagram_Model_Element_Uml_Diagram_Element;
-----------------------------------------------------------------------
-- MA_UMLDI_UML_Multiplicity_Label_Model_Element_Uml_Diagram_Element --
-----------------------------------------------------------------------
function MA_UMLDI_UML_Multiplicity_Label_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 89;
end MA_UMLDI_UML_Multiplicity_Label_Model_Element_Uml_Diagram_Element;
--------------------------------------------------------------
-- MA_UMLDI_UML_Name_Label_Mode_Element_Uml_Diagram_Element --
--------------------------------------------------------------
function MA_UMLDI_UML_Name_Label_Mode_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 90;
end MA_UMLDI_UML_Name_Label_Mode_Element_Uml_Diagram_Element;
--------------------------------------------------------------------
-- MA_UMLDI_UML_Redefines_Label_Model_Element_Uml_Diagram_Element --
--------------------------------------------------------------------
function MA_UMLDI_UML_Redefines_Label_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 91;
end MA_UMLDI_UML_Redefines_Label_Model_Element_Uml_Diagram_Element;
--------------------------------------------------------------------------
-- MA_UMLDI_UML_State_Machine_Diagram_Model_Element_Uml_Diagram_Element --
--------------------------------------------------------------------------
function MA_UMLDI_UML_State_Machine_Diagram_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 92;
end MA_UMLDI_UML_State_Machine_Diagram_Model_Element_Uml_Diagram_Element;
----------------------------------------------------------------
-- MA_UMLDI_UML_State_Shape_Model_Element_Uml_Diagram_Element --
----------------------------------------------------------------
function MA_UMLDI_UML_State_Shape_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 93;
end MA_UMLDI_UML_State_Shape_Model_Element_Uml_Diagram_Element;
------------------------------------------------------------------------------------
-- MA_UMLDI_UML_Stereotype_Property_Value_Label_Model_Element_Uml_Diagram_Element --
------------------------------------------------------------------------------------
function MA_UMLDI_UML_Stereotype_Property_Value_Label_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 94;
end MA_UMLDI_UML_Stereotype_Property_Value_Label_Model_Element_Uml_Diagram_Element;
-----------------------------------------------------------------------------------------------------
-- MA_UMLDI_UML_Stereotype_Property_Value_Label_Stereotyped_Element_Label_Showing_Stereotype_Value --
-----------------------------------------------------------------------------------------------------
function MA_UMLDI_UML_Stereotype_Property_Value_Label_Stereotyped_Element_Label_Showing_Stereotype_Value return AMF.Internals.CMOF_Element is
begin
return Base + 95;
end MA_UMLDI_UML_Stereotype_Property_Value_Label_Stereotyped_Element_Label_Showing_Stereotype_Value;
--------------
-- MB_UMLDI --
--------------
function MB_UMLDI return AMF.Internals.AMF_Element is
begin
return Base;
end MB_UMLDI;
--------------
-- MB_UMLDI --
--------------
function ML_UMLDI return AMF.Internals.AMF_Element is
begin
return Base + 319;
end ML_UMLDI;
end AMF.Internals.Tables.UMLDI_Metamodel;
| true |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
package body AMF.Internals.Tables.UMLDI_Metamodel is
--------------------
-- MM_UMLDI_UMLDI --
--------------------
function MM_UMLDI_UMLDI return AMF.Internals.CMOF_Element is
begin
return Base + 96;
end MM_UMLDI_UMLDI;
--------------------------------------------------------------
-- MC_UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind --
--------------------------------------------------------------
function MC_UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind return AMF.Internals.CMOF_Element is
begin
return Base + 272;
end MC_UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind;
----------------------------------------------
-- MC_UMLDI_UML_Inherited_State_Border_Kind --
----------------------------------------------
function MC_UMLDI_UML_Inherited_State_Border_Kind return AMF.Internals.CMOF_Element is
begin
return Base + 275;
end MC_UMLDI_UML_Inherited_State_Border_Kind;
-------------------------------------------
-- MC_UMLDI_UML_Interaction_Diagram_Kind --
-------------------------------------------
function MC_UMLDI_UML_Interaction_Diagram_Kind return AMF.Internals.CMOF_Element is
begin
return Base + 281;
end MC_UMLDI_UML_Interaction_Diagram_Kind;
-----------------------------------------------
-- MC_UMLDI_UML_Interaction_Table_Label_Kind --
-----------------------------------------------
function MC_UMLDI_UML_Interaction_Table_Label_Kind return AMF.Internals.CMOF_Element is
begin
return Base + 293;
end MC_UMLDI_UML_Interaction_Table_Label_Kind;
---------------------------------------------
-- MC_UMLDI_UML_Navigability_Notation_Kind --
---------------------------------------------
function MC_UMLDI_UML_Navigability_Notation_Kind return AMF.Internals.CMOF_Element is
begin
return Base + 309;
end MC_UMLDI_UML_Navigability_Notation_Kind;
-----------------------------------
-- MC_UMLDI_UML_Activity_Diagram --
-----------------------------------
function MC_UMLDI_UML_Activity_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 1;
end MC_UMLDI_UML_Activity_Diagram;
----------------------------------------
-- MC_UMLDI_UML_Association_End_Label --
----------------------------------------
function MC_UMLDI_UML_Association_End_Label return AMF.Internals.CMOF_Element is
begin
return Base + 2;
end MC_UMLDI_UML_Association_End_Label;
---------------------------------------------------------
-- MC_UMLDI_UML_Association_Or_Connector_Or_Link_Shape --
---------------------------------------------------------
function MC_UMLDI_UML_Association_Or_Connector_Or_Link_Shape return AMF.Internals.CMOF_Element is
begin
return Base + 3;
end MC_UMLDI_UML_Association_Or_Connector_Or_Link_Shape;
-----------------------------------
-- MC_UMLDI_UML_Behavior_Diagram --
-----------------------------------
function MC_UMLDI_UML_Behavior_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 4;
end MC_UMLDI_UML_Behavior_Diagram;
--------------------------------
-- MC_UMLDI_UML_Class_Diagram --
--------------------------------
function MC_UMLDI_UML_Class_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 5;
end MC_UMLDI_UML_Class_Diagram;
-------------------------------------------------------
-- MC_UMLDI_UML_Class_Or_Composite_Structure_Diagram --
-------------------------------------------------------
function MC_UMLDI_UML_Class_Or_Composite_Structure_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 6;
end MC_UMLDI_UML_Class_Or_Composite_Structure_Diagram;
-----------------------------------
-- MC_UMLDI_UML_Classifier_Shape --
-----------------------------------
function MC_UMLDI_UML_Classifier_Shape return AMF.Internals.CMOF_Element is
begin
return Base + 7;
end MC_UMLDI_UML_Classifier_Shape;
------------------------------
-- MC_UMLDI_UML_Compartment --
------------------------------
function MC_UMLDI_UML_Compartment return AMF.Internals.CMOF_Element is
begin
return Base + 8;
end MC_UMLDI_UML_Compartment;
----------------------------------------
-- MC_UMLDI_UML_Compartmentable_Shape --
----------------------------------------
function MC_UMLDI_UML_Compartmentable_Shape return AMF.Internals.CMOF_Element is
begin
return Base + 9;
end MC_UMLDI_UML_Compartmentable_Shape;
------------------------------------
-- MC_UMLDI_UML_Component_Diagram --
------------------------------------
function MC_UMLDI_UML_Component_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 10;
end MC_UMLDI_UML_Component_Diagram;
----------------------------------------------
-- MC_UMLDI_UML_Composite_Structure_Diagram --
----------------------------------------------
function MC_UMLDI_UML_Composite_Structure_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 11;
end MC_UMLDI_UML_Composite_Structure_Diagram;
-------------------------------------
-- MC_UMLDI_UML_Deployment_Diagram --
-------------------------------------
function MC_UMLDI_UML_Deployment_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 12;
end MC_UMLDI_UML_Deployment_Diagram;
--------------------------
-- MC_UMLDI_UML_Diagram --
--------------------------
function MC_UMLDI_UML_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 13;
end MC_UMLDI_UML_Diagram;
----------------------------------
-- MC_UMLDI_UML_Diagram_Element --
----------------------------------
function MC_UMLDI_UML_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 14;
end MC_UMLDI_UML_Diagram_Element;
-----------------------
-- MC_UMLDI_UML_Edge --
-----------------------
function MC_UMLDI_UML_Edge return AMF.Internals.CMOF_Element is
begin
return Base + 15;
end MC_UMLDI_UML_Edge;
--------------------------------------
-- MC_UMLDI_UML_Interaction_Diagram --
--------------------------------------
function MC_UMLDI_UML_Interaction_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 16;
end MC_UMLDI_UML_Interaction_Diagram;
------------------------------------------
-- MC_UMLDI_UML_Interaction_Table_Label --
------------------------------------------
function MC_UMLDI_UML_Interaction_Table_Label return AMF.Internals.CMOF_Element is
begin
return Base + 17;
end MC_UMLDI_UML_Interaction_Table_Label;
--------------------------------
-- MC_UMLDI_UML_Keyword_Label --
--------------------------------
function MC_UMLDI_UML_Keyword_Label return AMF.Internals.CMOF_Element is
begin
return Base + 18;
end MC_UMLDI_UML_Keyword_Label;
------------------------
-- MC_UMLDI_UML_Label --
------------------------
function MC_UMLDI_UML_Label return AMF.Internals.CMOF_Element is
begin
return Base + 19;
end MC_UMLDI_UML_Label;
-------------------------------------
-- MC_UMLDI_UML_Multiplicity_Label --
-------------------------------------
function MC_UMLDI_UML_Multiplicity_Label return AMF.Internals.CMOF_Element is
begin
return Base + 20;
end MC_UMLDI_UML_Multiplicity_Label;
-----------------------------
-- MC_UMLDI_UML_Name_Label --
-----------------------------
function MC_UMLDI_UML_Name_Label return AMF.Internals.CMOF_Element is
begin
return Base + 21;
end MC_UMLDI_UML_Name_Label;
---------------------------------
-- MC_UMLDI_UML_Object_Diagram --
---------------------------------
function MC_UMLDI_UML_Object_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 22;
end MC_UMLDI_UML_Object_Diagram;
----------------------------------
-- MC_UMLDI_UML_Package_Diagram --
----------------------------------
function MC_UMLDI_UML_Package_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 23;
end MC_UMLDI_UML_Package_Diagram;
----------------------------------
-- MC_UMLDI_UML_Profile_Diagram --
----------------------------------
function MC_UMLDI_UML_Profile_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 24;
end MC_UMLDI_UML_Profile_Diagram;
----------------------------------
-- MC_UMLDI_UML_Redefines_Label --
----------------------------------
function MC_UMLDI_UML_Redefines_Label return AMF.Internals.CMOF_Element is
begin
return Base + 25;
end MC_UMLDI_UML_Redefines_Label;
------------------------
-- MC_UMLDI_UML_Shape --
------------------------
function MC_UMLDI_UML_Shape return AMF.Internals.CMOF_Element is
begin
return Base + 26;
end MC_UMLDI_UML_Shape;
----------------------------------------
-- MC_UMLDI_UML_State_Machine_Diagram --
----------------------------------------
function MC_UMLDI_UML_State_Machine_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 27;
end MC_UMLDI_UML_State_Machine_Diagram;
------------------------------
-- MC_UMLDI_UML_State_Shape --
------------------------------
function MC_UMLDI_UML_State_Shape return AMF.Internals.CMOF_Element is
begin
return Base + 28;
end MC_UMLDI_UML_State_Shape;
--------------------------------------------------
-- MC_UMLDI_UML_Stereotype_Property_Value_Label --
--------------------------------------------------
function MC_UMLDI_UML_Stereotype_Property_Value_Label return AMF.Internals.CMOF_Element is
begin
return Base + 29;
end MC_UMLDI_UML_Stereotype_Property_Value_Label;
------------------------------------
-- MC_UMLDI_UML_Structure_Diagram --
------------------------------------
function MC_UMLDI_UML_Structure_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 30;
end MC_UMLDI_UML_Structure_Diagram;
------------------------
-- MC_UMLDI_UML_Style --
------------------------
function MC_UMLDI_UML_Style return AMF.Internals.CMOF_Element is
begin
return Base + 31;
end MC_UMLDI_UML_Style;
--------------------------------------
-- MC_UMLDI_UML_Typed_Element_Label --
--------------------------------------
function MC_UMLDI_UML_Typed_Element_Label return AMF.Internals.CMOF_Element is
begin
return Base + 32;
end MC_UMLDI_UML_Typed_Element_Label;
-----------------------------------
-- MC_UMLDI_UML_Use_Case_Diagram --
-----------------------------------
function MC_UMLDI_UML_Use_Case_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 33;
end MC_UMLDI_UML_Use_Case_Diagram;
-----------------------------------------------------
-- MP_UMLDI_UML_Activity_Diagram_Is_Activity_Frame --
-----------------------------------------------------
function MP_UMLDI_UML_Activity_Diagram_Is_Activity_Frame return AMF.Internals.CMOF_Element is
begin
return Base + 39;
end MP_UMLDI_UML_Activity_Diagram_Is_Activity_Frame;
-----------------------------------------------------------------------
-- MP_UMLDI_UML_Activity_Diagram_Model_Element_A_Uml_Diagram_Element --
-----------------------------------------------------------------------
function MP_UMLDI_UML_Activity_Diagram_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 40;
end MP_UMLDI_UML_Activity_Diagram_Model_Element_A_Uml_Diagram_Element;
----------------------------------------------------------------------------
-- MP_UMLDI_UML_Association_End_Label_Model_Element_A_Uml_Diagram_Element --
----------------------------------------------------------------------------
function MP_UMLDI_UML_Association_End_Label_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 41;
end MP_UMLDI_UML_Association_End_Label_Model_Element_A_Uml_Diagram_Element;
--------------------------------------------------------------
-- MP_UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind --
--------------------------------------------------------------
function MP_UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind return AMF.Internals.CMOF_Element is
begin
return Base + 42;
end MP_UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind;
-----------------------------------------------------------------------
-- MP_UMLDI_UML_Behavior_Diagram_Model_Element_A_Uml_Diagram_Element --
-----------------------------------------------------------------------
function MP_UMLDI_UML_Behavior_Diagram_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 43;
end MP_UMLDI_UML_Behavior_Diagram_Model_Element_A_Uml_Diagram_Element;
--------------------------------------------------------------------------------
-- MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Is_Association_Dot_Shown --
--------------------------------------------------------------------------------
function MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Is_Association_Dot_Shown return AMF.Internals.CMOF_Element is
begin
return Base + 44;
end MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Is_Association_Dot_Shown;
-----------------------------------------------------------------------------
-- MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Navigability_Notation --
-----------------------------------------------------------------------------
function MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Navigability_Notation return AMF.Internals.CMOF_Element is
begin
return Base + 45;
end MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Navigability_Notation;
---------------------------------------------------------------------------------
-- MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Non_Navigability_Notation --
---------------------------------------------------------------------------------
function MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Non_Navigability_Notation return AMF.Internals.CMOF_Element is
begin
return Base + 46;
end MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Non_Navigability_Notation;
---------------------------------------------------
-- MP_UMLDI_UML_Classifier_Shape_Is_Double_Sided --
---------------------------------------------------
function MP_UMLDI_UML_Classifier_Shape_Is_Double_Sided return AMF.Internals.CMOF_Element is
begin
return Base + 47;
end MP_UMLDI_UML_Classifier_Shape_Is_Double_Sided;
------------------------------------------------------------
-- MP_UMLDI_UML_Classifier_Shape_Is_Indent_For_Visibility --
------------------------------------------------------------
function MP_UMLDI_UML_Classifier_Shape_Is_Indent_For_Visibility return AMF.Internals.CMOF_Element is
begin
return Base + 48;
end MP_UMLDI_UML_Classifier_Shape_Is_Indent_For_Visibility;
-----------------------------------------------------------------------
-- MP_UMLDI_UML_Classifier_Shape_Model_Element_A_Uml_Diagram_Element --
-----------------------------------------------------------------------
function MP_UMLDI_UML_Classifier_Shape_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 49;
end MP_UMLDI_UML_Classifier_Shape_Model_Element_A_Uml_Diagram_Element;
--------------------------------------------------------------------------
-- MP_UMLDI_UML_Compartment_Element_In_Compartment_A_Owning_Compartment --
--------------------------------------------------------------------------
function MP_UMLDI_UML_Compartment_Element_In_Compartment_A_Owning_Compartment return AMF.Internals.CMOF_Element is
begin
return Base + 34;
end MP_UMLDI_UML_Compartment_Element_In_Compartment_A_Owning_Compartment;
--------------------------------------------------------------------------
-- MP_UMLDI_UML_Compartmentable_Shape_Compartment_A_Compartmented_Shape --
--------------------------------------------------------------------------
function MP_UMLDI_UML_Compartmentable_Shape_Compartment_A_Compartmented_Shape return AMF.Internals.CMOF_Element is
begin
return Base + 35;
end MP_UMLDI_UML_Compartmentable_Shape_Compartment_A_Compartmented_Shape;
---------------------------------------------------
-- MP_UMLDI_UML_Diagram_Heading_A_Headed_Diagram --
---------------------------------------------------
function MP_UMLDI_UML_Diagram_Heading_A_Headed_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 50;
end MP_UMLDI_UML_Diagram_Heading_A_Headed_Diagram;
-----------------------------------
-- MP_UMLDI_UML_Diagram_Is_Frame --
-----------------------------------
function MP_UMLDI_UML_Diagram_Is_Frame return AMF.Internals.CMOF_Element is
begin
return Base + 51;
end MP_UMLDI_UML_Diagram_Is_Frame;
---------------------------------
-- MP_UMLDI_UML_Diagram_Is_Iso --
---------------------------------
function MP_UMLDI_UML_Diagram_Is_Iso return AMF.Internals.CMOF_Element is
begin
return Base + 52;
end MP_UMLDI_UML_Diagram_Is_Iso;
------------------------------------------
-- MP_UMLDI_UML_Diagram_Element_Is_Icon --
------------------------------------------
function MP_UMLDI_UML_Diagram_Element_Is_Icon return AMF.Internals.CMOF_Element is
begin
return Base + 53;
end MP_UMLDI_UML_Diagram_Element_Is_Icon;
---------------------------------------------------------------
-- MP_UMLDI_UML_Diagram_Element_Local_Style_A_Styled_Element --
---------------------------------------------------------------
function MP_UMLDI_UML_Diagram_Element_Local_Style_A_Styled_Element return AMF.Internals.CMOF_Element is
begin
return Base + 54;
end MP_UMLDI_UML_Diagram_Element_Local_Style_A_Styled_Element;
----------------------------------------------------------------------
-- MP_UMLDI_UML_Diagram_Element_Model_Element_A_Uml_Diagram_Element --
----------------------------------------------------------------------
function MP_UMLDI_UML_Diagram_Element_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 36;
end MP_UMLDI_UML_Diagram_Element_Model_Element_A_Uml_Diagram_Element;
-----------------------------------------------------------------------------------
-- MP_UMLDI_UML_Diagram_Element_Owned_Element_UML_Diagram_Element_Owning_Element --
-----------------------------------------------------------------------------------
function MP_UMLDI_UML_Diagram_Element_Owned_Element_UML_Diagram_Element_Owning_Element return AMF.Internals.CMOF_Element is
begin
return Base + 37;
end MP_UMLDI_UML_Diagram_Element_Owned_Element_UML_Diagram_Element_Owning_Element;
-----------------------------------------------------------------------------------
-- MP_UMLDI_UML_Diagram_Element_Owning_Element_UML_Diagram_Element_Owned_Element --
-----------------------------------------------------------------------------------
function MP_UMLDI_UML_Diagram_Element_Owning_Element_UML_Diagram_Element_Owned_Element return AMF.Internals.CMOF_Element is
begin
return Base + 55;
end MP_UMLDI_UML_Diagram_Element_Owning_Element_UML_Diagram_Element_Owned_Element;
----------------------------------------------------------------
-- MP_UMLDI_UML_Diagram_Element_Shared_Style_A_Styled_Element --
----------------------------------------------------------------
function MP_UMLDI_UML_Diagram_Element_Shared_Style_A_Styled_Element return AMF.Internals.CMOF_Element is
begin
return Base + 56;
end MP_UMLDI_UML_Diagram_Element_Shared_Style_A_Styled_Element;
--------------------------------------------
-- MP_UMLDI_UML_Edge_Source_A_Source_Edge --
--------------------------------------------
function MP_UMLDI_UML_Edge_Source_A_Source_Edge return AMF.Internals.CMOF_Element is
begin
return Base + 57;
end MP_UMLDI_UML_Edge_Source_A_Source_Edge;
--------------------------------------------
-- MP_UMLDI_UML_Edge_Target_A_Target_Edge --
--------------------------------------------
function MP_UMLDI_UML_Edge_Target_A_Target_Edge return AMF.Internals.CMOF_Element is
begin
return Base + 58;
end MP_UMLDI_UML_Edge_Target_A_Target_Edge;
-------------------------------------------
-- MP_UMLDI_UML_Interaction_Diagram_Kind --
-------------------------------------------
function MP_UMLDI_UML_Interaction_Diagram_Kind return AMF.Internals.CMOF_Element is
begin
return Base + 59;
end MP_UMLDI_UML_Interaction_Diagram_Kind;
--------------------------------------------------------------------------
-- MP_UMLDI_UML_Interaction_Diagram_Model_Element_A_Uml_Diagram_Element --
--------------------------------------------------------------------------
function MP_UMLDI_UML_Interaction_Diagram_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 60;
end MP_UMLDI_UML_Interaction_Diagram_Model_Element_A_Uml_Diagram_Element;
-----------------------------------------------
-- MP_UMLDI_UML_Interaction_Table_Label_Kind --
-----------------------------------------------
function MP_UMLDI_UML_Interaction_Table_Label_Kind return AMF.Internals.CMOF_Element is
begin
return Base + 61;
end MP_UMLDI_UML_Interaction_Table_Label_Kind;
-----------------------------
-- MP_UMLDI_UML_Label_Text --
-----------------------------
function MP_UMLDI_UML_Label_Text return AMF.Internals.CMOF_Element is
begin
return Base + 62;
end MP_UMLDI_UML_Label_Text;
-------------------------------------------------------------------------
-- MP_UMLDI_UML_Multiplicity_Label_Model_Element_A_Uml_Diagram_Element --
-------------------------------------------------------------------------
function MP_UMLDI_UML_Multiplicity_Label_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 63;
end MP_UMLDI_UML_Multiplicity_Label_Model_Element_A_Uml_Diagram_Element;
----------------------------------------------------------------
-- MP_UMLDI_UML_Name_Label_Mode_Element_A_Uml_Diagram_Element --
----------------------------------------------------------------
function MP_UMLDI_UML_Name_Label_Mode_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 64;
end MP_UMLDI_UML_Name_Label_Mode_Element_A_Uml_Diagram_Element;
----------------------------------------------------------------------
-- MP_UMLDI_UML_Redefines_Label_Model_Element_A_Uml_Diagram_Element --
----------------------------------------------------------------------
function MP_UMLDI_UML_Redefines_Label_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 65;
end MP_UMLDI_UML_Redefines_Label_Model_Element_A_Uml_Diagram_Element;
---------------------------------------------------------------
-- MP_UMLDI_UML_State_Machine_Diagram_Inherited_State_Border --
---------------------------------------------------------------
function MP_UMLDI_UML_State_Machine_Diagram_Inherited_State_Border return AMF.Internals.CMOF_Element is
begin
return Base + 66;
end MP_UMLDI_UML_State_Machine_Diagram_Inherited_State_Border;
---------------------------------------------------------------
-- MP_UMLDI_UML_State_Machine_Diagram_Is_Collapse_State_Icon --
---------------------------------------------------------------
function MP_UMLDI_UML_State_Machine_Diagram_Is_Collapse_State_Icon return AMF.Internals.CMOF_Element is
begin
return Base + 67;
end MP_UMLDI_UML_State_Machine_Diagram_Is_Collapse_State_Icon;
---------------------------------------------------------------
-- MP_UMLDI_UML_State_Machine_Diagram_Is_Transition_Oriented --
---------------------------------------------------------------
function MP_UMLDI_UML_State_Machine_Diagram_Is_Transition_Oriented return AMF.Internals.CMOF_Element is
begin
return Base + 68;
end MP_UMLDI_UML_State_Machine_Diagram_Is_Transition_Oriented;
----------------------------------------------------------------------------
-- MP_UMLDI_UML_State_Machine_Diagram_Model_Element_A_Uml_Diagram_Element --
----------------------------------------------------------------------------
function MP_UMLDI_UML_State_Machine_Diagram_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 69;
end MP_UMLDI_UML_State_Machine_Diagram_Model_Element_A_Uml_Diagram_Element;
----------------------------------------
-- MP_UMLDI_UML_State_Shape_Is_Tabbed --
----------------------------------------
function MP_UMLDI_UML_State_Shape_Is_Tabbed return AMF.Internals.CMOF_Element is
begin
return Base + 70;
end MP_UMLDI_UML_State_Shape_Is_Tabbed;
------------------------------------------------------------------
-- MP_UMLDI_UML_State_Shape_Model_Element_A_Uml_Diagram_Element --
------------------------------------------------------------------
function MP_UMLDI_UML_State_Shape_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 38;
end MP_UMLDI_UML_State_Shape_Model_Element_A_Uml_Diagram_Element;
--------------------------------------------------------------------------------------
-- MP_UMLDI_UML_Stereotype_Property_Value_Label_Model_Element_A_Uml_Diagram_Element --
--------------------------------------------------------------------------------------
function MP_UMLDI_UML_Stereotype_Property_Value_Label_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 71;
end MP_UMLDI_UML_Stereotype_Property_Value_Label_Model_Element_A_Uml_Diagram_Element;
-------------------------------------------------------------------------------------------------------
-- MP_UMLDI_UML_Stereotype_Property_Value_Label_Stereotyped_Element_A_Label_Showing_Stereotype_Value --
-------------------------------------------------------------------------------------------------------
function MP_UMLDI_UML_Stereotype_Property_Value_Label_Stereotyped_Element_A_Label_Showing_Stereotype_Value return AMF.Internals.CMOF_Element is
begin
return Base + 72;
end MP_UMLDI_UML_Stereotype_Property_Value_Label_Stereotyped_Element_A_Label_Showing_Stereotype_Value;
----------------------------------
-- MP_UMLDI_UML_Style_Font_Name --
----------------------------------
function MP_UMLDI_UML_Style_Font_Name return AMF.Internals.CMOF_Element is
begin
return Base + 73;
end MP_UMLDI_UML_Style_Font_Name;
----------------------------------
-- MP_UMLDI_UML_Style_Font_Size --
----------------------------------
function MP_UMLDI_UML_Style_Font_Size return AMF.Internals.CMOF_Element is
begin
return Base + 74;
end MP_UMLDI_UML_Style_Font_Size;
-----------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Activity_Diagram_Model_Element --
-----------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Activity_Diagram_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 97;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Activity_Diagram_Model_Element;
----------------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Association_End_Label_Model_Element --
----------------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Association_End_Label_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 98;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Association_End_Label_Model_Element;
-----------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Behavior_Diagram_Model_Element --
-----------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Behavior_Diagram_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 99;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Behavior_Diagram_Model_Element;
-----------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Classifier_Shape_Model_Element --
-----------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Classifier_Shape_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 100;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Classifier_Shape_Model_Element;
--------------------------------------------------------------------------
-- MP_UMLDI_A_Owning_Compartment_UML_Compartment_Element_In_Compartment --
--------------------------------------------------------------------------
function MP_UMLDI_A_Owning_Compartment_UML_Compartment_Element_In_Compartment return AMF.Internals.CMOF_Element is
begin
return Base + 101;
end MP_UMLDI_A_Owning_Compartment_UML_Compartment_Element_In_Compartment;
--------------------------------------------------------------------------
-- MP_UMLDI_A_Compartmented_Shape_UML_Compartmentable_Shape_Compartment --
--------------------------------------------------------------------------
function MP_UMLDI_A_Compartmented_Shape_UML_Compartmentable_Shape_Compartment return AMF.Internals.CMOF_Element is
begin
return Base + 103;
end MP_UMLDI_A_Compartmented_Shape_UML_Compartmentable_Shape_Compartment;
---------------------------------------------------------------
-- MP_UMLDI_A_Styled_Element_UML_Diagram_Element_Local_Style --
---------------------------------------------------------------
function MP_UMLDI_A_Styled_Element_UML_Diagram_Element_Local_Style return AMF.Internals.CMOF_Element is
begin
return Base + 104;
end MP_UMLDI_A_Styled_Element_UML_Diagram_Element_Local_Style;
----------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Diagram_Element_Model_Element --
----------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Diagram_Element_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 105;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Diagram_Element_Model_Element;
----------------------------------------------------------------
-- MP_UMLDI_A_Styled_Element_UML_Diagram_Element_Shared_Style --
----------------------------------------------------------------
function MP_UMLDI_A_Styled_Element_UML_Diagram_Element_Shared_Style return AMF.Internals.CMOF_Element is
begin
return Base + 106;
end MP_UMLDI_A_Styled_Element_UML_Diagram_Element_Shared_Style;
---------------------------------------------------
-- MP_UMLDI_A_Headed_Diagram_UML_Diagram_Heading --
---------------------------------------------------
function MP_UMLDI_A_Headed_Diagram_UML_Diagram_Heading return AMF.Internals.CMOF_Element is
begin
return Base + 107;
end MP_UMLDI_A_Headed_Diagram_UML_Diagram_Heading;
--------------------------------------------
-- MP_UMLDI_A_Source_Edge_UML_Edge_Source --
--------------------------------------------
function MP_UMLDI_A_Source_Edge_UML_Edge_Source return AMF.Internals.CMOF_Element is
begin
return Base + 108;
end MP_UMLDI_A_Source_Edge_UML_Edge_Source;
--------------------------------------------
-- MP_UMLDI_A_Target_Edge_UML_Edge_Target --
--------------------------------------------
function MP_UMLDI_A_Target_Edge_UML_Edge_Target return AMF.Internals.CMOF_Element is
begin
return Base + 109;
end MP_UMLDI_A_Target_Edge_UML_Edge_Target;
--------------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Interaction_Diagram_Model_Element --
--------------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Interaction_Diagram_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 110;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Interaction_Diagram_Model_Element;
-------------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Multiplicity_Label_Model_Element --
-------------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Multiplicity_Label_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 111;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Multiplicity_Label_Model_Element;
----------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Name_Label_Mode_Element --
----------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Name_Label_Mode_Element return AMF.Internals.CMOF_Element is
begin
return Base + 112;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Name_Label_Mode_Element;
----------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Redefines_Label_Model_Element --
----------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Redefines_Label_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 113;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Redefines_Label_Model_Element;
----------------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_State_Machine_Diagram_Model_Element --
----------------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_State_Machine_Diagram_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 114;
end MP_UMLDI_A_Uml_Diagram_Element_UML_State_Machine_Diagram_Model_Element;
------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_State_Shape_Model_Element --
------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_State_Shape_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 115;
end MP_UMLDI_A_Uml_Diagram_Element_UML_State_Shape_Model_Element;
--------------------------------------------------------------------------------------
-- MP_UMLDI_A_Uml_Diagram_Element_UML_Stereotype_Property_Value_Label_Model_Element --
--------------------------------------------------------------------------------------
function MP_UMLDI_A_Uml_Diagram_Element_UML_Stereotype_Property_Value_Label_Model_Element return AMF.Internals.CMOF_Element is
begin
return Base + 116;
end MP_UMLDI_A_Uml_Diagram_Element_UML_Stereotype_Property_Value_Label_Model_Element;
-------------------------------------------------------------------------------------------------------
-- MP_UMLDI_A_Label_Showing_Stereotype_Value_UML_Stereotype_Property_Value_Label_Stereotyped_Element --
-------------------------------------------------------------------------------------------------------
function MP_UMLDI_A_Label_Showing_Stereotype_Value_UML_Stereotype_Property_Value_Label_Stereotyped_Element return AMF.Internals.CMOF_Element is
begin
return Base + 117;
end MP_UMLDI_A_Label_Showing_Stereotype_Value_UML_Stereotype_Property_Value_Label_Stereotyped_Element;
---------------------------------------------------------------------
-- MA_UMLDI_UML_Activity_Diagram_Model_Element_Uml_Diagram_Element --
---------------------------------------------------------------------
function MA_UMLDI_UML_Activity_Diagram_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 75;
end MA_UMLDI_UML_Activity_Diagram_Model_Element_Uml_Diagram_Element;
--------------------------------------------------------------------------
-- MA_UMLDI_UML_Association_End_Label_Model_Element_Uml_Diagram_Element --
--------------------------------------------------------------------------
function MA_UMLDI_UML_Association_End_Label_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 76;
end MA_UMLDI_UML_Association_End_Label_Model_Element_Uml_Diagram_Element;
---------------------------------------------------------------------
-- MA_UMLDI_UML_Behavior_Diagram_Model_Element_Uml_Diagram_Element --
---------------------------------------------------------------------
function MA_UMLDI_UML_Behavior_Diagram_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 77;
end MA_UMLDI_UML_Behavior_Diagram_Model_Element_Uml_Diagram_Element;
---------------------------------------------------------------------
-- MA_UMLDI_UML_Classifier_Shape_Model_Element_Uml_Diagram_Element --
---------------------------------------------------------------------
function MA_UMLDI_UML_Classifier_Shape_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 78;
end MA_UMLDI_UML_Classifier_Shape_Model_Element_Uml_Diagram_Element;
------------------------------------------------------------------------
-- MA_UMLDI_UML_Compartment_Element_In_Compartment_Owning_Compartment --
------------------------------------------------------------------------
function MA_UMLDI_UML_Compartment_Element_In_Compartment_Owning_Compartment return AMF.Internals.CMOF_Element is
begin
return Base + 79;
end MA_UMLDI_UML_Compartment_Element_In_Compartment_Owning_Compartment;
------------------------------------------------------------------------
-- MA_UMLDI_UML_Compartmentable_Shape_Compartment_Compartmented_Shape --
------------------------------------------------------------------------
function MA_UMLDI_UML_Compartmentable_Shape_Compartment_Compartmented_Shape return AMF.Internals.CMOF_Element is
begin
return Base + 80;
end MA_UMLDI_UML_Compartmentable_Shape_Compartment_Compartmented_Shape;
-------------------------------------------------------------
-- MA_UMLDI_UML_Diagram_Element_Local_Style_Styled_Element --
-------------------------------------------------------------
function MA_UMLDI_UML_Diagram_Element_Local_Style_Styled_Element return AMF.Internals.CMOF_Element is
begin
return Base + 81;
end MA_UMLDI_UML_Diagram_Element_Local_Style_Styled_Element;
--------------------------------------------------------------------
-- MA_UMLDI_UML_Diagram_Element_Model_Element_Uml_Diagram_Element --
--------------------------------------------------------------------
function MA_UMLDI_UML_Diagram_Element_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 82;
end MA_UMLDI_UML_Diagram_Element_Model_Element_Uml_Diagram_Element;
---------------------------------------------------------------
-- MA_UMLDI_UML_Diagram_Element_Owned_Element_Owning_Element --
---------------------------------------------------------------
function MA_UMLDI_UML_Diagram_Element_Owned_Element_Owning_Element return AMF.Internals.CMOF_Element is
begin
return Base + 83;
end MA_UMLDI_UML_Diagram_Element_Owned_Element_Owning_Element;
--------------------------------------------------------------
-- MA_UMLDI_UML_Diagram_Element_Shared_Style_Styled_Element --
--------------------------------------------------------------
function MA_UMLDI_UML_Diagram_Element_Shared_Style_Styled_Element return AMF.Internals.CMOF_Element is
begin
return Base + 84;
end MA_UMLDI_UML_Diagram_Element_Shared_Style_Styled_Element;
-------------------------------------------------
-- MA_UMLDI_UML_Diagram_Heading_Headed_Diagram --
-------------------------------------------------
function MA_UMLDI_UML_Diagram_Heading_Headed_Diagram return AMF.Internals.CMOF_Element is
begin
return Base + 85;
end MA_UMLDI_UML_Diagram_Heading_Headed_Diagram;
------------------------------------------
-- MA_UMLDI_UML_Edge_Source_Source_Edge --
------------------------------------------
function MA_UMLDI_UML_Edge_Source_Source_Edge return AMF.Internals.CMOF_Element is
begin
return Base + 86;
end MA_UMLDI_UML_Edge_Source_Source_Edge;
------------------------------------------
-- MA_UMLDI_UML_Edge_Target_Target_Edge --
------------------------------------------
function MA_UMLDI_UML_Edge_Target_Target_Edge return AMF.Internals.CMOF_Element is
begin
return Base + 87;
end MA_UMLDI_UML_Edge_Target_Target_Edge;
------------------------------------------------------------------------
-- MA_UMLDI_UML_Interaction_Diagram_Model_Element_Uml_Diagram_Element --
------------------------------------------------------------------------
function MA_UMLDI_UML_Interaction_Diagram_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 88;
end MA_UMLDI_UML_Interaction_Diagram_Model_Element_Uml_Diagram_Element;
-----------------------------------------------------------------------
-- MA_UMLDI_UML_Multiplicity_Label_Model_Element_Uml_Diagram_Element --
-----------------------------------------------------------------------
function MA_UMLDI_UML_Multiplicity_Label_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 89;
end MA_UMLDI_UML_Multiplicity_Label_Model_Element_Uml_Diagram_Element;
--------------------------------------------------------------
-- MA_UMLDI_UML_Name_Label_Mode_Element_Uml_Diagram_Element --
--------------------------------------------------------------
function MA_UMLDI_UML_Name_Label_Mode_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 90;
end MA_UMLDI_UML_Name_Label_Mode_Element_Uml_Diagram_Element;
--------------------------------------------------------------------
-- MA_UMLDI_UML_Redefines_Label_Model_Element_Uml_Diagram_Element --
--------------------------------------------------------------------
function MA_UMLDI_UML_Redefines_Label_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 91;
end MA_UMLDI_UML_Redefines_Label_Model_Element_Uml_Diagram_Element;
--------------------------------------------------------------------------
-- MA_UMLDI_UML_State_Machine_Diagram_Model_Element_Uml_Diagram_Element --
--------------------------------------------------------------------------
function MA_UMLDI_UML_State_Machine_Diagram_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 92;
end MA_UMLDI_UML_State_Machine_Diagram_Model_Element_Uml_Diagram_Element;
----------------------------------------------------------------
-- MA_UMLDI_UML_State_Shape_Model_Element_Uml_Diagram_Element --
----------------------------------------------------------------
function MA_UMLDI_UML_State_Shape_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 93;
end MA_UMLDI_UML_State_Shape_Model_Element_Uml_Diagram_Element;
------------------------------------------------------------------------------------
-- MA_UMLDI_UML_Stereotype_Property_Value_Label_Model_Element_Uml_Diagram_Element --
------------------------------------------------------------------------------------
function MA_UMLDI_UML_Stereotype_Property_Value_Label_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is
begin
return Base + 94;
end MA_UMLDI_UML_Stereotype_Property_Value_Label_Model_Element_Uml_Diagram_Element;
-----------------------------------------------------------------------------------------------------
-- MA_UMLDI_UML_Stereotype_Property_Value_Label_Stereotyped_Element_Label_Showing_Stereotype_Value --
-----------------------------------------------------------------------------------------------------
function MA_UMLDI_UML_Stereotype_Property_Value_Label_Stereotyped_Element_Label_Showing_Stereotype_Value return AMF.Internals.CMOF_Element is
begin
return Base + 95;
end MA_UMLDI_UML_Stereotype_Property_Value_Label_Stereotyped_Element_Label_Showing_Stereotype_Value;
--------------
-- MB_UMLDI --
--------------
function MB_UMLDI return AMF.Internals.AMF_Element is
begin
return Base;
end MB_UMLDI;
--------------
-- MB_UMLDI --
--------------
function ML_UMLDI return AMF.Internals.AMF_Element is
begin
return Base + 319;
end ML_UMLDI;
end AMF.Internals.Tables.UMLDI_Metamodel;
|
[
{
"context": "OGRAM_ERROR, STORAGE_ERROR, AND TASKING_ERROR.\n\n-- R.WILLIAMS 9/18/86\n\nPACKAGE AA2010A_TYPEDEF IS\n TYPE ENU",
"end": 1537,
"score": 0.9987615942955017,
"start": 1527,
"tag": "NAME",
"value": "R.WILLIAMS"
}
] |
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/a/aa2010a.ada
|
best08618/asylo
| 7 |
-- AA2010A.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- CHECK THAT SUBUNIT NAMES CAN BE IDENTICAL TO IDENTIFIERS DECLARED IN
-- STANDARD, NAMELY, BOOLEAN, INTEGER, FLOAT, CHARACTER, ASCII,
-- NATURAL, POSITIVE, STRING, DURATION, CONSTRAINT_ERROR,
-- NUMERIC_ERROR, PROGRAM_ERROR, STORAGE_ERROR, AND TASKING_ERROR.
-- R.WILLIAMS 9/18/86
PACKAGE AA2010A_TYPEDEF IS
TYPE ENUM IS (E1, E2, E3);
END AA2010A_TYPEDEF;
WITH AA2010A_TYPEDEF; USE AA2010A_TYPEDEF;
PACKAGE AA2010A_PARENT IS
PROCEDURE BOOLEAN;
FUNCTION INTEGER RETURN ENUM;
PACKAGE FLOAT IS END FLOAT;
PROCEDURE CHARACTER;
FUNCTION ASCII RETURN ENUM;
TASK NATURAL IS
ENTRY E;
END NATURAL;
PROCEDURE POSITIVE;
FUNCTION STRING RETURN ENUM;
PACKAGE DURATION IS END DURATION;
PROCEDURE CONSTRAINT_ERROR;
FUNCTION NUMERIC_ERROR RETURN ENUM;
TASK PROGRAM_ERROR IS
ENTRY E;
END PROGRAM_ERROR;
PROCEDURE STORAGE_ERROR;
FUNCTION TASKING_ERROR RETURN ENUM;
END AA2010A_PARENT;
PACKAGE BODY AA2010A_PARENT IS
PROCEDURE BOOLEAN IS SEPARATE;
FUNCTION INTEGER RETURN ENUM IS SEPARATE;
PACKAGE BODY FLOAT IS SEPARATE;
PROCEDURE CHARACTER IS SEPARATE;
FUNCTION ASCII RETURN ENUM IS SEPARATE;
TASK BODY NATURAL IS SEPARATE;
PROCEDURE POSITIVE IS SEPARATE;
FUNCTION STRING RETURN ENUM IS SEPARATE;
PACKAGE BODY DURATION IS SEPARATE;
PROCEDURE CONSTRAINT_ERROR IS SEPARATE;
FUNCTION NUMERIC_ERROR RETURN ENUM IS SEPARATE;
TASK BODY PROGRAM_ERROR IS SEPARATE;
PROCEDURE STORAGE_ERROR IS SEPARATE;
FUNCTION TASKING_ERROR RETURN ENUM IS SEPARATE;
END AA2010A_PARENT;
SEPARATE (AA2010A_PARENT)
PROCEDURE BOOLEAN IS
BEGIN
NULL;
END;
SEPARATE (AA2010A_PARENT)
FUNCTION INTEGER RETURN ENUM IS
BEGIN
RETURN E1;
END;
SEPARATE (AA2010A_PARENT)
PACKAGE BODY FLOAT IS END;
SEPARATE (AA2010A_PARENT)
PROCEDURE CHARACTER IS
BEGIN
NULL;
END;
SEPARATE (AA2010A_PARENT)
FUNCTION ASCII RETURN ENUM IS
BEGIN
RETURN E1;
END;
SEPARATE (AA2010A_PARENT)
TASK BODY NATURAL IS
BEGIN
ACCEPT E;
END;
SEPARATE (AA2010A_PARENT)
PROCEDURE POSITIVE IS
BEGIN
NULL;
END;
SEPARATE (AA2010A_PARENT)
FUNCTION STRING RETURN ENUM IS
BEGIN
RETURN E1;
END;
SEPARATE (AA2010A_PARENT)
PACKAGE BODY DURATION IS END;
SEPARATE (AA2010A_PARENT)
PROCEDURE CONSTRAINT_ERROR IS
BEGIN
NULL;
END;
SEPARATE (AA2010A_PARENT)
FUNCTION NUMERIC_ERROR RETURN ENUM IS
BEGIN
RETURN E1;
END;
SEPARATE (AA2010A_PARENT)
TASK BODY PROGRAM_ERROR IS
BEGIN
ACCEPT E;
END;
SEPARATE (AA2010A_PARENT)
PROCEDURE STORAGE_ERROR IS
BEGIN
NULL;
END;
SEPARATE (AA2010A_PARENT)
FUNCTION TASKING_ERROR RETURN ENUM IS
BEGIN
RETURN E1;
END;
WITH REPORT; USE REPORT;
WITH AA2010A_TYPEDEF; USE AA2010A_TYPEDEF;
WITH AA2010A_PARENT; USE AA2010A_PARENT;
PROCEDURE AA2010A IS
E : ENUM;
BEGIN
TEST ( "AA2010A", "CHECK THAT SUBUNIT NAMES CAN BE IDENTICAL " &
"TO IDENTIFIERS DECLARED IN STANDARD, " &
"NAMELY, BOOLEAN, INTEGER, FLOAT, " &
"CHARACTER, ASCII, NATURAL, POSITIVE, " &
"STRING, DURATION, CONSTRAINT_ERROR, " &
"NUMERIC_ERROR, PROGRAM_ERROR, " &
"STORAGE_ERROR, AND TASKING_ERROR" );
AA2010A_PARENT.BOOLEAN;
E := AA2010A_PARENT.INTEGER;
AA2010A_PARENT.CHARACTER;
E := AA2010A_PARENT.ASCII;
AA2010A_PARENT.NATURAL.E;
AA2010A_PARENT.POSITIVE;
E := AA2010A_PARENT.STRING;
AA2010A_PARENT.CONSTRAINT_ERROR;
E := AA2010A_PARENT.NUMERIC_ERROR;
AA2010A_PARENT.PROGRAM_ERROR.E;
AA2010A_PARENT.STORAGE_ERROR;
E := AA2010A_PARENT.TASKING_ERROR;
RESULT;
END AA2010A;
|
11540
|
-- AA2010A.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- CHECK THAT SUBUNIT NAMES CAN BE IDENTICAL TO IDENTIFIERS DECLARED IN
-- STANDARD, NAMELY, BOOLEAN, INTEGER, FLOAT, CHARACTER, ASCII,
-- NATURAL, POSITIVE, STRING, DURATION, CONSTRAINT_ERROR,
-- NUMERIC_ERROR, PROGRAM_ERROR, STORAGE_ERROR, AND TASKING_ERROR.
-- <NAME> 9/18/86
PACKAGE AA2010A_TYPEDEF IS
TYPE ENUM IS (E1, E2, E3);
END AA2010A_TYPEDEF;
WITH AA2010A_TYPEDEF; USE AA2010A_TYPEDEF;
PACKAGE AA2010A_PARENT IS
PROCEDURE BOOLEAN;
FUNCTION INTEGER RETURN ENUM;
PACKAGE FLOAT IS END FLOAT;
PROCEDURE CHARACTER;
FUNCTION ASCII RETURN ENUM;
TASK NATURAL IS
ENTRY E;
END NATURAL;
PROCEDURE POSITIVE;
FUNCTION STRING RETURN ENUM;
PACKAGE DURATION IS END DURATION;
PROCEDURE CONSTRAINT_ERROR;
FUNCTION NUMERIC_ERROR RETURN ENUM;
TASK PROGRAM_ERROR IS
ENTRY E;
END PROGRAM_ERROR;
PROCEDURE STORAGE_ERROR;
FUNCTION TASKING_ERROR RETURN ENUM;
END AA2010A_PARENT;
PACKAGE BODY AA2010A_PARENT IS
PROCEDURE BOOLEAN IS SEPARATE;
FUNCTION INTEGER RETURN ENUM IS SEPARATE;
PACKAGE BODY FLOAT IS SEPARATE;
PROCEDURE CHARACTER IS SEPARATE;
FUNCTION ASCII RETURN ENUM IS SEPARATE;
TASK BODY NATURAL IS SEPARATE;
PROCEDURE POSITIVE IS SEPARATE;
FUNCTION STRING RETURN ENUM IS SEPARATE;
PACKAGE BODY DURATION IS SEPARATE;
PROCEDURE CONSTRAINT_ERROR IS SEPARATE;
FUNCTION NUMERIC_ERROR RETURN ENUM IS SEPARATE;
TASK BODY PROGRAM_ERROR IS SEPARATE;
PROCEDURE STORAGE_ERROR IS SEPARATE;
FUNCTION TASKING_ERROR RETURN ENUM IS SEPARATE;
END AA2010A_PARENT;
SEPARATE (AA2010A_PARENT)
PROCEDURE BOOLEAN IS
BEGIN
NULL;
END;
SEPARATE (AA2010A_PARENT)
FUNCTION INTEGER RETURN ENUM IS
BEGIN
RETURN E1;
END;
SEPARATE (AA2010A_PARENT)
PACKAGE BODY FLOAT IS END;
SEPARATE (AA2010A_PARENT)
PROCEDURE CHARACTER IS
BEGIN
NULL;
END;
SEPARATE (AA2010A_PARENT)
FUNCTION ASCII RETURN ENUM IS
BEGIN
RETURN E1;
END;
SEPARATE (AA2010A_PARENT)
TASK BODY NATURAL IS
BEGIN
ACCEPT E;
END;
SEPARATE (AA2010A_PARENT)
PROCEDURE POSITIVE IS
BEGIN
NULL;
END;
SEPARATE (AA2010A_PARENT)
FUNCTION STRING RETURN ENUM IS
BEGIN
RETURN E1;
END;
SEPARATE (AA2010A_PARENT)
PACKAGE BODY DURATION IS END;
SEPARATE (AA2010A_PARENT)
PROCEDURE CONSTRAINT_ERROR IS
BEGIN
NULL;
END;
SEPARATE (AA2010A_PARENT)
FUNCTION NUMERIC_ERROR RETURN ENUM IS
BEGIN
RETURN E1;
END;
SEPARATE (AA2010A_PARENT)
TASK BODY PROGRAM_ERROR IS
BEGIN
ACCEPT E;
END;
SEPARATE (AA2010A_PARENT)
PROCEDURE STORAGE_ERROR IS
BEGIN
NULL;
END;
SEPARATE (AA2010A_PARENT)
FUNCTION TASKING_ERROR RETURN ENUM IS
BEGIN
RETURN E1;
END;
WITH REPORT; USE REPORT;
WITH AA2010A_TYPEDEF; USE AA2010A_TYPEDEF;
WITH AA2010A_PARENT; USE AA2010A_PARENT;
PROCEDURE AA2010A IS
E : ENUM;
BEGIN
TEST ( "AA2010A", "CHECK THAT SUBUNIT NAMES CAN BE IDENTICAL " &
"TO IDENTIFIERS DECLARED IN STANDARD, " &
"NAMELY, BOOLEAN, INTEGER, FLOAT, " &
"CHARACTER, ASCII, NATURAL, POSITIVE, " &
"STRING, DURATION, CONSTRAINT_ERROR, " &
"NUMERIC_ERROR, PROGRAM_ERROR, " &
"STORAGE_ERROR, AND TASKING_ERROR" );
AA2010A_PARENT.BOOLEAN;
E := AA2010A_PARENT.INTEGER;
AA2010A_PARENT.CHARACTER;
E := AA2010A_PARENT.ASCII;
AA2010A_PARENT.NATURAL.E;
AA2010A_PARENT.POSITIVE;
E := AA2010A_PARENT.STRING;
AA2010A_PARENT.CONSTRAINT_ERROR;
E := AA2010A_PARENT.NUMERIC_ERROR;
AA2010A_PARENT.PROGRAM_ERROR.E;
AA2010A_PARENT.STORAGE_ERROR;
E := AA2010A_PARENT.TASKING_ERROR;
RESULT;
END AA2010A;
| true |
-- AA2010A.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- CHECK THAT SUBUNIT NAMES CAN BE IDENTICAL TO IDENTIFIERS DECLARED IN
-- STANDARD, NAMELY, BOOLEAN, INTEGER, FLOAT, CHARACTER, ASCII,
-- NATURAL, POSITIVE, STRING, DURATION, CONSTRAINT_ERROR,
-- NUMERIC_ERROR, PROGRAM_ERROR, STORAGE_ERROR, AND TASKING_ERROR.
-- PI:NAME:<NAME>END_PI 9/18/86
PACKAGE AA2010A_TYPEDEF IS
TYPE ENUM IS (E1, E2, E3);
END AA2010A_TYPEDEF;
WITH AA2010A_TYPEDEF; USE AA2010A_TYPEDEF;
PACKAGE AA2010A_PARENT IS
PROCEDURE BOOLEAN;
FUNCTION INTEGER RETURN ENUM;
PACKAGE FLOAT IS END FLOAT;
PROCEDURE CHARACTER;
FUNCTION ASCII RETURN ENUM;
TASK NATURAL IS
ENTRY E;
END NATURAL;
PROCEDURE POSITIVE;
FUNCTION STRING RETURN ENUM;
PACKAGE DURATION IS END DURATION;
PROCEDURE CONSTRAINT_ERROR;
FUNCTION NUMERIC_ERROR RETURN ENUM;
TASK PROGRAM_ERROR IS
ENTRY E;
END PROGRAM_ERROR;
PROCEDURE STORAGE_ERROR;
FUNCTION TASKING_ERROR RETURN ENUM;
END AA2010A_PARENT;
PACKAGE BODY AA2010A_PARENT IS
PROCEDURE BOOLEAN IS SEPARATE;
FUNCTION INTEGER RETURN ENUM IS SEPARATE;
PACKAGE BODY FLOAT IS SEPARATE;
PROCEDURE CHARACTER IS SEPARATE;
FUNCTION ASCII RETURN ENUM IS SEPARATE;
TASK BODY NATURAL IS SEPARATE;
PROCEDURE POSITIVE IS SEPARATE;
FUNCTION STRING RETURN ENUM IS SEPARATE;
PACKAGE BODY DURATION IS SEPARATE;
PROCEDURE CONSTRAINT_ERROR IS SEPARATE;
FUNCTION NUMERIC_ERROR RETURN ENUM IS SEPARATE;
TASK BODY PROGRAM_ERROR IS SEPARATE;
PROCEDURE STORAGE_ERROR IS SEPARATE;
FUNCTION TASKING_ERROR RETURN ENUM IS SEPARATE;
END AA2010A_PARENT;
SEPARATE (AA2010A_PARENT)
PROCEDURE BOOLEAN IS
BEGIN
NULL;
END;
SEPARATE (AA2010A_PARENT)
FUNCTION INTEGER RETURN ENUM IS
BEGIN
RETURN E1;
END;
SEPARATE (AA2010A_PARENT)
PACKAGE BODY FLOAT IS END;
SEPARATE (AA2010A_PARENT)
PROCEDURE CHARACTER IS
BEGIN
NULL;
END;
SEPARATE (AA2010A_PARENT)
FUNCTION ASCII RETURN ENUM IS
BEGIN
RETURN E1;
END;
SEPARATE (AA2010A_PARENT)
TASK BODY NATURAL IS
BEGIN
ACCEPT E;
END;
SEPARATE (AA2010A_PARENT)
PROCEDURE POSITIVE IS
BEGIN
NULL;
END;
SEPARATE (AA2010A_PARENT)
FUNCTION STRING RETURN ENUM IS
BEGIN
RETURN E1;
END;
SEPARATE (AA2010A_PARENT)
PACKAGE BODY DURATION IS END;
SEPARATE (AA2010A_PARENT)
PROCEDURE CONSTRAINT_ERROR IS
BEGIN
NULL;
END;
SEPARATE (AA2010A_PARENT)
FUNCTION NUMERIC_ERROR RETURN ENUM IS
BEGIN
RETURN E1;
END;
SEPARATE (AA2010A_PARENT)
TASK BODY PROGRAM_ERROR IS
BEGIN
ACCEPT E;
END;
SEPARATE (AA2010A_PARENT)
PROCEDURE STORAGE_ERROR IS
BEGIN
NULL;
END;
SEPARATE (AA2010A_PARENT)
FUNCTION TASKING_ERROR RETURN ENUM IS
BEGIN
RETURN E1;
END;
WITH REPORT; USE REPORT;
WITH AA2010A_TYPEDEF; USE AA2010A_TYPEDEF;
WITH AA2010A_PARENT; USE AA2010A_PARENT;
PROCEDURE AA2010A IS
E : ENUM;
BEGIN
TEST ( "AA2010A", "CHECK THAT SUBUNIT NAMES CAN BE IDENTICAL " &
"TO IDENTIFIERS DECLARED IN STANDARD, " &
"NAMELY, BOOLEAN, INTEGER, FLOAT, " &
"CHARACTER, ASCII, NATURAL, POSITIVE, " &
"STRING, DURATION, CONSTRAINT_ERROR, " &
"NUMERIC_ERROR, PROGRAM_ERROR, " &
"STORAGE_ERROR, AND TASKING_ERROR" );
AA2010A_PARENT.BOOLEAN;
E := AA2010A_PARENT.INTEGER;
AA2010A_PARENT.CHARACTER;
E := AA2010A_PARENT.ASCII;
AA2010A_PARENT.NATURAL.E;
AA2010A_PARENT.POSITIVE;
E := AA2010A_PARENT.STRING;
AA2010A_PARENT.CONSTRAINT_ERROR;
E := AA2010A_PARENT.NUMERIC_ERROR;
AA2010A_PARENT.PROGRAM_ERROR.E;
AA2010A_PARENT.STORAGE_ERROR;
E := AA2010A_PARENT.TASKING_ERROR;
RESULT;
END AA2010A;
|
[
{
"context": "asses -- CSS Class Analysis\n-- Copyright (C) 2017 Stephane Carrez\n-- Written by Stephane Carrez (Stephane.Carrez@g",
"end": 157,
"score": 0.9998741149902344,
"start": 142,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": " Copyright (C) 2017 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under",
"end": 188,
"score": 0.9998817443847656,
"start": 173,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "7 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under the Apache License, Versio",
"end": 215,
"score": 0.9999254941940308,
"start": 190,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
tools/css-analysis-classes.ads
|
stcarrez/ada-css
| 3 |
-----------------------------------------------------------------------
-- css-analysis-classes -- CSS Class Analysis
-- Copyright (C) 2017 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Containers.Indefinite_Ordered_Maps;
with CSS.Core.Errors;
with CSS.Core.Sets;
with CSS.Core.Selectors;
with CSS.Core.Sheets;
with CSS.Tools.Location_Sets;
-- == Analysis of CSS Classes ==
-- The <tt>CSS.Analysis.Classes</tt> package defines some simple analysis
-- arround the CSS classes defined and used by the CSS rule selectors.
package CSS.Analysis.Classes is
type Class_Information is record
Name : CSS.Core.Selectors.CSSSelector;
List : CSS.Core.Sets.Set;
Loc : CSS.Tools.Location_Sets.Set;
end record;
package Class_Maps is
new Ada.Containers.Indefinite_Ordered_Maps (Key_Type => String,
Element_Type => Class_Information);
subtype Map is Class_Maps.Map;
subtype Cursor is Class_Maps.Cursor;
-- Analyze the CSS selectors used by the stylesheet and collect the class
-- information with the associated CSS rules.
procedure Analyze (Sheet : in CSS.Core.Sheets.CSSStylesheet;
Result : in out Class_Maps.Map;
Report : in out CSS.Core.Errors.Error_Handler'Class);
end CSS.Analysis.Classes;
|
30441
|
-----------------------------------------------------------------------
-- css-analysis-classes -- CSS Class Analysis
-- Copyright (C) 2017 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Containers.Indefinite_Ordered_Maps;
with CSS.Core.Errors;
with CSS.Core.Sets;
with CSS.Core.Selectors;
with CSS.Core.Sheets;
with CSS.Tools.Location_Sets;
-- == Analysis of CSS Classes ==
-- The <tt>CSS.Analysis.Classes</tt> package defines some simple analysis
-- arround the CSS classes defined and used by the CSS rule selectors.
package CSS.Analysis.Classes is
type Class_Information is record
Name : CSS.Core.Selectors.CSSSelector;
List : CSS.Core.Sets.Set;
Loc : CSS.Tools.Location_Sets.Set;
end record;
package Class_Maps is
new Ada.Containers.Indefinite_Ordered_Maps (Key_Type => String,
Element_Type => Class_Information);
subtype Map is Class_Maps.Map;
subtype Cursor is Class_Maps.Cursor;
-- Analyze the CSS selectors used by the stylesheet and collect the class
-- information with the associated CSS rules.
procedure Analyze (Sheet : in CSS.Core.Sheets.CSSStylesheet;
Result : in out Class_Maps.Map;
Report : in out CSS.Core.Errors.Error_Handler'Class);
end CSS.Analysis.Classes;
| true |
-----------------------------------------------------------------------
-- css-analysis-classes -- CSS Class Analysis
-- Copyright (C) 2017 PI:NAME:<NAME>END_PI
-- Written by PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Containers.Indefinite_Ordered_Maps;
with CSS.Core.Errors;
with CSS.Core.Sets;
with CSS.Core.Selectors;
with CSS.Core.Sheets;
with CSS.Tools.Location_Sets;
-- == Analysis of CSS Classes ==
-- The <tt>CSS.Analysis.Classes</tt> package defines some simple analysis
-- arround the CSS classes defined and used by the CSS rule selectors.
package CSS.Analysis.Classes is
type Class_Information is record
Name : CSS.Core.Selectors.CSSSelector;
List : CSS.Core.Sets.Set;
Loc : CSS.Tools.Location_Sets.Set;
end record;
package Class_Maps is
new Ada.Containers.Indefinite_Ordered_Maps (Key_Type => String,
Element_Type => Class_Information);
subtype Map is Class_Maps.Map;
subtype Cursor is Class_Maps.Cursor;
-- Analyze the CSS selectors used by the stylesheet and collect the class
-- information with the associated CSS rules.
procedure Analyze (Sheet : in CSS.Core.Sheets.CSSStylesheet;
Result : in out Class_Maps.Map;
Report : in out CSS.Core.Errors.Error_Handler'Class);
end CSS.Analysis.Classes;
|
[
{
"context": " year := 1901;\n dayofweek := 1;\n -- 01-01-1901 : mardi \n \n count := 0;\n while year /= 2001 loop\n n",
"end": 2278,
"score": 0.9988155961036682,
"start": 2273,
"tag": "NAME",
"value": "mardi"
}
] |
out/euler19.adb
|
FardaleM/metalang
| 22 |
with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;
procedure euler19 is
type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;
function is_leap(year : in Integer) return Boolean is
begin
return year rem 400 = 0 or else (year rem 100 /= 0 and then year rem 4 = 0);
end;
function ndayinmonth(month : in Integer; year : in Integer) return Integer is
begin
if month = 0
then
return 31;
else
if month = 1
then
if is_leap(year)
then
return 29;
else
return 28;
end if;
else
if month = 2
then
return 31;
else
if month = 3
then
return 30;
else
if month = 4
then
return 31;
else
if month = 5
then
return 30;
else
if month = 6
then
return 31;
else
if month = 7
then
return 31;
else
if month = 8
then
return 30;
else
if month = 9
then
return 31;
else
if month = 10
then
return 30;
else
if month = 11
then
return 31;
end if;
end if;
end if;
end if;
end if;
end if;
end if;
end if;
end if;
end if;
end if;
end if;
return 0;
end;
year : Integer;
ndays : Integer;
month : Integer;
dayofweek : Integer;
count : Integer;
begin
month := 0;
year := 1901;
dayofweek := 1;
-- 01-01-1901 : mardi
count := 0;
while year /= 2001 loop
ndays := ndayinmonth(month, year);
dayofweek := (dayofweek + ndays) rem 7;
month := month + 1;
if month = 12
then
month := 0;
year := year + 1;
end if;
if dayofweek rem 7 = 6
then
count := count + 1;
end if;
end loop;
PInt(count);
PString(new char_array'( To_C("" & Character'Val(10))));
end;
|
12384
|
with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;
procedure euler19 is
type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;
function is_leap(year : in Integer) return Boolean is
begin
return year rem 400 = 0 or else (year rem 100 /= 0 and then year rem 4 = 0);
end;
function ndayinmonth(month : in Integer; year : in Integer) return Integer is
begin
if month = 0
then
return 31;
else
if month = 1
then
if is_leap(year)
then
return 29;
else
return 28;
end if;
else
if month = 2
then
return 31;
else
if month = 3
then
return 30;
else
if month = 4
then
return 31;
else
if month = 5
then
return 30;
else
if month = 6
then
return 31;
else
if month = 7
then
return 31;
else
if month = 8
then
return 30;
else
if month = 9
then
return 31;
else
if month = 10
then
return 30;
else
if month = 11
then
return 31;
end if;
end if;
end if;
end if;
end if;
end if;
end if;
end if;
end if;
end if;
end if;
end if;
return 0;
end;
year : Integer;
ndays : Integer;
month : Integer;
dayofweek : Integer;
count : Integer;
begin
month := 0;
year := 1901;
dayofweek := 1;
-- 01-01-1901 : <NAME>
count := 0;
while year /= 2001 loop
ndays := ndayinmonth(month, year);
dayofweek := (dayofweek + ndays) rem 7;
month := month + 1;
if month = 12
then
month := 0;
year := year + 1;
end if;
if dayofweek rem 7 = 6
then
count := count + 1;
end if;
end loop;
PInt(count);
PString(new char_array'( To_C("" & Character'Val(10))));
end;
| true |
with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;
procedure euler19 is
type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;
function is_leap(year : in Integer) return Boolean is
begin
return year rem 400 = 0 or else (year rem 100 /= 0 and then year rem 4 = 0);
end;
function ndayinmonth(month : in Integer; year : in Integer) return Integer is
begin
if month = 0
then
return 31;
else
if month = 1
then
if is_leap(year)
then
return 29;
else
return 28;
end if;
else
if month = 2
then
return 31;
else
if month = 3
then
return 30;
else
if month = 4
then
return 31;
else
if month = 5
then
return 30;
else
if month = 6
then
return 31;
else
if month = 7
then
return 31;
else
if month = 8
then
return 30;
else
if month = 9
then
return 31;
else
if month = 10
then
return 30;
else
if month = 11
then
return 31;
end if;
end if;
end if;
end if;
end if;
end if;
end if;
end if;
end if;
end if;
end if;
end if;
return 0;
end;
year : Integer;
ndays : Integer;
month : Integer;
dayofweek : Integer;
count : Integer;
begin
month := 0;
year := 1901;
dayofweek := 1;
-- 01-01-1901 : PI:NAME:<NAME>END_PI
count := 0;
while year /= 2001 loop
ndays := ndayinmonth(month, year);
dayofweek := (dayofweek + ndays) rem 7;
month := month + 1;
if month = 12
then
month := 0;
year := year + 1;
end if;
if dayofweek rem 7 = 6
then
count := count + 1;
end if;
end loop;
PInt(count);
PString(new char_array'( To_C("" & Character'Val(10))));
end;
|
[
{
"context": "omponents\n-- Copyright (C) 2009, 2010, 2011, 2012 Stephane Carrez\n-- Written by Stephane Carrez (Stephane.Carrez@g",
"end": 160,
"score": 0.9998787045478821,
"start": 145,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "9, 2010, 2011, 2012 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under",
"end": 191,
"score": 0.9998774528503418,
"start": 176,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "2 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under the Apache License, Versio",
"end": 218,
"score": 0.9999293088912964,
"start": 193,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
src/asf-utils.adb
|
Letractively/ada-asf
| 0 |
-----------------------------------------------------------------------
-- html -- ASF HTML Components
-- Copyright (C) 2009, 2010, 2011, 2012 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
package body ASF.Utils is
TITLE_ATTR : aliased constant String := "title";
STYLE_ATTR : aliased constant String := "style";
STYLE_CLASS_ATTR : aliased constant String := "styleClass";
DIR_ATTR : aliased constant String := "dir";
LANG_ATTR : aliased constant String := "lang";
ACCESS_KEY_ATTR : aliased constant String := "accesskey";
ON_BLUR_ATTR : aliased constant String := "onblur";
ON_CLICK_ATTR : aliased constant String := "onclick";
ON_DBLCLICK_ATTR : aliased constant String := "ondblclick";
ON_FOCUS_ATTR : aliased constant String := "onfocus";
ON_KEYDOWN_ATTR : aliased constant String := "onkeydown";
ON_KEYUP_ATTR : aliased constant String := "onkeyup";
ON_MOUSE_DOWN_ATTR : aliased constant String := "onmousedown";
ON_MOUSE_MOVE_ATTR : aliased constant String := "onmousemove";
ON_MOUSE_OUT_ATTR : aliased constant String := "onmouseout";
ON_MOUSE_OVER_ATTR : aliased constant String := "onmouseover";
ON_MOUSE_UP_ATTR : aliased constant String := "onmouseup";
ON_CHANGE_ATTR : aliased constant String := "onchange";
ON_RESET_ATTR : aliased constant String := "onreset";
ON_SUBMIT_ATTR : aliased constant String := "onsubmit";
ENCTYPE_ATTR : aliased constant String := "enctype";
ON_LOAD_ATTR : aliased constant String := "onload";
ON_UNLOAD_ATTR : aliased constant String := "onunload";
TABINDEX_ATTR : aliased constant String := "tabindex";
AUTOCOMPLETE_ATTR : aliased constant String := "autocomplete";
SIZE_ATTR : aliased constant String := "size";
MAXLENGTH_ATTR : aliased constant String := "maxlength";
ALT_ATTR : aliased constant String := "alt";
DISABLED_ATTR : aliased constant String := "disabled";
READONLY_ATTR : aliased constant String := "readonly";
ACCEPT_ATTR : aliased constant String := "accept";
ROWS_ATTR : aliased constant String := "rows";
COLS_ATTR : aliased constant String := "cols";
CHARSET_ATTR : aliased constant String := "charset";
SHAPE_ATTR : aliased constant String := "shape";
REV_ATTR : aliased constant String := "rev";
COORDS_ATTR : aliased constant String := "coords";
TARGET_ATTR : aliased constant String := "target";
HREFLANG_ATTR : aliased constant String := "hreflang";
-- ------------------------------
-- Add in the <b>names</b> set, the basic text attributes that can be set
-- on HTML elements (dir, lang, style, title).
-- ------------------------------
procedure Set_Text_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (STYLE_CLASS_ATTR'Access);
Names.Insert (TITLE_ATTR'Access);
Names.Insert (DIR_ATTR'Access);
Names.Insert (LANG_ATTR'Access);
Names.Insert (STYLE_ATTR'Access);
end Set_Text_Attributes;
-- ------------------------------
-- Add in the <b>names</b> set, the onXXX attributes that can be set
-- on HTML elements (accesskey, tabindex, onXXX).
-- ------------------------------
procedure Set_Interactive_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (ACCESS_KEY_ATTR'Access);
Names.Insert (TABINDEX_ATTR'Access);
Names.Insert (ON_BLUR_ATTR'Access);
Names.Insert (ON_MOUSE_UP_ATTR'Access);
Names.Insert (ON_MOUSE_OVER_ATTR'Access);
Names.Insert (ON_MOUSE_OUT_ATTR'Access);
Names.Insert (ON_MOUSE_MOVE_ATTR'Access);
Names.Insert (ON_MOUSE_DOWN_ATTR'Access);
Names.Insert (ON_KEYUP_ATTR'Access);
Names.Insert (ON_KEYDOWN_ATTR'Access);
Names.Insert (ON_FOCUS_ATTR'Access);
Names.Insert (ON_DBLCLICK_ATTR'Access);
Names.Insert (ON_CLICK_ATTR'Access);
Names.Insert (ON_CHANGE_ATTR'Access);
end Set_Interactive_Attributes;
-- ------------------------------
-- Add in the <b>names</b> set, the size attributes that can be set
-- on HTML elements.
-- ------------------------------
procedure Set_Input_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (SIZE_ATTR'Access);
Names.Insert (AUTOCOMPLETE_ATTR'Access);
Names.Insert (MAXLENGTH_ATTR'Access);
Names.Insert (ALT_ATTR'Access);
Names.Insert (DISABLED_ATTR'Access);
Names.Insert (READONLY_ATTR'Access);
end Set_Input_Attributes;
-- ------------------------------
-- Add in the <b>names</b> set, the size attributes that can be set
-- on <textarea> elements.
-- ------------------------------
procedure Set_Textarea_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (ROWS_ATTR'Access);
Names.Insert (COLS_ATTR'Access);
end Set_Textarea_Attributes;
-- ------------------------------
-- Add in the <b>names</b> set, the online and onunload attributes that can be set
-- on <body> elements.
-- ------------------------------
procedure Set_Body_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (ON_LOAD_ATTR'Access);
Names.Insert (ON_UNLOAD_ATTR'Access);
end Set_Body_Attributes;
-- ------------------------------
-- Add in the <b>names</b> set, the dir, lang attributes that can be set
-- on <head> elements.
-- ------------------------------
procedure Set_Head_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (DIR_ATTR'Access);
Names.Insert (LANG_ATTR'Access);
end Set_Head_Attributes;
--------------------
-- Add in the <b>names</b> set, the onreset and onsubmit attributes that can be set
-- on <form> elements.
-- ------------------------------
procedure Set_Form_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (ON_RESET_ATTR'Access);
Names.Insert (ON_SUBMIT_ATTR'Access);
Names.Insert (ENCTYPE_ATTR'Access);
end Set_Form_Attributes;
--------------------
-- Add in the <b>names</b> set, the attributes which are specific to a link.
-- ------------------------------
procedure Set_Link_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (CHARSET_ATTR'Access);
Names.Insert (SHAPE_ATTR'Access);
Names.Insert (REV_ATTR'Access);
Names.Insert (COORDS_ATTR'Access);
Names.Insert (TARGET_ATTR'Access);
Names.Insert (HREFLANG_ATTR'Access);
end Set_Link_Attributes;
-- ------------------------------
-- Add in the <b>names</b> set, the attributes which are specific to an input file.
-- ------------------------------
procedure Set_File_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (ACCEPT_ATTR'Access);
end Set_File_Attributes;
end ASF.Utils;
|
2010
|
-----------------------------------------------------------------------
-- html -- ASF HTML Components
-- Copyright (C) 2009, 2010, 2011, 2012 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
package body ASF.Utils is
TITLE_ATTR : aliased constant String := "title";
STYLE_ATTR : aliased constant String := "style";
STYLE_CLASS_ATTR : aliased constant String := "styleClass";
DIR_ATTR : aliased constant String := "dir";
LANG_ATTR : aliased constant String := "lang";
ACCESS_KEY_ATTR : aliased constant String := "accesskey";
ON_BLUR_ATTR : aliased constant String := "onblur";
ON_CLICK_ATTR : aliased constant String := "onclick";
ON_DBLCLICK_ATTR : aliased constant String := "ondblclick";
ON_FOCUS_ATTR : aliased constant String := "onfocus";
ON_KEYDOWN_ATTR : aliased constant String := "onkeydown";
ON_KEYUP_ATTR : aliased constant String := "onkeyup";
ON_MOUSE_DOWN_ATTR : aliased constant String := "onmousedown";
ON_MOUSE_MOVE_ATTR : aliased constant String := "onmousemove";
ON_MOUSE_OUT_ATTR : aliased constant String := "onmouseout";
ON_MOUSE_OVER_ATTR : aliased constant String := "onmouseover";
ON_MOUSE_UP_ATTR : aliased constant String := "onmouseup";
ON_CHANGE_ATTR : aliased constant String := "onchange";
ON_RESET_ATTR : aliased constant String := "onreset";
ON_SUBMIT_ATTR : aliased constant String := "onsubmit";
ENCTYPE_ATTR : aliased constant String := "enctype";
ON_LOAD_ATTR : aliased constant String := "onload";
ON_UNLOAD_ATTR : aliased constant String := "onunload";
TABINDEX_ATTR : aliased constant String := "tabindex";
AUTOCOMPLETE_ATTR : aliased constant String := "autocomplete";
SIZE_ATTR : aliased constant String := "size";
MAXLENGTH_ATTR : aliased constant String := "maxlength";
ALT_ATTR : aliased constant String := "alt";
DISABLED_ATTR : aliased constant String := "disabled";
READONLY_ATTR : aliased constant String := "readonly";
ACCEPT_ATTR : aliased constant String := "accept";
ROWS_ATTR : aliased constant String := "rows";
COLS_ATTR : aliased constant String := "cols";
CHARSET_ATTR : aliased constant String := "charset";
SHAPE_ATTR : aliased constant String := "shape";
REV_ATTR : aliased constant String := "rev";
COORDS_ATTR : aliased constant String := "coords";
TARGET_ATTR : aliased constant String := "target";
HREFLANG_ATTR : aliased constant String := "hreflang";
-- ------------------------------
-- Add in the <b>names</b> set, the basic text attributes that can be set
-- on HTML elements (dir, lang, style, title).
-- ------------------------------
procedure Set_Text_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (STYLE_CLASS_ATTR'Access);
Names.Insert (TITLE_ATTR'Access);
Names.Insert (DIR_ATTR'Access);
Names.Insert (LANG_ATTR'Access);
Names.Insert (STYLE_ATTR'Access);
end Set_Text_Attributes;
-- ------------------------------
-- Add in the <b>names</b> set, the onXXX attributes that can be set
-- on HTML elements (accesskey, tabindex, onXXX).
-- ------------------------------
procedure Set_Interactive_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (ACCESS_KEY_ATTR'Access);
Names.Insert (TABINDEX_ATTR'Access);
Names.Insert (ON_BLUR_ATTR'Access);
Names.Insert (ON_MOUSE_UP_ATTR'Access);
Names.Insert (ON_MOUSE_OVER_ATTR'Access);
Names.Insert (ON_MOUSE_OUT_ATTR'Access);
Names.Insert (ON_MOUSE_MOVE_ATTR'Access);
Names.Insert (ON_MOUSE_DOWN_ATTR'Access);
Names.Insert (ON_KEYUP_ATTR'Access);
Names.Insert (ON_KEYDOWN_ATTR'Access);
Names.Insert (ON_FOCUS_ATTR'Access);
Names.Insert (ON_DBLCLICK_ATTR'Access);
Names.Insert (ON_CLICK_ATTR'Access);
Names.Insert (ON_CHANGE_ATTR'Access);
end Set_Interactive_Attributes;
-- ------------------------------
-- Add in the <b>names</b> set, the size attributes that can be set
-- on HTML elements.
-- ------------------------------
procedure Set_Input_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (SIZE_ATTR'Access);
Names.Insert (AUTOCOMPLETE_ATTR'Access);
Names.Insert (MAXLENGTH_ATTR'Access);
Names.Insert (ALT_ATTR'Access);
Names.Insert (DISABLED_ATTR'Access);
Names.Insert (READONLY_ATTR'Access);
end Set_Input_Attributes;
-- ------------------------------
-- Add in the <b>names</b> set, the size attributes that can be set
-- on <textarea> elements.
-- ------------------------------
procedure Set_Textarea_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (ROWS_ATTR'Access);
Names.Insert (COLS_ATTR'Access);
end Set_Textarea_Attributes;
-- ------------------------------
-- Add in the <b>names</b> set, the online and onunload attributes that can be set
-- on <body> elements.
-- ------------------------------
procedure Set_Body_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (ON_LOAD_ATTR'Access);
Names.Insert (ON_UNLOAD_ATTR'Access);
end Set_Body_Attributes;
-- ------------------------------
-- Add in the <b>names</b> set, the dir, lang attributes that can be set
-- on <head> elements.
-- ------------------------------
procedure Set_Head_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (DIR_ATTR'Access);
Names.Insert (LANG_ATTR'Access);
end Set_Head_Attributes;
--------------------
-- Add in the <b>names</b> set, the onreset and onsubmit attributes that can be set
-- on <form> elements.
-- ------------------------------
procedure Set_Form_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (ON_RESET_ATTR'Access);
Names.Insert (ON_SUBMIT_ATTR'Access);
Names.Insert (ENCTYPE_ATTR'Access);
end Set_Form_Attributes;
--------------------
-- Add in the <b>names</b> set, the attributes which are specific to a link.
-- ------------------------------
procedure Set_Link_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (CHARSET_ATTR'Access);
Names.Insert (SHAPE_ATTR'Access);
Names.Insert (REV_ATTR'Access);
Names.Insert (COORDS_ATTR'Access);
Names.Insert (TARGET_ATTR'Access);
Names.Insert (HREFLANG_ATTR'Access);
end Set_Link_Attributes;
-- ------------------------------
-- Add in the <b>names</b> set, the attributes which are specific to an input file.
-- ------------------------------
procedure Set_File_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (ACCEPT_ATTR'Access);
end Set_File_Attributes;
end ASF.Utils;
| true |
-----------------------------------------------------------------------
-- html -- ASF HTML Components
-- Copyright (C) 2009, 2010, 2011, 2012 PI:NAME:<NAME>END_PI
-- Written by PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
package body ASF.Utils is
TITLE_ATTR : aliased constant String := "title";
STYLE_ATTR : aliased constant String := "style";
STYLE_CLASS_ATTR : aliased constant String := "styleClass";
DIR_ATTR : aliased constant String := "dir";
LANG_ATTR : aliased constant String := "lang";
ACCESS_KEY_ATTR : aliased constant String := "accesskey";
ON_BLUR_ATTR : aliased constant String := "onblur";
ON_CLICK_ATTR : aliased constant String := "onclick";
ON_DBLCLICK_ATTR : aliased constant String := "ondblclick";
ON_FOCUS_ATTR : aliased constant String := "onfocus";
ON_KEYDOWN_ATTR : aliased constant String := "onkeydown";
ON_KEYUP_ATTR : aliased constant String := "onkeyup";
ON_MOUSE_DOWN_ATTR : aliased constant String := "onmousedown";
ON_MOUSE_MOVE_ATTR : aliased constant String := "onmousemove";
ON_MOUSE_OUT_ATTR : aliased constant String := "onmouseout";
ON_MOUSE_OVER_ATTR : aliased constant String := "onmouseover";
ON_MOUSE_UP_ATTR : aliased constant String := "onmouseup";
ON_CHANGE_ATTR : aliased constant String := "onchange";
ON_RESET_ATTR : aliased constant String := "onreset";
ON_SUBMIT_ATTR : aliased constant String := "onsubmit";
ENCTYPE_ATTR : aliased constant String := "enctype";
ON_LOAD_ATTR : aliased constant String := "onload";
ON_UNLOAD_ATTR : aliased constant String := "onunload";
TABINDEX_ATTR : aliased constant String := "tabindex";
AUTOCOMPLETE_ATTR : aliased constant String := "autocomplete";
SIZE_ATTR : aliased constant String := "size";
MAXLENGTH_ATTR : aliased constant String := "maxlength";
ALT_ATTR : aliased constant String := "alt";
DISABLED_ATTR : aliased constant String := "disabled";
READONLY_ATTR : aliased constant String := "readonly";
ACCEPT_ATTR : aliased constant String := "accept";
ROWS_ATTR : aliased constant String := "rows";
COLS_ATTR : aliased constant String := "cols";
CHARSET_ATTR : aliased constant String := "charset";
SHAPE_ATTR : aliased constant String := "shape";
REV_ATTR : aliased constant String := "rev";
COORDS_ATTR : aliased constant String := "coords";
TARGET_ATTR : aliased constant String := "target";
HREFLANG_ATTR : aliased constant String := "hreflang";
-- ------------------------------
-- Add in the <b>names</b> set, the basic text attributes that can be set
-- on HTML elements (dir, lang, style, title).
-- ------------------------------
procedure Set_Text_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (STYLE_CLASS_ATTR'Access);
Names.Insert (TITLE_ATTR'Access);
Names.Insert (DIR_ATTR'Access);
Names.Insert (LANG_ATTR'Access);
Names.Insert (STYLE_ATTR'Access);
end Set_Text_Attributes;
-- ------------------------------
-- Add in the <b>names</b> set, the onXXX attributes that can be set
-- on HTML elements (accesskey, tabindex, onXXX).
-- ------------------------------
procedure Set_Interactive_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (ACCESS_KEY_ATTR'Access);
Names.Insert (TABINDEX_ATTR'Access);
Names.Insert (ON_BLUR_ATTR'Access);
Names.Insert (ON_MOUSE_UP_ATTR'Access);
Names.Insert (ON_MOUSE_OVER_ATTR'Access);
Names.Insert (ON_MOUSE_OUT_ATTR'Access);
Names.Insert (ON_MOUSE_MOVE_ATTR'Access);
Names.Insert (ON_MOUSE_DOWN_ATTR'Access);
Names.Insert (ON_KEYUP_ATTR'Access);
Names.Insert (ON_KEYDOWN_ATTR'Access);
Names.Insert (ON_FOCUS_ATTR'Access);
Names.Insert (ON_DBLCLICK_ATTR'Access);
Names.Insert (ON_CLICK_ATTR'Access);
Names.Insert (ON_CHANGE_ATTR'Access);
end Set_Interactive_Attributes;
-- ------------------------------
-- Add in the <b>names</b> set, the size attributes that can be set
-- on HTML elements.
-- ------------------------------
procedure Set_Input_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (SIZE_ATTR'Access);
Names.Insert (AUTOCOMPLETE_ATTR'Access);
Names.Insert (MAXLENGTH_ATTR'Access);
Names.Insert (ALT_ATTR'Access);
Names.Insert (DISABLED_ATTR'Access);
Names.Insert (READONLY_ATTR'Access);
end Set_Input_Attributes;
-- ------------------------------
-- Add in the <b>names</b> set, the size attributes that can be set
-- on <textarea> elements.
-- ------------------------------
procedure Set_Textarea_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (ROWS_ATTR'Access);
Names.Insert (COLS_ATTR'Access);
end Set_Textarea_Attributes;
-- ------------------------------
-- Add in the <b>names</b> set, the online and onunload attributes that can be set
-- on <body> elements.
-- ------------------------------
procedure Set_Body_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (ON_LOAD_ATTR'Access);
Names.Insert (ON_UNLOAD_ATTR'Access);
end Set_Body_Attributes;
-- ------------------------------
-- Add in the <b>names</b> set, the dir, lang attributes that can be set
-- on <head> elements.
-- ------------------------------
procedure Set_Head_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (DIR_ATTR'Access);
Names.Insert (LANG_ATTR'Access);
end Set_Head_Attributes;
--------------------
-- Add in the <b>names</b> set, the onreset and onsubmit attributes that can be set
-- on <form> elements.
-- ------------------------------
procedure Set_Form_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (ON_RESET_ATTR'Access);
Names.Insert (ON_SUBMIT_ATTR'Access);
Names.Insert (ENCTYPE_ATTR'Access);
end Set_Form_Attributes;
--------------------
-- Add in the <b>names</b> set, the attributes which are specific to a link.
-- ------------------------------
procedure Set_Link_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (CHARSET_ATTR'Access);
Names.Insert (SHAPE_ATTR'Access);
Names.Insert (REV_ATTR'Access);
Names.Insert (COORDS_ATTR'Access);
Names.Insert (TARGET_ATTR'Access);
Names.Insert (HREFLANG_ATTR'Access);
end Set_Link_Attributes;
-- ------------------------------
-- Add in the <b>names</b> set, the attributes which are specific to an input file.
-- ------------------------------
procedure Set_File_Attributes (Names : in out Util.Strings.String_Set.Set) is
begin
Names.Insert (ACCEPT_ATTR'Access);
end Set_File_Attributes;
end ASF.Utils;
|
[
{
"context": "right (C) 2010, 2011, 2012, 2014, 2015, 2016, 2018 Stephane Carrez\n-- Written by Stephane Carrez (Stephane.Carrez@g",
"end": 203,
"score": 0.9998863935470581,
"start": 188,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "4, 2015, 2016, 2018 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under",
"end": 234,
"score": 0.9998952746391296,
"start": 219,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "8 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under the Apache License, Versio",
"end": 261,
"score": 0.9999297857284546,
"start": 236,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
src/servlet-sessions-factory.adb
|
My-Colaborations/ada-servlet
| 6 |
-----------------------------------------------------------------------
-- servlet-sessions.factory -- Servlet Sessions factory
-- Copyright (C) 2010, 2011, 2012, 2014, 2015, 2016, 2018 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Encoders.Base64;
with Util.Log.Loggers;
-- The <b>Servlet.Sessions.Factory</b> package is a factory for creating, searching
-- and deleting sessions.
package body Servlet.Sessions.Factory is
use Ada.Finalization;
use Ada.Strings.Unbounded;
-- The logger
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Servlet.Sessions.Factory");
-- ------------------------------
-- Allocate a unique and random session identifier. The default implementation
-- generates a 256 bit random number that it serializes as base64 in the string.
-- Upon successful completion, the sequence string buffer is allocated and
-- returned in <b>Id</b>. The buffer will be freed when the session is removed.
-- ------------------------------
procedure Allocate_Session_Id (Factory : in out Session_Factory;
Id : out Ada.Strings.Unbounded.String_Access) is
use Ada.Streams;
Rand : Stream_Element_Array (0 .. 4 * Factory.Id_Size - 1);
Buffer : Stream_Element_Array (0 .. 4 * 3 * Factory.Id_Size);
Encoder : Util.Encoders.Base64.Encoder;
Last : Stream_Element_Offset;
Encoded : Stream_Element_Offset;
begin
Factory.Sessions.Generate_Id (Rand);
-- Encode the random stream in base64 and save it into the Id string.
Encoder.Transform (Data => Rand, Into => Buffer,
Last => Last, Encoded => Encoded);
Id := new String (1 .. Natural (Encoded + 1));
for I in 0 .. Encoded loop
Id (Natural (I + 1)) := Character'Val (Buffer (I));
end loop;
Log.Info ("Allocated session {0}", Id.all);
end Allocate_Session_Id;
-- ------------------------------
-- Create a new session
-- ------------------------------
procedure Create_Session (Factory : in out Session_Factory;
Result : out Session) is
Sess : Session;
Impl : constant Session_Record_Access
:= new Session_Record '(Ada.Finalization.Limited_Controlled with
Ref_Counter => Util.Concurrent.Counters.ONE,
Create_Time => Ada.Calendar.Clock,
Max_Inactive => Factory.Max_Inactive,
others => <>);
begin
Impl.Access_Time := Impl.Create_Time;
Sess.Impl := Impl;
Session_Factory'Class (Factory).Allocate_Session_Id (Impl.Id);
Factory.Sessions.Insert (Sess);
Result := Sess;
end Create_Session;
-- ------------------------------
-- Deletes the session.
-- ------------------------------
procedure Delete_Session (Factory : in out Session_Factory;
Sess : in out Session) is
begin
Factory.Sessions.Delete (Sess);
end Delete_Session;
-- ------------------------------
-- Finds the session knowing the session identifier.
-- If the session is found, the last access time is updated.
-- Otherwise, the null session object is returned.
-- ------------------------------
procedure Find_Session (Factory : in out Session_Factory;
Id : in String;
Result : out Session) is
begin
Result := Factory.Sessions.Find (Id);
if Result.Is_Valid then
Result.Impl.Access_Time := Ada.Calendar.Clock;
Log.Info ("Found active session {0}", Id);
else
Log.Info ("Invalid session {0}", Id);
end if;
end Find_Session;
-- ------------------------------
-- Returns the maximum time interval, in seconds, that the servlet container will
-- keep this session open between client accesses. After this interval, the servlet
-- container will invalidate the session. The maximum time interval can be set with
-- the Set_Max_Inactive_Interval method.
-- A negative time indicates the session should never timeout.
-- ------------------------------
function Get_Max_Inactive_Interval (Factory : in Session_Factory) return Duration is
begin
return Factory.Max_Inactive;
end Get_Max_Inactive_Interval;
-- ------------------------------
-- Specifies the time, in seconds, between client requests before the servlet
-- container will invalidate this session. A negative time indicates the session
-- should never timeout.
-- ------------------------------
procedure Set_Max_Inactive_Interval (Factory : in out Session_Factory;
Interval : in Duration) is
begin
Factory.Max_Inactive := Interval;
end Set_Max_Inactive_Interval;
-- ------------------------------
-- Initialize the session factory.
-- ------------------------------
overriding
procedure Initialize (Factory : in out Session_Factory) is
begin
Factory.Sessions.Initialize;
end Initialize;
-- ------------------------------
-- Release all the sessions.
-- ------------------------------
overriding
procedure Finalize (Factory : in out Session_Factory) is
begin
Factory.Sessions.Clear;
end Finalize;
protected body Session_Cache is
-- ------------------------------
-- Find the session in the session cache.
-- ------------------------------
function Find (Id : in String) return Session is
Pos : constant Session_Maps.Cursor := Sessions.Find (Id'Unrestricted_Access);
begin
if Session_Maps.Has_Element (Pos) then
return Session_Maps.Element (Pos);
else
return Null_Session;
end if;
end Find;
-- ------------------------------
-- Insert the session in the session cache.
-- ------------------------------
procedure Insert (Sess : in Session) is
begin
Sessions.Insert (Sess.Impl.Id.all'Access, Sess);
end Insert;
-- ------------------------------
-- Remove the session from the session cache.
-- ------------------------------
procedure Delete (Sess : in out Session) is
Pos : Session_Maps.Cursor := Sessions.Find (Sess.Impl.Id.all'Access);
begin
if Session_Maps.Has_Element (Pos) then
Session_Maps.Delete (Sessions, Pos);
end if;
Finalize (Sess);
end Delete;
-- Clear the session cache.
procedure Clear is
begin
null;
end Clear;
-- ------------------------------
-- Generate a random bitstream.
-- ------------------------------
procedure Generate_Id (Rand : out Ada.Streams.Stream_Element_Array) is
use Ada.Streams;
use Interfaces;
Size : constant Stream_Element_Offset := Rand'Length / 4;
begin
-- Generate the random sequence.
for I in 0 .. Size - 1 loop
declare
Value : constant Unsigned_32 := Id_Random.Random (Random);
begin
Rand (4 * I) := Stream_Element (Value and 16#0FF#);
Rand (4 * I + 1) := Stream_Element (Shift_Right (Value, 8) and 16#0FF#);
Rand (4 * I + 2) := Stream_Element (Shift_Right (Value, 16) and 16#0FF#);
Rand (4 * I + 3) := Stream_Element (Shift_Right (Value, 24) and 16#0FF#);
end;
end loop;
end Generate_Id;
-- ------------------------------
-- Initialize the random generator.
-- ------------------------------
procedure Initialize is
begin
Id_Random.Reset (Random);
end Initialize;
end Session_Cache;
end Servlet.Sessions.Factory;
|
21673
|
-----------------------------------------------------------------------
-- servlet-sessions.factory -- Servlet Sessions factory
-- Copyright (C) 2010, 2011, 2012, 2014, 2015, 2016, 2018 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Encoders.Base64;
with Util.Log.Loggers;
-- The <b>Servlet.Sessions.Factory</b> package is a factory for creating, searching
-- and deleting sessions.
package body Servlet.Sessions.Factory is
use Ada.Finalization;
use Ada.Strings.Unbounded;
-- The logger
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Servlet.Sessions.Factory");
-- ------------------------------
-- Allocate a unique and random session identifier. The default implementation
-- generates a 256 bit random number that it serializes as base64 in the string.
-- Upon successful completion, the sequence string buffer is allocated and
-- returned in <b>Id</b>. The buffer will be freed when the session is removed.
-- ------------------------------
procedure Allocate_Session_Id (Factory : in out Session_Factory;
Id : out Ada.Strings.Unbounded.String_Access) is
use Ada.Streams;
Rand : Stream_Element_Array (0 .. 4 * Factory.Id_Size - 1);
Buffer : Stream_Element_Array (0 .. 4 * 3 * Factory.Id_Size);
Encoder : Util.Encoders.Base64.Encoder;
Last : Stream_Element_Offset;
Encoded : Stream_Element_Offset;
begin
Factory.Sessions.Generate_Id (Rand);
-- Encode the random stream in base64 and save it into the Id string.
Encoder.Transform (Data => Rand, Into => Buffer,
Last => Last, Encoded => Encoded);
Id := new String (1 .. Natural (Encoded + 1));
for I in 0 .. Encoded loop
Id (Natural (I + 1)) := Character'Val (Buffer (I));
end loop;
Log.Info ("Allocated session {0}", Id.all);
end Allocate_Session_Id;
-- ------------------------------
-- Create a new session
-- ------------------------------
procedure Create_Session (Factory : in out Session_Factory;
Result : out Session) is
Sess : Session;
Impl : constant Session_Record_Access
:= new Session_Record '(Ada.Finalization.Limited_Controlled with
Ref_Counter => Util.Concurrent.Counters.ONE,
Create_Time => Ada.Calendar.Clock,
Max_Inactive => Factory.Max_Inactive,
others => <>);
begin
Impl.Access_Time := Impl.Create_Time;
Sess.Impl := Impl;
Session_Factory'Class (Factory).Allocate_Session_Id (Impl.Id);
Factory.Sessions.Insert (Sess);
Result := Sess;
end Create_Session;
-- ------------------------------
-- Deletes the session.
-- ------------------------------
procedure Delete_Session (Factory : in out Session_Factory;
Sess : in out Session) is
begin
Factory.Sessions.Delete (Sess);
end Delete_Session;
-- ------------------------------
-- Finds the session knowing the session identifier.
-- If the session is found, the last access time is updated.
-- Otherwise, the null session object is returned.
-- ------------------------------
procedure Find_Session (Factory : in out Session_Factory;
Id : in String;
Result : out Session) is
begin
Result := Factory.Sessions.Find (Id);
if Result.Is_Valid then
Result.Impl.Access_Time := Ada.Calendar.Clock;
Log.Info ("Found active session {0}", Id);
else
Log.Info ("Invalid session {0}", Id);
end if;
end Find_Session;
-- ------------------------------
-- Returns the maximum time interval, in seconds, that the servlet container will
-- keep this session open between client accesses. After this interval, the servlet
-- container will invalidate the session. The maximum time interval can be set with
-- the Set_Max_Inactive_Interval method.
-- A negative time indicates the session should never timeout.
-- ------------------------------
function Get_Max_Inactive_Interval (Factory : in Session_Factory) return Duration is
begin
return Factory.Max_Inactive;
end Get_Max_Inactive_Interval;
-- ------------------------------
-- Specifies the time, in seconds, between client requests before the servlet
-- container will invalidate this session. A negative time indicates the session
-- should never timeout.
-- ------------------------------
procedure Set_Max_Inactive_Interval (Factory : in out Session_Factory;
Interval : in Duration) is
begin
Factory.Max_Inactive := Interval;
end Set_Max_Inactive_Interval;
-- ------------------------------
-- Initialize the session factory.
-- ------------------------------
overriding
procedure Initialize (Factory : in out Session_Factory) is
begin
Factory.Sessions.Initialize;
end Initialize;
-- ------------------------------
-- Release all the sessions.
-- ------------------------------
overriding
procedure Finalize (Factory : in out Session_Factory) is
begin
Factory.Sessions.Clear;
end Finalize;
protected body Session_Cache is
-- ------------------------------
-- Find the session in the session cache.
-- ------------------------------
function Find (Id : in String) return Session is
Pos : constant Session_Maps.Cursor := Sessions.Find (Id'Unrestricted_Access);
begin
if Session_Maps.Has_Element (Pos) then
return Session_Maps.Element (Pos);
else
return Null_Session;
end if;
end Find;
-- ------------------------------
-- Insert the session in the session cache.
-- ------------------------------
procedure Insert (Sess : in Session) is
begin
Sessions.Insert (Sess.Impl.Id.all'Access, Sess);
end Insert;
-- ------------------------------
-- Remove the session from the session cache.
-- ------------------------------
procedure Delete (Sess : in out Session) is
Pos : Session_Maps.Cursor := Sessions.Find (Sess.Impl.Id.all'Access);
begin
if Session_Maps.Has_Element (Pos) then
Session_Maps.Delete (Sessions, Pos);
end if;
Finalize (Sess);
end Delete;
-- Clear the session cache.
procedure Clear is
begin
null;
end Clear;
-- ------------------------------
-- Generate a random bitstream.
-- ------------------------------
procedure Generate_Id (Rand : out Ada.Streams.Stream_Element_Array) is
use Ada.Streams;
use Interfaces;
Size : constant Stream_Element_Offset := Rand'Length / 4;
begin
-- Generate the random sequence.
for I in 0 .. Size - 1 loop
declare
Value : constant Unsigned_32 := Id_Random.Random (Random);
begin
Rand (4 * I) := Stream_Element (Value and 16#0FF#);
Rand (4 * I + 1) := Stream_Element (Shift_Right (Value, 8) and 16#0FF#);
Rand (4 * I + 2) := Stream_Element (Shift_Right (Value, 16) and 16#0FF#);
Rand (4 * I + 3) := Stream_Element (Shift_Right (Value, 24) and 16#0FF#);
end;
end loop;
end Generate_Id;
-- ------------------------------
-- Initialize the random generator.
-- ------------------------------
procedure Initialize is
begin
Id_Random.Reset (Random);
end Initialize;
end Session_Cache;
end Servlet.Sessions.Factory;
| true |
-----------------------------------------------------------------------
-- servlet-sessions.factory -- Servlet Sessions factory
-- Copyright (C) 2010, 2011, 2012, 2014, 2015, 2016, 2018 PI:NAME:<NAME>END_PI
-- Written by PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Encoders.Base64;
with Util.Log.Loggers;
-- The <b>Servlet.Sessions.Factory</b> package is a factory for creating, searching
-- and deleting sessions.
package body Servlet.Sessions.Factory is
use Ada.Finalization;
use Ada.Strings.Unbounded;
-- The logger
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Servlet.Sessions.Factory");
-- ------------------------------
-- Allocate a unique and random session identifier. The default implementation
-- generates a 256 bit random number that it serializes as base64 in the string.
-- Upon successful completion, the sequence string buffer is allocated and
-- returned in <b>Id</b>. The buffer will be freed when the session is removed.
-- ------------------------------
procedure Allocate_Session_Id (Factory : in out Session_Factory;
Id : out Ada.Strings.Unbounded.String_Access) is
use Ada.Streams;
Rand : Stream_Element_Array (0 .. 4 * Factory.Id_Size - 1);
Buffer : Stream_Element_Array (0 .. 4 * 3 * Factory.Id_Size);
Encoder : Util.Encoders.Base64.Encoder;
Last : Stream_Element_Offset;
Encoded : Stream_Element_Offset;
begin
Factory.Sessions.Generate_Id (Rand);
-- Encode the random stream in base64 and save it into the Id string.
Encoder.Transform (Data => Rand, Into => Buffer,
Last => Last, Encoded => Encoded);
Id := new String (1 .. Natural (Encoded + 1));
for I in 0 .. Encoded loop
Id (Natural (I + 1)) := Character'Val (Buffer (I));
end loop;
Log.Info ("Allocated session {0}", Id.all);
end Allocate_Session_Id;
-- ------------------------------
-- Create a new session
-- ------------------------------
procedure Create_Session (Factory : in out Session_Factory;
Result : out Session) is
Sess : Session;
Impl : constant Session_Record_Access
:= new Session_Record '(Ada.Finalization.Limited_Controlled with
Ref_Counter => Util.Concurrent.Counters.ONE,
Create_Time => Ada.Calendar.Clock,
Max_Inactive => Factory.Max_Inactive,
others => <>);
begin
Impl.Access_Time := Impl.Create_Time;
Sess.Impl := Impl;
Session_Factory'Class (Factory).Allocate_Session_Id (Impl.Id);
Factory.Sessions.Insert (Sess);
Result := Sess;
end Create_Session;
-- ------------------------------
-- Deletes the session.
-- ------------------------------
procedure Delete_Session (Factory : in out Session_Factory;
Sess : in out Session) is
begin
Factory.Sessions.Delete (Sess);
end Delete_Session;
-- ------------------------------
-- Finds the session knowing the session identifier.
-- If the session is found, the last access time is updated.
-- Otherwise, the null session object is returned.
-- ------------------------------
procedure Find_Session (Factory : in out Session_Factory;
Id : in String;
Result : out Session) is
begin
Result := Factory.Sessions.Find (Id);
if Result.Is_Valid then
Result.Impl.Access_Time := Ada.Calendar.Clock;
Log.Info ("Found active session {0}", Id);
else
Log.Info ("Invalid session {0}", Id);
end if;
end Find_Session;
-- ------------------------------
-- Returns the maximum time interval, in seconds, that the servlet container will
-- keep this session open between client accesses. After this interval, the servlet
-- container will invalidate the session. The maximum time interval can be set with
-- the Set_Max_Inactive_Interval method.
-- A negative time indicates the session should never timeout.
-- ------------------------------
function Get_Max_Inactive_Interval (Factory : in Session_Factory) return Duration is
begin
return Factory.Max_Inactive;
end Get_Max_Inactive_Interval;
-- ------------------------------
-- Specifies the time, in seconds, between client requests before the servlet
-- container will invalidate this session. A negative time indicates the session
-- should never timeout.
-- ------------------------------
procedure Set_Max_Inactive_Interval (Factory : in out Session_Factory;
Interval : in Duration) is
begin
Factory.Max_Inactive := Interval;
end Set_Max_Inactive_Interval;
-- ------------------------------
-- Initialize the session factory.
-- ------------------------------
overriding
procedure Initialize (Factory : in out Session_Factory) is
begin
Factory.Sessions.Initialize;
end Initialize;
-- ------------------------------
-- Release all the sessions.
-- ------------------------------
overriding
procedure Finalize (Factory : in out Session_Factory) is
begin
Factory.Sessions.Clear;
end Finalize;
protected body Session_Cache is
-- ------------------------------
-- Find the session in the session cache.
-- ------------------------------
function Find (Id : in String) return Session is
Pos : constant Session_Maps.Cursor := Sessions.Find (Id'Unrestricted_Access);
begin
if Session_Maps.Has_Element (Pos) then
return Session_Maps.Element (Pos);
else
return Null_Session;
end if;
end Find;
-- ------------------------------
-- Insert the session in the session cache.
-- ------------------------------
procedure Insert (Sess : in Session) is
begin
Sessions.Insert (Sess.Impl.Id.all'Access, Sess);
end Insert;
-- ------------------------------
-- Remove the session from the session cache.
-- ------------------------------
procedure Delete (Sess : in out Session) is
Pos : Session_Maps.Cursor := Sessions.Find (Sess.Impl.Id.all'Access);
begin
if Session_Maps.Has_Element (Pos) then
Session_Maps.Delete (Sessions, Pos);
end if;
Finalize (Sess);
end Delete;
-- Clear the session cache.
procedure Clear is
begin
null;
end Clear;
-- ------------------------------
-- Generate a random bitstream.
-- ------------------------------
procedure Generate_Id (Rand : out Ada.Streams.Stream_Element_Array) is
use Ada.Streams;
use Interfaces;
Size : constant Stream_Element_Offset := Rand'Length / 4;
begin
-- Generate the random sequence.
for I in 0 .. Size - 1 loop
declare
Value : constant Unsigned_32 := Id_Random.Random (Random);
begin
Rand (4 * I) := Stream_Element (Value and 16#0FF#);
Rand (4 * I + 1) := Stream_Element (Shift_Right (Value, 8) and 16#0FF#);
Rand (4 * I + 2) := Stream_Element (Shift_Right (Value, 16) and 16#0FF#);
Rand (4 * I + 3) := Stream_Element (Shift_Right (Value, 24) and 16#0FF#);
end;
end loop;
end Generate_Id;
-- ------------------------------
-- Initialize the random generator.
-- ------------------------------
procedure Initialize is
begin
Id_Random.Reset (Random);
end Initialize;
end Session_Cache;
end Servlet.Sessions.Factory;
|
[
{
"context": " --\n-- Author: Jorge Real ",
"end": 1723,
"score": 0.999869167804718,
"start": 1713,
"tag": "NAME",
"value": "Jorge Real"
}
] |
src/bb.adb
|
jorge-real/Ball-On-Beam
| 4 |
--------------------------------------------------------------------------------
-- --
-- B B --
-- Ball on Beam Simulator --
-- --
-- Body --
-- --
-- This is the root package of a library implementing a ball on beam system --
-- simulator. It gives general definitions concerning this system, namely --
-- the types for representing the system variables (ball position and --
-- beam angle); and it implements general operations on the system, such --
-- as moving the system to a given solar system object or setting the --
-- simulator operating mode. --
-- --
-- The interfaces to obtain the ball position and set the beam angle from a --
-- client program are implemented by child packages of BB, which need to --
-- with'ed, together with package BB. These packages present different --
-- abstractions for the purpose, such as an ADC device to obtain the ball --
-- position. The same goes for the gnoga-based graphical user interface, --
-- which is implemented in child package BB.GUI and childs of it. --
-- --
-- Author: Jorge Real --
-- Universitat Politecnica de Valencia --
-- July, 2020 - Version 1 --
-- February, 2021 - Version 2 --
-- --
-- This is free software in the ample sense: you can use it freely, --
-- provided you preserve this comment at the header of source files and --
-- you clearly indicate the changes made to the original file, if any. --
-- --
--------------------------------------------------------------------------------
with System;
with Ada.Real_Time; use Ada.Real_Time;
with Ada.Real_Time.Timing_Events; use Ada.Real_Time.Timing_Events;
with Ada.Numerics.Elementary_Functions; use Ada.Numerics.Elementary_Functions;
package body BB is
-- Location related entities
Current_Location : Solar_System_Object := Earth
with Atomic;
type Gravities is array (Solar_System_Object) of Float;
Gravity_Of : constant Gravities :=
(Mercury => 3.7, Venus => 8.87, Earth => 9.80665,
Mars => 3.711, Jupiter => 24.79, Saturn => 10.4,
Uranus => 8.69, Neptune => 11.15, Pluto => 0.62,
Moon => 1.6249, Ceres => 0.27, Eris => 0.82,
Vesta => 0.22);
g : Float := Gravity_Of (Current_Location)
with Atomic;
procedure Move_BB_To (Where : in Solar_System_Object) is
begin
Current_Location := Where;
g := Gravity_Of (Current_Location);
end Move_BB_To;
function Current_Planet return Solar_System_Object is (Current_Location);
-- The BB.GUI obtains the current SSO name using this function
pi : constant := Ada.Numerics.Pi;
-- The default simulation mode is passive
Auto_Mode_On : Boolean := False;
-- Duration of a simulation step in auto mode
Auto_Period : Duration := 0.1;
pragma Atomic (Auto_Period);
-------------------
-- Sim (spec) --
-------------------
-- Protected object to simulate the ball & beam system.
-- The simulator can be used from concurrent tasks, but task dispatching
-- policy and locking policy are not enforced from this simulator.
-- There are only two significant events: calling Set_Angle and calling
-- Get_Pos. Either call recalculates the current position based on the
-- position, speed and acceleration of the ball at the previous event,
-- and the time elapsed since then. In addition, Set_Angle sets the Angle
-- to the given value, which determines the ball acceleration until the
-- next call to Set_Angle.
protected Sim
with Priority => System.Priority'Last
is
procedure Set_Angle (To : Angle);
procedure Get_Pos (Where : out Position);
-- These two procedures imply a state update in the simulator, i.e. the
-- calculation of a simulation step.
function Last_Pos return Position;
function Last_Angle return Angle;
-- These two functions simply return the most recently simulated position
-- and angle, without forcing the recalculation of a simulation step.
-- They are intended for GUI updates, for which a relatively recent value
-- is good enough. They do not update the simulation state, so they are
-- faster and less interferring. GUI updates are performed from a task
-- in child package BB.GUI.Controller.
procedure Set_Refresh_Mode (Mode : Simulation_Mode);
-- Set the auto-refresh mode, passive for Closed_Loop or 100 ms periodic
-- for Open_Loop mode. Auto-refresh is operated by a recurring TE
private
procedure Update_State (Last_Interval : in Time_Span);
Pos : Position := 0.0; -- Simulated ball position, in mm
Vel : Float := 0.0; -- Ball velocity, in mm/s
Acc : Float := 0.0; -- Ball acceleration, in mm/s^2
Ang : Angle := 0.0; -- Beam angle, in degrees
Last_Event : Time := Clock; -- Start time of simulation interval
Refresh_TE : Timing_Event;
Time_To_Refresh : Time;
procedure Auto_Refresh (TE : in out Timing_Event);
-- TE and support for Auto-refresh (Open_Loop) mode
end Sim;
------------------
-- Sim (body) --
------------------
Refresh_Period : constant Time_Span := Milliseconds (100);
-- Auto-refresh period in Open_Loop mode
protected body Sim is
procedure Update_State (Last_Interval : in Time_Span) is
-- Duration of last simulation interval, in seconds, as a Float
T : constant Float := Float (To_Duration (Last_Interval));
-- An estimated position could fall out of range, so we use this
-- Float for the calculated position, and then trim it to fall
-- within the bounds of type Position, imposed by the beam size.
Unbounded_Pos : Float;
begin
-- Update simulator state. Called whenever there is a simulator event.
-- The current ball position depends on the beam angle during the last
-- interval (which determines the acceleration), and the ball
-- velocity and position at the start of the simulation interval.
-- Since changing the beam angle causes a simulator event, the beam
-- angle remains constant during a simulator step.
-- Ball acceleration as a function of beam angle.
-- Since angle grows CCW and position decreases leftwards, a positive
-- angle causes a negative acceleration -- hence "-Ang" here.
Acc := (5.0 * g * Sin ((Float (-Ang) * pi) / 180.0)) / 7.0; -- m/s**2
-- Ball velocity acquired during last interval.
Vel := Vel + Acc * T; -- m/s
-- Calculated a ball position that is not constrained to the range
-- of type Position. If it was constrained, there would be a
-- Constraint_Error if T was large enough to let the ball continue
-- falling beyond either end of the beam.
-- The constant 1_000.0 scales meters to mm, since ball position is
-- given in mm.
Unbounded_Pos := Pos + (1_000.0 * Vel * T) +
((1_000.0 * Acc * T**2) / 2.0);
-- Adjust to position limits. Assume ball stoppers at both beam ends.
-- Assume also no bouncing when the ball hits a stopper.
if Unbounded_Pos > Position'Last then -- Ball hits right end
Unbounded_Pos := Position'Last;
Vel := 0.0; -- Rectify velocity: the ball hit the right stopper
elsif Unbounded_Pos < Position'First then -- Ball hits left end
Unbounded_Pos := Position'First;
Vel := 0.0; -- Rectify velocity: the ball hit the left stopper
end if;
Pos := Position (Unbounded_Pos); -- Safe conversion after adjustment
end Update_State;
procedure Set_Angle (To : Angle) is
Now : constant Time := Clock;
begin
Update_State (Now - Last_Event);
Last_Event := Now;
-- Set the beam inclination to the given angle
Ang := To;
end Set_Angle;
procedure Get_Pos (Where : out Position) is
Now : constant Time := Clock;
begin
Update_State (Now - Last_Event);
Last_Event := Now;
-- Return updated position
Where := Pos;
end Get_Pos;
function Last_Pos return Position is (Pos);
function Last_Angle return Angle is (Ang);
procedure Set_Refresh_Mode (Mode : Simulation_Mode) is
Cancelled : Boolean;
begin
case Mode is
when Open_Loop =>
Time_To_Refresh := Clock;
Set_Handler (Event => Refresh_TE,
At_Time => Time_To_Refresh,
Handler => Auto_Refresh'Access);
when Closed_Loop =>
Cancel_Handler (Refresh_TE, Cancelled);
end case;
end Set_Refresh_Mode;
procedure Auto_Refresh (TE : in out Timing_Event) is
begin
-- Update simulator state to make it simulate one more step so that
-- the GUI can show progress in open-loop uses
Update_State (Time_To_Refresh - Last_Event);
Last_Event := Time_To_Refresh;
Time_To_Refresh := Time_To_Refresh + Refresh_Period;
Set_Handler (Event => Refresh_TE,
At_Time => Time_To_Refresh,
Handler => Auto_Refresh'Access);
end Auto_Refresh;
end Sim;
--------------------
-- Set_Beam_Angle --
--------------------
procedure Set_Beam_Angle (Inclination : Angle) is
begin
Sim.Set_Angle (Inclination);
end Set_Beam_Angle;
-------------------
-- Ball_Position --
-------------------
function Ball_Position return Position is
Result : Position;
begin
Sim.Get_Pos (Result);
return Result;
end Ball_Position;
-------------------------
-- Set_Simulation_Mode --
-------------------------
procedure Set_Simulation_Mode (Mode : Simulation_Mode) is
begin
Sim.Set_Refresh_Mode (Mode);
end Set_Simulation_Mode;
-- Private subprograms
--------------
-- Last_Pos --
--------------
function Last_Pos return Position is (Sim.Last_Pos);
----------------
-- Last_Angle --
----------------
function Last_Angle return Angle is (Sim.Last_Angle);
end BB;
|
13416
|
--------------------------------------------------------------------------------
-- --
-- B B --
-- Ball on Beam Simulator --
-- --
-- Body --
-- --
-- This is the root package of a library implementing a ball on beam system --
-- simulator. It gives general definitions concerning this system, namely --
-- the types for representing the system variables (ball position and --
-- beam angle); and it implements general operations on the system, such --
-- as moving the system to a given solar system object or setting the --
-- simulator operating mode. --
-- --
-- The interfaces to obtain the ball position and set the beam angle from a --
-- client program are implemented by child packages of BB, which need to --
-- with'ed, together with package BB. These packages present different --
-- abstractions for the purpose, such as an ADC device to obtain the ball --
-- position. The same goes for the gnoga-based graphical user interface, --
-- which is implemented in child package BB.GUI and childs of it. --
-- --
-- Author: <NAME> --
-- Universitat Politecnica de Valencia --
-- July, 2020 - Version 1 --
-- February, 2021 - Version 2 --
-- --
-- This is free software in the ample sense: you can use it freely, --
-- provided you preserve this comment at the header of source files and --
-- you clearly indicate the changes made to the original file, if any. --
-- --
--------------------------------------------------------------------------------
with System;
with Ada.Real_Time; use Ada.Real_Time;
with Ada.Real_Time.Timing_Events; use Ada.Real_Time.Timing_Events;
with Ada.Numerics.Elementary_Functions; use Ada.Numerics.Elementary_Functions;
package body BB is
-- Location related entities
Current_Location : Solar_System_Object := Earth
with Atomic;
type Gravities is array (Solar_System_Object) of Float;
Gravity_Of : constant Gravities :=
(Mercury => 3.7, Venus => 8.87, Earth => 9.80665,
Mars => 3.711, Jupiter => 24.79, Saturn => 10.4,
Uranus => 8.69, Neptune => 11.15, Pluto => 0.62,
Moon => 1.6249, Ceres => 0.27, Eris => 0.82,
Vesta => 0.22);
g : Float := Gravity_Of (Current_Location)
with Atomic;
procedure Move_BB_To (Where : in Solar_System_Object) is
begin
Current_Location := Where;
g := Gravity_Of (Current_Location);
end Move_BB_To;
function Current_Planet return Solar_System_Object is (Current_Location);
-- The BB.GUI obtains the current SSO name using this function
pi : constant := Ada.Numerics.Pi;
-- The default simulation mode is passive
Auto_Mode_On : Boolean := False;
-- Duration of a simulation step in auto mode
Auto_Period : Duration := 0.1;
pragma Atomic (Auto_Period);
-------------------
-- Sim (spec) --
-------------------
-- Protected object to simulate the ball & beam system.
-- The simulator can be used from concurrent tasks, but task dispatching
-- policy and locking policy are not enforced from this simulator.
-- There are only two significant events: calling Set_Angle and calling
-- Get_Pos. Either call recalculates the current position based on the
-- position, speed and acceleration of the ball at the previous event,
-- and the time elapsed since then. In addition, Set_Angle sets the Angle
-- to the given value, which determines the ball acceleration until the
-- next call to Set_Angle.
protected Sim
with Priority => System.Priority'Last
is
procedure Set_Angle (To : Angle);
procedure Get_Pos (Where : out Position);
-- These two procedures imply a state update in the simulator, i.e. the
-- calculation of a simulation step.
function Last_Pos return Position;
function Last_Angle return Angle;
-- These two functions simply return the most recently simulated position
-- and angle, without forcing the recalculation of a simulation step.
-- They are intended for GUI updates, for which a relatively recent value
-- is good enough. They do not update the simulation state, so they are
-- faster and less interferring. GUI updates are performed from a task
-- in child package BB.GUI.Controller.
procedure Set_Refresh_Mode (Mode : Simulation_Mode);
-- Set the auto-refresh mode, passive for Closed_Loop or 100 ms periodic
-- for Open_Loop mode. Auto-refresh is operated by a recurring TE
private
procedure Update_State (Last_Interval : in Time_Span);
Pos : Position := 0.0; -- Simulated ball position, in mm
Vel : Float := 0.0; -- Ball velocity, in mm/s
Acc : Float := 0.0; -- Ball acceleration, in mm/s^2
Ang : Angle := 0.0; -- Beam angle, in degrees
Last_Event : Time := Clock; -- Start time of simulation interval
Refresh_TE : Timing_Event;
Time_To_Refresh : Time;
procedure Auto_Refresh (TE : in out Timing_Event);
-- TE and support for Auto-refresh (Open_Loop) mode
end Sim;
------------------
-- Sim (body) --
------------------
Refresh_Period : constant Time_Span := Milliseconds (100);
-- Auto-refresh period in Open_Loop mode
protected body Sim is
procedure Update_State (Last_Interval : in Time_Span) is
-- Duration of last simulation interval, in seconds, as a Float
T : constant Float := Float (To_Duration (Last_Interval));
-- An estimated position could fall out of range, so we use this
-- Float for the calculated position, and then trim it to fall
-- within the bounds of type Position, imposed by the beam size.
Unbounded_Pos : Float;
begin
-- Update simulator state. Called whenever there is a simulator event.
-- The current ball position depends on the beam angle during the last
-- interval (which determines the acceleration), and the ball
-- velocity and position at the start of the simulation interval.
-- Since changing the beam angle causes a simulator event, the beam
-- angle remains constant during a simulator step.
-- Ball acceleration as a function of beam angle.
-- Since angle grows CCW and position decreases leftwards, a positive
-- angle causes a negative acceleration -- hence "-Ang" here.
Acc := (5.0 * g * Sin ((Float (-Ang) * pi) / 180.0)) / 7.0; -- m/s**2
-- Ball velocity acquired during last interval.
Vel := Vel + Acc * T; -- m/s
-- Calculated a ball position that is not constrained to the range
-- of type Position. If it was constrained, there would be a
-- Constraint_Error if T was large enough to let the ball continue
-- falling beyond either end of the beam.
-- The constant 1_000.0 scales meters to mm, since ball position is
-- given in mm.
Unbounded_Pos := Pos + (1_000.0 * Vel * T) +
((1_000.0 * Acc * T**2) / 2.0);
-- Adjust to position limits. Assume ball stoppers at both beam ends.
-- Assume also no bouncing when the ball hits a stopper.
if Unbounded_Pos > Position'Last then -- Ball hits right end
Unbounded_Pos := Position'Last;
Vel := 0.0; -- Rectify velocity: the ball hit the right stopper
elsif Unbounded_Pos < Position'First then -- Ball hits left end
Unbounded_Pos := Position'First;
Vel := 0.0; -- Rectify velocity: the ball hit the left stopper
end if;
Pos := Position (Unbounded_Pos); -- Safe conversion after adjustment
end Update_State;
procedure Set_Angle (To : Angle) is
Now : constant Time := Clock;
begin
Update_State (Now - Last_Event);
Last_Event := Now;
-- Set the beam inclination to the given angle
Ang := To;
end Set_Angle;
procedure Get_Pos (Where : out Position) is
Now : constant Time := Clock;
begin
Update_State (Now - Last_Event);
Last_Event := Now;
-- Return updated position
Where := Pos;
end Get_Pos;
function Last_Pos return Position is (Pos);
function Last_Angle return Angle is (Ang);
procedure Set_Refresh_Mode (Mode : Simulation_Mode) is
Cancelled : Boolean;
begin
case Mode is
when Open_Loop =>
Time_To_Refresh := Clock;
Set_Handler (Event => Refresh_TE,
At_Time => Time_To_Refresh,
Handler => Auto_Refresh'Access);
when Closed_Loop =>
Cancel_Handler (Refresh_TE, Cancelled);
end case;
end Set_Refresh_Mode;
procedure Auto_Refresh (TE : in out Timing_Event) is
begin
-- Update simulator state to make it simulate one more step so that
-- the GUI can show progress in open-loop uses
Update_State (Time_To_Refresh - Last_Event);
Last_Event := Time_To_Refresh;
Time_To_Refresh := Time_To_Refresh + Refresh_Period;
Set_Handler (Event => Refresh_TE,
At_Time => Time_To_Refresh,
Handler => Auto_Refresh'Access);
end Auto_Refresh;
end Sim;
--------------------
-- Set_Beam_Angle --
--------------------
procedure Set_Beam_Angle (Inclination : Angle) is
begin
Sim.Set_Angle (Inclination);
end Set_Beam_Angle;
-------------------
-- Ball_Position --
-------------------
function Ball_Position return Position is
Result : Position;
begin
Sim.Get_Pos (Result);
return Result;
end Ball_Position;
-------------------------
-- Set_Simulation_Mode --
-------------------------
procedure Set_Simulation_Mode (Mode : Simulation_Mode) is
begin
Sim.Set_Refresh_Mode (Mode);
end Set_Simulation_Mode;
-- Private subprograms
--------------
-- Last_Pos --
--------------
function Last_Pos return Position is (Sim.Last_Pos);
----------------
-- Last_Angle --
----------------
function Last_Angle return Angle is (Sim.Last_Angle);
end BB;
| true |
--------------------------------------------------------------------------------
-- --
-- B B --
-- Ball on Beam Simulator --
-- --
-- Body --
-- --
-- This is the root package of a library implementing a ball on beam system --
-- simulator. It gives general definitions concerning this system, namely --
-- the types for representing the system variables (ball position and --
-- beam angle); and it implements general operations on the system, such --
-- as moving the system to a given solar system object or setting the --
-- simulator operating mode. --
-- --
-- The interfaces to obtain the ball position and set the beam angle from a --
-- client program are implemented by child packages of BB, which need to --
-- with'ed, together with package BB. These packages present different --
-- abstractions for the purpose, such as an ADC device to obtain the ball --
-- position. The same goes for the gnoga-based graphical user interface, --
-- which is implemented in child package BB.GUI and childs of it. --
-- --
-- Author: PI:NAME:<NAME>END_PI --
-- Universitat Politecnica de Valencia --
-- July, 2020 - Version 1 --
-- February, 2021 - Version 2 --
-- --
-- This is free software in the ample sense: you can use it freely, --
-- provided you preserve this comment at the header of source files and --
-- you clearly indicate the changes made to the original file, if any. --
-- --
--------------------------------------------------------------------------------
with System;
with Ada.Real_Time; use Ada.Real_Time;
with Ada.Real_Time.Timing_Events; use Ada.Real_Time.Timing_Events;
with Ada.Numerics.Elementary_Functions; use Ada.Numerics.Elementary_Functions;
package body BB is
-- Location related entities
Current_Location : Solar_System_Object := Earth
with Atomic;
type Gravities is array (Solar_System_Object) of Float;
Gravity_Of : constant Gravities :=
(Mercury => 3.7, Venus => 8.87, Earth => 9.80665,
Mars => 3.711, Jupiter => 24.79, Saturn => 10.4,
Uranus => 8.69, Neptune => 11.15, Pluto => 0.62,
Moon => 1.6249, Ceres => 0.27, Eris => 0.82,
Vesta => 0.22);
g : Float := Gravity_Of (Current_Location)
with Atomic;
procedure Move_BB_To (Where : in Solar_System_Object) is
begin
Current_Location := Where;
g := Gravity_Of (Current_Location);
end Move_BB_To;
function Current_Planet return Solar_System_Object is (Current_Location);
-- The BB.GUI obtains the current SSO name using this function
pi : constant := Ada.Numerics.Pi;
-- The default simulation mode is passive
Auto_Mode_On : Boolean := False;
-- Duration of a simulation step in auto mode
Auto_Period : Duration := 0.1;
pragma Atomic (Auto_Period);
-------------------
-- Sim (spec) --
-------------------
-- Protected object to simulate the ball & beam system.
-- The simulator can be used from concurrent tasks, but task dispatching
-- policy and locking policy are not enforced from this simulator.
-- There are only two significant events: calling Set_Angle and calling
-- Get_Pos. Either call recalculates the current position based on the
-- position, speed and acceleration of the ball at the previous event,
-- and the time elapsed since then. In addition, Set_Angle sets the Angle
-- to the given value, which determines the ball acceleration until the
-- next call to Set_Angle.
protected Sim
with Priority => System.Priority'Last
is
procedure Set_Angle (To : Angle);
procedure Get_Pos (Where : out Position);
-- These two procedures imply a state update in the simulator, i.e. the
-- calculation of a simulation step.
function Last_Pos return Position;
function Last_Angle return Angle;
-- These two functions simply return the most recently simulated position
-- and angle, without forcing the recalculation of a simulation step.
-- They are intended for GUI updates, for which a relatively recent value
-- is good enough. They do not update the simulation state, so they are
-- faster and less interferring. GUI updates are performed from a task
-- in child package BB.GUI.Controller.
procedure Set_Refresh_Mode (Mode : Simulation_Mode);
-- Set the auto-refresh mode, passive for Closed_Loop or 100 ms periodic
-- for Open_Loop mode. Auto-refresh is operated by a recurring TE
private
procedure Update_State (Last_Interval : in Time_Span);
Pos : Position := 0.0; -- Simulated ball position, in mm
Vel : Float := 0.0; -- Ball velocity, in mm/s
Acc : Float := 0.0; -- Ball acceleration, in mm/s^2
Ang : Angle := 0.0; -- Beam angle, in degrees
Last_Event : Time := Clock; -- Start time of simulation interval
Refresh_TE : Timing_Event;
Time_To_Refresh : Time;
procedure Auto_Refresh (TE : in out Timing_Event);
-- TE and support for Auto-refresh (Open_Loop) mode
end Sim;
------------------
-- Sim (body) --
------------------
Refresh_Period : constant Time_Span := Milliseconds (100);
-- Auto-refresh period in Open_Loop mode
protected body Sim is
procedure Update_State (Last_Interval : in Time_Span) is
-- Duration of last simulation interval, in seconds, as a Float
T : constant Float := Float (To_Duration (Last_Interval));
-- An estimated position could fall out of range, so we use this
-- Float for the calculated position, and then trim it to fall
-- within the bounds of type Position, imposed by the beam size.
Unbounded_Pos : Float;
begin
-- Update simulator state. Called whenever there is a simulator event.
-- The current ball position depends on the beam angle during the last
-- interval (which determines the acceleration), and the ball
-- velocity and position at the start of the simulation interval.
-- Since changing the beam angle causes a simulator event, the beam
-- angle remains constant during a simulator step.
-- Ball acceleration as a function of beam angle.
-- Since angle grows CCW and position decreases leftwards, a positive
-- angle causes a negative acceleration -- hence "-Ang" here.
Acc := (5.0 * g * Sin ((Float (-Ang) * pi) / 180.0)) / 7.0; -- m/s**2
-- Ball velocity acquired during last interval.
Vel := Vel + Acc * T; -- m/s
-- Calculated a ball position that is not constrained to the range
-- of type Position. If it was constrained, there would be a
-- Constraint_Error if T was large enough to let the ball continue
-- falling beyond either end of the beam.
-- The constant 1_000.0 scales meters to mm, since ball position is
-- given in mm.
Unbounded_Pos := Pos + (1_000.0 * Vel * T) +
((1_000.0 * Acc * T**2) / 2.0);
-- Adjust to position limits. Assume ball stoppers at both beam ends.
-- Assume also no bouncing when the ball hits a stopper.
if Unbounded_Pos > Position'Last then -- Ball hits right end
Unbounded_Pos := Position'Last;
Vel := 0.0; -- Rectify velocity: the ball hit the right stopper
elsif Unbounded_Pos < Position'First then -- Ball hits left end
Unbounded_Pos := Position'First;
Vel := 0.0; -- Rectify velocity: the ball hit the left stopper
end if;
Pos := Position (Unbounded_Pos); -- Safe conversion after adjustment
end Update_State;
procedure Set_Angle (To : Angle) is
Now : constant Time := Clock;
begin
Update_State (Now - Last_Event);
Last_Event := Now;
-- Set the beam inclination to the given angle
Ang := To;
end Set_Angle;
procedure Get_Pos (Where : out Position) is
Now : constant Time := Clock;
begin
Update_State (Now - Last_Event);
Last_Event := Now;
-- Return updated position
Where := Pos;
end Get_Pos;
function Last_Pos return Position is (Pos);
function Last_Angle return Angle is (Ang);
procedure Set_Refresh_Mode (Mode : Simulation_Mode) is
Cancelled : Boolean;
begin
case Mode is
when Open_Loop =>
Time_To_Refresh := Clock;
Set_Handler (Event => Refresh_TE,
At_Time => Time_To_Refresh,
Handler => Auto_Refresh'Access);
when Closed_Loop =>
Cancel_Handler (Refresh_TE, Cancelled);
end case;
end Set_Refresh_Mode;
procedure Auto_Refresh (TE : in out Timing_Event) is
begin
-- Update simulator state to make it simulate one more step so that
-- the GUI can show progress in open-loop uses
Update_State (Time_To_Refresh - Last_Event);
Last_Event := Time_To_Refresh;
Time_To_Refresh := Time_To_Refresh + Refresh_Period;
Set_Handler (Event => Refresh_TE,
At_Time => Time_To_Refresh,
Handler => Auto_Refresh'Access);
end Auto_Refresh;
end Sim;
--------------------
-- Set_Beam_Angle --
--------------------
procedure Set_Beam_Angle (Inclination : Angle) is
begin
Sim.Set_Angle (Inclination);
end Set_Beam_Angle;
-------------------
-- Ball_Position --
-------------------
function Ball_Position return Position is
Result : Position;
begin
Sim.Get_Pos (Result);
return Result;
end Ball_Position;
-------------------------
-- Set_Simulation_Mode --
-------------------------
procedure Set_Simulation_Mode (Mode : Simulation_Mode) is
begin
Sim.Set_Refresh_Mode (Mode);
end Set_Simulation_Mode;
-- Private subprograms
--------------
-- Last_Pos --
--------------
function Last_Pos return Position is (Sim.Last_Pos);
----------------
-- Last_Angle --
----------------
function Last_Angle return Angle is (Sim.Last_Angle);
end BB;
|
[
{
"context": "ge,\n\t\t\t\t\tVillage_Id => Village_Id,\n\t\t\t\t\tUser_Id => User_Id,\n\t\t\t\t\tUser_Password => User_Password));\n\t\telsi",
"end": 1115,
"score": 0.4010469317436218,
"start": 1111,
"tag": "USERNAME",
"value": "User"
},
{
"context": "Id,\n\t\t\t\t\tUser_Id => User_Id,\n\t\t\t\t\tUser_Password => User_Password));\n\t\telsif Tag = \"title\" then\n\t\t\tif Village /= nu",
"end": 1155,
"score": 0.9991559386253357,
"start": 1142,
"tag": "PASSWORD",
"value": "User_Password"
}
] |
source/vampire-r3-message_page.adb
|
ytomino/vampire
| 1 |
-- The Village of Vampire by YT, このソースコードはNYSLです
with Web.HTML;
procedure Vampire.R3.Message_Page (
Output : not null access Ada.Streams.Root_Stream_Type'Class;
Form : in Forms.Root_Form_Type'Class;
Template : in String;
Base_Page : in Forms.Base_Page;
Village_Id : in Tabula.Villages.Village_Id :=
Tabula.Villages.Invalid_Village_Id;
Village : access constant Tabula.Villages.Village_Type'Class := null;
Message : in String;
User_Id : in String;
User_Password : in String)
is
procedure Handle (
Output : not null access Ada.Streams.Root_Stream_Type'Class;
Tag : in String;
Contents : in Web.Producers.Template) is
begin
if Tag = "action_cgi" then
Forms.Write_Attribute_Name (Output, "action");
Forms.Write_Link (
Output,
Form,
Current_Directory => ".",
Resource => Forms.Self);
elsif Tag = "message" then
Forms.Write_In_HTML (Output, Form, Message);
elsif Tag = "parameters" then
Web.HTML.Write_Query_In_HTML (
Output,
Form.HTML_Version,
Form.Parameters_To_Base_Page (
Base_Page => Base_Page,
Village_Id => Village_Id,
User_Id => User_Id,
User_Password => User_Password));
elsif Tag = "title" then
if Village /= null then
declare
State : Tabula.Villages.Village_State;
Today : Natural;
begin
Tabula.Villages.Get_State (Village.all, State, Today);
Forms.Write_In_HTML (
Output,
Form,
Village.Name.Constant_Reference & " " & Day_Name (Today, Today, State)
& " - ");
end;
end if;
else
Raise_Unknown_Tag (Tag);
end if;
end Handle;
begin
Web.Producers.Produce (Output, Read (Template), Handler => Handle'Access);
end Vampire.R3.Message_Page;
|
24454
|
-- The Village of Vampire by YT, このソースコードはNYSLです
with Web.HTML;
procedure Vampire.R3.Message_Page (
Output : not null access Ada.Streams.Root_Stream_Type'Class;
Form : in Forms.Root_Form_Type'Class;
Template : in String;
Base_Page : in Forms.Base_Page;
Village_Id : in Tabula.Villages.Village_Id :=
Tabula.Villages.Invalid_Village_Id;
Village : access constant Tabula.Villages.Village_Type'Class := null;
Message : in String;
User_Id : in String;
User_Password : in String)
is
procedure Handle (
Output : not null access Ada.Streams.Root_Stream_Type'Class;
Tag : in String;
Contents : in Web.Producers.Template) is
begin
if Tag = "action_cgi" then
Forms.Write_Attribute_Name (Output, "action");
Forms.Write_Link (
Output,
Form,
Current_Directory => ".",
Resource => Forms.Self);
elsif Tag = "message" then
Forms.Write_In_HTML (Output, Form, Message);
elsif Tag = "parameters" then
Web.HTML.Write_Query_In_HTML (
Output,
Form.HTML_Version,
Form.Parameters_To_Base_Page (
Base_Page => Base_Page,
Village_Id => Village_Id,
User_Id => User_Id,
User_Password => <PASSWORD>));
elsif Tag = "title" then
if Village /= null then
declare
State : Tabula.Villages.Village_State;
Today : Natural;
begin
Tabula.Villages.Get_State (Village.all, State, Today);
Forms.Write_In_HTML (
Output,
Form,
Village.Name.Constant_Reference & " " & Day_Name (Today, Today, State)
& " - ");
end;
end if;
else
Raise_Unknown_Tag (Tag);
end if;
end Handle;
begin
Web.Producers.Produce (Output, Read (Template), Handler => Handle'Access);
end Vampire.R3.Message_Page;
| true |
-- The Village of Vampire by YT, このソースコードはNYSLです
with Web.HTML;
procedure Vampire.R3.Message_Page (
Output : not null access Ada.Streams.Root_Stream_Type'Class;
Form : in Forms.Root_Form_Type'Class;
Template : in String;
Base_Page : in Forms.Base_Page;
Village_Id : in Tabula.Villages.Village_Id :=
Tabula.Villages.Invalid_Village_Id;
Village : access constant Tabula.Villages.Village_Type'Class := null;
Message : in String;
User_Id : in String;
User_Password : in String)
is
procedure Handle (
Output : not null access Ada.Streams.Root_Stream_Type'Class;
Tag : in String;
Contents : in Web.Producers.Template) is
begin
if Tag = "action_cgi" then
Forms.Write_Attribute_Name (Output, "action");
Forms.Write_Link (
Output,
Form,
Current_Directory => ".",
Resource => Forms.Self);
elsif Tag = "message" then
Forms.Write_In_HTML (Output, Form, Message);
elsif Tag = "parameters" then
Web.HTML.Write_Query_In_HTML (
Output,
Form.HTML_Version,
Form.Parameters_To_Base_Page (
Base_Page => Base_Page,
Village_Id => Village_Id,
User_Id => User_Id,
User_Password => PI:PASSWORD:<PASSWORD>END_PI));
elsif Tag = "title" then
if Village /= null then
declare
State : Tabula.Villages.Village_State;
Today : Natural;
begin
Tabula.Villages.Get_State (Village.all, State, Today);
Forms.Write_In_HTML (
Output,
Form,
Village.Name.Constant_Reference & " " & Day_Name (Today, Today, State)
& " - ");
end;
end if;
else
Raise_Unknown_Tag (Tag);
end if;
end Handle;
begin
Web.Producers.Produce (Output, Read (Template), Handler => Handle'Access);
end Vampire.R3.Message_Page;
|
[
{
"context": "cess to managed beans\n-- Copyright (C) 2013, 2017 Stephane Carrez\n-- Written by Stephane Carrez (Stephane.Carrez@g",
"end": 195,
"score": 0.9998749494552612,
"start": 180,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "ight (C) 2013, 2017 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under",
"end": 226,
"score": 0.9998762011528015,
"start": 211,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": "7 Stephane Carrez\n-- Written by Stephane Carrez ([email protected])\n--\n-- Licensed under the Apache License, Versio",
"end": 253,
"score": 0.9999287724494934,
"start": 228,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
src/asf-beans-resolvers.adb
|
jquorning/ada-asf
| 12 |
-----------------------------------------------------------------------
-- asf-beans-resolvers -- Resolver to create and give access to managed beans
-- Copyright (C) 2013, 2017 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with ASF.Sessions;
with ASF.Beans.Params;
with ASF.Beans.Flash;
with ASF.Beans.Globals;
with ASF.Beans.Headers;
with ASF.Beans.Requests;
package body ASF.Beans.Resolvers is
-- ------------------------------
-- Initialize the EL resolver to use the application bean factory and the given request.
-- ------------------------------
procedure Initialize (Resolver : in out ELResolver;
App : in ASF.Applications.Main.Application_Access;
Request : in ASF.Requests.Request_Access) is
begin
Resolver.Application := App;
Resolver.Request := Request;
Resolver.Attributes_Access := Resolver.Attributes'Unchecked_Access;
end Initialize;
-- ------------------------------
-- Resolve the name represented by <tt>Name</tt> according to a base object <tt>Base</tt>.
-- The resolver tries to look first in pre-defined objects (params, flash, headers, initParam).
-- It then looks in the request and session attributes for the value. If the value was
-- not in the request or session, it uses the application bean factory to create the
-- new managed bean and adds it to the request or session.
-- ------------------------------
overriding
function Get_Value (Resolver : in ELResolver;
Context : in EL.Contexts.ELContext'Class;
Base : access Util.Beans.Basic.Readonly_Bean'Class;
Name : in Ada.Strings.Unbounded.Unbounded_String)
return Util.Beans.Objects.Object is
use type Util.Beans.Basic.Readonly_Bean_Access;
use type ASF.Requests.Request_Access;
Key : constant String := To_String (Name);
begin
if Base /= null then
return Base.Get_Value (Key);
elsif Key = ASF.Beans.Params.PARAM_ATTRIBUTE_NAME then
return ASF.Beans.Params.Instance;
elsif Key = ASF.Beans.Headers.HEADER_ATTRIBUTE_NAME then
return ASF.Beans.Headers.Instance;
elsif Key = ASF.Beans.Flash.FLASH_ATTRIBUTE_NAME then
return ASF.Beans.Flash.Instance;
elsif Key = ASF.Beans.Globals.INIT_PARAM_ATTRIBUTE_NAME then
return ASF.Beans.Globals.Instance;
elsif Key = ASF.Beans.Requests.REQUEST_ATTRIBUTE_NAME then
return ASF.Beans.Requests.Instance;
end if;
declare
Result : Util.Beans.Objects.Object;
Scope : Scope_Type;
Bean : Util.Beans.Basic.Readonly_Bean_Access;
-- Look in the resolver's attributes first.
Pos : constant Util.Beans.Objects.Maps.Cursor := Resolver.Attributes.Find (Key);
begin
if Util.Beans.Objects.Maps.Has_Element (Pos) then
return Util.Beans.Objects.Maps.Element (Pos);
elsif Resolver.Request /= null then
Result := Resolver.Request.Get_Attribute (Key);
if not Util.Beans.Objects.Is_Null (Result) then
return Result;
end if;
-- If there is a session, look if the attribute is defined there.
declare
Session : ASF.Sessions.Session := Resolver.Request.Get_Session;
begin
if Session.Is_Valid then
Result := Session.Get_Attribute (Key);
if not Util.Beans.Objects.Is_Null (Result) then
return Result;
end if;
end if;
Resolver.Application.Create (Name, Context, Bean, Scope);
if Bean = null then
return Resolver.Application.Get_Global (Name, Context);
end if;
Result := Util.Beans.Objects.To_Object (Bean);
if Scope = SESSION_SCOPE then
Session.Set_Attribute (Name => Key,
Value => Result);
else
Resolver.Request.Set_Attribute (Name => Key,
Value => Result);
end if;
return Result;
end;
else
Resolver.Application.Create (Name, Context, Bean, Scope);
if Bean = null then
return Resolver.Application.Get_Global (Name, Context);
end if;
Result := Util.Beans.Objects.To_Object (Bean);
Resolver.Attributes_Access.Include (Key, Result);
return Result;
end if;
end;
end Get_Value;
-- ------------------------------
-- Sets the value represented by the <tt>Name</tt> in the base object <tt>Base</tt>.
-- If there is no <tt>Base</tt> object, the request attribute with the given name is
-- updated to the given value.
-- ------------------------------
overriding
procedure Set_Value (Resolver : in out ELResolver;
Context : in EL.Contexts.ELContext'Class;
Base : access Util.Beans.Basic.Bean'Class;
Name : in Ada.Strings.Unbounded.Unbounded_String;
Value : in Util.Beans.Objects.Object) is
pragma Unreferenced (Context);
Key : constant String := To_String (Name);
begin
if Base /= null then
Base.Set_Value (Name => Key, Value => Value);
else
Resolver.Request.Set_Attribute (Name => Key, Value => Value);
end if;
end Set_Value;
-- ------------------------------
-- Initialize the resolver.
-- ------------------------------
overriding
procedure Initialize (Resolver : in out ELResolver) is
begin
Resolver.Attributes_Access := Resolver.Attributes'Unchecked_Access;
end Initialize;
end ASF.Beans.Resolvers;
|
13798
|
-----------------------------------------------------------------------
-- asf-beans-resolvers -- Resolver to create and give access to managed beans
-- Copyright (C) 2013, 2017 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with ASF.Sessions;
with ASF.Beans.Params;
with ASF.Beans.Flash;
with ASF.Beans.Globals;
with ASF.Beans.Headers;
with ASF.Beans.Requests;
package body ASF.Beans.Resolvers is
-- ------------------------------
-- Initialize the EL resolver to use the application bean factory and the given request.
-- ------------------------------
procedure Initialize (Resolver : in out ELResolver;
App : in ASF.Applications.Main.Application_Access;
Request : in ASF.Requests.Request_Access) is
begin
Resolver.Application := App;
Resolver.Request := Request;
Resolver.Attributes_Access := Resolver.Attributes'Unchecked_Access;
end Initialize;
-- ------------------------------
-- Resolve the name represented by <tt>Name</tt> according to a base object <tt>Base</tt>.
-- The resolver tries to look first in pre-defined objects (params, flash, headers, initParam).
-- It then looks in the request and session attributes for the value. If the value was
-- not in the request or session, it uses the application bean factory to create the
-- new managed bean and adds it to the request or session.
-- ------------------------------
overriding
function Get_Value (Resolver : in ELResolver;
Context : in EL.Contexts.ELContext'Class;
Base : access Util.Beans.Basic.Readonly_Bean'Class;
Name : in Ada.Strings.Unbounded.Unbounded_String)
return Util.Beans.Objects.Object is
use type Util.Beans.Basic.Readonly_Bean_Access;
use type ASF.Requests.Request_Access;
Key : constant String := To_String (Name);
begin
if Base /= null then
return Base.Get_Value (Key);
elsif Key = ASF.Beans.Params.PARAM_ATTRIBUTE_NAME then
return ASF.Beans.Params.Instance;
elsif Key = ASF.Beans.Headers.HEADER_ATTRIBUTE_NAME then
return ASF.Beans.Headers.Instance;
elsif Key = ASF.Beans.Flash.FLASH_ATTRIBUTE_NAME then
return ASF.Beans.Flash.Instance;
elsif Key = ASF.Beans.Globals.INIT_PARAM_ATTRIBUTE_NAME then
return ASF.Beans.Globals.Instance;
elsif Key = ASF.Beans.Requests.REQUEST_ATTRIBUTE_NAME then
return ASF.Beans.Requests.Instance;
end if;
declare
Result : Util.Beans.Objects.Object;
Scope : Scope_Type;
Bean : Util.Beans.Basic.Readonly_Bean_Access;
-- Look in the resolver's attributes first.
Pos : constant Util.Beans.Objects.Maps.Cursor := Resolver.Attributes.Find (Key);
begin
if Util.Beans.Objects.Maps.Has_Element (Pos) then
return Util.Beans.Objects.Maps.Element (Pos);
elsif Resolver.Request /= null then
Result := Resolver.Request.Get_Attribute (Key);
if not Util.Beans.Objects.Is_Null (Result) then
return Result;
end if;
-- If there is a session, look if the attribute is defined there.
declare
Session : ASF.Sessions.Session := Resolver.Request.Get_Session;
begin
if Session.Is_Valid then
Result := Session.Get_Attribute (Key);
if not Util.Beans.Objects.Is_Null (Result) then
return Result;
end if;
end if;
Resolver.Application.Create (Name, Context, Bean, Scope);
if Bean = null then
return Resolver.Application.Get_Global (Name, Context);
end if;
Result := Util.Beans.Objects.To_Object (Bean);
if Scope = SESSION_SCOPE then
Session.Set_Attribute (Name => Key,
Value => Result);
else
Resolver.Request.Set_Attribute (Name => Key,
Value => Result);
end if;
return Result;
end;
else
Resolver.Application.Create (Name, Context, Bean, Scope);
if Bean = null then
return Resolver.Application.Get_Global (Name, Context);
end if;
Result := Util.Beans.Objects.To_Object (Bean);
Resolver.Attributes_Access.Include (Key, Result);
return Result;
end if;
end;
end Get_Value;
-- ------------------------------
-- Sets the value represented by the <tt>Name</tt> in the base object <tt>Base</tt>.
-- If there is no <tt>Base</tt> object, the request attribute with the given name is
-- updated to the given value.
-- ------------------------------
overriding
procedure Set_Value (Resolver : in out ELResolver;
Context : in EL.Contexts.ELContext'Class;
Base : access Util.Beans.Basic.Bean'Class;
Name : in Ada.Strings.Unbounded.Unbounded_String;
Value : in Util.Beans.Objects.Object) is
pragma Unreferenced (Context);
Key : constant String := To_String (Name);
begin
if Base /= null then
Base.Set_Value (Name => Key, Value => Value);
else
Resolver.Request.Set_Attribute (Name => Key, Value => Value);
end if;
end Set_Value;
-- ------------------------------
-- Initialize the resolver.
-- ------------------------------
overriding
procedure Initialize (Resolver : in out ELResolver) is
begin
Resolver.Attributes_Access := Resolver.Attributes'Unchecked_Access;
end Initialize;
end ASF.Beans.Resolvers;
| true |
-----------------------------------------------------------------------
-- asf-beans-resolvers -- Resolver to create and give access to managed beans
-- Copyright (C) 2013, 2017 PI:NAME:<NAME>END_PI
-- Written by PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with ASF.Sessions;
with ASF.Beans.Params;
with ASF.Beans.Flash;
with ASF.Beans.Globals;
with ASF.Beans.Headers;
with ASF.Beans.Requests;
package body ASF.Beans.Resolvers is
-- ------------------------------
-- Initialize the EL resolver to use the application bean factory and the given request.
-- ------------------------------
procedure Initialize (Resolver : in out ELResolver;
App : in ASF.Applications.Main.Application_Access;
Request : in ASF.Requests.Request_Access) is
begin
Resolver.Application := App;
Resolver.Request := Request;
Resolver.Attributes_Access := Resolver.Attributes'Unchecked_Access;
end Initialize;
-- ------------------------------
-- Resolve the name represented by <tt>Name</tt> according to a base object <tt>Base</tt>.
-- The resolver tries to look first in pre-defined objects (params, flash, headers, initParam).
-- It then looks in the request and session attributes for the value. If the value was
-- not in the request or session, it uses the application bean factory to create the
-- new managed bean and adds it to the request or session.
-- ------------------------------
overriding
function Get_Value (Resolver : in ELResolver;
Context : in EL.Contexts.ELContext'Class;
Base : access Util.Beans.Basic.Readonly_Bean'Class;
Name : in Ada.Strings.Unbounded.Unbounded_String)
return Util.Beans.Objects.Object is
use type Util.Beans.Basic.Readonly_Bean_Access;
use type ASF.Requests.Request_Access;
Key : constant String := To_String (Name);
begin
if Base /= null then
return Base.Get_Value (Key);
elsif Key = ASF.Beans.Params.PARAM_ATTRIBUTE_NAME then
return ASF.Beans.Params.Instance;
elsif Key = ASF.Beans.Headers.HEADER_ATTRIBUTE_NAME then
return ASF.Beans.Headers.Instance;
elsif Key = ASF.Beans.Flash.FLASH_ATTRIBUTE_NAME then
return ASF.Beans.Flash.Instance;
elsif Key = ASF.Beans.Globals.INIT_PARAM_ATTRIBUTE_NAME then
return ASF.Beans.Globals.Instance;
elsif Key = ASF.Beans.Requests.REQUEST_ATTRIBUTE_NAME then
return ASF.Beans.Requests.Instance;
end if;
declare
Result : Util.Beans.Objects.Object;
Scope : Scope_Type;
Bean : Util.Beans.Basic.Readonly_Bean_Access;
-- Look in the resolver's attributes first.
Pos : constant Util.Beans.Objects.Maps.Cursor := Resolver.Attributes.Find (Key);
begin
if Util.Beans.Objects.Maps.Has_Element (Pos) then
return Util.Beans.Objects.Maps.Element (Pos);
elsif Resolver.Request /= null then
Result := Resolver.Request.Get_Attribute (Key);
if not Util.Beans.Objects.Is_Null (Result) then
return Result;
end if;
-- If there is a session, look if the attribute is defined there.
declare
Session : ASF.Sessions.Session := Resolver.Request.Get_Session;
begin
if Session.Is_Valid then
Result := Session.Get_Attribute (Key);
if not Util.Beans.Objects.Is_Null (Result) then
return Result;
end if;
end if;
Resolver.Application.Create (Name, Context, Bean, Scope);
if Bean = null then
return Resolver.Application.Get_Global (Name, Context);
end if;
Result := Util.Beans.Objects.To_Object (Bean);
if Scope = SESSION_SCOPE then
Session.Set_Attribute (Name => Key,
Value => Result);
else
Resolver.Request.Set_Attribute (Name => Key,
Value => Result);
end if;
return Result;
end;
else
Resolver.Application.Create (Name, Context, Bean, Scope);
if Bean = null then
return Resolver.Application.Get_Global (Name, Context);
end if;
Result := Util.Beans.Objects.To_Object (Bean);
Resolver.Attributes_Access.Include (Key, Result);
return Result;
end if;
end;
end Get_Value;
-- ------------------------------
-- Sets the value represented by the <tt>Name</tt> in the base object <tt>Base</tt>.
-- If there is no <tt>Base</tt> object, the request attribute with the given name is
-- updated to the given value.
-- ------------------------------
overriding
procedure Set_Value (Resolver : in out ELResolver;
Context : in EL.Contexts.ELContext'Class;
Base : access Util.Beans.Basic.Bean'Class;
Name : in Ada.Strings.Unbounded.Unbounded_String;
Value : in Util.Beans.Objects.Object) is
pragma Unreferenced (Context);
Key : constant String := To_String (Name);
begin
if Base /= null then
Base.Set_Value (Name => Key, Value => Value);
else
Resolver.Request.Set_Attribute (Name => Key, Value => Value);
end if;
end Set_Value;
-- ------------------------------
-- Initialize the resolver.
-- ------------------------------
overriding
procedure Initialize (Resolver : in out ELResolver) is
begin
Resolver.Attributes_Access := Resolver.Attributes'Unchecked_Access;
end Initialize;
end ASF.Beans.Resolvers;
|
[
{
"context": " --\n-- Copyright © 2012, Vadim Godunko <[email protected]> --\n-- Al",
"end": 824,
"score": 0.999886691570282,
"start": 811,
"tag": "NAME",
"value": "Vadim Godunko"
},
{
"context": " --\n-- Copyright © 2012, Vadim Godunko <[email protected]> --\n-- All rights reserved. ",
"end": 844,
"score": 0.9999319314956665,
"start": 826,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
source/amf/dd/amf-dg-marked_elements.ads
|
svn2github/matreshka
| 24 |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
-- MarkedElement is a graphic element that can be decorated at its vertices
-- with markers (e.g. arrowheads).
------------------------------------------------------------------------------
with AMF.DG.Graphical_Elements;
limited with AMF.DG.Markers;
package AMF.DG.Marked_Elements is
pragma Preelaborate;
type DG_Marked_Element is limited interface
and AMF.DG.Graphical_Elements.DG_Graphical_Element;
type DG_Marked_Element_Access is
access all DG_Marked_Element'Class;
for DG_Marked_Element_Access'Storage_Size use 0;
not overriding function Get_Start_Marker
(Self : not null access constant DG_Marked_Element)
return AMF.DG.Markers.DG_Marker_Access is abstract;
-- Getter of MarkedElement::startMarker.
--
-- an optional start marker that aligns with the first vertex of the
-- marked element.
not overriding procedure Set_Start_Marker
(Self : not null access DG_Marked_Element;
To : AMF.DG.Markers.DG_Marker_Access) is abstract;
-- Setter of MarkedElement::startMarker.
--
-- an optional start marker that aligns with the first vertex of the
-- marked element.
not overriding function Get_End_Marker
(Self : not null access constant DG_Marked_Element)
return AMF.DG.Markers.DG_Marker_Access is abstract;
-- Getter of MarkedElement::endMarker.
--
-- an optional end marker that aligns with the last vertex of the marked
-- element.
not overriding procedure Set_End_Marker
(Self : not null access DG_Marked_Element;
To : AMF.DG.Markers.DG_Marker_Access) is abstract;
-- Setter of MarkedElement::endMarker.
--
-- an optional end marker that aligns with the last vertex of the marked
-- element.
not overriding function Get_Mid_Marker
(Self : not null access constant DG_Marked_Element)
return AMF.DG.Markers.DG_Marker_Access is abstract;
-- Getter of MarkedElement::midMarker.
--
-- an optional mid marker that aligns with all vertices of the marked
-- element except the first and the last.
not overriding procedure Set_Mid_Marker
(Self : not null access DG_Marked_Element;
To : AMF.DG.Markers.DG_Marker_Access) is abstract;
-- Setter of MarkedElement::midMarker.
--
-- an optional mid marker that aligns with all vertices of the marked
-- element except the first and the last.
end AMF.DG.Marked_Elements;
|
24448
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
-- MarkedElement is a graphic element that can be decorated at its vertices
-- with markers (e.g. arrowheads).
------------------------------------------------------------------------------
with AMF.DG.Graphical_Elements;
limited with AMF.DG.Markers;
package AMF.DG.Marked_Elements is
pragma Preelaborate;
type DG_Marked_Element is limited interface
and AMF.DG.Graphical_Elements.DG_Graphical_Element;
type DG_Marked_Element_Access is
access all DG_Marked_Element'Class;
for DG_Marked_Element_Access'Storage_Size use 0;
not overriding function Get_Start_Marker
(Self : not null access constant DG_Marked_Element)
return AMF.DG.Markers.DG_Marker_Access is abstract;
-- Getter of MarkedElement::startMarker.
--
-- an optional start marker that aligns with the first vertex of the
-- marked element.
not overriding procedure Set_Start_Marker
(Self : not null access DG_Marked_Element;
To : AMF.DG.Markers.DG_Marker_Access) is abstract;
-- Setter of MarkedElement::startMarker.
--
-- an optional start marker that aligns with the first vertex of the
-- marked element.
not overriding function Get_End_Marker
(Self : not null access constant DG_Marked_Element)
return AMF.DG.Markers.DG_Marker_Access is abstract;
-- Getter of MarkedElement::endMarker.
--
-- an optional end marker that aligns with the last vertex of the marked
-- element.
not overriding procedure Set_End_Marker
(Self : not null access DG_Marked_Element;
To : AMF.DG.Markers.DG_Marker_Access) is abstract;
-- Setter of MarkedElement::endMarker.
--
-- an optional end marker that aligns with the last vertex of the marked
-- element.
not overriding function Get_Mid_Marker
(Self : not null access constant DG_Marked_Element)
return AMF.DG.Markers.DG_Marker_Access is abstract;
-- Getter of MarkedElement::midMarker.
--
-- an optional mid marker that aligns with all vertices of the marked
-- element except the first and the last.
not overriding procedure Set_Mid_Marker
(Self : not null access DG_Marked_Element;
To : AMF.DG.Markers.DG_Marker_Access) is abstract;
-- Setter of MarkedElement::midMarker.
--
-- an optional mid marker that aligns with all vertices of the marked
-- element except the first and the last.
end AMF.DG.Marked_Elements;
| true |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
-- MarkedElement is a graphic element that can be decorated at its vertices
-- with markers (e.g. arrowheads).
------------------------------------------------------------------------------
with AMF.DG.Graphical_Elements;
limited with AMF.DG.Markers;
package AMF.DG.Marked_Elements is
pragma Preelaborate;
type DG_Marked_Element is limited interface
and AMF.DG.Graphical_Elements.DG_Graphical_Element;
type DG_Marked_Element_Access is
access all DG_Marked_Element'Class;
for DG_Marked_Element_Access'Storage_Size use 0;
not overriding function Get_Start_Marker
(Self : not null access constant DG_Marked_Element)
return AMF.DG.Markers.DG_Marker_Access is abstract;
-- Getter of MarkedElement::startMarker.
--
-- an optional start marker that aligns with the first vertex of the
-- marked element.
not overriding procedure Set_Start_Marker
(Self : not null access DG_Marked_Element;
To : AMF.DG.Markers.DG_Marker_Access) is abstract;
-- Setter of MarkedElement::startMarker.
--
-- an optional start marker that aligns with the first vertex of the
-- marked element.
not overriding function Get_End_Marker
(Self : not null access constant DG_Marked_Element)
return AMF.DG.Markers.DG_Marker_Access is abstract;
-- Getter of MarkedElement::endMarker.
--
-- an optional end marker that aligns with the last vertex of the marked
-- element.
not overriding procedure Set_End_Marker
(Self : not null access DG_Marked_Element;
To : AMF.DG.Markers.DG_Marker_Access) is abstract;
-- Setter of MarkedElement::endMarker.
--
-- an optional end marker that aligns with the last vertex of the marked
-- element.
not overriding function Get_Mid_Marker
(Self : not null access constant DG_Marked_Element)
return AMF.DG.Markers.DG_Marker_Access is abstract;
-- Getter of MarkedElement::midMarker.
--
-- an optional mid marker that aligns with all vertices of the marked
-- element except the first and the last.
not overriding procedure Set_Mid_Marker
(Self : not null access DG_Marked_Element;
To : AMF.DG.Markers.DG_Marker_Access) is abstract;
-- Setter of MarkedElement::midMarker.
--
-- an optional mid marker that aligns with all vertices of the marked
-- element except the first and the last.
end AMF.DG.Marked_Elements;
|
[
{
"context": " --\n-- Copyright © 2010-2012, Vadim Godunko <[email protected]> --\n-- All rig",
"end": 829,
"score": 0.9998893737792969,
"start": 816,
"tag": "NAME",
"value": "Vadim Godunko"
},
{
"context": " --\n-- Copyright © 2010-2012, Vadim Godunko <[email protected]> --\n-- All rights reserved. ",
"end": 849,
"score": 0.9999305605888367,
"start": 831,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
source/league/matreshka-internals-string_vectors.ads
|
svn2github/matreshka
| 24 |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.Atomics.Counters;
with Matreshka.Internals.Strings;
package Matreshka.Internals.String_Vectors is
pragma Preelaborate;
type String_Vector_Index is mod 2 ** 32;
for String_Vector_Index'Size use 32;
type Shared_String_Array is
array (String_Vector_Index range <>)
of Matreshka.Internals.Strings.Shared_String_Access;
type Shared_String_Vector (Last : String_Vector_Index) is limited record
Counter : Matreshka.Atomics.Counters.Counter;
-- Atomic reference counter.
Unused : String_Vector_Index := 0;
-- Length of the actual data.
Value : Shared_String_Array (0 .. Last);
end record;
type Shared_String_Vector_Access is access all Shared_String_Vector;
Empty_Shared_String_Vector : aliased Shared_String_Vector (0);
procedure Reference (Item : Shared_String_Vector_Access);
pragma Inline (Reference);
pragma Inline_Always (Reference);
-- Increment reference counter. Change of reference counter of
-- Empty_Shared_String_Vector object is prevented to provide speedup
-- and to allow to use it to initialize components of
-- Preelaborateable_Initialization types.
procedure Dereference (Item : in out Shared_String_Vector_Access);
-- Decrement reference counter and free resources if it reach zero value.
-- Self is setted to null. Decrement of reference counter and deallocation
-- of Empty_Shared_String_Vector object is prevented to provide minor
-- speedup and to allow use it to initialize components of
-- Preelaborateable_Initialization types.
function Allocate
(Size : String_Vector_Index) return not null Shared_String_Vector_Access;
-- Allocates new instance of string with specified size. Actual size of the
-- allocated string can be greater. This subprogram must not be called with
-- zero argument.
procedure Detach
(Item : in out Shared_String_Vector_Access;
Size : String_Vector_Index);
-- Detach specified shared string vector. If reference counter equal to
-- one, shared string vector is not an empty shared string vector object
-- and its current size is sufficient to store specified number of strings
-- then to nothing. Otherwise, allocates new shared string vector and
-- copy existing data.
procedure Append
(Item : in out Shared_String_Vector_Access;
String : not null Matreshka.Internals.Strings.Shared_String_Access);
-- Append string to the vector, reallocate vector then necessary. String's
-- reference counter is not incremented.
procedure Prepend
(Self : in out Shared_String_Vector_Access;
Vector : not null Shared_String_Vector_Access);
-- Prepends strings from vector to the vector, reallocates vector then
-- necessary. Both vectors are still valid after this operation, reference
-- counters of all prepended strings are incremented.
procedure Replace
(Self : in out Shared_String_Vector_Access;
Index : String_Vector_Index;
Item : not null Matreshka.Internals.Strings.Shared_String_Access);
-- Replace string at the specified position by another one.
procedure Insert
(Self : in out Shared_String_Vector_Access;
Index : String_Vector_Index;
Item : not null Matreshka.Internals.Strings.Shared_String_Access);
-- Inserts string into the specified position.
end Matreshka.Internals.String_Vectors;
|
17901
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010-2012, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.Atomics.Counters;
with Matreshka.Internals.Strings;
package Matreshka.Internals.String_Vectors is
pragma Preelaborate;
type String_Vector_Index is mod 2 ** 32;
for String_Vector_Index'Size use 32;
type Shared_String_Array is
array (String_Vector_Index range <>)
of Matreshka.Internals.Strings.Shared_String_Access;
type Shared_String_Vector (Last : String_Vector_Index) is limited record
Counter : Matreshka.Atomics.Counters.Counter;
-- Atomic reference counter.
Unused : String_Vector_Index := 0;
-- Length of the actual data.
Value : Shared_String_Array (0 .. Last);
end record;
type Shared_String_Vector_Access is access all Shared_String_Vector;
Empty_Shared_String_Vector : aliased Shared_String_Vector (0);
procedure Reference (Item : Shared_String_Vector_Access);
pragma Inline (Reference);
pragma Inline_Always (Reference);
-- Increment reference counter. Change of reference counter of
-- Empty_Shared_String_Vector object is prevented to provide speedup
-- and to allow to use it to initialize components of
-- Preelaborateable_Initialization types.
procedure Dereference (Item : in out Shared_String_Vector_Access);
-- Decrement reference counter and free resources if it reach zero value.
-- Self is setted to null. Decrement of reference counter and deallocation
-- of Empty_Shared_String_Vector object is prevented to provide minor
-- speedup and to allow use it to initialize components of
-- Preelaborateable_Initialization types.
function Allocate
(Size : String_Vector_Index) return not null Shared_String_Vector_Access;
-- Allocates new instance of string with specified size. Actual size of the
-- allocated string can be greater. This subprogram must not be called with
-- zero argument.
procedure Detach
(Item : in out Shared_String_Vector_Access;
Size : String_Vector_Index);
-- Detach specified shared string vector. If reference counter equal to
-- one, shared string vector is not an empty shared string vector object
-- and its current size is sufficient to store specified number of strings
-- then to nothing. Otherwise, allocates new shared string vector and
-- copy existing data.
procedure Append
(Item : in out Shared_String_Vector_Access;
String : not null Matreshka.Internals.Strings.Shared_String_Access);
-- Append string to the vector, reallocate vector then necessary. String's
-- reference counter is not incremented.
procedure Prepend
(Self : in out Shared_String_Vector_Access;
Vector : not null Shared_String_Vector_Access);
-- Prepends strings from vector to the vector, reallocates vector then
-- necessary. Both vectors are still valid after this operation, reference
-- counters of all prepended strings are incremented.
procedure Replace
(Self : in out Shared_String_Vector_Access;
Index : String_Vector_Index;
Item : not null Matreshka.Internals.Strings.Shared_String_Access);
-- Replace string at the specified position by another one.
procedure Insert
(Self : in out Shared_String_Vector_Access;
Index : String_Vector_Index;
Item : not null Matreshka.Internals.Strings.Shared_String_Access);
-- Inserts string into the specified position.
end Matreshka.Internals.String_Vectors;
| true |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010-2012, PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.Atomics.Counters;
with Matreshka.Internals.Strings;
package Matreshka.Internals.String_Vectors is
pragma Preelaborate;
type String_Vector_Index is mod 2 ** 32;
for String_Vector_Index'Size use 32;
type Shared_String_Array is
array (String_Vector_Index range <>)
of Matreshka.Internals.Strings.Shared_String_Access;
type Shared_String_Vector (Last : String_Vector_Index) is limited record
Counter : Matreshka.Atomics.Counters.Counter;
-- Atomic reference counter.
Unused : String_Vector_Index := 0;
-- Length of the actual data.
Value : Shared_String_Array (0 .. Last);
end record;
type Shared_String_Vector_Access is access all Shared_String_Vector;
Empty_Shared_String_Vector : aliased Shared_String_Vector (0);
procedure Reference (Item : Shared_String_Vector_Access);
pragma Inline (Reference);
pragma Inline_Always (Reference);
-- Increment reference counter. Change of reference counter of
-- Empty_Shared_String_Vector object is prevented to provide speedup
-- and to allow to use it to initialize components of
-- Preelaborateable_Initialization types.
procedure Dereference (Item : in out Shared_String_Vector_Access);
-- Decrement reference counter and free resources if it reach zero value.
-- Self is setted to null. Decrement of reference counter and deallocation
-- of Empty_Shared_String_Vector object is prevented to provide minor
-- speedup and to allow use it to initialize components of
-- Preelaborateable_Initialization types.
function Allocate
(Size : String_Vector_Index) return not null Shared_String_Vector_Access;
-- Allocates new instance of string with specified size. Actual size of the
-- allocated string can be greater. This subprogram must not be called with
-- zero argument.
procedure Detach
(Item : in out Shared_String_Vector_Access;
Size : String_Vector_Index);
-- Detach specified shared string vector. If reference counter equal to
-- one, shared string vector is not an empty shared string vector object
-- and its current size is sufficient to store specified number of strings
-- then to nothing. Otherwise, allocates new shared string vector and
-- copy existing data.
procedure Append
(Item : in out Shared_String_Vector_Access;
String : not null Matreshka.Internals.Strings.Shared_String_Access);
-- Append string to the vector, reallocate vector then necessary. String's
-- reference counter is not incremented.
procedure Prepend
(Self : in out Shared_String_Vector_Access;
Vector : not null Shared_String_Vector_Access);
-- Prepends strings from vector to the vector, reallocates vector then
-- necessary. Both vectors are still valid after this operation, reference
-- counters of all prepended strings are incremented.
procedure Replace
(Self : in out Shared_String_Vector_Access;
Index : String_Vector_Index;
Item : not null Matreshka.Internals.Strings.Shared_String_Access);
-- Replace string at the specified position by another one.
procedure Insert
(Self : in out Shared_String_Vector_Access;
Index : String_Vector_Index;
Item : not null Matreshka.Internals.Strings.Shared_String_Access);
-- Inserts string into the specified position.
end Matreshka.Internals.String_Vectors;
|
[
{
"context": "-- part of AdaYaml, (c) 2017 Felix Krause\n-- released under the terms of the MIT license, ",
"end": 42,
"score": 0.9998447299003601,
"start": 30,
"tag": "NAME",
"value": "Felix Krause"
}
] |
dropin/src/lexer-source-c_handler.adb
|
robdaemon/AdaYaml
| 32 |
-- part of AdaYaml, (c) 2017 Felix Krause
-- released under the terms of the MIT license, see the file "copying.txt"
with Interfaces.C;
package body Lexer.Source.C_Handler is
use type Yaml.C.Bool;
procedure Read_Data (S : in out Instance; Buffer : out String;
Length : out Natural) is
begin
if not S.Handler.all (S.Data, Buffer (Buffer'First)'Address,
Buffer'Length, Interfaces.C.size_t (Length)) then
raise Lexer_Error with "Error when reading into buffer";
end if;
end Read_Data;
function As_Source (Data : System.Address; Handler : Yaml.C.Read_Handler)
return Pointer is
(new Instance'(Source.Instance with
Handler => Handler, Data => Data));
end Lexer.Source.C_Handler;
|
14592
|
-- part of AdaYaml, (c) 2017 <NAME>
-- released under the terms of the MIT license, see the file "copying.txt"
with Interfaces.C;
package body Lexer.Source.C_Handler is
use type Yaml.C.Bool;
procedure Read_Data (S : in out Instance; Buffer : out String;
Length : out Natural) is
begin
if not S.Handler.all (S.Data, Buffer (Buffer'First)'Address,
Buffer'Length, Interfaces.C.size_t (Length)) then
raise Lexer_Error with "Error when reading into buffer";
end if;
end Read_Data;
function As_Source (Data : System.Address; Handler : Yaml.C.Read_Handler)
return Pointer is
(new Instance'(Source.Instance with
Handler => Handler, Data => Data));
end Lexer.Source.C_Handler;
| true |
-- part of AdaYaml, (c) 2017 PI:NAME:<NAME>END_PI
-- released under the terms of the MIT license, see the file "copying.txt"
with Interfaces.C;
package body Lexer.Source.C_Handler is
use type Yaml.C.Bool;
procedure Read_Data (S : in out Instance; Buffer : out String;
Length : out Natural) is
begin
if not S.Handler.all (S.Data, Buffer (Buffer'First)'Address,
Buffer'Length, Interfaces.C.size_t (Length)) then
raise Lexer_Error with "Error when reading into buffer";
end if;
end Read_Data;
function As_Source (Data : System.Address; Handler : Yaml.C.Read_Handler)
return Pointer is
(new Instance'(Source.Instance with
Handler => Handler, Data => Data));
end Lexer.Source.C_Handler;
|
[
{
"context": "al version of this component has been developed by Jean-Charles--\n-- Marteau ([email protected]",
"end": 2999,
"score": 0.9861962199211121,
"start": 2987,
"tag": "NAME",
"value": "Jean-Charles"
},
{
"context": " component has been developed by Jean-Charles--\n-- Marteau ([email protected]) and Serge ",
"end": 3012,
"score": 0.9998102188110352,
"start": 3005,
"tag": "NAME",
"value": "Marteau"
},
{
"context": " has been developed by Jean-Charles--\n-- Marteau ([email protected]) and Serge Reboul --\n-- (Serge.Reboul@en",
"end": 3050,
"score": 0.9999106526374817,
"start": 3014,
"tag": "EMAIL",
"value": "[email protected]"
},
{
"context": "Marteau ([email protected]) and Serge Reboul --\n-- ([email protected]), EN",
"end": 3068,
"score": 0.9998801946640015,
"start": 3056,
"tag": "NAME",
"value": "Serge Reboul"
},
{
"context": "ensimag.imag.fr) and Serge Reboul --\n-- ([email protected]), ENSIMAG High School Graduates (Computer --\n-- ",
"end": 3113,
"score": 0.9999243021011353,
"start": 3085,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
src/asis/a4g-queries.ads
|
My-Colaborations/dynamo
| 15 |
------------------------------------------------------------------------------
-- --
-- ASIS-for-GNAT IMPLEMENTATION COMPONENTS --
-- --
-- A 4 G . Q U E R I E S --
-- --
-- S p e c --
-- --
-- Copyright (c) 1995-2006, Free Software Foundation, Inc. --
-- --
-- ASIS-for-GNAT is free software; you can redistribute it and/or modify it --
-- under terms of the GNU General Public License as published by the Free --
-- Software Foundation; either version 2, or (at your option) any later --
-- version. ASIS-for-GNAT is distributed in the hope that it will be use- --
-- ful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- --
-- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General --
-- Public License for more details. You should have received a copy of the --
-- GNU General Public License distributed with ASIS-for-GNAT; see file --
-- COPYING. If not, write to the Free Software Foundation, 51 Franklin --
-- Street, Fifth Floor, Boston, MA 02110-1301, USA. --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
-- ASIS-for-GNAT was originally developed by the ASIS-for-GNAT team at the --
-- Software Engineering Laboratory of the Swiss Federal Institute of --
-- Technology (LGL-EPFL) in Lausanne, Switzerland, in cooperation with the --
-- Scientific Research Computer Center of Moscow State University (SRCC --
-- MSU), Russia, with funding partially provided by grants from the Swiss --
-- National Science Foundation and the Swiss Academy of Engineering --
-- Sciences. ASIS-for-GNAT is now maintained by AdaCore --
-- (http://www.adaccore.com). --
-- --
-- The original version of this component has been developed by Jean-Charles--
-- Marteau ([email protected]) and Serge Reboul --
-- ([email protected]), ENSIMAG High School Graduates (Computer --
-- sciences) Grenoble, France in Sema Group Grenoble, France. Now this --
-- component is maintained by the ASIS team --
-- --
------------------------------------------------------------------------------
with Asis; use Asis;
----------------------------------------------------------
-- The goal of this package is, when we have an element --
-- to let us have ALL the possible queries for that --
-- element that return its children. --
----------------------------------------------------------
package A4G.Queries is
-- There is 3 kinds of queries in Asis :
type Query_Kinds is
(Bug,
-- just for the discriminant default expression
Single_Element_Query,
-- Queries taking an element and returning an element.
Element_List_Query,
-- Queries taking an element and returning a list of elements.
Element_List_Query_With_Boolean
-- Queries taking an element and a boolean and returning a list
-- of elements.
);
type A_Single_Element_Query is access
function (Elem : Asis.Element) return Asis.Element;
type A_Element_List_Query is access
function (Elem : Asis.Element) return Asis.Element_List;
type A_Element_List_Query_With_Boolean is access
function
(Elem : Asis.Element;
Bool : Boolean)
return Asis.Element_List;
-- Discriminant record that can access any type of query.
type Func_Elem (Query_Kind : Query_Kinds := Bug) is record
case Query_Kind is
when Bug =>
null;
when Single_Element_Query =>
Func_Simple : A_Single_Element_Query;
when Element_List_Query =>
Func_List : A_Element_List_Query;
when Element_List_Query_With_Boolean =>
Func_List_Boolean : A_Element_List_Query_With_Boolean;
Bool : Boolean;
end case;
end record;
type Query_Array is array (Positive range <>) of Func_Elem;
-- an empty array, when the element is a terminal
No_Query : Query_Array (1 .. 0);
----------------------------------------------------
-- This function returns a Query_Array containing --
-- all the existing queries for that element. --
-- If an element has no children, No_Query is --
-- returned. --
----------------------------------------------------
function Appropriate_Queries (Element : Asis.Element) return Query_Array;
end A4G.Queries;
|
21968
|
------------------------------------------------------------------------------
-- --
-- ASIS-for-GNAT IMPLEMENTATION COMPONENTS --
-- --
-- A 4 G . Q U E R I E S --
-- --
-- S p e c --
-- --
-- Copyright (c) 1995-2006, Free Software Foundation, Inc. --
-- --
-- ASIS-for-GNAT is free software; you can redistribute it and/or modify it --
-- under terms of the GNU General Public License as published by the Free --
-- Software Foundation; either version 2, or (at your option) any later --
-- version. ASIS-for-GNAT is distributed in the hope that it will be use- --
-- ful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- --
-- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General --
-- Public License for more details. You should have received a copy of the --
-- GNU General Public License distributed with ASIS-for-GNAT; see file --
-- COPYING. If not, write to the Free Software Foundation, 51 Franklin --
-- Street, Fifth Floor, Boston, MA 02110-1301, USA. --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
-- ASIS-for-GNAT was originally developed by the ASIS-for-GNAT team at the --
-- Software Engineering Laboratory of the Swiss Federal Institute of --
-- Technology (LGL-EPFL) in Lausanne, Switzerland, in cooperation with the --
-- Scientific Research Computer Center of Moscow State University (SRCC --
-- MSU), Russia, with funding partially provided by grants from the Swiss --
-- National Science Foundation and the Swiss Academy of Engineering --
-- Sciences. ASIS-for-GNAT is now maintained by AdaCore --
-- (http://www.adaccore.com). --
-- --
-- The original version of this component has been developed by <NAME>--
-- <NAME> (<EMAIL>) and <NAME> --
-- (<EMAIL>), ENSIMAG High School Graduates (Computer --
-- sciences) Grenoble, France in Sema Group Grenoble, France. Now this --
-- component is maintained by the ASIS team --
-- --
------------------------------------------------------------------------------
with Asis; use Asis;
----------------------------------------------------------
-- The goal of this package is, when we have an element --
-- to let us have ALL the possible queries for that --
-- element that return its children. --
----------------------------------------------------------
package A4G.Queries is
-- There is 3 kinds of queries in Asis :
type Query_Kinds is
(Bug,
-- just for the discriminant default expression
Single_Element_Query,
-- Queries taking an element and returning an element.
Element_List_Query,
-- Queries taking an element and returning a list of elements.
Element_List_Query_With_Boolean
-- Queries taking an element and a boolean and returning a list
-- of elements.
);
type A_Single_Element_Query is access
function (Elem : Asis.Element) return Asis.Element;
type A_Element_List_Query is access
function (Elem : Asis.Element) return Asis.Element_List;
type A_Element_List_Query_With_Boolean is access
function
(Elem : Asis.Element;
Bool : Boolean)
return Asis.Element_List;
-- Discriminant record that can access any type of query.
type Func_Elem (Query_Kind : Query_Kinds := Bug) is record
case Query_Kind is
when Bug =>
null;
when Single_Element_Query =>
Func_Simple : A_Single_Element_Query;
when Element_List_Query =>
Func_List : A_Element_List_Query;
when Element_List_Query_With_Boolean =>
Func_List_Boolean : A_Element_List_Query_With_Boolean;
Bool : Boolean;
end case;
end record;
type Query_Array is array (Positive range <>) of Func_Elem;
-- an empty array, when the element is a terminal
No_Query : Query_Array (1 .. 0);
----------------------------------------------------
-- This function returns a Query_Array containing --
-- all the existing queries for that element. --
-- If an element has no children, No_Query is --
-- returned. --
----------------------------------------------------
function Appropriate_Queries (Element : Asis.Element) return Query_Array;
end A4G.Queries;
| true |
------------------------------------------------------------------------------
-- --
-- ASIS-for-GNAT IMPLEMENTATION COMPONENTS --
-- --
-- A 4 G . Q U E R I E S --
-- --
-- S p e c --
-- --
-- Copyright (c) 1995-2006, Free Software Foundation, Inc. --
-- --
-- ASIS-for-GNAT is free software; you can redistribute it and/or modify it --
-- under terms of the GNU General Public License as published by the Free --
-- Software Foundation; either version 2, or (at your option) any later --
-- version. ASIS-for-GNAT is distributed in the hope that it will be use- --
-- ful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- --
-- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General --
-- Public License for more details. You should have received a copy of the --
-- GNU General Public License distributed with ASIS-for-GNAT; see file --
-- COPYING. If not, write to the Free Software Foundation, 51 Franklin --
-- Street, Fifth Floor, Boston, MA 02110-1301, USA. --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
-- ASIS-for-GNAT was originally developed by the ASIS-for-GNAT team at the --
-- Software Engineering Laboratory of the Swiss Federal Institute of --
-- Technology (LGL-EPFL) in Lausanne, Switzerland, in cooperation with the --
-- Scientific Research Computer Center of Moscow State University (SRCC --
-- MSU), Russia, with funding partially provided by grants from the Swiss --
-- National Science Foundation and the Swiss Academy of Engineering --
-- Sciences. ASIS-for-GNAT is now maintained by AdaCore --
-- (http://www.adaccore.com). --
-- --
-- The original version of this component has been developed by PI:NAME:<NAME>END_PI--
-- PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI) and PI:NAME:<NAME>END_PI --
-- (PI:EMAIL:<EMAIL>END_PI), ENSIMAG High School Graduates (Computer --
-- sciences) Grenoble, France in Sema Group Grenoble, France. Now this --
-- component is maintained by the ASIS team --
-- --
------------------------------------------------------------------------------
with Asis; use Asis;
----------------------------------------------------------
-- The goal of this package is, when we have an element --
-- to let us have ALL the possible queries for that --
-- element that return its children. --
----------------------------------------------------------
package A4G.Queries is
-- There is 3 kinds of queries in Asis :
type Query_Kinds is
(Bug,
-- just for the discriminant default expression
Single_Element_Query,
-- Queries taking an element and returning an element.
Element_List_Query,
-- Queries taking an element and returning a list of elements.
Element_List_Query_With_Boolean
-- Queries taking an element and a boolean and returning a list
-- of elements.
);
type A_Single_Element_Query is access
function (Elem : Asis.Element) return Asis.Element;
type A_Element_List_Query is access
function (Elem : Asis.Element) return Asis.Element_List;
type A_Element_List_Query_With_Boolean is access
function
(Elem : Asis.Element;
Bool : Boolean)
return Asis.Element_List;
-- Discriminant record that can access any type of query.
type Func_Elem (Query_Kind : Query_Kinds := Bug) is record
case Query_Kind is
when Bug =>
null;
when Single_Element_Query =>
Func_Simple : A_Single_Element_Query;
when Element_List_Query =>
Func_List : A_Element_List_Query;
when Element_List_Query_With_Boolean =>
Func_List_Boolean : A_Element_List_Query_With_Boolean;
Bool : Boolean;
end case;
end record;
type Query_Array is array (Positive range <>) of Func_Elem;
-- an empty array, when the element is a terminal
No_Query : Query_Array (1 .. 0);
----------------------------------------------------
-- This function returns a Query_Array containing --
-- all the existing queries for that element. --
-- If an element has no children, No_Query is --
-- returned. --
----------------------------------------------------
function Appropriate_Queries (Element : Asis.Element) return Query_Array;
end A4G.Queries;
|
[
{
"context": "----------------------\n-- Copyright (c) 2013-2014, Natacha Porté --\n-- ",
"end": 120,
"score": 0.9998511075973511,
"start": 107,
"tag": "NAME",
"value": "Natacha Porté"
}
] |
src/natools-s_expressions.ads
|
faelys/natools
| 0 |
------------------------------------------------------------------------------
-- Copyright (c) 2013-2014, Natacha Porté --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Natools.S_Expression declare basic types used in all children packages --
-- dealing with S-expressions. --
-- --
-- S-expressions here are defined as a half serialization mechanism, using --
-- standard syntax from http://people.csail.mit.edu/rivest/Sexp.txt --
-- --
-- Briefly, "atoms" are defined as a sequence of octets of any length, and --
-- "lists" are defined as a sequence of items, each of which being either --
-- an atom or another list. A S-expression is a sequence of octets that --
-- represents such a list. --
-- --
-- So atoms are unstructured blob of data, supposed to be the serialization --
-- of some lower-level object (e.g. a string), and they are structured as --
-- leaves in a tree. --
-- --
-- All S-expression code here assume that Stream_Element is actually an --
-- 8-bit byte. So Octet, Atom and related types are derived from --
-- Ada.Streams entries. --
------------------------------------------------------------------------------
with Ada.Streams;
package Natools.S_Expressions is
pragma Pure (Natools.S_Expressions);
-----------------
-- Basic Types --
-----------------
subtype Octet is Ada.Streams.Stream_Element;
subtype Offset is Ada.Streams.Stream_Element_Offset;
subtype Count is Ada.Streams.Stream_Element_Count;
subtype Atom is Ada.Streams.Stream_Element_Array;
Null_Atom : constant Atom (1 .. 0) := (others => <>);
function To_String (Data : in Atom) return String;
function To_Atom (Data : in String) return Atom;
function "=" (Left, Right : Atom) return Boolean
renames Ada.Streams."=";
function "<" (Left, Right : Atom) return Boolean
renames Ada.Streams."<";
function Less_Than (Left, Right : Atom) return Boolean;
-----------------------------
-- S-expression Descriptor --
-----------------------------
package Events is
type Event is
(Error,
Open_List,
Close_List,
Add_Atom,
End_Of_Input);
end Events;
type Descriptor is limited interface;
-- Descriptor interface can be implemented by objects that can
-- describe a S-expression to its holder, using an event-driven
-- interface. The current event reports error conditions, or whether
-- a beginning or end of list encountered, or whether a new atom is
-- available.
function Current_Event (Object : in Descriptor) return Events.Event
is abstract;
-- Return the current event in Object
function Current_Atom (Object : in Descriptor) return Atom is abstract;
-- Return the current atom in an Object whose state is Add_Atom
function Current_Level (Object : in Descriptor) return Natural is abstract;
-- Return the number of nested lists currently opened
procedure Query_Atom
(Object : in Descriptor;
Process : not null access procedure (Data : in Atom)) is abstract;
-- Read-in-place callback for the current atom in Object.
-- Must only be called when current event in Object is Add_Event.
procedure Read_Atom
(Object : in Descriptor;
Data : out Atom;
Length : out Count) is abstract;
-- Copy the current atom in Object to Data.
-- Must only be called when current event in Object is Add_Event.
procedure Next
(Object : in out Descriptor;
Event : out Events.Event) is abstract;
-- Update Object to reflect the next event in the S-expression
procedure Next (Object : in out Descriptor'Class);
-- Call Next discarding current event
procedure Close_Current_List (Object : in out Descriptor'Class);
-- Repeatedly call Next until reaching end-of-input or the Close_List
-- event matching the current list.
-- Note: if current event is Open_List, then this is the designated list
-- while for other events, including Close_List, the designated list
-- contains the current object or the just-closed list.
private
use type Ada.Streams.Stream_Element;
use type Ada.Streams.Stream_Element_Offset;
use type Ada.Streams.Stream_Element_Array;
use type Events.Event;
end Natools.S_Expressions;
|
21910
|
------------------------------------------------------------------------------
-- Copyright (c) 2013-2014, <NAME> --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Natools.S_Expression declare basic types used in all children packages --
-- dealing with S-expressions. --
-- --
-- S-expressions here are defined as a half serialization mechanism, using --
-- standard syntax from http://people.csail.mit.edu/rivest/Sexp.txt --
-- --
-- Briefly, "atoms" are defined as a sequence of octets of any length, and --
-- "lists" are defined as a sequence of items, each of which being either --
-- an atom or another list. A S-expression is a sequence of octets that --
-- represents such a list. --
-- --
-- So atoms are unstructured blob of data, supposed to be the serialization --
-- of some lower-level object (e.g. a string), and they are structured as --
-- leaves in a tree. --
-- --
-- All S-expression code here assume that Stream_Element is actually an --
-- 8-bit byte. So Octet, Atom and related types are derived from --
-- Ada.Streams entries. --
------------------------------------------------------------------------------
with Ada.Streams;
package Natools.S_Expressions is
pragma Pure (Natools.S_Expressions);
-----------------
-- Basic Types --
-----------------
subtype Octet is Ada.Streams.Stream_Element;
subtype Offset is Ada.Streams.Stream_Element_Offset;
subtype Count is Ada.Streams.Stream_Element_Count;
subtype Atom is Ada.Streams.Stream_Element_Array;
Null_Atom : constant Atom (1 .. 0) := (others => <>);
function To_String (Data : in Atom) return String;
function To_Atom (Data : in String) return Atom;
function "=" (Left, Right : Atom) return Boolean
renames Ada.Streams."=";
function "<" (Left, Right : Atom) return Boolean
renames Ada.Streams."<";
function Less_Than (Left, Right : Atom) return Boolean;
-----------------------------
-- S-expression Descriptor --
-----------------------------
package Events is
type Event is
(Error,
Open_List,
Close_List,
Add_Atom,
End_Of_Input);
end Events;
type Descriptor is limited interface;
-- Descriptor interface can be implemented by objects that can
-- describe a S-expression to its holder, using an event-driven
-- interface. The current event reports error conditions, or whether
-- a beginning or end of list encountered, or whether a new atom is
-- available.
function Current_Event (Object : in Descriptor) return Events.Event
is abstract;
-- Return the current event in Object
function Current_Atom (Object : in Descriptor) return Atom is abstract;
-- Return the current atom in an Object whose state is Add_Atom
function Current_Level (Object : in Descriptor) return Natural is abstract;
-- Return the number of nested lists currently opened
procedure Query_Atom
(Object : in Descriptor;
Process : not null access procedure (Data : in Atom)) is abstract;
-- Read-in-place callback for the current atom in Object.
-- Must only be called when current event in Object is Add_Event.
procedure Read_Atom
(Object : in Descriptor;
Data : out Atom;
Length : out Count) is abstract;
-- Copy the current atom in Object to Data.
-- Must only be called when current event in Object is Add_Event.
procedure Next
(Object : in out Descriptor;
Event : out Events.Event) is abstract;
-- Update Object to reflect the next event in the S-expression
procedure Next (Object : in out Descriptor'Class);
-- Call Next discarding current event
procedure Close_Current_List (Object : in out Descriptor'Class);
-- Repeatedly call Next until reaching end-of-input or the Close_List
-- event matching the current list.
-- Note: if current event is Open_List, then this is the designated list
-- while for other events, including Close_List, the designated list
-- contains the current object or the just-closed list.
private
use type Ada.Streams.Stream_Element;
use type Ada.Streams.Stream_Element_Offset;
use type Ada.Streams.Stream_Element_Array;
use type Events.Event;
end Natools.S_Expressions;
| true |
------------------------------------------------------------------------------
-- Copyright (c) 2013-2014, PI:NAME:<NAME>END_PI --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Natools.S_Expression declare basic types used in all children packages --
-- dealing with S-expressions. --
-- --
-- S-expressions here are defined as a half serialization mechanism, using --
-- standard syntax from http://people.csail.mit.edu/rivest/Sexp.txt --
-- --
-- Briefly, "atoms" are defined as a sequence of octets of any length, and --
-- "lists" are defined as a sequence of items, each of which being either --
-- an atom or another list. A S-expression is a sequence of octets that --
-- represents such a list. --
-- --
-- So atoms are unstructured blob of data, supposed to be the serialization --
-- of some lower-level object (e.g. a string), and they are structured as --
-- leaves in a tree. --
-- --
-- All S-expression code here assume that Stream_Element is actually an --
-- 8-bit byte. So Octet, Atom and related types are derived from --
-- Ada.Streams entries. --
------------------------------------------------------------------------------
with Ada.Streams;
package Natools.S_Expressions is
pragma Pure (Natools.S_Expressions);
-----------------
-- Basic Types --
-----------------
subtype Octet is Ada.Streams.Stream_Element;
subtype Offset is Ada.Streams.Stream_Element_Offset;
subtype Count is Ada.Streams.Stream_Element_Count;
subtype Atom is Ada.Streams.Stream_Element_Array;
Null_Atom : constant Atom (1 .. 0) := (others => <>);
function To_String (Data : in Atom) return String;
function To_Atom (Data : in String) return Atom;
function "=" (Left, Right : Atom) return Boolean
renames Ada.Streams."=";
function "<" (Left, Right : Atom) return Boolean
renames Ada.Streams."<";
function Less_Than (Left, Right : Atom) return Boolean;
-----------------------------
-- S-expression Descriptor --
-----------------------------
package Events is
type Event is
(Error,
Open_List,
Close_List,
Add_Atom,
End_Of_Input);
end Events;
type Descriptor is limited interface;
-- Descriptor interface can be implemented by objects that can
-- describe a S-expression to its holder, using an event-driven
-- interface. The current event reports error conditions, or whether
-- a beginning or end of list encountered, or whether a new atom is
-- available.
function Current_Event (Object : in Descriptor) return Events.Event
is abstract;
-- Return the current event in Object
function Current_Atom (Object : in Descriptor) return Atom is abstract;
-- Return the current atom in an Object whose state is Add_Atom
function Current_Level (Object : in Descriptor) return Natural is abstract;
-- Return the number of nested lists currently opened
procedure Query_Atom
(Object : in Descriptor;
Process : not null access procedure (Data : in Atom)) is abstract;
-- Read-in-place callback for the current atom in Object.
-- Must only be called when current event in Object is Add_Event.
procedure Read_Atom
(Object : in Descriptor;
Data : out Atom;
Length : out Count) is abstract;
-- Copy the current atom in Object to Data.
-- Must only be called when current event in Object is Add_Event.
procedure Next
(Object : in out Descriptor;
Event : out Events.Event) is abstract;
-- Update Object to reflect the next event in the S-expression
procedure Next (Object : in out Descriptor'Class);
-- Call Next discarding current event
procedure Close_Current_List (Object : in out Descriptor'Class);
-- Repeatedly call Next until reaching end-of-input or the Close_List
-- event matching the current list.
-- Note: if current event is Open_List, then this is the designated list
-- while for other events, including Close_List, the designated list
-- contains the current object or the just-closed list.
private
use type Ada.Streams.Stream_Element;
use type Ada.Streams.Stream_Element_Offset;
use type Ada.Streams.Stream_Element_Array;
use type Events.Event;
end Natools.S_Expressions;
|
[
{
"context": " --\n-- Copyright (C) 2001 A.M.F.Vargas --\n-- Antonio M",
"end": 266,
"score": 0.9998714923858643,
"start": 254,
"tag": "NAME",
"value": "A.M.F.Vargas"
},
{
"context": "M.F.Vargas --\n-- Antonio M. F. Vargas --\n-- ",
"end": 327,
"score": 0.9998727440834045,
"start": 307,
"tag": "NAME",
"value": "Antonio M. F. Vargas"
},
{
"context": " --\n-- Ponta Delgada - Azores - Portugal --\n-- ",
"end": 389,
"score": 0.5144278407096863,
"start": 388,
"tag": "NAME",
"value": "g"
},
{
"context": " --\n-- http://www.adapower.net/~avargas --\n-- E-mail: av",
"end": 483,
"score": 0.6127126216888428,
"start": 476,
"tag": "USERNAME",
"value": "avargas"
},
{
"context": "gas --\n-- E-mail: [email protected] --\n-- ---------------------",
"end": 551,
"score": 0.9999325275421143,
"start": 531,
"tag": "EMAIL",
"value": "[email protected]"
},
{
"context": "er API, supports multiple timers\n -- Written by Stephane Peter <[email protected]>\n\n -- Function prototy",
"end": 5467,
"score": 0.9998900890350342,
"start": 5453,
"tag": "NAME",
"value": "Stephane Peter"
},
{
"context": "multiple timers\n -- Written by Stephane Peter <[email protected]>\n\n -- Function prototype for the new timer cal",
"end": 5491,
"score": 0.9999351501464844,
"start": 5469,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
thirdparty/adasdl/thin/adasdl/AdaSDL/binding/sdl-timer.ads
|
Lucretia/old_nehe_ada95
| 0 |
-- ----------------------------------------------------------------- --
-- AdaSDL --
-- Binding to Simple Direct Media Layer --
-- Copyright (C) 2001 A.M.F.Vargas --
-- Antonio M. F. Vargas --
-- Ponta Delgada - Azores - Portugal --
-- http://www.adapower.net/~avargas --
-- E-mail: [email protected] --
-- ----------------------------------------------------------------- --
-- --
-- This library is free software; you can redistribute it and/or --
-- modify it under the terms of the GNU General Public --
-- License as published by the Free Software Foundation; either --
-- version 2 of the License, or (at your option) any later version. --
-- --
-- This library is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- General Public License for more details. --
-- --
-- You should have received a copy of the GNU General Public --
-- License along with this library; if not, write to the --
-- Free Software Foundation, Inc., 59 Temple Place - Suite 330, --
-- Boston, MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from --
-- this unit, or you link this unit with other files to produce an --
-- executable, this unit does not by itself cause the resulting --
-- executable to be covered by the GNU General Public License. This --
-- exception does not however invalidate any other reasons why the --
-- executable file might be covered by the GNU Public License. --
-- ----------------------------------------------------------------- --
-- **************************************************************** --
-- This is an Ada binding to SDL ( Simple DirectMedia Layer from --
-- Sam Lantinga - www.libsld.org ) --
-- **************************************************************** --
-- In order to help the Ada programmer, the comments in this file --
-- are, in great extent, a direct copy of the original text in the --
-- SDL header files. --
-- **************************************************************** --
with System;
with SDL.Types; use SDL.Types;
package SDL.Timer is
-- This is the OS scheduler timeslice, in milliseconds
TIMESLICE : constant := 10;
-- This is the maximum resolution of the SDL timer on all platforms
RESOLUTION : constant := 10; -- Experimentally determined
-- Get the number of milliseconds since the SDL library initialization.
-- Note that this value wraps if the program runs for more than ~49 days.
function GetTicks return Uint32;
pragma Import (C, GetTicks, "SDL_GetTicks");
-- Wait a specified number of milliseconds before returning
procedure SDL_Delay (ms : Uint32);
pragma Import (C, SDL_Delay, "SDL_Delay");
-- Function pointer prototype for the timer callback function
type TimerCallback_ptr is
access function (interval : Uint32) return Uint32;
pragma Convention (C, TimerCallback_ptr);
-- Set a callback to run after the specified number of milliseconds has
-- elapsed. The callback function is passed the current timer interval
-- and returns the next timer interval. If the returned value is the
-- same as the one passed in, the periodic alarm continues, otherwise a
-- new alarm is scheduled. If the callback returns 0, the periodic alarm
-- is cancelled.
-- To cancel a currently running timer, call SetTimer(0, NULL);
-- The timer callback function may run in a different thread than your
-- main code, and so shouldn't call any functions from within itself.
-- The maximum resolution of this timer is 10 ms, which means that if
-- you request a 16 ms timer, your callback will run approximately 20 ms
-- later on an unloaded system. If you wanted to set a flag signaling
-- a frame update at 30 frames per second (every 33 ms), you might set a
-- timer for 30 ms:
-- SetTimer((33/10)*10, flag_update);
-- If you use this function, you need to pass INIT_TIMER to SDL_Init().
-- Under UNIX, you should not use raise or use SIGALRM and this function
-- in the same program, as it is implemented using setitimer(). You also
-- should not use this function in multi-threaded applications as signals
-- to multi-threaded apps have undefined behavior in some implementations.
function SetTimer (
interval : Uint32;
callback : TimerCallback_ptr)
return C.int;
procedure SetTimer (
interval : Uint32;
callback : TimerCallback_ptr);
pragma Import (C, SetTimer, "SDL_SetTimer");
-- New timer API, supports multiple timers
-- Written by Stephane Peter <[email protected]>
-- Function prototype for the new timer callback function.
-- The callback function is passed the current timer interval and returns
-- the next timer interval. If the returned value is the same as the one
-- passed in, the periodic alarm continues, otherwise a new alarm is
-- scheduled. If the callback returns 0, the periodic alarm is cancelled.
type NewTimerCallback_ptr is
access function (
interval : Uint32;
param : System.Address)
return Uint32;
pragma Convention (C, NewTimerCallback_ptr);
-- Definition of the timer ID type
type TimerID is new System.Address;
Null_TimerID : constant TimerID := TimerID (System.Null_Address);
-- Add a new timer to the pool of timers already running.
-- Returns a timer ID, or NULL when an error occurs.
function AddTimer (
interval : Uint32;
callback : NewTimerCallback_ptr;
param : System.Address)
return TimerID;
pragma Import (C, AddTimer, "SDL_AddTimer");
-- Remove one of the multiple timers knowing its ID.
-- Returns a boolean value indicating success.
function RemoveTimer (t : TimerID) return SDL_bool;
pragma Import (C, RemoveTimer, "SDL_RemoveTimer");
end SDL.Timer;
|
29647
|
-- ----------------------------------------------------------------- --
-- AdaSDL --
-- Binding to Simple Direct Media Layer --
-- Copyright (C) 2001 <NAME> --
-- <NAME> --
-- Ponta Del<NAME>ada - Azores - Portugal --
-- http://www.adapower.net/~avargas --
-- E-mail: <EMAIL> --
-- ----------------------------------------------------------------- --
-- --
-- This library is free software; you can redistribute it and/or --
-- modify it under the terms of the GNU General Public --
-- License as published by the Free Software Foundation; either --
-- version 2 of the License, or (at your option) any later version. --
-- --
-- This library is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- General Public License for more details. --
-- --
-- You should have received a copy of the GNU General Public --
-- License along with this library; if not, write to the --
-- Free Software Foundation, Inc., 59 Temple Place - Suite 330, --
-- Boston, MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from --
-- this unit, or you link this unit with other files to produce an --
-- executable, this unit does not by itself cause the resulting --
-- executable to be covered by the GNU General Public License. This --
-- exception does not however invalidate any other reasons why the --
-- executable file might be covered by the GNU Public License. --
-- ----------------------------------------------------------------- --
-- **************************************************************** --
-- This is an Ada binding to SDL ( Simple DirectMedia Layer from --
-- Sam Lantinga - www.libsld.org ) --
-- **************************************************************** --
-- In order to help the Ada programmer, the comments in this file --
-- are, in great extent, a direct copy of the original text in the --
-- SDL header files. --
-- **************************************************************** --
with System;
with SDL.Types; use SDL.Types;
package SDL.Timer is
-- This is the OS scheduler timeslice, in milliseconds
TIMESLICE : constant := 10;
-- This is the maximum resolution of the SDL timer on all platforms
RESOLUTION : constant := 10; -- Experimentally determined
-- Get the number of milliseconds since the SDL library initialization.
-- Note that this value wraps if the program runs for more than ~49 days.
function GetTicks return Uint32;
pragma Import (C, GetTicks, "SDL_GetTicks");
-- Wait a specified number of milliseconds before returning
procedure SDL_Delay (ms : Uint32);
pragma Import (C, SDL_Delay, "SDL_Delay");
-- Function pointer prototype for the timer callback function
type TimerCallback_ptr is
access function (interval : Uint32) return Uint32;
pragma Convention (C, TimerCallback_ptr);
-- Set a callback to run after the specified number of milliseconds has
-- elapsed. The callback function is passed the current timer interval
-- and returns the next timer interval. If the returned value is the
-- same as the one passed in, the periodic alarm continues, otherwise a
-- new alarm is scheduled. If the callback returns 0, the periodic alarm
-- is cancelled.
-- To cancel a currently running timer, call SetTimer(0, NULL);
-- The timer callback function may run in a different thread than your
-- main code, and so shouldn't call any functions from within itself.
-- The maximum resolution of this timer is 10 ms, which means that if
-- you request a 16 ms timer, your callback will run approximately 20 ms
-- later on an unloaded system. If you wanted to set a flag signaling
-- a frame update at 30 frames per second (every 33 ms), you might set a
-- timer for 30 ms:
-- SetTimer((33/10)*10, flag_update);
-- If you use this function, you need to pass INIT_TIMER to SDL_Init().
-- Under UNIX, you should not use raise or use SIGALRM and this function
-- in the same program, as it is implemented using setitimer(). You also
-- should not use this function in multi-threaded applications as signals
-- to multi-threaded apps have undefined behavior in some implementations.
function SetTimer (
interval : Uint32;
callback : TimerCallback_ptr)
return C.int;
procedure SetTimer (
interval : Uint32;
callback : TimerCallback_ptr);
pragma Import (C, SetTimer, "SDL_SetTimer");
-- New timer API, supports multiple timers
-- Written by <NAME> <<EMAIL>>
-- Function prototype for the new timer callback function.
-- The callback function is passed the current timer interval and returns
-- the next timer interval. If the returned value is the same as the one
-- passed in, the periodic alarm continues, otherwise a new alarm is
-- scheduled. If the callback returns 0, the periodic alarm is cancelled.
type NewTimerCallback_ptr is
access function (
interval : Uint32;
param : System.Address)
return Uint32;
pragma Convention (C, NewTimerCallback_ptr);
-- Definition of the timer ID type
type TimerID is new System.Address;
Null_TimerID : constant TimerID := TimerID (System.Null_Address);
-- Add a new timer to the pool of timers already running.
-- Returns a timer ID, or NULL when an error occurs.
function AddTimer (
interval : Uint32;
callback : NewTimerCallback_ptr;
param : System.Address)
return TimerID;
pragma Import (C, AddTimer, "SDL_AddTimer");
-- Remove one of the multiple timers knowing its ID.
-- Returns a boolean value indicating success.
function RemoveTimer (t : TimerID) return SDL_bool;
pragma Import (C, RemoveTimer, "SDL_RemoveTimer");
end SDL.Timer;
| true |
-- ----------------------------------------------------------------- --
-- AdaSDL --
-- Binding to Simple Direct Media Layer --
-- Copyright (C) 2001 PI:NAME:<NAME>END_PI --
-- PI:NAME:<NAME>END_PI --
-- Ponta DelPI:NAME:<NAME>END_PIada - Azores - Portugal --
-- http://www.adapower.net/~avargas --
-- E-mail: PI:EMAIL:<EMAIL>END_PI --
-- ----------------------------------------------------------------- --
-- --
-- This library is free software; you can redistribute it and/or --
-- modify it under the terms of the GNU General Public --
-- License as published by the Free Software Foundation; either --
-- version 2 of the License, or (at your option) any later version. --
-- --
-- This library is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- General Public License for more details. --
-- --
-- You should have received a copy of the GNU General Public --
-- License along with this library; if not, write to the --
-- Free Software Foundation, Inc., 59 Temple Place - Suite 330, --
-- Boston, MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from --
-- this unit, or you link this unit with other files to produce an --
-- executable, this unit does not by itself cause the resulting --
-- executable to be covered by the GNU General Public License. This --
-- exception does not however invalidate any other reasons why the --
-- executable file might be covered by the GNU Public License. --
-- ----------------------------------------------------------------- --
-- **************************************************************** --
-- This is an Ada binding to SDL ( Simple DirectMedia Layer from --
-- Sam Lantinga - www.libsld.org ) --
-- **************************************************************** --
-- In order to help the Ada programmer, the comments in this file --
-- are, in great extent, a direct copy of the original text in the --
-- SDL header files. --
-- **************************************************************** --
with System;
with SDL.Types; use SDL.Types;
package SDL.Timer is
-- This is the OS scheduler timeslice, in milliseconds
TIMESLICE : constant := 10;
-- This is the maximum resolution of the SDL timer on all platforms
RESOLUTION : constant := 10; -- Experimentally determined
-- Get the number of milliseconds since the SDL library initialization.
-- Note that this value wraps if the program runs for more than ~49 days.
function GetTicks return Uint32;
pragma Import (C, GetTicks, "SDL_GetTicks");
-- Wait a specified number of milliseconds before returning
procedure SDL_Delay (ms : Uint32);
pragma Import (C, SDL_Delay, "SDL_Delay");
-- Function pointer prototype for the timer callback function
type TimerCallback_ptr is
access function (interval : Uint32) return Uint32;
pragma Convention (C, TimerCallback_ptr);
-- Set a callback to run after the specified number of milliseconds has
-- elapsed. The callback function is passed the current timer interval
-- and returns the next timer interval. If the returned value is the
-- same as the one passed in, the periodic alarm continues, otherwise a
-- new alarm is scheduled. If the callback returns 0, the periodic alarm
-- is cancelled.
-- To cancel a currently running timer, call SetTimer(0, NULL);
-- The timer callback function may run in a different thread than your
-- main code, and so shouldn't call any functions from within itself.
-- The maximum resolution of this timer is 10 ms, which means that if
-- you request a 16 ms timer, your callback will run approximately 20 ms
-- later on an unloaded system. If you wanted to set a flag signaling
-- a frame update at 30 frames per second (every 33 ms), you might set a
-- timer for 30 ms:
-- SetTimer((33/10)*10, flag_update);
-- If you use this function, you need to pass INIT_TIMER to SDL_Init().
-- Under UNIX, you should not use raise or use SIGALRM and this function
-- in the same program, as it is implemented using setitimer(). You also
-- should not use this function in multi-threaded applications as signals
-- to multi-threaded apps have undefined behavior in some implementations.
function SetTimer (
interval : Uint32;
callback : TimerCallback_ptr)
return C.int;
procedure SetTimer (
interval : Uint32;
callback : TimerCallback_ptr);
pragma Import (C, SetTimer, "SDL_SetTimer");
-- New timer API, supports multiple timers
-- Written by PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>
-- Function prototype for the new timer callback function.
-- The callback function is passed the current timer interval and returns
-- the next timer interval. If the returned value is the same as the one
-- passed in, the periodic alarm continues, otherwise a new alarm is
-- scheduled. If the callback returns 0, the periodic alarm is cancelled.
type NewTimerCallback_ptr is
access function (
interval : Uint32;
param : System.Address)
return Uint32;
pragma Convention (C, NewTimerCallback_ptr);
-- Definition of the timer ID type
type TimerID is new System.Address;
Null_TimerID : constant TimerID := TimerID (System.Null_Address);
-- Add a new timer to the pool of timers already running.
-- Returns a timer ID, or NULL when an error occurs.
function AddTimer (
interval : Uint32;
callback : NewTimerCallback_ptr;
param : System.Address)
return TimerID;
pragma Import (C, AddTimer, "SDL_AddTimer");
-- Remove one of the multiple timers knowing its ID.
-- Returns a boolean value indicating success.
function RemoveTimer (t : TimerID) return SDL_bool;
pragma Import (C, RemoveTimer, "SDL_RemoveTimer");
end SDL.Timer;
|
[
{
"context": "-- Copyright (c) 2020-2021 Bartek thindil Jasicki <[email protected]>\n--\n-- This program is free so",
"end": 49,
"score": 0.9998499751091003,
"start": 27,
"tag": "NAME",
"value": "Bartek thindil Jasicki"
},
{
"context": "- Copyright (c) 2020-2021 Bartek thindil Jasicki <[email protected]>\n--\n-- This program is free software: you can red",
"end": 68,
"score": 0.999934732913971,
"start": 51,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
src/ui/ships-ui.adb
|
thindil/steamsky
| 80 |
-- Copyright (c) 2020-2021 Bartek thindil Jasicki <[email protected]>
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Interfaces.C.Strings; use Interfaces.C.Strings;
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
with Tcl.Ada; use Tcl.Ada;
with Tcl.Tk.Ada; use Tcl.Tk.Ada;
with Tcl.Tk.Ada.Event; use Tcl.Tk.Ada.Event;
with Tcl.Tk.Ada.Grid;
with Tcl.Tk.Ada.Widgets; use Tcl.Tk.Ada.Widgets;
with Tcl.Tk.Ada.Widgets.Canvas; use Tcl.Tk.Ada.Widgets.Canvas;
with Tcl.Tk.Ada.Widgets.Menu; use Tcl.Tk.Ada.Widgets.Menu;
with Tcl.Tk.Ada.Widgets.TtkButton; use Tcl.Tk.Ada.Widgets.TtkButton;
with Tcl.Tk.Ada.Widgets.TtkEntry.TtkComboBox;
use Tcl.Tk.Ada.Widgets.TtkEntry.TtkComboBox;
with Tcl.Tk.Ada.Widgets.TtkFrame; use Tcl.Tk.Ada.Widgets.TtkFrame;
with Tcl.Tk.Ada.Widgets.TtkLabel; use Tcl.Tk.Ada.Widgets.TtkLabel;
with Tcl.Tk.Ada.Widgets.TtkProgressBar; use Tcl.Tk.Ada.Widgets.TtkProgressBar;
with Tcl.Tk.Ada.Winfo; use Tcl.Tk.Ada.Winfo;
with Bases; use Bases;
with Config; use Config;
with CoreUI; use CoreUI;
with Factions; use Factions;
with Maps; use Maps;
with Maps.UI; use Maps.UI;
with Missions; use Missions;
with ShipModules; use ShipModules;
with Ships.UI.Crew;
with Ships.UI.Cargo;
with Ships.UI.Modules;
with Utils.UI; use Utils.UI;
package body Ships.UI is
function Show_Ship_Info_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is
pragma Unreferenced(ClientData, Argv);
ShipInfoFrame: Ttk_Frame :=
Get_Widget(Main_Paned & ".shipinfoframe", Interp);
Label: Ttk_Label;
UpgradeInfo, ProgressBarStyle: Unbounded_String;
MaxUpgrade: Integer;
UpgradePercent: Float;
UpgradeProgress: Ttk_ProgressBar;
CancelButton: Ttk_Button;
ShipCanvas: constant Tk_Canvas :=
Get_Widget(ShipInfoFrame & ".general.canvas");
TypeBox: constant Ttk_ComboBox :=
Get_Widget
(ShipInfoFrame & ".cargo.canvas.frame.selecttype.combo", Interp);
begin
if Winfo_Get(ShipInfoFrame, "exists") = "0" then
Tcl_EvalFile
(Get_Context,
To_String(Data_Directory) & "ui" & Dir_Separator & "shipinfo.tcl");
elsif Winfo_Get(ShipInfoFrame, "ismapped") = "1" and Argc = 1 then
Entry_Configure(GameMenu, "Help", "-command {ShowHelp general}");
Tcl_Eval(Interp, "InvokeButton " & Close_Button);
Tcl.Tk.Ada.Grid.Grid_Remove(Close_Button);
return TCL_OK;
end if;
Entry_Configure(GameMenu, "Help", "-command {ShowHelp repair}");
Tcl.Tk.Ada.Grid.Grid(Close_Button, "-row 0 -column 1");
ShipInfoFrame.Name :=
New_String(Main_Paned & ".shipinfoframe.general.canvas.frame");
Label := Get_Widget(ShipInfoFrame & ".name");
configure(Label, "-text {Name: " & To_String(Player_Ship.Name) & "}");
Label.Name := New_String(ShipInfoFrame & ".upgradelabel");
UpgradeProgress := Get_Widget(ShipInfoFrame & ".upgrade");
CancelButton := Get_Widget(ShipInfoFrame & ".cancelupgrade");
-- Show or hide upgrade module info
if Player_Ship.Upgrade_Module = 0 then
Tcl.Tk.Ada.Grid.Grid_Remove(Label);
Tcl.Tk.Ada.Grid.Grid_Remove(UpgradeProgress);
Tcl.Tk.Ada.Grid.Grid_Remove(CancelButton);
else
UpgradeInfo :=
"Upgrade:" & Player_Ship.Modules(Player_Ship.Upgrade_Module).Name &
" ";
case Player_Ship.Modules(Player_Ship.Upgrade_Module).Upgrade_Action is
when DURABILITY =>
Append(UpgradeInfo, "(durability)");
MaxUpgrade :=
Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module)
.Proto_Index)
.Durability;
when MAX_VALUE =>
case Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module).Proto_Index)
.MType is
when ENGINE =>
Append(UpgradeInfo, "(power)");
MaxUpgrade :=
Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module)
.Proto_Index)
.MaxValue /
20;
when CABIN =>
Append(UpgradeInfo, "(quality)");
MaxUpgrade :=
Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module)
.Proto_Index)
.MaxValue;
when GUN | BATTERING_RAM =>
Append(UpgradeInfo, "(damage)");
MaxUpgrade :=
Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module)
.Proto_Index)
.MaxValue *
2;
when HULL =>
Append(UpgradeInfo, "(enlarge)");
MaxUpgrade :=
Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module)
.Proto_Index)
.MaxValue *
40;
when HARPOON_GUN =>
Append(UpgradeInfo, "(strength)");
MaxUpgrade :=
Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module)
.Proto_Index)
.MaxValue *
10;
when others =>
null;
end case;
when VALUE =>
case Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module).Proto_Index)
.MType is
when ENGINE =>
Append(UpgradeInfo, "(fuel usage)");
MaxUpgrade :=
Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module)
.Proto_Index)
.Value *
20;
when others =>
null;
end case;
when others =>
null;
end case;
MaxUpgrade :=
Integer
(Float(MaxUpgrade) * Float(New_Game_Settings.Upgrade_Cost_Bonus));
if MaxUpgrade = 0 then
MaxUpgrade := 1;
end if;
UpgradePercent :=
1.0 -
(Float
(Player_Ship.Modules(Player_Ship.Upgrade_Module)
.Upgrade_Progress) /
Float(MaxUpgrade));
ProgressBarStyle :=
(if UpgradePercent > 0.74 then
To_Unbounded_String(" -style green.Horizontal.TProgressbar")
elsif UpgradePercent > 0.24 then
To_Unbounded_String(" -style yellow.Horizontal.TProgressbar")
else To_Unbounded_String(" -style Horizontal.TProgressbar"));
configure
(UpgradeProgress,
"-value" & Float'Image(UpgradePercent) &
To_String(ProgressBarStyle));
configure(Label, "-text {" & To_String(UpgradeInfo) & "}");
Tcl.Tk.Ada.Grid.Grid(Label);
Tcl.Tk.Ada.Grid.Grid(UpgradeProgress);
Tcl.Tk.Ada.Grid.Grid(CancelButton);
end if;
-- Show or hide repair priority info
Label.Name := New_String(ShipInfoFrame & ".repairlabel");
CancelButton.Name := New_String(ShipInfoFrame & ".cancelpriority");
if Player_Ship.Repair_Module = 0 then
Tcl.Tk.Ada.Grid.Grid_Remove(Label);
Tcl.Tk.Ada.Grid.Grid_Remove(CancelButton);
else
configure
(Label,
"-text {Repair first: " &
To_String(Player_Ship.Modules(Player_Ship.Repair_Module).Name) &
"}");
Tcl.Tk.Ada.Grid.Grid(Label);
Tcl.Tk.Ada.Grid.Grid(CancelButton);
end if;
-- Show or hide destination info
Label.Name := New_String(ShipInfoFrame & ".destinationlabel");
CancelButton.Name := New_String(ShipInfoFrame & ".canceldestination");
if Player_Ship.Destination_X = 0 and Player_Ship.Destination_Y = 0 then
Tcl.Tk.Ada.Grid.Grid_Remove(Label);
Tcl.Tk.Ada.Grid.Grid_Remove(CancelButton);
else
if SkyMap(Player_Ship.Destination_X, Player_Ship.Destination_Y)
.BaseIndex >
0 then
configure
(Label,
"-text {Destination: " &
To_String
(Sky_Bases
(SkyMap
(Player_Ship.Destination_X, Player_Ship.Destination_Y)
.BaseIndex)
.Name) &
"}");
else
configure
(Label,
"-text {Destination: X:" &
Positive'Image(Player_Ship.Destination_X) & " Y:" &
Positive'Image(Player_Ship.Destination_Y) & "}");
end if;
Tcl.Tk.Ada.Grid.Grid(Label);
Tcl.Tk.Ada.Grid.Grid(CancelButton);
end if;
Label.Name := New_String(ShipInfoFrame & ".homelabel");
configure
(Label,
"-text {Home: " & To_String(Sky_Bases(Player_Ship.Home_Base).Name) &
"}");
Label.Name := New_String(ShipInfoFrame & ".weight");
configure
(Label,
"-text {Weight:" & Integer'Image(Count_Ship_Weight(Player_Ship)) &
"kg}");
Tcl_Eval(Get_Context, "update");
configure
(ShipCanvas, "-scrollregion [list " & BBox(ShipCanvas, "all") & "]");
Xview_Move_To(ShipCanvas, "0.0");
Yview_Move_To(ShipCanvas, "0.0");
-- Setting ship modules info
Ships.UI.Modules.UpdateModulesInfo;
-- Setting crew info
Ships.UI.Crew.UpdateCrewInfo;
-- Setting cargo info
Set(TypeBox, "All");
Generate(TypeBox, "<<ComboboxSelected>>");
-- Show ship info
Show_Screen("shipinfoframe");
return TCL_OK;
end Show_Ship_Info_Command;
-- ****o* SUI2/SUI2.Set_Ship_Name_Command
-- FUNCTION
-- Change name of the player's ship
-- PARAMETERS
-- ClientData - Custom data send to the command. Unused
-- Interp - Tcl interpreter in which command was executed.
-- Argc - Number of arguments passed to the command.
-- Argv - Values of arguments passed to the command.
-- RESULT
-- This function always return TCL_OK
-- COMMANDS
-- SetShipName shipname
-- Shipname is the new name for the player's ship
-- SOURCE
function Set_Ship_Name_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with
Convention => C;
-- ****
function Set_Ship_Name_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is
pragma Unreferenced(ClientData);
NameEntry: constant Ttk_Label :=
Get_Widget
(Main_Paned & ".shipinfoframe.general.canvas.frame.name", Interp);
begin
if Argc = 1 then
return TCL_OK;
end if;
Player_Ship.Name := To_Unbounded_String(CArgv.Arg(Argv, 1));
configure(NameEntry, "-text {Name: " & CArgv.Arg(Argv, 1) & "}");
return TCL_OK;
end Set_Ship_Name_Command;
-- ****o* SUI2/SUI2.Ship_Max_Min_Command
-- FUNCTION
-- Maximize or minimize the selected section of ship info
-- PARAMETERS
-- ClientData - Custom data send to the command. Unused
-- Interp - Tcl interpreter in which command was executed.
-- Argc - Number of arguments passed to the command. Unused
-- Argv - Values of arguments passed to the command.
-- RESULT
-- This function always return TCL_OK
-- COMMANDS
-- ShipMaxMin framename
-- Framename is name of the frame to maximize or minimize
-- SOURCE
function Ship_Max_Min_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with
Convention => C;
-- ****
function Ship_Max_Min_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is
pragma Unreferenced(ClientData, Argc);
type Frame_Info is record
Name: Unbounded_String;
Column: Natural range 0 .. 1;
Row: Natural range 0 .. 1;
end record;
Frames: constant array(1 .. 4) of Frame_Info :=
((To_Unbounded_String("general"), 0, 0),
(To_Unbounded_String("modules"), 0, 1),
(To_Unbounded_String("crew"), 1, 0),
(To_Unbounded_String("cargo"), 1, 1));
Frame: Ttk_Frame := Get_Widget(Main_Paned & ".shipinfoframe", Interp);
Button: constant Ttk_Button :=
Get_Widget
(Frame & "." & CArgv.Arg(Argv, 1) & ".canvas.frame.maxmin", Interp);
begin
if CArgv.Arg(Argv, 2) /= "show" then
Show_Frames_Loop :
for FrameInfo of Frames loop
Frame.Name :=
New_String
(Main_Paned & ".shipinfoframe." & To_String(FrameInfo.Name));
if To_String(FrameInfo.Name) /= CArgv.Arg(Argv, 1) then
Tcl.Tk.Ada.Grid.Grid(Frame);
else
Tcl.Tk.Ada.Grid.Grid_Configure
(Frame,
"-columnspan 1 -rowspan 1 -column" &
Natural'Image(FrameInfo.Column) & " -row" &
Natural'Image(FrameInfo.Row));
end if;
end loop Show_Frames_Loop;
configure
(Button,
"-text ""[format %c 0xf106]"" -command {ShipMaxMin " &
CArgv.Arg(Argv, 1) & " show}");
else
Hide_Frames_Loop :
for FrameInfo of Frames loop
Frame.Name :=
New_String
(Main_Paned & ".shipinfoframe." & To_String(FrameInfo.Name));
if To_String(FrameInfo.Name) /= CArgv.Arg(Argv, 1) then
Tcl.Tk.Ada.Grid.Grid_Remove(Frame);
else
Tcl.Tk.Ada.Grid.Grid_Configure
(Frame, "-columnspan 2 -rowspan 2 -row 0 -column 0");
end if;
end loop Hide_Frames_Loop;
configure
(Button,
"-text ""[format %c 0xf107]"" -command {ShipMaxMin " &
CArgv.Arg(Argv, 1) & " hide}");
end if;
return TCL_OK;
end Ship_Max_Min_Command;
procedure AddCommands is
begin
Add_Command("ShowShipInfo", Show_Ship_Info_Command'Access);
Add_Command("SetShipName", Set_Ship_Name_Command'Access);
Add_Command("ShipMaxMin", Ship_Max_Min_Command'Access);
Ships.UI.Modules.AddCommands;
Ships.UI.Crew.AddCommands;
Ships.UI.Cargo.AddCommands;
end AddCommands;
end Ships.UI;
|
12824
|
-- Copyright (c) 2020-2021 <NAME> <<EMAIL>>
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Interfaces.C.Strings; use Interfaces.C.Strings;
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
with Tcl.Ada; use Tcl.Ada;
with Tcl.Tk.Ada; use Tcl.Tk.Ada;
with Tcl.Tk.Ada.Event; use Tcl.Tk.Ada.Event;
with Tcl.Tk.Ada.Grid;
with Tcl.Tk.Ada.Widgets; use Tcl.Tk.Ada.Widgets;
with Tcl.Tk.Ada.Widgets.Canvas; use Tcl.Tk.Ada.Widgets.Canvas;
with Tcl.Tk.Ada.Widgets.Menu; use Tcl.Tk.Ada.Widgets.Menu;
with Tcl.Tk.Ada.Widgets.TtkButton; use Tcl.Tk.Ada.Widgets.TtkButton;
with Tcl.Tk.Ada.Widgets.TtkEntry.TtkComboBox;
use Tcl.Tk.Ada.Widgets.TtkEntry.TtkComboBox;
with Tcl.Tk.Ada.Widgets.TtkFrame; use Tcl.Tk.Ada.Widgets.TtkFrame;
with Tcl.Tk.Ada.Widgets.TtkLabel; use Tcl.Tk.Ada.Widgets.TtkLabel;
with Tcl.Tk.Ada.Widgets.TtkProgressBar; use Tcl.Tk.Ada.Widgets.TtkProgressBar;
with Tcl.Tk.Ada.Winfo; use Tcl.Tk.Ada.Winfo;
with Bases; use Bases;
with Config; use Config;
with CoreUI; use CoreUI;
with Factions; use Factions;
with Maps; use Maps;
with Maps.UI; use Maps.UI;
with Missions; use Missions;
with ShipModules; use ShipModules;
with Ships.UI.Crew;
with Ships.UI.Cargo;
with Ships.UI.Modules;
with Utils.UI; use Utils.UI;
package body Ships.UI is
function Show_Ship_Info_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is
pragma Unreferenced(ClientData, Argv);
ShipInfoFrame: Ttk_Frame :=
Get_Widget(Main_Paned & ".shipinfoframe", Interp);
Label: Ttk_Label;
UpgradeInfo, ProgressBarStyle: Unbounded_String;
MaxUpgrade: Integer;
UpgradePercent: Float;
UpgradeProgress: Ttk_ProgressBar;
CancelButton: Ttk_Button;
ShipCanvas: constant Tk_Canvas :=
Get_Widget(ShipInfoFrame & ".general.canvas");
TypeBox: constant Ttk_ComboBox :=
Get_Widget
(ShipInfoFrame & ".cargo.canvas.frame.selecttype.combo", Interp);
begin
if Winfo_Get(ShipInfoFrame, "exists") = "0" then
Tcl_EvalFile
(Get_Context,
To_String(Data_Directory) & "ui" & Dir_Separator & "shipinfo.tcl");
elsif Winfo_Get(ShipInfoFrame, "ismapped") = "1" and Argc = 1 then
Entry_Configure(GameMenu, "Help", "-command {ShowHelp general}");
Tcl_Eval(Interp, "InvokeButton " & Close_Button);
Tcl.Tk.Ada.Grid.Grid_Remove(Close_Button);
return TCL_OK;
end if;
Entry_Configure(GameMenu, "Help", "-command {ShowHelp repair}");
Tcl.Tk.Ada.Grid.Grid(Close_Button, "-row 0 -column 1");
ShipInfoFrame.Name :=
New_String(Main_Paned & ".shipinfoframe.general.canvas.frame");
Label := Get_Widget(ShipInfoFrame & ".name");
configure(Label, "-text {Name: " & To_String(Player_Ship.Name) & "}");
Label.Name := New_String(ShipInfoFrame & ".upgradelabel");
UpgradeProgress := Get_Widget(ShipInfoFrame & ".upgrade");
CancelButton := Get_Widget(ShipInfoFrame & ".cancelupgrade");
-- Show or hide upgrade module info
if Player_Ship.Upgrade_Module = 0 then
Tcl.Tk.Ada.Grid.Grid_Remove(Label);
Tcl.Tk.Ada.Grid.Grid_Remove(UpgradeProgress);
Tcl.Tk.Ada.Grid.Grid_Remove(CancelButton);
else
UpgradeInfo :=
"Upgrade:" & Player_Ship.Modules(Player_Ship.Upgrade_Module).Name &
" ";
case Player_Ship.Modules(Player_Ship.Upgrade_Module).Upgrade_Action is
when DURABILITY =>
Append(UpgradeInfo, "(durability)");
MaxUpgrade :=
Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module)
.Proto_Index)
.Durability;
when MAX_VALUE =>
case Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module).Proto_Index)
.MType is
when ENGINE =>
Append(UpgradeInfo, "(power)");
MaxUpgrade :=
Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module)
.Proto_Index)
.MaxValue /
20;
when CABIN =>
Append(UpgradeInfo, "(quality)");
MaxUpgrade :=
Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module)
.Proto_Index)
.MaxValue;
when GUN | BATTERING_RAM =>
Append(UpgradeInfo, "(damage)");
MaxUpgrade :=
Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module)
.Proto_Index)
.MaxValue *
2;
when HULL =>
Append(UpgradeInfo, "(enlarge)");
MaxUpgrade :=
Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module)
.Proto_Index)
.MaxValue *
40;
when HARPOON_GUN =>
Append(UpgradeInfo, "(strength)");
MaxUpgrade :=
Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module)
.Proto_Index)
.MaxValue *
10;
when others =>
null;
end case;
when VALUE =>
case Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module).Proto_Index)
.MType is
when ENGINE =>
Append(UpgradeInfo, "(fuel usage)");
MaxUpgrade :=
Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module)
.Proto_Index)
.Value *
20;
when others =>
null;
end case;
when others =>
null;
end case;
MaxUpgrade :=
Integer
(Float(MaxUpgrade) * Float(New_Game_Settings.Upgrade_Cost_Bonus));
if MaxUpgrade = 0 then
MaxUpgrade := 1;
end if;
UpgradePercent :=
1.0 -
(Float
(Player_Ship.Modules(Player_Ship.Upgrade_Module)
.Upgrade_Progress) /
Float(MaxUpgrade));
ProgressBarStyle :=
(if UpgradePercent > 0.74 then
To_Unbounded_String(" -style green.Horizontal.TProgressbar")
elsif UpgradePercent > 0.24 then
To_Unbounded_String(" -style yellow.Horizontal.TProgressbar")
else To_Unbounded_String(" -style Horizontal.TProgressbar"));
configure
(UpgradeProgress,
"-value" & Float'Image(UpgradePercent) &
To_String(ProgressBarStyle));
configure(Label, "-text {" & To_String(UpgradeInfo) & "}");
Tcl.Tk.Ada.Grid.Grid(Label);
Tcl.Tk.Ada.Grid.Grid(UpgradeProgress);
Tcl.Tk.Ada.Grid.Grid(CancelButton);
end if;
-- Show or hide repair priority info
Label.Name := New_String(ShipInfoFrame & ".repairlabel");
CancelButton.Name := New_String(ShipInfoFrame & ".cancelpriority");
if Player_Ship.Repair_Module = 0 then
Tcl.Tk.Ada.Grid.Grid_Remove(Label);
Tcl.Tk.Ada.Grid.Grid_Remove(CancelButton);
else
configure
(Label,
"-text {Repair first: " &
To_String(Player_Ship.Modules(Player_Ship.Repair_Module).Name) &
"}");
Tcl.Tk.Ada.Grid.Grid(Label);
Tcl.Tk.Ada.Grid.Grid(CancelButton);
end if;
-- Show or hide destination info
Label.Name := New_String(ShipInfoFrame & ".destinationlabel");
CancelButton.Name := New_String(ShipInfoFrame & ".canceldestination");
if Player_Ship.Destination_X = 0 and Player_Ship.Destination_Y = 0 then
Tcl.Tk.Ada.Grid.Grid_Remove(Label);
Tcl.Tk.Ada.Grid.Grid_Remove(CancelButton);
else
if SkyMap(Player_Ship.Destination_X, Player_Ship.Destination_Y)
.BaseIndex >
0 then
configure
(Label,
"-text {Destination: " &
To_String
(Sky_Bases
(SkyMap
(Player_Ship.Destination_X, Player_Ship.Destination_Y)
.BaseIndex)
.Name) &
"}");
else
configure
(Label,
"-text {Destination: X:" &
Positive'Image(Player_Ship.Destination_X) & " Y:" &
Positive'Image(Player_Ship.Destination_Y) & "}");
end if;
Tcl.Tk.Ada.Grid.Grid(Label);
Tcl.Tk.Ada.Grid.Grid(CancelButton);
end if;
Label.Name := New_String(ShipInfoFrame & ".homelabel");
configure
(Label,
"-text {Home: " & To_String(Sky_Bases(Player_Ship.Home_Base).Name) &
"}");
Label.Name := New_String(ShipInfoFrame & ".weight");
configure
(Label,
"-text {Weight:" & Integer'Image(Count_Ship_Weight(Player_Ship)) &
"kg}");
Tcl_Eval(Get_Context, "update");
configure
(ShipCanvas, "-scrollregion [list " & BBox(ShipCanvas, "all") & "]");
Xview_Move_To(ShipCanvas, "0.0");
Yview_Move_To(ShipCanvas, "0.0");
-- Setting ship modules info
Ships.UI.Modules.UpdateModulesInfo;
-- Setting crew info
Ships.UI.Crew.UpdateCrewInfo;
-- Setting cargo info
Set(TypeBox, "All");
Generate(TypeBox, "<<ComboboxSelected>>");
-- Show ship info
Show_Screen("shipinfoframe");
return TCL_OK;
end Show_Ship_Info_Command;
-- ****o* SUI2/SUI2.Set_Ship_Name_Command
-- FUNCTION
-- Change name of the player's ship
-- PARAMETERS
-- ClientData - Custom data send to the command. Unused
-- Interp - Tcl interpreter in which command was executed.
-- Argc - Number of arguments passed to the command.
-- Argv - Values of arguments passed to the command.
-- RESULT
-- This function always return TCL_OK
-- COMMANDS
-- SetShipName shipname
-- Shipname is the new name for the player's ship
-- SOURCE
function Set_Ship_Name_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with
Convention => C;
-- ****
function Set_Ship_Name_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is
pragma Unreferenced(ClientData);
NameEntry: constant Ttk_Label :=
Get_Widget
(Main_Paned & ".shipinfoframe.general.canvas.frame.name", Interp);
begin
if Argc = 1 then
return TCL_OK;
end if;
Player_Ship.Name := To_Unbounded_String(CArgv.Arg(Argv, 1));
configure(NameEntry, "-text {Name: " & CArgv.Arg(Argv, 1) & "}");
return TCL_OK;
end Set_Ship_Name_Command;
-- ****o* SUI2/SUI2.Ship_Max_Min_Command
-- FUNCTION
-- Maximize or minimize the selected section of ship info
-- PARAMETERS
-- ClientData - Custom data send to the command. Unused
-- Interp - Tcl interpreter in which command was executed.
-- Argc - Number of arguments passed to the command. Unused
-- Argv - Values of arguments passed to the command.
-- RESULT
-- This function always return TCL_OK
-- COMMANDS
-- ShipMaxMin framename
-- Framename is name of the frame to maximize or minimize
-- SOURCE
function Ship_Max_Min_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with
Convention => C;
-- ****
function Ship_Max_Min_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is
pragma Unreferenced(ClientData, Argc);
type Frame_Info is record
Name: Unbounded_String;
Column: Natural range 0 .. 1;
Row: Natural range 0 .. 1;
end record;
Frames: constant array(1 .. 4) of Frame_Info :=
((To_Unbounded_String("general"), 0, 0),
(To_Unbounded_String("modules"), 0, 1),
(To_Unbounded_String("crew"), 1, 0),
(To_Unbounded_String("cargo"), 1, 1));
Frame: Ttk_Frame := Get_Widget(Main_Paned & ".shipinfoframe", Interp);
Button: constant Ttk_Button :=
Get_Widget
(Frame & "." & CArgv.Arg(Argv, 1) & ".canvas.frame.maxmin", Interp);
begin
if CArgv.Arg(Argv, 2) /= "show" then
Show_Frames_Loop :
for FrameInfo of Frames loop
Frame.Name :=
New_String
(Main_Paned & ".shipinfoframe." & To_String(FrameInfo.Name));
if To_String(FrameInfo.Name) /= CArgv.Arg(Argv, 1) then
Tcl.Tk.Ada.Grid.Grid(Frame);
else
Tcl.Tk.Ada.Grid.Grid_Configure
(Frame,
"-columnspan 1 -rowspan 1 -column" &
Natural'Image(FrameInfo.Column) & " -row" &
Natural'Image(FrameInfo.Row));
end if;
end loop Show_Frames_Loop;
configure
(Button,
"-text ""[format %c 0xf106]"" -command {ShipMaxMin " &
CArgv.Arg(Argv, 1) & " show}");
else
Hide_Frames_Loop :
for FrameInfo of Frames loop
Frame.Name :=
New_String
(Main_Paned & ".shipinfoframe." & To_String(FrameInfo.Name));
if To_String(FrameInfo.Name) /= CArgv.Arg(Argv, 1) then
Tcl.Tk.Ada.Grid.Grid_Remove(Frame);
else
Tcl.Tk.Ada.Grid.Grid_Configure
(Frame, "-columnspan 2 -rowspan 2 -row 0 -column 0");
end if;
end loop Hide_Frames_Loop;
configure
(Button,
"-text ""[format %c 0xf107]"" -command {ShipMaxMin " &
CArgv.Arg(Argv, 1) & " hide}");
end if;
return TCL_OK;
end Ship_Max_Min_Command;
procedure AddCommands is
begin
Add_Command("ShowShipInfo", Show_Ship_Info_Command'Access);
Add_Command("SetShipName", Set_Ship_Name_Command'Access);
Add_Command("ShipMaxMin", Ship_Max_Min_Command'Access);
Ships.UI.Modules.AddCommands;
Ships.UI.Crew.AddCommands;
Ships.UI.Cargo.AddCommands;
end AddCommands;
end Ships.UI;
| true |
-- Copyright (c) 2020-2021 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Interfaces.C.Strings; use Interfaces.C.Strings;
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
with Tcl.Ada; use Tcl.Ada;
with Tcl.Tk.Ada; use Tcl.Tk.Ada;
with Tcl.Tk.Ada.Event; use Tcl.Tk.Ada.Event;
with Tcl.Tk.Ada.Grid;
with Tcl.Tk.Ada.Widgets; use Tcl.Tk.Ada.Widgets;
with Tcl.Tk.Ada.Widgets.Canvas; use Tcl.Tk.Ada.Widgets.Canvas;
with Tcl.Tk.Ada.Widgets.Menu; use Tcl.Tk.Ada.Widgets.Menu;
with Tcl.Tk.Ada.Widgets.TtkButton; use Tcl.Tk.Ada.Widgets.TtkButton;
with Tcl.Tk.Ada.Widgets.TtkEntry.TtkComboBox;
use Tcl.Tk.Ada.Widgets.TtkEntry.TtkComboBox;
with Tcl.Tk.Ada.Widgets.TtkFrame; use Tcl.Tk.Ada.Widgets.TtkFrame;
with Tcl.Tk.Ada.Widgets.TtkLabel; use Tcl.Tk.Ada.Widgets.TtkLabel;
with Tcl.Tk.Ada.Widgets.TtkProgressBar; use Tcl.Tk.Ada.Widgets.TtkProgressBar;
with Tcl.Tk.Ada.Winfo; use Tcl.Tk.Ada.Winfo;
with Bases; use Bases;
with Config; use Config;
with CoreUI; use CoreUI;
with Factions; use Factions;
with Maps; use Maps;
with Maps.UI; use Maps.UI;
with Missions; use Missions;
with ShipModules; use ShipModules;
with Ships.UI.Crew;
with Ships.UI.Cargo;
with Ships.UI.Modules;
with Utils.UI; use Utils.UI;
package body Ships.UI is
function Show_Ship_Info_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is
pragma Unreferenced(ClientData, Argv);
ShipInfoFrame: Ttk_Frame :=
Get_Widget(Main_Paned & ".shipinfoframe", Interp);
Label: Ttk_Label;
UpgradeInfo, ProgressBarStyle: Unbounded_String;
MaxUpgrade: Integer;
UpgradePercent: Float;
UpgradeProgress: Ttk_ProgressBar;
CancelButton: Ttk_Button;
ShipCanvas: constant Tk_Canvas :=
Get_Widget(ShipInfoFrame & ".general.canvas");
TypeBox: constant Ttk_ComboBox :=
Get_Widget
(ShipInfoFrame & ".cargo.canvas.frame.selecttype.combo", Interp);
begin
if Winfo_Get(ShipInfoFrame, "exists") = "0" then
Tcl_EvalFile
(Get_Context,
To_String(Data_Directory) & "ui" & Dir_Separator & "shipinfo.tcl");
elsif Winfo_Get(ShipInfoFrame, "ismapped") = "1" and Argc = 1 then
Entry_Configure(GameMenu, "Help", "-command {ShowHelp general}");
Tcl_Eval(Interp, "InvokeButton " & Close_Button);
Tcl.Tk.Ada.Grid.Grid_Remove(Close_Button);
return TCL_OK;
end if;
Entry_Configure(GameMenu, "Help", "-command {ShowHelp repair}");
Tcl.Tk.Ada.Grid.Grid(Close_Button, "-row 0 -column 1");
ShipInfoFrame.Name :=
New_String(Main_Paned & ".shipinfoframe.general.canvas.frame");
Label := Get_Widget(ShipInfoFrame & ".name");
configure(Label, "-text {Name: " & To_String(Player_Ship.Name) & "}");
Label.Name := New_String(ShipInfoFrame & ".upgradelabel");
UpgradeProgress := Get_Widget(ShipInfoFrame & ".upgrade");
CancelButton := Get_Widget(ShipInfoFrame & ".cancelupgrade");
-- Show or hide upgrade module info
if Player_Ship.Upgrade_Module = 0 then
Tcl.Tk.Ada.Grid.Grid_Remove(Label);
Tcl.Tk.Ada.Grid.Grid_Remove(UpgradeProgress);
Tcl.Tk.Ada.Grid.Grid_Remove(CancelButton);
else
UpgradeInfo :=
"Upgrade:" & Player_Ship.Modules(Player_Ship.Upgrade_Module).Name &
" ";
case Player_Ship.Modules(Player_Ship.Upgrade_Module).Upgrade_Action is
when DURABILITY =>
Append(UpgradeInfo, "(durability)");
MaxUpgrade :=
Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module)
.Proto_Index)
.Durability;
when MAX_VALUE =>
case Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module).Proto_Index)
.MType is
when ENGINE =>
Append(UpgradeInfo, "(power)");
MaxUpgrade :=
Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module)
.Proto_Index)
.MaxValue /
20;
when CABIN =>
Append(UpgradeInfo, "(quality)");
MaxUpgrade :=
Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module)
.Proto_Index)
.MaxValue;
when GUN | BATTERING_RAM =>
Append(UpgradeInfo, "(damage)");
MaxUpgrade :=
Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module)
.Proto_Index)
.MaxValue *
2;
when HULL =>
Append(UpgradeInfo, "(enlarge)");
MaxUpgrade :=
Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module)
.Proto_Index)
.MaxValue *
40;
when HARPOON_GUN =>
Append(UpgradeInfo, "(strength)");
MaxUpgrade :=
Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module)
.Proto_Index)
.MaxValue *
10;
when others =>
null;
end case;
when VALUE =>
case Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module).Proto_Index)
.MType is
when ENGINE =>
Append(UpgradeInfo, "(fuel usage)");
MaxUpgrade :=
Modules_List
(Player_Ship.Modules(Player_Ship.Upgrade_Module)
.Proto_Index)
.Value *
20;
when others =>
null;
end case;
when others =>
null;
end case;
MaxUpgrade :=
Integer
(Float(MaxUpgrade) * Float(New_Game_Settings.Upgrade_Cost_Bonus));
if MaxUpgrade = 0 then
MaxUpgrade := 1;
end if;
UpgradePercent :=
1.0 -
(Float
(Player_Ship.Modules(Player_Ship.Upgrade_Module)
.Upgrade_Progress) /
Float(MaxUpgrade));
ProgressBarStyle :=
(if UpgradePercent > 0.74 then
To_Unbounded_String(" -style green.Horizontal.TProgressbar")
elsif UpgradePercent > 0.24 then
To_Unbounded_String(" -style yellow.Horizontal.TProgressbar")
else To_Unbounded_String(" -style Horizontal.TProgressbar"));
configure
(UpgradeProgress,
"-value" & Float'Image(UpgradePercent) &
To_String(ProgressBarStyle));
configure(Label, "-text {" & To_String(UpgradeInfo) & "}");
Tcl.Tk.Ada.Grid.Grid(Label);
Tcl.Tk.Ada.Grid.Grid(UpgradeProgress);
Tcl.Tk.Ada.Grid.Grid(CancelButton);
end if;
-- Show or hide repair priority info
Label.Name := New_String(ShipInfoFrame & ".repairlabel");
CancelButton.Name := New_String(ShipInfoFrame & ".cancelpriority");
if Player_Ship.Repair_Module = 0 then
Tcl.Tk.Ada.Grid.Grid_Remove(Label);
Tcl.Tk.Ada.Grid.Grid_Remove(CancelButton);
else
configure
(Label,
"-text {Repair first: " &
To_String(Player_Ship.Modules(Player_Ship.Repair_Module).Name) &
"}");
Tcl.Tk.Ada.Grid.Grid(Label);
Tcl.Tk.Ada.Grid.Grid(CancelButton);
end if;
-- Show or hide destination info
Label.Name := New_String(ShipInfoFrame & ".destinationlabel");
CancelButton.Name := New_String(ShipInfoFrame & ".canceldestination");
if Player_Ship.Destination_X = 0 and Player_Ship.Destination_Y = 0 then
Tcl.Tk.Ada.Grid.Grid_Remove(Label);
Tcl.Tk.Ada.Grid.Grid_Remove(CancelButton);
else
if SkyMap(Player_Ship.Destination_X, Player_Ship.Destination_Y)
.BaseIndex >
0 then
configure
(Label,
"-text {Destination: " &
To_String
(Sky_Bases
(SkyMap
(Player_Ship.Destination_X, Player_Ship.Destination_Y)
.BaseIndex)
.Name) &
"}");
else
configure
(Label,
"-text {Destination: X:" &
Positive'Image(Player_Ship.Destination_X) & " Y:" &
Positive'Image(Player_Ship.Destination_Y) & "}");
end if;
Tcl.Tk.Ada.Grid.Grid(Label);
Tcl.Tk.Ada.Grid.Grid(CancelButton);
end if;
Label.Name := New_String(ShipInfoFrame & ".homelabel");
configure
(Label,
"-text {Home: " & To_String(Sky_Bases(Player_Ship.Home_Base).Name) &
"}");
Label.Name := New_String(ShipInfoFrame & ".weight");
configure
(Label,
"-text {Weight:" & Integer'Image(Count_Ship_Weight(Player_Ship)) &
"kg}");
Tcl_Eval(Get_Context, "update");
configure
(ShipCanvas, "-scrollregion [list " & BBox(ShipCanvas, "all") & "]");
Xview_Move_To(ShipCanvas, "0.0");
Yview_Move_To(ShipCanvas, "0.0");
-- Setting ship modules info
Ships.UI.Modules.UpdateModulesInfo;
-- Setting crew info
Ships.UI.Crew.UpdateCrewInfo;
-- Setting cargo info
Set(TypeBox, "All");
Generate(TypeBox, "<<ComboboxSelected>>");
-- Show ship info
Show_Screen("shipinfoframe");
return TCL_OK;
end Show_Ship_Info_Command;
-- ****o* SUI2/SUI2.Set_Ship_Name_Command
-- FUNCTION
-- Change name of the player's ship
-- PARAMETERS
-- ClientData - Custom data send to the command. Unused
-- Interp - Tcl interpreter in which command was executed.
-- Argc - Number of arguments passed to the command.
-- Argv - Values of arguments passed to the command.
-- RESULT
-- This function always return TCL_OK
-- COMMANDS
-- SetShipName shipname
-- Shipname is the new name for the player's ship
-- SOURCE
function Set_Ship_Name_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with
Convention => C;
-- ****
function Set_Ship_Name_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is
pragma Unreferenced(ClientData);
NameEntry: constant Ttk_Label :=
Get_Widget
(Main_Paned & ".shipinfoframe.general.canvas.frame.name", Interp);
begin
if Argc = 1 then
return TCL_OK;
end if;
Player_Ship.Name := To_Unbounded_String(CArgv.Arg(Argv, 1));
configure(NameEntry, "-text {Name: " & CArgv.Arg(Argv, 1) & "}");
return TCL_OK;
end Set_Ship_Name_Command;
-- ****o* SUI2/SUI2.Ship_Max_Min_Command
-- FUNCTION
-- Maximize or minimize the selected section of ship info
-- PARAMETERS
-- ClientData - Custom data send to the command. Unused
-- Interp - Tcl interpreter in which command was executed.
-- Argc - Number of arguments passed to the command. Unused
-- Argv - Values of arguments passed to the command.
-- RESULT
-- This function always return TCL_OK
-- COMMANDS
-- ShipMaxMin framename
-- Framename is name of the frame to maximize or minimize
-- SOURCE
function Ship_Max_Min_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with
Convention => C;
-- ****
function Ship_Max_Min_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is
pragma Unreferenced(ClientData, Argc);
type Frame_Info is record
Name: Unbounded_String;
Column: Natural range 0 .. 1;
Row: Natural range 0 .. 1;
end record;
Frames: constant array(1 .. 4) of Frame_Info :=
((To_Unbounded_String("general"), 0, 0),
(To_Unbounded_String("modules"), 0, 1),
(To_Unbounded_String("crew"), 1, 0),
(To_Unbounded_String("cargo"), 1, 1));
Frame: Ttk_Frame := Get_Widget(Main_Paned & ".shipinfoframe", Interp);
Button: constant Ttk_Button :=
Get_Widget
(Frame & "." & CArgv.Arg(Argv, 1) & ".canvas.frame.maxmin", Interp);
begin
if CArgv.Arg(Argv, 2) /= "show" then
Show_Frames_Loop :
for FrameInfo of Frames loop
Frame.Name :=
New_String
(Main_Paned & ".shipinfoframe." & To_String(FrameInfo.Name));
if To_String(FrameInfo.Name) /= CArgv.Arg(Argv, 1) then
Tcl.Tk.Ada.Grid.Grid(Frame);
else
Tcl.Tk.Ada.Grid.Grid_Configure
(Frame,
"-columnspan 1 -rowspan 1 -column" &
Natural'Image(FrameInfo.Column) & " -row" &
Natural'Image(FrameInfo.Row));
end if;
end loop Show_Frames_Loop;
configure
(Button,
"-text ""[format %c 0xf106]"" -command {ShipMaxMin " &
CArgv.Arg(Argv, 1) & " show}");
else
Hide_Frames_Loop :
for FrameInfo of Frames loop
Frame.Name :=
New_String
(Main_Paned & ".shipinfoframe." & To_String(FrameInfo.Name));
if To_String(FrameInfo.Name) /= CArgv.Arg(Argv, 1) then
Tcl.Tk.Ada.Grid.Grid_Remove(Frame);
else
Tcl.Tk.Ada.Grid.Grid_Configure
(Frame, "-columnspan 2 -rowspan 2 -row 0 -column 0");
end if;
end loop Hide_Frames_Loop;
configure
(Button,
"-text ""[format %c 0xf107]"" -command {ShipMaxMin " &
CArgv.Arg(Argv, 1) & " hide}");
end if;
return TCL_OK;
end Ship_Max_Min_Command;
procedure AddCommands is
begin
Add_Command("ShowShipInfo", Show_Ship_Info_Command'Access);
Add_Command("SetShipName", Set_Ship_Name_Command'Access);
Add_Command("ShipMaxMin", Ship_Max_Min_Command'Access);
Ships.UI.Modules.AddCommands;
Ships.UI.Crew.AddCommands;
Ships.UI.Cargo.AddCommands;
end AddCommands;
end Ships.UI;
|
[
{
"context": " --\n-- Copyright © 2012, Vadim Godunko <[email protected]> --\n-- Al",
"end": 824,
"score": 0.999886691570282,
"start": 811,
"tag": "NAME",
"value": "Vadim Godunko"
},
{
"context": " --\n-- Copyright © 2012, Vadim Godunko <[email protected]> --\n-- All rights reserved. ",
"end": 844,
"score": 0.9999316930770874,
"start": 826,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
source/amf/utp/amf-visitors-utp_iterators.ads
|
svn2github/matreshka
| 24 |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Utp.Coding_Rules;
with AMF.Utp.Data_Partitions;
with AMF.Utp.Data_Pools;
with AMF.Utp.Data_Selectors;
with AMF.Utp.Default_Applications;
with AMF.Utp.Defaults;
with AMF.Utp.Determ_Alts;
with AMF.Utp.Finish_Actions;
with AMF.Utp.Get_Timezone_Actions;
with AMF.Utp.Literal_Anies;
with AMF.Utp.Literal_Any_Or_Nulls;
with AMF.Utp.Log_Actions;
with AMF.Utp.Managed_Elements;
with AMF.Utp.Read_Timer_Actions;
with AMF.Utp.SUTs;
with AMF.Utp.Set_Timezone_Actions;
with AMF.Utp.Start_Timer_Actions;
with AMF.Utp.Stop_Timer_Actions;
with AMF.Utp.Test_Cases;
with AMF.Utp.Test_Components;
with AMF.Utp.Test_Contexts;
with AMF.Utp.Test_Log_Applications;
with AMF.Utp.Test_Logs;
with AMF.Utp.Test_Objectives;
with AMF.Utp.Test_Suites;
with AMF.Utp.Time_Out_Actions;
with AMF.Utp.Time_Out_Messages;
with AMF.Utp.Time_Outs;
with AMF.Utp.Timer_Running_Actions;
with AMF.Utp.Validation_Actions;
package AMF.Visitors.Utp_Iterators is
pragma Preelaborate;
type Utp_Iterator is limited interface and AMF.Visitors.Abstract_Iterator;
not overriding procedure Visit_Coding_Rule
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Data_Partition
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Data_Partitions.Utp_Data_Partition_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Data_Pool
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Data_Pools.Utp_Data_Pool_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Data_Selector
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Data_Selectors.Utp_Data_Selector_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Default
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Defaults.Utp_Default_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Default_Application
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Default_Applications.Utp_Default_Application_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Determ_Alt
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Determ_Alts.Utp_Determ_Alt_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Finish_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Finish_Actions.Utp_Finish_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Get_Timezone_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Get_Timezone_Actions.Utp_Get_Timezone_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Literal_Any
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Literal_Anies.Utp_Literal_Any_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Literal_Any_Or_Null
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Literal_Any_Or_Nulls.Utp_Literal_Any_Or_Null_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Log_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Log_Actions.Utp_Log_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Managed_Element
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Managed_Elements.Utp_Managed_Element_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Read_Timer_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Read_Timer_Actions.Utp_Read_Timer_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_SUT
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.SUTs.Utp_SUT_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Set_Timezone_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Set_Timezone_Actions.Utp_Set_Timezone_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Start_Timer_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Start_Timer_Actions.Utp_Start_Timer_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Stop_Timer_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Stop_Timer_Actions.Utp_Stop_Timer_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Test_Case
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Test_Cases.Utp_Test_Case_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Test_Component
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Test_Components.Utp_Test_Component_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Test_Context
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Test_Contexts.Utp_Test_Context_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Test_Log
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Test_Logs.Utp_Test_Log_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Test_Log_Application
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Test_Log_Applications.Utp_Test_Log_Application_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Test_Objective
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Test_Objectives.Utp_Test_Objective_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Test_Suite
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Test_Suites.Utp_Test_Suite_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Time_Out
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Time_Outs.Utp_Time_Out_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Time_Out_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Time_Out_Actions.Utp_Time_Out_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Time_Out_Message
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Time_Out_Messages.Utp_Time_Out_Message_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Timer_Running_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Timer_Running_Actions.Utp_Timer_Running_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Validation_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Validation_Actions.Utp_Validation_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
end AMF.Visitors.Utp_Iterators;
|
12588
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Utp.Coding_Rules;
with AMF.Utp.Data_Partitions;
with AMF.Utp.Data_Pools;
with AMF.Utp.Data_Selectors;
with AMF.Utp.Default_Applications;
with AMF.Utp.Defaults;
with AMF.Utp.Determ_Alts;
with AMF.Utp.Finish_Actions;
with AMF.Utp.Get_Timezone_Actions;
with AMF.Utp.Literal_Anies;
with AMF.Utp.Literal_Any_Or_Nulls;
with AMF.Utp.Log_Actions;
with AMF.Utp.Managed_Elements;
with AMF.Utp.Read_Timer_Actions;
with AMF.Utp.SUTs;
with AMF.Utp.Set_Timezone_Actions;
with AMF.Utp.Start_Timer_Actions;
with AMF.Utp.Stop_Timer_Actions;
with AMF.Utp.Test_Cases;
with AMF.Utp.Test_Components;
with AMF.Utp.Test_Contexts;
with AMF.Utp.Test_Log_Applications;
with AMF.Utp.Test_Logs;
with AMF.Utp.Test_Objectives;
with AMF.Utp.Test_Suites;
with AMF.Utp.Time_Out_Actions;
with AMF.Utp.Time_Out_Messages;
with AMF.Utp.Time_Outs;
with AMF.Utp.Timer_Running_Actions;
with AMF.Utp.Validation_Actions;
package AMF.Visitors.Utp_Iterators is
pragma Preelaborate;
type Utp_Iterator is limited interface and AMF.Visitors.Abstract_Iterator;
not overriding procedure Visit_Coding_Rule
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Data_Partition
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Data_Partitions.Utp_Data_Partition_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Data_Pool
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Data_Pools.Utp_Data_Pool_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Data_Selector
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Data_Selectors.Utp_Data_Selector_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Default
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Defaults.Utp_Default_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Default_Application
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Default_Applications.Utp_Default_Application_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Determ_Alt
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Determ_Alts.Utp_Determ_Alt_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Finish_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Finish_Actions.Utp_Finish_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Get_Timezone_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Get_Timezone_Actions.Utp_Get_Timezone_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Literal_Any
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Literal_Anies.Utp_Literal_Any_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Literal_Any_Or_Null
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Literal_Any_Or_Nulls.Utp_Literal_Any_Or_Null_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Log_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Log_Actions.Utp_Log_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Managed_Element
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Managed_Elements.Utp_Managed_Element_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Read_Timer_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Read_Timer_Actions.Utp_Read_Timer_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_SUT
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.SUTs.Utp_SUT_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Set_Timezone_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Set_Timezone_Actions.Utp_Set_Timezone_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Start_Timer_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Start_Timer_Actions.Utp_Start_Timer_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Stop_Timer_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Stop_Timer_Actions.Utp_Stop_Timer_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Test_Case
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Test_Cases.Utp_Test_Case_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Test_Component
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Test_Components.Utp_Test_Component_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Test_Context
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Test_Contexts.Utp_Test_Context_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Test_Log
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Test_Logs.Utp_Test_Log_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Test_Log_Application
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Test_Log_Applications.Utp_Test_Log_Application_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Test_Objective
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Test_Objectives.Utp_Test_Objective_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Test_Suite
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Test_Suites.Utp_Test_Suite_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Time_Out
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Time_Outs.Utp_Time_Out_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Time_Out_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Time_Out_Actions.Utp_Time_Out_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Time_Out_Message
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Time_Out_Messages.Utp_Time_Out_Message_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Timer_Running_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Timer_Running_Actions.Utp_Timer_Running_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Validation_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Validation_Actions.Utp_Validation_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
end AMF.Visitors.Utp_Iterators;
| true |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Utp.Coding_Rules;
with AMF.Utp.Data_Partitions;
with AMF.Utp.Data_Pools;
with AMF.Utp.Data_Selectors;
with AMF.Utp.Default_Applications;
with AMF.Utp.Defaults;
with AMF.Utp.Determ_Alts;
with AMF.Utp.Finish_Actions;
with AMF.Utp.Get_Timezone_Actions;
with AMF.Utp.Literal_Anies;
with AMF.Utp.Literal_Any_Or_Nulls;
with AMF.Utp.Log_Actions;
with AMF.Utp.Managed_Elements;
with AMF.Utp.Read_Timer_Actions;
with AMF.Utp.SUTs;
with AMF.Utp.Set_Timezone_Actions;
with AMF.Utp.Start_Timer_Actions;
with AMF.Utp.Stop_Timer_Actions;
with AMF.Utp.Test_Cases;
with AMF.Utp.Test_Components;
with AMF.Utp.Test_Contexts;
with AMF.Utp.Test_Log_Applications;
with AMF.Utp.Test_Logs;
with AMF.Utp.Test_Objectives;
with AMF.Utp.Test_Suites;
with AMF.Utp.Time_Out_Actions;
with AMF.Utp.Time_Out_Messages;
with AMF.Utp.Time_Outs;
with AMF.Utp.Timer_Running_Actions;
with AMF.Utp.Validation_Actions;
package AMF.Visitors.Utp_Iterators is
pragma Preelaborate;
type Utp_Iterator is limited interface and AMF.Visitors.Abstract_Iterator;
not overriding procedure Visit_Coding_Rule
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Data_Partition
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Data_Partitions.Utp_Data_Partition_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Data_Pool
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Data_Pools.Utp_Data_Pool_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Data_Selector
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Data_Selectors.Utp_Data_Selector_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Default
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Defaults.Utp_Default_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Default_Application
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Default_Applications.Utp_Default_Application_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Determ_Alt
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Determ_Alts.Utp_Determ_Alt_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Finish_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Finish_Actions.Utp_Finish_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Get_Timezone_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Get_Timezone_Actions.Utp_Get_Timezone_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Literal_Any
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Literal_Anies.Utp_Literal_Any_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Literal_Any_Or_Null
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Literal_Any_Or_Nulls.Utp_Literal_Any_Or_Null_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Log_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Log_Actions.Utp_Log_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Managed_Element
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Managed_Elements.Utp_Managed_Element_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Read_Timer_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Read_Timer_Actions.Utp_Read_Timer_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_SUT
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.SUTs.Utp_SUT_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Set_Timezone_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Set_Timezone_Actions.Utp_Set_Timezone_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Start_Timer_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Start_Timer_Actions.Utp_Start_Timer_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Stop_Timer_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Stop_Timer_Actions.Utp_Stop_Timer_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Test_Case
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Test_Cases.Utp_Test_Case_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Test_Component
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Test_Components.Utp_Test_Component_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Test_Context
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Test_Contexts.Utp_Test_Context_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Test_Log
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Test_Logs.Utp_Test_Log_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Test_Log_Application
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Test_Log_Applications.Utp_Test_Log_Application_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Test_Objective
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Test_Objectives.Utp_Test_Objective_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Test_Suite
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Test_Suites.Utp_Test_Suite_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Time_Out
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Time_Outs.Utp_Time_Out_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Time_Out_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Time_Out_Actions.Utp_Time_Out_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Time_Out_Message
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Time_Out_Messages.Utp_Time_Out_Message_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Timer_Running_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Timer_Running_Actions.Utp_Timer_Running_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
not overriding procedure Visit_Validation_Action
(Self : in out Utp_Iterator;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Element : not null AMF.Utp.Validation_Actions.Utp_Validation_Action_Access;
Control : in out AMF.Visitors.Traverse_Control) is null;
end AMF.Visitors.Utp_Iterators;
|
[
{
"context": " --\n-- Copyright (c) 2015, John Leimon --\n-- ",
"end": 116,
"score": 0.9997727870941162,
"start": 105,
"tag": "NAME",
"value": "John Leimon"
}
] |
spec/spi.ads
|
0xA1/pi-spi
| 0 |
-- --
-- Copyright (c) 2015, John Leimon --
-- --
-- Permission to use, copy, modify, and/or distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
-- --
with Interfaces.C; use Interfaces.C;
with stdint_h; use stdint_h;
with stddef_h; use stddef_h;
with Interfaces.C.Strings;
package SPI is
type Mode_Type is new uint32_t;
Mode_Loop : constant Mode_Type := 16#0000_0020#;
Mode_CPHA : constant Mode_Type := 16#0000_0001#;
Mode_CPOL : constant Mode_Type := 16#0000_0002#;
Mode_LSB_First : constant Mode_Type := 16#0000_0008#;
Mode_CS_High : constant Mode_Type := 16#0000_0004#;
Mode_No_CS : constant Mode_Type := 16#0000_0040#;
Mode_3Wire : constant Mode_Type := 16#0000_0010#;
Mode_Ready : constant Mode_Type := 16#0000_0080#;
Mode_TX_Dual : constant Mode_Type := 16#0000_0100#;
Mode_TX_Quad : constant Mode_Type := 16#0000_0200#;
Mode_RX_Dual : constant Mode_Type := 16#0000_0400#;
Mode_RX_Quad : constant Mode_Type := 16#0000_0800#;
Error_Mode : exception;
Error_Bits : exception;
Error_Freq : exception;
Error_Device : exception;
Error_Xfer : exception;
Error_Unknown : exception;
type SPI_Device is record
fd : aliased int; -- ../include/spi_driver.h:32
clk_freq : aliased uint32_t; -- ../include/spi_driver.h:33
mode : aliased uint32_t; -- ../include/spi_driver.h:34
c_delay : aliased uint16_t; -- ../include/spi_driver.h:35
bits : aliased uint8_t; -- ../include/spi_driver.h:36
end record;
pragma Convention (C_Pass_By_Copy, SPI_Device); -- ../include/spi_driver.h:31
procedure Open(device : access SPI_Device;
device_path : Interfaces.C.Strings.chars_ptr;
mode : Mode_Type;
bits : uint8_t;
freq : uint32_t);
procedure Transfer(device : access SPI_Device;
transmit_buffer : access uint8_t;
receive_buffer : access uint8_t;
c_delay : uint16_t;
length : stddef_h.size_t);
procedure Close(device : access SPI_Device);
private
-- @brief Initialize and configure a SPI device.
-- @param[in,out] spi Address of a SPI device structure.
-- @param[in] dev Full path to SPI device.
-- @param[in] mode SPI_MODE_LOOP Loopback
-- SPI_MODE_CPHA Clock Phase
-- SPI_MODE_CPOL Clock Polarity
-- SPI_MODE_LSB_FIRST Least Significant Bit First
-- SPI_MODE_CS_HIGH Chip Select Active High
-- SPI_MODE_NO_CS No Chip Select
-- SPI_MODE_3WIRE SI/SO Signals Shared
-- SPI_MODE_READY Slave may pull down to pause
-- SPI_MODE_TX_DUAL Dual transfer
-- SPI_MODE_TX_QUAD Quad transfer
-- @param[in] bits Number of bits in a transfer
-- @param[in] freq Clock frequency (Hz)
-- @return SPI_SUCCESS SPI device opened successfully
-- @return SPI_ERROR_MODE Error: Cannot set mode
-- @return SPI_ERROR_BITS Error: Cannot set bits
-- @return SPI_ERROR_FREQ Error: Cannot set frequency
-- @return SPI_ERROR_DEV Error: Cannot open device
--
function c_open
(device : access SPI_Device;
device_path : Interfaces.C.Strings.chars_ptr;
mode : uint32_t;
bits : uint8_t;
freq : uint32_t) return int; -- ../include/pi-spi_driver.h:85
pragma Import (CPP, c_open, "_Z15spi_driver_openP6spidevPcjhj");
-- @brief Send and receive some data.
-- @param[in,out] spi Address of a SPI device structure.
-- @param[in] transmit_buffer Address of the first byte to transmit
-- @param[out] receive_buffer Address to write data read in from SPI
-- @param[in] delay Delay in us before the transmission
-- @param[in] length Number of bytes to read/write
-- @return SPI_SUCCESS Operation completed successfully
-- @return SPI_ERROR_XFER Error: Could not send data
--
function c_transfer
(device : access SPI_Device;
transmit_buffer : access uint8_t;
receive_buffer : access uint8_t;
c_delay : uint16_t;
length : stddef_h.size_t) return int; -- ../include/spi_driver.h:101
pragma Import (CPP, c_transfer, "_Z19spi_driver_transferP6spidevPhS1_tj");
-- @brief Close SPI device.
-- @param[in,out] spi Address of a SPI device structure.
--
procedure c_close (device : access SPI_Device); -- ../include/spi_driver.h:111
pragma Import (CPP, c_close, "_Z16spi_driver_closeP6spidev");
end SPI;
|
29189
|
-- --
-- Copyright (c) 2015, <NAME> --
-- --
-- Permission to use, copy, modify, and/or distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
-- --
with Interfaces.C; use Interfaces.C;
with stdint_h; use stdint_h;
with stddef_h; use stddef_h;
with Interfaces.C.Strings;
package SPI is
type Mode_Type is new uint32_t;
Mode_Loop : constant Mode_Type := 16#0000_0020#;
Mode_CPHA : constant Mode_Type := 16#0000_0001#;
Mode_CPOL : constant Mode_Type := 16#0000_0002#;
Mode_LSB_First : constant Mode_Type := 16#0000_0008#;
Mode_CS_High : constant Mode_Type := 16#0000_0004#;
Mode_No_CS : constant Mode_Type := 16#0000_0040#;
Mode_3Wire : constant Mode_Type := 16#0000_0010#;
Mode_Ready : constant Mode_Type := 16#0000_0080#;
Mode_TX_Dual : constant Mode_Type := 16#0000_0100#;
Mode_TX_Quad : constant Mode_Type := 16#0000_0200#;
Mode_RX_Dual : constant Mode_Type := 16#0000_0400#;
Mode_RX_Quad : constant Mode_Type := 16#0000_0800#;
Error_Mode : exception;
Error_Bits : exception;
Error_Freq : exception;
Error_Device : exception;
Error_Xfer : exception;
Error_Unknown : exception;
type SPI_Device is record
fd : aliased int; -- ../include/spi_driver.h:32
clk_freq : aliased uint32_t; -- ../include/spi_driver.h:33
mode : aliased uint32_t; -- ../include/spi_driver.h:34
c_delay : aliased uint16_t; -- ../include/spi_driver.h:35
bits : aliased uint8_t; -- ../include/spi_driver.h:36
end record;
pragma Convention (C_Pass_By_Copy, SPI_Device); -- ../include/spi_driver.h:31
procedure Open(device : access SPI_Device;
device_path : Interfaces.C.Strings.chars_ptr;
mode : Mode_Type;
bits : uint8_t;
freq : uint32_t);
procedure Transfer(device : access SPI_Device;
transmit_buffer : access uint8_t;
receive_buffer : access uint8_t;
c_delay : uint16_t;
length : stddef_h.size_t);
procedure Close(device : access SPI_Device);
private
-- @brief Initialize and configure a SPI device.
-- @param[in,out] spi Address of a SPI device structure.
-- @param[in] dev Full path to SPI device.
-- @param[in] mode SPI_MODE_LOOP Loopback
-- SPI_MODE_CPHA Clock Phase
-- SPI_MODE_CPOL Clock Polarity
-- SPI_MODE_LSB_FIRST Least Significant Bit First
-- SPI_MODE_CS_HIGH Chip Select Active High
-- SPI_MODE_NO_CS No Chip Select
-- SPI_MODE_3WIRE SI/SO Signals Shared
-- SPI_MODE_READY Slave may pull down to pause
-- SPI_MODE_TX_DUAL Dual transfer
-- SPI_MODE_TX_QUAD Quad transfer
-- @param[in] bits Number of bits in a transfer
-- @param[in] freq Clock frequency (Hz)
-- @return SPI_SUCCESS SPI device opened successfully
-- @return SPI_ERROR_MODE Error: Cannot set mode
-- @return SPI_ERROR_BITS Error: Cannot set bits
-- @return SPI_ERROR_FREQ Error: Cannot set frequency
-- @return SPI_ERROR_DEV Error: Cannot open device
--
function c_open
(device : access SPI_Device;
device_path : Interfaces.C.Strings.chars_ptr;
mode : uint32_t;
bits : uint8_t;
freq : uint32_t) return int; -- ../include/pi-spi_driver.h:85
pragma Import (CPP, c_open, "_Z15spi_driver_openP6spidevPcjhj");
-- @brief Send and receive some data.
-- @param[in,out] spi Address of a SPI device structure.
-- @param[in] transmit_buffer Address of the first byte to transmit
-- @param[out] receive_buffer Address to write data read in from SPI
-- @param[in] delay Delay in us before the transmission
-- @param[in] length Number of bytes to read/write
-- @return SPI_SUCCESS Operation completed successfully
-- @return SPI_ERROR_XFER Error: Could not send data
--
function c_transfer
(device : access SPI_Device;
transmit_buffer : access uint8_t;
receive_buffer : access uint8_t;
c_delay : uint16_t;
length : stddef_h.size_t) return int; -- ../include/spi_driver.h:101
pragma Import (CPP, c_transfer, "_Z19spi_driver_transferP6spidevPhS1_tj");
-- @brief Close SPI device.
-- @param[in,out] spi Address of a SPI device structure.
--
procedure c_close (device : access SPI_Device); -- ../include/spi_driver.h:111
pragma Import (CPP, c_close, "_Z16spi_driver_closeP6spidev");
end SPI;
| true |
-- --
-- Copyright (c) 2015, PI:NAME:<NAME>END_PI --
-- --
-- Permission to use, copy, modify, and/or distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
-- --
with Interfaces.C; use Interfaces.C;
with stdint_h; use stdint_h;
with stddef_h; use stddef_h;
with Interfaces.C.Strings;
package SPI is
type Mode_Type is new uint32_t;
Mode_Loop : constant Mode_Type := 16#0000_0020#;
Mode_CPHA : constant Mode_Type := 16#0000_0001#;
Mode_CPOL : constant Mode_Type := 16#0000_0002#;
Mode_LSB_First : constant Mode_Type := 16#0000_0008#;
Mode_CS_High : constant Mode_Type := 16#0000_0004#;
Mode_No_CS : constant Mode_Type := 16#0000_0040#;
Mode_3Wire : constant Mode_Type := 16#0000_0010#;
Mode_Ready : constant Mode_Type := 16#0000_0080#;
Mode_TX_Dual : constant Mode_Type := 16#0000_0100#;
Mode_TX_Quad : constant Mode_Type := 16#0000_0200#;
Mode_RX_Dual : constant Mode_Type := 16#0000_0400#;
Mode_RX_Quad : constant Mode_Type := 16#0000_0800#;
Error_Mode : exception;
Error_Bits : exception;
Error_Freq : exception;
Error_Device : exception;
Error_Xfer : exception;
Error_Unknown : exception;
type SPI_Device is record
fd : aliased int; -- ../include/spi_driver.h:32
clk_freq : aliased uint32_t; -- ../include/spi_driver.h:33
mode : aliased uint32_t; -- ../include/spi_driver.h:34
c_delay : aliased uint16_t; -- ../include/spi_driver.h:35
bits : aliased uint8_t; -- ../include/spi_driver.h:36
end record;
pragma Convention (C_Pass_By_Copy, SPI_Device); -- ../include/spi_driver.h:31
procedure Open(device : access SPI_Device;
device_path : Interfaces.C.Strings.chars_ptr;
mode : Mode_Type;
bits : uint8_t;
freq : uint32_t);
procedure Transfer(device : access SPI_Device;
transmit_buffer : access uint8_t;
receive_buffer : access uint8_t;
c_delay : uint16_t;
length : stddef_h.size_t);
procedure Close(device : access SPI_Device);
private
-- @brief Initialize and configure a SPI device.
-- @param[in,out] spi Address of a SPI device structure.
-- @param[in] dev Full path to SPI device.
-- @param[in] mode SPI_MODE_LOOP Loopback
-- SPI_MODE_CPHA Clock Phase
-- SPI_MODE_CPOL Clock Polarity
-- SPI_MODE_LSB_FIRST Least Significant Bit First
-- SPI_MODE_CS_HIGH Chip Select Active High
-- SPI_MODE_NO_CS No Chip Select
-- SPI_MODE_3WIRE SI/SO Signals Shared
-- SPI_MODE_READY Slave may pull down to pause
-- SPI_MODE_TX_DUAL Dual transfer
-- SPI_MODE_TX_QUAD Quad transfer
-- @param[in] bits Number of bits in a transfer
-- @param[in] freq Clock frequency (Hz)
-- @return SPI_SUCCESS SPI device opened successfully
-- @return SPI_ERROR_MODE Error: Cannot set mode
-- @return SPI_ERROR_BITS Error: Cannot set bits
-- @return SPI_ERROR_FREQ Error: Cannot set frequency
-- @return SPI_ERROR_DEV Error: Cannot open device
--
function c_open
(device : access SPI_Device;
device_path : Interfaces.C.Strings.chars_ptr;
mode : uint32_t;
bits : uint8_t;
freq : uint32_t) return int; -- ../include/pi-spi_driver.h:85
pragma Import (CPP, c_open, "_Z15spi_driver_openP6spidevPcjhj");
-- @brief Send and receive some data.
-- @param[in,out] spi Address of a SPI device structure.
-- @param[in] transmit_buffer Address of the first byte to transmit
-- @param[out] receive_buffer Address to write data read in from SPI
-- @param[in] delay Delay in us before the transmission
-- @param[in] length Number of bytes to read/write
-- @return SPI_SUCCESS Operation completed successfully
-- @return SPI_ERROR_XFER Error: Could not send data
--
function c_transfer
(device : access SPI_Device;
transmit_buffer : access uint8_t;
receive_buffer : access uint8_t;
c_delay : uint16_t;
length : stddef_h.size_t) return int; -- ../include/spi_driver.h:101
pragma Import (CPP, c_transfer, "_Z19spi_driver_transferP6spidevPhS1_tj");
-- @brief Close SPI device.
-- @param[in,out] spi Address of a SPI device structure.
--
procedure c_close (device : access SPI_Device); -- ../include/spi_driver.h:111
pragma Import (CPP, c_close, "_Z16spi_driver_closeP6spidev");
end SPI;
|
[
{
"context": "onent children\r\n-- Copyright (C) 2011, 2012, 2014 Stephane Carrez\r\n-- Written by Stephane Carrez (Stephane.Carrez@",
"end": 211,
"score": 0.9998441934585571,
"start": 196,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": ") 2011, 2012, 2014 Stephane Carrez\r\n-- Written by Stephane Carrez ([email protected])\r\n--\r\n-- Licensed und",
"end": 243,
"score": 0.9998787045478821,
"start": 228,
"tag": "NAME",
"value": "Stephane Carrez"
},
{
"context": " Stephane Carrez\r\n-- Written by Stephane Carrez ([email protected])\r\n--\r\n-- Licensed under the Apache License, Vers",
"end": 270,
"score": 0.9999305009841919,
"start": 245,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
src/asf-components-utils-escapes.adb
|
jquorning/ada-asf
| 12 |
-----------------------------------------------------------------------
-- components-utils-escape -- Escape generated content produced by component children
-- Copyright (C) 2011, 2012, 2014 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Strings.Transforms;
package body ASF.Components.Utils.Escapes is
-- ------------------------------
-- Write the content that was collected by rendering the inner children.
-- Escape the content using Javascript escape rules.
-- ------------------------------
procedure Write_Content (UI : in UIEscape;
Writer : in out Contexts.Writer.Response_Writer'Class;
Content : in String;
Context : in out ASF.Contexts.Faces.Faces_Context'Class) is
Result : Ada.Strings.Unbounded.Unbounded_String;
Mode : constant String := UI.Get_Attribute (ESCAPE_MODE_NAME, Context);
begin
if Mode = "xml" then
Util.Strings.Transforms.Escape_Xml (Content => Content,
Into => Result);
else
Util.Strings.Transforms.Escape_Java (Content => Content,
Into => Result);
end if;
Writer.Write (Result);
end Write_Content;
-- ------------------------------
-- Encode the children components in the javascript queue.
-- ------------------------------
overriding
procedure Encode_Children (UI : in UIEscape;
Context : in out ASF.Contexts.Faces.Faces_Context'Class) is
procedure Process (Content : in String);
procedure Process (Content : in String) is
Writer : constant Contexts.Writer.Response_Writer_Access := Context.Get_Response_Writer;
begin
UIEscape'Class (UI).Write_Content (Writer.all, Content, Context);
end Process;
begin
UI.Wrap_Encode_Children (Context, Process'Access);
end Encode_Children;
end ASF.Components.Utils.Escapes;
|
16800
|
-----------------------------------------------------------------------
-- components-utils-escape -- Escape generated content produced by component children
-- Copyright (C) 2011, 2012, 2014 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Strings.Transforms;
package body ASF.Components.Utils.Escapes is
-- ------------------------------
-- Write the content that was collected by rendering the inner children.
-- Escape the content using Javascript escape rules.
-- ------------------------------
procedure Write_Content (UI : in UIEscape;
Writer : in out Contexts.Writer.Response_Writer'Class;
Content : in String;
Context : in out ASF.Contexts.Faces.Faces_Context'Class) is
Result : Ada.Strings.Unbounded.Unbounded_String;
Mode : constant String := UI.Get_Attribute (ESCAPE_MODE_NAME, Context);
begin
if Mode = "xml" then
Util.Strings.Transforms.Escape_Xml (Content => Content,
Into => Result);
else
Util.Strings.Transforms.Escape_Java (Content => Content,
Into => Result);
end if;
Writer.Write (Result);
end Write_Content;
-- ------------------------------
-- Encode the children components in the javascript queue.
-- ------------------------------
overriding
procedure Encode_Children (UI : in UIEscape;
Context : in out ASF.Contexts.Faces.Faces_Context'Class) is
procedure Process (Content : in String);
procedure Process (Content : in String) is
Writer : constant Contexts.Writer.Response_Writer_Access := Context.Get_Response_Writer;
begin
UIEscape'Class (UI).Write_Content (Writer.all, Content, Context);
end Process;
begin
UI.Wrap_Encode_Children (Context, Process'Access);
end Encode_Children;
end ASF.Components.Utils.Escapes;
| true |
-----------------------------------------------------------------------
-- components-utils-escape -- Escape generated content produced by component children
-- Copyright (C) 2011, 2012, 2014 PI:NAME:<NAME>END_PI
-- Written by PI:NAME:<NAME>END_PI (PI:EMAIL:<EMAIL>END_PI)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Strings.Transforms;
package body ASF.Components.Utils.Escapes is
-- ------------------------------
-- Write the content that was collected by rendering the inner children.
-- Escape the content using Javascript escape rules.
-- ------------------------------
procedure Write_Content (UI : in UIEscape;
Writer : in out Contexts.Writer.Response_Writer'Class;
Content : in String;
Context : in out ASF.Contexts.Faces.Faces_Context'Class) is
Result : Ada.Strings.Unbounded.Unbounded_String;
Mode : constant String := UI.Get_Attribute (ESCAPE_MODE_NAME, Context);
begin
if Mode = "xml" then
Util.Strings.Transforms.Escape_Xml (Content => Content,
Into => Result);
else
Util.Strings.Transforms.Escape_Java (Content => Content,
Into => Result);
end if;
Writer.Write (Result);
end Write_Content;
-- ------------------------------
-- Encode the children components in the javascript queue.
-- ------------------------------
overriding
procedure Encode_Children (UI : in UIEscape;
Context : in out ASF.Contexts.Faces.Faces_Context'Class) is
procedure Process (Content : in String);
procedure Process (Content : in String) is
Writer : constant Contexts.Writer.Response_Writer_Access := Context.Get_Response_Writer;
begin
UIEscape'Class (UI).Write_Content (Writer.all, Content, Context);
end Process;
begin
UI.Wrap_Encode_Children (Context, Process'Access);
end Encode_Children;
end ASF.Components.Utils.Escapes;
|
[
{
"context": " --\n-- Copyright © 2012-2015, Vadim Godunko <[email protected]> --\n-- All rig",
"end": 829,
"score": 0.9998899102210999,
"start": 816,
"tag": "NAME",
"value": "Vadim Godunko"
},
{
"context": " --\n-- Copyright © 2012-2015, Vadim Godunko <[email protected]> --\n-- All rights reserved. ",
"end": 849,
"score": 0.999931275844574,
"start": 831,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
source/league/ucd/matreshka-internals-unicode-ucd-core_0101.ads
|
svn2github/matreshka
| 24 |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2015, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
pragma Restrictions (No_Elaboration_Code);
-- GNAT: enforce generation of preinitialized data section instead of
-- generation of elaboration code.
package Matreshka.Internals.Unicode.Ucd.Core_0101 is
pragma Preelaborate;
Group_0101 : aliased constant Core_Second_Stage
:= (16#00# .. 16#02# => -- 010100 .. 010102
(Other_Punctuation, Neutral,
Other, Other, Other, Break_After,
(Grapheme_Base => True,
others => False)),
16#03# .. 16#06# => -- 010103 .. 010106
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#07# .. 16#33# => -- 010107 .. 010133
(Other_Number, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#34# .. 16#36# => -- 010134 .. 010136
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#40# .. 16#74# => -- 010140 .. 010174
(Letter_Number, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#75# .. 16#78# => -- 010175 .. 010178
(Other_Number, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#8A# .. 16#8B# => -- 01018A .. 01018B
(Other_Number, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#8D# .. 16#8F# => -- 01018D .. 01018F
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#9C# .. 16#9F# => -- 01019C .. 01019F
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#A1# .. 16#CF# => -- 0101A1 .. 0101CF
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#FD# => -- 0101FD
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#FE# .. 16#FF# => -- 0101FE .. 0101FF
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
others =>
(Other_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)));
end Matreshka.Internals.Unicode.Ucd.Core_0101;
|
1654
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2015, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
pragma Restrictions (No_Elaboration_Code);
-- GNAT: enforce generation of preinitialized data section instead of
-- generation of elaboration code.
package Matreshka.Internals.Unicode.Ucd.Core_0101 is
pragma Preelaborate;
Group_0101 : aliased constant Core_Second_Stage
:= (16#00# .. 16#02# => -- 010100 .. 010102
(Other_Punctuation, Neutral,
Other, Other, Other, Break_After,
(Grapheme_Base => True,
others => False)),
16#03# .. 16#06# => -- 010103 .. 010106
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#07# .. 16#33# => -- 010107 .. 010133
(Other_Number, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#34# .. 16#36# => -- 010134 .. 010136
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#40# .. 16#74# => -- 010140 .. 010174
(Letter_Number, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#75# .. 16#78# => -- 010175 .. 010178
(Other_Number, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#8A# .. 16#8B# => -- 01018A .. 01018B
(Other_Number, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#8D# .. 16#8F# => -- 01018D .. 01018F
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#9C# .. 16#9F# => -- 01019C .. 01019F
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#A1# .. 16#CF# => -- 0101A1 .. 0101CF
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#FD# => -- 0101FD
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#FE# .. 16#FF# => -- 0101FE .. 0101FF
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
others =>
(Other_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)));
end Matreshka.Internals.Unicode.Ucd.Core_0101;
| true |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2015, PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
pragma Restrictions (No_Elaboration_Code);
-- GNAT: enforce generation of preinitialized data section instead of
-- generation of elaboration code.
package Matreshka.Internals.Unicode.Ucd.Core_0101 is
pragma Preelaborate;
Group_0101 : aliased constant Core_Second_Stage
:= (16#00# .. 16#02# => -- 010100 .. 010102
(Other_Punctuation, Neutral,
Other, Other, Other, Break_After,
(Grapheme_Base => True,
others => False)),
16#03# .. 16#06# => -- 010103 .. 010106
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#07# .. 16#33# => -- 010107 .. 010133
(Other_Number, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#34# .. 16#36# => -- 010134 .. 010136
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#40# .. 16#74# => -- 010140 .. 010174
(Letter_Number, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#75# .. 16#78# => -- 010175 .. 010178
(Other_Number, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#8A# .. 16#8B# => -- 01018A .. 01018B
(Other_Number, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#8D# .. 16#8F# => -- 01018D .. 01018F
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#9C# .. 16#9F# => -- 01019C .. 01019F
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#A1# .. 16#CF# => -- 0101A1 .. 0101CF
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#FD# => -- 0101FD
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#FE# .. 16#FF# => -- 0101FE .. 0101FF
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
others =>
(Other_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)));
end Matreshka.Internals.Unicode.Ucd.Core_0101;
|
[
{
"context": " --\n-- Copyright © 2012, Vadim Godunko <[email protected]> --\n-- Al",
"end": 824,
"score": 0.9998862147331238,
"start": 811,
"tag": "NAME",
"value": "Vadim Godunko"
},
{
"context": " --\n-- Copyright © 2012, Vadim Godunko <[email protected]> --\n-- All rights reserved. ",
"end": 844,
"score": 0.999931812286377,
"start": 826,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
source/amf/utp/amf-internals-tables-utp_reflection.adb
|
svn2github/matreshka
| 24 |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Holders.Elements;
with AMF.Holders.Unlimited_Naturals;
with AMF.Internals.Helpers;
with AMF.Internals.Holders.UML_Holders;
with AMF.Internals.Tables.UTP_Element_Table;
with AMF.Internals.Tables.UTP_Types;
with AMF.Internals.Tables.Utp_Metamodel;
with AMF.String_Collections.Internals;
with AMF.UML.Accept_Event_Actions;
with AMF.UML.Behaviored_Classifiers;
with AMF.UML.Behaviors;
with AMF.UML.Call_Operation_Actions;
with AMF.UML.Classifiers;
with AMF.UML.Combined_Fragments;
with AMF.UML.Dependencies;
with AMF.UML.Elements;
with AMF.UML.Invocation_Actions;
with AMF.UML.Literal_Specifications;
with AMF.UML.Messages;
with AMF.UML.Namespaces;
with AMF.UML.Opaque_Actions;
with AMF.UML.Operations;
with AMF.UML.Properties;
with AMF.UML.Read_Structural_Feature_Actions;
with AMF.UML.Send_Object_Actions;
with AMF.UML.Structured_Classifiers;
with AMF.UML.Time_Events;
with AMF.UML.Value_Specifications;
with AMF.UML.Write_Structural_Feature_Actions;
with AMF.Utp.Coding_Rules;
with AMF.Utp.Data_Partitions;
with AMF.Utp.Data_Pools;
with AMF.Utp.Data_Selectors;
with AMF.Utp.Default_Applications;
with AMF.Utp.Defaults;
with AMF.Utp.Determ_Alts;
with AMF.Utp.Finish_Actions;
with AMF.Utp.Get_Timezone_Actions;
with AMF.Utp.Holders.Verdicts;
with AMF.Utp.Literal_Anies;
with AMF.Utp.Literal_Any_Or_Nulls;
with AMF.Utp.Log_Actions;
with AMF.Utp.Managed_Elements;
with AMF.Utp.Read_Timer_Actions;
with AMF.Utp.SUTs;
with AMF.Utp.Set_Timezone_Actions;
with AMF.Utp.Start_Timer_Actions;
with AMF.Utp.Stop_Timer_Actions;
with AMF.Utp.Test_Cases.Collections;
with AMF.Utp.Test_Components;
with AMF.Utp.Test_Contexts;
with AMF.Utp.Test_Log_Applications;
with AMF.Utp.Test_Logs;
with AMF.Utp.Test_Objectives;
with AMF.Utp.Test_Suites;
with AMF.Utp.Time_Out_Actions;
with AMF.Utp.Time_Out_Messages;
with AMF.Utp.Time_Outs;
with AMF.Utp.Timer_Running_Actions;
with AMF.Utp.Validation_Actions;
with League.Holders;
package body AMF.Internals.Tables.UTP_Reflection is
---------
-- Get --
---------
function Get
(Self : AMF.Internals.AMF_Element;
Property : CMOF_Element) return League.Holders.Holder
is
function Utp_Coding_Rule_Get return League.Holders.Holder;
-- Returns attribute's value of instance of CodingRule class.
function Utp_Data_Partition_Get return League.Holders.Holder;
-- Returns attribute's value of instance of DataPartition class.
function Utp_Data_Pool_Get return League.Holders.Holder;
-- Returns attribute's value of instance of DataPool class.
function Utp_Data_Selector_Get return League.Holders.Holder;
-- Returns attribute's value of instance of DataSelector class.
function Utp_Default_Get return League.Holders.Holder;
-- Returns attribute's value of instance of Default class.
function Utp_Default_Application_Get return League.Holders.Holder;
-- Returns attribute's value of instance of DefaultApplication class.
function Utp_Determ_Alt_Get return League.Holders.Holder;
-- Returns attribute's value of instance of DetermAlt class.
function Utp_Finish_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of FinishAction class.
function Utp_Get_Timezone_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of GetTimezoneAction class.
function Utp_Literal_Any_Get return League.Holders.Holder;
-- Returns attribute's value of instance of LiteralAny class.
function Utp_Literal_Any_Or_Null_Get return League.Holders.Holder;
-- Returns attribute's value of instance of LiteralAnyOrNull class.
function Utp_Log_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of LogAction class.
function Utp_Managed_Element_Get return League.Holders.Holder;
-- Returns attribute's value of instance of ManagedElement class.
function Utp_Read_Timer_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of ReadTimerAction class.
function Utp_SUT_Get return League.Holders.Holder;
-- Returns attribute's value of instance of SUT class.
function Utp_Set_Timezone_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of SetTimezoneAction class.
function Utp_Start_Timer_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of StartTimerAction class.
function Utp_Stop_Timer_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of StopTimerAction class.
function Utp_Test_Case_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TestCase class.
function Utp_Test_Component_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TestComponent class.
function Utp_Test_Context_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TestContext class.
function Utp_Test_Log_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TestLog class.
function Utp_Test_Log_Application_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TestLogApplication class.
function Utp_Test_Objective_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TestObjective class.
function Utp_Test_Suite_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TestSuite class.
function Utp_Time_Out_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TimeOut class.
function Utp_Time_Out_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TimeOutAction class.
function Utp_Time_Out_Message_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TimeOutMessage class.
function Utp_Timer_Running_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TimerRunningAction class.
function Utp_Validation_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of ValidationAction class.
-------------------------
-- Utp_Coding_Rule_Get --
-------------------------
function Utp_Coding_Rule_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Coding_Rule_Base_Namespace_A_Extension_Coding_Rule then
-- CodingRule::base_Namespace : Namespace
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Namespaces.UML_Namespace_Access'
(AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Namespace));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Coding_Rule_Base_Property_A_Extension_Coding_Rule then
-- CodingRule::base_Property : Property
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Properties.UML_Property_Access'
(AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Property));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Coding_Rule_Base_Value_Specification_A_Extension_Coding_Rule then
-- CodingRule::base_ValueSpecification : ValueSpecification
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Value_Specifications.UML_Value_Specification_Access'
(AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Value_Specification));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Coding_Rule_Coding then
-- CodingRule::coding : String
return
League.Holders.To_Holder
(AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Coding);
else
raise Program_Error;
end if;
end Utp_Coding_Rule_Get;
----------------------------
-- Utp_Data_Partition_Get --
----------------------------
function Utp_Data_Partition_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Data_Partition_Base_Classifier_A_Extension_Data_Partition then
-- DataPartition::base_Classifier : Classifier
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Classifiers.UML_Classifier_Access'
(AMF.Utp.Data_Partitions.Utp_Data_Partition_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Classifier));
else
raise Program_Error;
end if;
end Utp_Data_Partition_Get;
-----------------------
-- Utp_Data_Pool_Get --
-----------------------
function Utp_Data_Pool_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Data_Pool_Base_Classifier_A_Extension_Data_Pool then
-- DataPool::base_Classifier : Classifier
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Classifiers.UML_Classifier_Access'
(AMF.Utp.Data_Pools.Utp_Data_Pool_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Classifier));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Data_Pool_Base_Property_A_Extension_Data_Pool then
-- DataPool::base_Property : Property
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Properties.UML_Property_Access'
(AMF.Utp.Data_Pools.Utp_Data_Pool_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Property));
else
raise Program_Error;
end if;
end Utp_Data_Pool_Get;
---------------------------
-- Utp_Data_Selector_Get --
---------------------------
function Utp_Data_Selector_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Data_Selector_Base_Operation_A_Extension_Data_Selector then
-- DataSelector::base_Operation : Operation
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Operations.UML_Operation_Access'
(AMF.Utp.Data_Selectors.Utp_Data_Selector_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Operation));
else
raise Program_Error;
end if;
end Utp_Data_Selector_Get;
---------------------
-- Utp_Default_Get --
---------------------
function Utp_Default_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Default_Base_Behavior_A_Extension_Default then
-- Default::base_Behavior : Behavior
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Behaviors.UML_Behavior_Access'
(AMF.Utp.Defaults.Utp_Default_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Behavior));
else
raise Program_Error;
end if;
end Utp_Default_Get;
---------------------------------
-- Utp_Default_Application_Get --
---------------------------------
function Utp_Default_Application_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Default_Application_Base_Dependency_A_Extension_Default_Application then
-- DefaultApplication::base_Dependency : Dependency
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Dependencies.UML_Dependency_Access'
(AMF.Utp.Default_Applications.Utp_Default_Application_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Dependency));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Default_Application_Repetition then
-- DefaultApplication::repetition : UnlimitedNatural
return
AMF.Holders.Unlimited_Naturals.To_Holder
(AMF.Utp.Default_Applications.Utp_Default_Application_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Repetition);
else
raise Program_Error;
end if;
end Utp_Default_Application_Get;
------------------------
-- Utp_Determ_Alt_Get --
------------------------
function Utp_Determ_Alt_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Determ_Alt_Base_Combined_Fragment_A_Extension_Determ_Alt then
-- DetermAlt::base_CombinedFragment : CombinedFragment
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Combined_Fragments.UML_Combined_Fragment_Access'
(AMF.Utp.Determ_Alts.Utp_Determ_Alt_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Combined_Fragment));
else
raise Program_Error;
end if;
end Utp_Determ_Alt_Get;
---------------------------
-- Utp_Finish_Action_Get --
---------------------------
function Utp_Finish_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Finish_Action_Base_Invocation_Action_A_Extension_Finish_Action then
-- FinishAction::base_InvocationAction : InvocationAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Invocation_Actions.UML_Invocation_Action_Access'
(AMF.Utp.Finish_Actions.Utp_Finish_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Invocation_Action));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Finish_Action_Base_Opaque_Action_A_Extension_Finish_Action then
-- FinishAction::base_OpaqueAction : OpaqueAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Opaque_Actions.UML_Opaque_Action_Access'
(AMF.Utp.Finish_Actions.Utp_Finish_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Opaque_Action));
else
raise Program_Error;
end if;
end Utp_Finish_Action_Get;
---------------------------------
-- Utp_Get_Timezone_Action_Get --
---------------------------------
function Utp_Get_Timezone_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Get_Timezone_Action_Base_Read_Structural_Feature_Action_A_Extension_Get_Timezone_Action then
-- GetTimezoneAction::base_ReadStructuralFeatureAction : ReadStructuralFeatureAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Read_Structural_Feature_Actions.UML_Read_Structural_Feature_Action_Access'
(AMF.Utp.Get_Timezone_Actions.Utp_Get_Timezone_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Read_Structural_Feature_Action));
else
raise Program_Error;
end if;
end Utp_Get_Timezone_Action_Get;
-------------------------
-- Utp_Literal_Any_Get --
-------------------------
function Utp_Literal_Any_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Literal_Any_Base_Literal_Specification_A_Extension_Literal_Any then
-- LiteralAny::base_LiteralSpecification : LiteralSpecification
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Literal_Specifications.UML_Literal_Specification_Access'
(AMF.Utp.Literal_Anies.Utp_Literal_Any_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Literal_Specification));
else
raise Program_Error;
end if;
end Utp_Literal_Any_Get;
---------------------------------
-- Utp_Literal_Any_Or_Null_Get --
---------------------------------
function Utp_Literal_Any_Or_Null_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Literal_Any_Or_Null_Base_Literal_Specification_A_Extension_Literal_Any_Or_Null then
-- LiteralAnyOrNull::base_LiteralSpecification : LiteralSpecification
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Literal_Specifications.UML_Literal_Specification_Access'
(AMF.Utp.Literal_Any_Or_Nulls.Utp_Literal_Any_Or_Null_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Literal_Specification));
else
raise Program_Error;
end if;
end Utp_Literal_Any_Or_Null_Get;
------------------------
-- Utp_Log_Action_Get --
------------------------
function Utp_Log_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Log_Action_Base_Send_Object_Action_A_Extension_Log_Action then
-- LogAction::base_SendObjectAction : SendObjectAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Send_Object_Actions.UML_Send_Object_Action_Access'
(AMF.Utp.Log_Actions.Utp_Log_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Send_Object_Action));
else
raise Program_Error;
end if;
end Utp_Log_Action_Get;
-----------------------------
-- Utp_Managed_Element_Get --
-----------------------------
function Utp_Managed_Element_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Base_Element_A_Extension_Managed_Element then
-- ManagedElement::base_Element : Element
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Elements.UML_Element_Access'
(AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Element));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Criticality then
-- ManagedElement::criticality : String
return
AMF.Holders.To_Holder
(AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Criticality);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Description then
-- ManagedElement::description : String
return
AMF.Holders.To_Holder
(AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Description);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Owner then
-- ManagedElement::owner : String
return
AMF.Holders.To_Holder
(AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Owner);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Version then
-- ManagedElement::version : String
return
AMF.Holders.To_Holder
(AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Version);
else
raise Program_Error;
end if;
end Utp_Managed_Element_Get;
-------------------------------
-- Utp_Read_Timer_Action_Get --
-------------------------------
function Utp_Read_Timer_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Read_Timer_Action_Base_Call_Operation_Action_A_Extension_Read_Timer_Action then
-- ReadTimerAction::base_CallOperationAction : CallOperationAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access'
(AMF.Utp.Read_Timer_Actions.Utp_Read_Timer_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Call_Operation_Action));
else
raise Program_Error;
end if;
end Utp_Read_Timer_Action_Get;
-----------------
-- Utp_SUT_Get --
-----------------
function Utp_SUT_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_SUT_Base_Property_A_Extension_SUT then
-- SUT::base_Property : Property
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Properties.UML_Property_Access'
(AMF.Utp.SUTs.Utp_SUT_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Property));
else
raise Program_Error;
end if;
end Utp_SUT_Get;
---------------------------------
-- Utp_Set_Timezone_Action_Get --
---------------------------------
function Utp_Set_Timezone_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Set_Timezone_Action_Base_Write_Structural_Feature_Action_A_Extension_Set_Timezone_Action then
-- SetTimezoneAction::base_WriteStructuralFeatureAction : WriteStructuralFeatureAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Write_Structural_Feature_Actions.UML_Write_Structural_Feature_Action_Access'
(AMF.Utp.Set_Timezone_Actions.Utp_Set_Timezone_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Write_Structural_Feature_Action));
else
raise Program_Error;
end if;
end Utp_Set_Timezone_Action_Get;
--------------------------------
-- Utp_Start_Timer_Action_Get --
--------------------------------
function Utp_Start_Timer_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Start_Timer_Action_Base_Call_Operation_Action_A_Extension_Start_Timer_Action then
-- StartTimerAction::base_CallOperationAction : CallOperationAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access'
(AMF.Utp.Start_Timer_Actions.Utp_Start_Timer_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Call_Operation_Action));
else
raise Program_Error;
end if;
end Utp_Start_Timer_Action_Get;
-------------------------------
-- Utp_Stop_Timer_Action_Get --
-------------------------------
function Utp_Stop_Timer_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Stop_Timer_Action_Base_Call_Operation_Action_A_Extension_Stop_Timer_Action then
-- StopTimerAction::base_CallOperationAction : CallOperationAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access'
(AMF.Utp.Stop_Timer_Actions.Utp_Stop_Timer_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Call_Operation_Action));
else
raise Program_Error;
end if;
end Utp_Stop_Timer_Action_Get;
-----------------------
-- Utp_Test_Case_Get --
-----------------------
function Utp_Test_Case_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Case_Base_Behavior_A_Extension_Test_Case then
-- TestCase::base_Behavior : Behavior
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Behaviors.UML_Behavior_Access'
(AMF.Utp.Test_Cases.Utp_Test_Case_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Behavior));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Case_Base_Operation_A_Extension_Test_Case then
-- TestCase::base_Operation : Operation
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Operations.UML_Operation_Access'
(AMF.Utp.Test_Cases.Utp_Test_Case_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Operation));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Case_Compatible_SUT_Variant then
-- TestCase::compatibleSUTVariant : String
return
AMF.String_Collections.Internals.To_Holder
(AMF.Utp.Test_Cases.Utp_Test_Case_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Compatible_SUT_Variant);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Case_Compatible_SUT_Version then
-- TestCase::compatibleSUTVersion : String
return
AMF.String_Collections.Internals.To_Holder
(AMF.Utp.Test_Cases.Utp_Test_Case_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Compatible_SUT_Version);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Case_Priority then
-- TestCase::priority : String
return
AMF.Holders.To_Holder
(AMF.Utp.Test_Cases.Utp_Test_Case_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Priority);
else
raise Program_Error;
end if;
end Utp_Test_Case_Get;
----------------------------
-- Utp_Test_Component_Get --
----------------------------
function Utp_Test_Component_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Component_Base_Structured_Classifier_A_Extension_Test_Component then
-- TestComponent::base_StructuredClassifier : StructuredClassifier
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Structured_Classifiers.UML_Structured_Classifier_Access'
(AMF.Utp.Test_Components.Utp_Test_Component_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Structured_Classifier));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Component_Compatible_SUT_Variant then
-- TestComponent::compatibleSUTVariant : String
return
AMF.String_Collections.Internals.To_Holder
(AMF.Utp.Test_Components.Utp_Test_Component_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Compatible_SUT_Variant);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Component_Compatible_SUT_Version then
-- TestComponent::compatibleSUTVersion : String
return
AMF.String_Collections.Internals.To_Holder
(AMF.Utp.Test_Components.Utp_Test_Component_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Compatible_SUT_Version);
else
raise Program_Error;
end if;
end Utp_Test_Component_Get;
--------------------------
-- Utp_Test_Context_Get --
--------------------------
function Utp_Test_Context_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Context_Base_Behaviored_Classifier_A_Extension_Test_Context then
-- TestContext::base_BehavioredClassifier : BehavioredClassifier
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Behaviored_Classifiers.UML_Behaviored_Classifier_Access'
(AMF.Utp.Test_Contexts.Utp_Test_Context_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Behaviored_Classifier));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Context_Base_Structured_Classifier_A_Extension_Test_Context then
-- TestContext::base_StructuredClassifier : StructuredClassifier
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Structured_Classifiers.UML_Structured_Classifier_Access'
(AMF.Utp.Test_Contexts.Utp_Test_Context_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Structured_Classifier));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Context_Compatible_SUT_Variant then
-- TestContext::compatibleSUTVariant : String
return
AMF.String_Collections.Internals.To_Holder
(AMF.Utp.Test_Contexts.Utp_Test_Context_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Compatible_SUT_Variant);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Context_Compatible_SUT_Version then
-- TestContext::compatibleSUTVersion : String
return
AMF.String_Collections.Internals.To_Holder
(AMF.Utp.Test_Contexts.Utp_Test_Context_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Compatible_SUT_Version);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Context_Test_Level then
-- TestContext::testLevel : String
return
AMF.Holders.To_Holder
(AMF.Utp.Test_Contexts.Utp_Test_Context_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Test_Level);
else
raise Program_Error;
end if;
end Utp_Test_Context_Get;
----------------------
-- Utp_Test_Log_Get --
----------------------
function Utp_Test_Log_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Base_Behavior_A_Extension_Test_Log then
-- TestLog::base_Behavior : Behavior
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Behaviors.UML_Behavior_Access'
(AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Behavior));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Duration then
-- TestLog::duration : String
return
AMF.Holders.To_Holder
(AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Duration);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Executed_At then
-- TestLog::executedAt : String
return
AMF.Holders.To_Holder
(AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Executed_At);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Sut_Version then
-- TestLog::sutVersion : String
return
AMF.Holders.To_Holder
(AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Sut_Version);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Tester then
-- TestLog::tester : String
return
AMF.String_Collections.Internals.To_Holder
(AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Tester);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Verdict then
-- TestLog::verdict : Verdict
return
AMF.Utp.Holders.Verdicts.To_Holder
(AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Verdict);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Verdict_Reason then
-- TestLog::verdictReason : String
return
AMF.Holders.To_Holder
(AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Verdict_Reason);
else
raise Program_Error;
end if;
end Utp_Test_Log_Get;
----------------------------------
-- Utp_Test_Log_Application_Get --
----------------------------------
function Utp_Test_Log_Application_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Application_Base_Dependency_A_Extension_Test_Log_Application then
-- TestLogApplication::base_Dependency : Dependency
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Dependencies.UML_Dependency_Access'
(AMF.Utp.Test_Log_Applications.Utp_Test_Log_Application_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Dependency));
else
raise Program_Error;
end if;
end Utp_Test_Log_Application_Get;
----------------------------
-- Utp_Test_Objective_Get --
----------------------------
function Utp_Test_Objective_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Objective_Base_Dependency_A_Extension_Test_Objective then
-- TestObjective::base_Dependency : Dependency
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Dependencies.UML_Dependency_Access'
(AMF.Utp.Test_Objectives.Utp_Test_Objective_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Dependency));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Objective_Priority then
-- TestObjective::priority : String
return
AMF.Holders.To_Holder
(AMF.Utp.Test_Objectives.Utp_Test_Objective_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Priority);
else
raise Program_Error;
end if;
end Utp_Test_Objective_Get;
------------------------
-- Utp_Test_Suite_Get --
------------------------
function Utp_Test_Suite_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Suite_Base_Behavior_A_Extension_Test_Suite then
-- TestSuite::base_Behavior : Behavior
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Behaviors.UML_Behavior_Access'
(AMF.Utp.Test_Suites.Utp_Test_Suite_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Behavior));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Suite_Priority then
-- TestSuite::priority : String
return
AMF.Holders.To_Holder
(AMF.Utp.Test_Suites.Utp_Test_Suite_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Priority);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Suite_Test_Case then
-- TestSuite::testCase : TestCase
return
AMF.Utp.Test_Cases.Collections.Utp_Test_Case_Collections.Internals.To_Holder
(AMF.Utp.Test_Suites.Utp_Test_Suite_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Test_Case);
else
raise Program_Error;
end if;
end Utp_Test_Suite_Get;
----------------------
-- Utp_Time_Out_Get --
----------------------
function Utp_Time_Out_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Time_Out_Base_Time_Event_A_Extension_Time_Out then
-- TimeOut::base_TimeEvent : TimeEvent
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Time_Events.UML_Time_Event_Access'
(AMF.Utp.Time_Outs.Utp_Time_Out_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Time_Event));
else
raise Program_Error;
end if;
end Utp_Time_Out_Get;
-----------------------------
-- Utp_Time_Out_Action_Get --
-----------------------------
function Utp_Time_Out_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Time_Out_Action_Base_Accept_Event_Action_A_Extension_Time_Out_Action then
-- TimeOutAction::base_AcceptEventAction : AcceptEventAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Accept_Event_Actions.UML_Accept_Event_Action_Access'
(AMF.Utp.Time_Out_Actions.Utp_Time_Out_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Accept_Event_Action));
else
raise Program_Error;
end if;
end Utp_Time_Out_Action_Get;
------------------------------
-- Utp_Time_Out_Message_Get --
------------------------------
function Utp_Time_Out_Message_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Time_Out_Message_Base_Message_A_Extension_Time_Out_Message then
-- TimeOutMessage::base_Message : Message
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Messages.UML_Message_Access'
(AMF.Utp.Time_Out_Messages.Utp_Time_Out_Message_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Message));
else
raise Program_Error;
end if;
end Utp_Time_Out_Message_Get;
----------------------------------
-- Utp_Timer_Running_Action_Get --
----------------------------------
function Utp_Timer_Running_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Timer_Running_Action_Base_Read_Structural_Feature_Action_A_Extension_Timer_Running_Action then
-- TimerRunningAction::base_ReadStructuralFeatureAction : ReadStructuralFeatureAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Read_Structural_Feature_Actions.UML_Read_Structural_Feature_Action_Access'
(AMF.Utp.Timer_Running_Actions.Utp_Timer_Running_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Read_Structural_Feature_Action));
else
raise Program_Error;
end if;
end Utp_Timer_Running_Action_Get;
-------------------------------
-- Utp_Validation_Action_Get --
-------------------------------
function Utp_Validation_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Validation_Action_Base_Call_Operation_Action_A_Extension_Validation_Action then
-- ValidationAction::base_CallOperationAction : CallOperationAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access'
(AMF.Utp.Validation_Actions.Utp_Validation_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Call_Operation_Action));
else
raise Program_Error;
end if;
end Utp_Validation_Action_Get;
begin
case AMF.Internals.Tables.UTP_Element_Table.Table (Self).Kind is
when AMF.Internals.Tables.UTP_Types.E_None =>
raise Program_Error;
when AMF.Internals.Tables.UTP_Types.E_Utp_Coding_Rule =>
return Utp_Coding_Rule_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Partition =>
return Utp_Data_Partition_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Pool =>
return Utp_Data_Pool_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Selector =>
return Utp_Data_Selector_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Default =>
return Utp_Default_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Default_Application =>
return Utp_Default_Application_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Determ_Alt =>
return Utp_Determ_Alt_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Finish_Action =>
return Utp_Finish_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Get_Timezone_Action =>
return Utp_Get_Timezone_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Literal_Any =>
return Utp_Literal_Any_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Literal_Any_Or_Null =>
return Utp_Literal_Any_Or_Null_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Log_Action =>
return Utp_Log_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Managed_Element =>
return Utp_Managed_Element_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Read_Timer_Action =>
return Utp_Read_Timer_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_SUT =>
return Utp_SUT_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Set_Timezone_Action =>
return Utp_Set_Timezone_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Start_Timer_Action =>
return Utp_Start_Timer_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Stop_Timer_Action =>
return Utp_Stop_Timer_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Case =>
return Utp_Test_Case_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Component =>
return Utp_Test_Component_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Context =>
return Utp_Test_Context_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Log =>
return Utp_Test_Log_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Log_Application =>
return Utp_Test_Log_Application_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Objective =>
return Utp_Test_Objective_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Suite =>
return Utp_Test_Suite_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out =>
return Utp_Time_Out_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out_Action =>
return Utp_Time_Out_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out_Message =>
return Utp_Time_Out_Message_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Timer_Running_Action =>
return Utp_Timer_Running_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Validation_Action =>
return Utp_Validation_Action_Get;
end case;
end Get;
--------------------
-- Get_Meta_Class --
--------------------
function Get_Meta_Class
(Self : AMF.Internals.AMF_Element) return CMOF_Element is
begin
case UTP_Element_Table.Table (Self).Kind is
when AMF.Internals.Tables.UTP_Types.E_None =>
return 0;
when AMF.Internals.Tables.UTP_Types.E_Utp_Coding_Rule =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Coding_Rule;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Partition =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Data_Partition;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Pool =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Data_Pool;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Selector =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Data_Selector;
when AMF.Internals.Tables.UTP_Types.E_Utp_Default =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Default;
when AMF.Internals.Tables.UTP_Types.E_Utp_Default_Application =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Default_Application;
when AMF.Internals.Tables.UTP_Types.E_Utp_Determ_Alt =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Determ_Alt;
when AMF.Internals.Tables.UTP_Types.E_Utp_Finish_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Finish_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_Get_Timezone_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Get_Timezone_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_Literal_Any =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Literal_Any;
when AMF.Internals.Tables.UTP_Types.E_Utp_Literal_Any_Or_Null =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Literal_Any_Or_Null;
when AMF.Internals.Tables.UTP_Types.E_Utp_Log_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Log_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_Managed_Element =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Managed_Element;
when AMF.Internals.Tables.UTP_Types.E_Utp_Read_Timer_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Read_Timer_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_SUT =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_SUT;
when AMF.Internals.Tables.UTP_Types.E_Utp_Set_Timezone_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Set_Timezone_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_Start_Timer_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Start_Timer_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_Stop_Timer_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Stop_Timer_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Case =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Test_Case;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Component =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Test_Component;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Context =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Test_Context;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Log =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Test_Log;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Log_Application =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Test_Log_Application;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Objective =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Test_Objective;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Suite =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Test_Suite;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Time_Out;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Time_Out_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out_Message =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Time_Out_Message;
when AMF.Internals.Tables.UTP_Types.E_Utp_Timer_Running_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Timer_Running_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_Validation_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Validation_Action;
end case;
end Get_Meta_Class;
---------
-- Set --
---------
procedure Set
(Self : AMF.Internals.AMF_Element;
Property : CMOF_Element;
Value : League.Holders.Holder)
is
procedure Utp_Coding_Rule_Set;
-- Sets attribute's value of instance of CodingRule class.
procedure Utp_Data_Partition_Set;
-- Sets attribute's value of instance of DataPartition class.
procedure Utp_Data_Pool_Set;
-- Sets attribute's value of instance of DataPool class.
procedure Utp_Data_Selector_Set;
-- Sets attribute's value of instance of DataSelector class.
procedure Utp_Default_Set;
-- Sets attribute's value of instance of Default class.
procedure Utp_Default_Application_Set;
-- Sets attribute's value of instance of DefaultApplication class.
procedure Utp_Determ_Alt_Set;
-- Sets attribute's value of instance of DetermAlt class.
procedure Utp_Finish_Action_Set;
-- Sets attribute's value of instance of FinishAction class.
procedure Utp_Get_Timezone_Action_Set;
-- Sets attribute's value of instance of GetTimezoneAction class.
procedure Utp_Literal_Any_Set;
-- Sets attribute's value of instance of LiteralAny class.
procedure Utp_Literal_Any_Or_Null_Set;
-- Sets attribute's value of instance of LiteralAnyOrNull class.
procedure Utp_Log_Action_Set;
-- Sets attribute's value of instance of LogAction class.
procedure Utp_Managed_Element_Set;
-- Sets attribute's value of instance of ManagedElement class.
procedure Utp_Read_Timer_Action_Set;
-- Sets attribute's value of instance of ReadTimerAction class.
procedure Utp_SUT_Set;
-- Sets attribute's value of instance of SUT class.
procedure Utp_Set_Timezone_Action_Set;
-- Sets attribute's value of instance of SetTimezoneAction class.
procedure Utp_Start_Timer_Action_Set;
-- Sets attribute's value of instance of StartTimerAction class.
procedure Utp_Stop_Timer_Action_Set;
-- Sets attribute's value of instance of StopTimerAction class.
procedure Utp_Test_Case_Set;
-- Sets attribute's value of instance of TestCase class.
procedure Utp_Test_Component_Set;
-- Sets attribute's value of instance of TestComponent class.
procedure Utp_Test_Context_Set;
-- Sets attribute's value of instance of TestContext class.
procedure Utp_Test_Log_Set;
-- Sets attribute's value of instance of TestLog class.
procedure Utp_Test_Log_Application_Set;
-- Sets attribute's value of instance of TestLogApplication class.
procedure Utp_Test_Objective_Set;
-- Sets attribute's value of instance of TestObjective class.
procedure Utp_Test_Suite_Set;
-- Sets attribute's value of instance of TestSuite class.
procedure Utp_Time_Out_Set;
-- Sets attribute's value of instance of TimeOut class.
procedure Utp_Time_Out_Action_Set;
-- Sets attribute's value of instance of TimeOutAction class.
procedure Utp_Time_Out_Message_Set;
-- Sets attribute's value of instance of TimeOutMessage class.
procedure Utp_Timer_Running_Action_Set;
-- Sets attribute's value of instance of TimerRunningAction class.
procedure Utp_Validation_Action_Set;
-- Sets attribute's value of instance of ValidationAction class.
-------------------------
-- Utp_Coding_Rule_Set --
-------------------------
procedure Utp_Coding_Rule_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Coding_Rule_Base_Namespace_A_Extension_Coding_Rule then
-- CodingRule::base_Namespace : Namespace
AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Namespace
(AMF.UML.Namespaces.UML_Namespace_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Coding_Rule_Base_Property_A_Extension_Coding_Rule then
-- CodingRule::base_Property : Property
AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Property
(AMF.UML.Properties.UML_Property_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Coding_Rule_Base_Value_Specification_A_Extension_Coding_Rule then
-- CodingRule::base_ValueSpecification : ValueSpecification
AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Value_Specification
(AMF.UML.Value_Specifications.UML_Value_Specification_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Coding_Rule_Coding then
-- CodingRule::coding : String
AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Coding
(League.Holders.Element (Value));
else
raise Program_Error;
end if;
end Utp_Coding_Rule_Set;
----------------------------
-- Utp_Data_Partition_Set --
----------------------------
procedure Utp_Data_Partition_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Data_Partition_Base_Classifier_A_Extension_Data_Partition then
-- DataPartition::base_Classifier : Classifier
AMF.Utp.Data_Partitions.Utp_Data_Partition_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Classifier
(AMF.UML.Classifiers.UML_Classifier_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Data_Partition_Set;
-----------------------
-- Utp_Data_Pool_Set --
-----------------------
procedure Utp_Data_Pool_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Data_Pool_Base_Classifier_A_Extension_Data_Pool then
-- DataPool::base_Classifier : Classifier
AMF.Utp.Data_Pools.Utp_Data_Pool_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Classifier
(AMF.UML.Classifiers.UML_Classifier_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Data_Pool_Base_Property_A_Extension_Data_Pool then
-- DataPool::base_Property : Property
AMF.Utp.Data_Pools.Utp_Data_Pool_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Property
(AMF.UML.Properties.UML_Property_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Data_Pool_Set;
---------------------------
-- Utp_Data_Selector_Set --
---------------------------
procedure Utp_Data_Selector_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Data_Selector_Base_Operation_A_Extension_Data_Selector then
-- DataSelector::base_Operation : Operation
AMF.Utp.Data_Selectors.Utp_Data_Selector_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Operation
(AMF.UML.Operations.UML_Operation_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Data_Selector_Set;
---------------------
-- Utp_Default_Set --
---------------------
procedure Utp_Default_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Default_Base_Behavior_A_Extension_Default then
-- Default::base_Behavior : Behavior
AMF.Utp.Defaults.Utp_Default_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Behavior
(AMF.UML.Behaviors.UML_Behavior_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Default_Set;
---------------------------------
-- Utp_Default_Application_Set --
---------------------------------
procedure Utp_Default_Application_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Default_Application_Base_Dependency_A_Extension_Default_Application then
-- DefaultApplication::base_Dependency : Dependency
AMF.Utp.Default_Applications.Utp_Default_Application_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Dependency
(AMF.UML.Dependencies.UML_Dependency_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Default_Application_Repetition then
-- DefaultApplication::repetition : UnlimitedNatural
AMF.Utp.Default_Applications.Utp_Default_Application_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Repetition
(AMF.Holders.Unlimited_Naturals.Element (Value));
else
raise Program_Error;
end if;
end Utp_Default_Application_Set;
------------------------
-- Utp_Determ_Alt_Set --
------------------------
procedure Utp_Determ_Alt_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Determ_Alt_Base_Combined_Fragment_A_Extension_Determ_Alt then
-- DetermAlt::base_CombinedFragment : CombinedFragment
AMF.Utp.Determ_Alts.Utp_Determ_Alt_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Combined_Fragment
(AMF.UML.Combined_Fragments.UML_Combined_Fragment_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Determ_Alt_Set;
---------------------------
-- Utp_Finish_Action_Set --
---------------------------
procedure Utp_Finish_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Finish_Action_Base_Invocation_Action_A_Extension_Finish_Action then
-- FinishAction::base_InvocationAction : InvocationAction
AMF.Utp.Finish_Actions.Utp_Finish_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Invocation_Action
(AMF.UML.Invocation_Actions.UML_Invocation_Action_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Finish_Action_Base_Opaque_Action_A_Extension_Finish_Action then
-- FinishAction::base_OpaqueAction : OpaqueAction
AMF.Utp.Finish_Actions.Utp_Finish_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Opaque_Action
(AMF.UML.Opaque_Actions.UML_Opaque_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Finish_Action_Set;
---------------------------------
-- Utp_Get_Timezone_Action_Set --
---------------------------------
procedure Utp_Get_Timezone_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Get_Timezone_Action_Base_Read_Structural_Feature_Action_A_Extension_Get_Timezone_Action then
-- GetTimezoneAction::base_ReadStructuralFeatureAction : ReadStructuralFeatureAction
AMF.Utp.Get_Timezone_Actions.Utp_Get_Timezone_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Read_Structural_Feature_Action
(AMF.UML.Read_Structural_Feature_Actions.UML_Read_Structural_Feature_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Get_Timezone_Action_Set;
-------------------------
-- Utp_Literal_Any_Set --
-------------------------
procedure Utp_Literal_Any_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Literal_Any_Base_Literal_Specification_A_Extension_Literal_Any then
-- LiteralAny::base_LiteralSpecification : LiteralSpecification
AMF.Utp.Literal_Anies.Utp_Literal_Any_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Literal_Specification
(AMF.UML.Literal_Specifications.UML_Literal_Specification_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Literal_Any_Set;
---------------------------------
-- Utp_Literal_Any_Or_Null_Set --
---------------------------------
procedure Utp_Literal_Any_Or_Null_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Literal_Any_Or_Null_Base_Literal_Specification_A_Extension_Literal_Any_Or_Null then
-- LiteralAnyOrNull::base_LiteralSpecification : LiteralSpecification
AMF.Utp.Literal_Any_Or_Nulls.Utp_Literal_Any_Or_Null_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Literal_Specification
(AMF.UML.Literal_Specifications.UML_Literal_Specification_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Literal_Any_Or_Null_Set;
------------------------
-- Utp_Log_Action_Set --
------------------------
procedure Utp_Log_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Log_Action_Base_Send_Object_Action_A_Extension_Log_Action then
-- LogAction::base_SendObjectAction : SendObjectAction
AMF.Utp.Log_Actions.Utp_Log_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Send_Object_Action
(AMF.UML.Send_Object_Actions.UML_Send_Object_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Log_Action_Set;
-----------------------------
-- Utp_Managed_Element_Set --
-----------------------------
procedure Utp_Managed_Element_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Base_Element_A_Extension_Managed_Element then
-- ManagedElement::base_Element : Element
AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Element
(AMF.UML.Elements.UML_Element_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Criticality then
-- ManagedElement::criticality : String
AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Criticality
(AMF.Holders.Element (Value));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Description then
-- ManagedElement::description : String
AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Description
(AMF.Holders.Element (Value));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Owner then
-- ManagedElement::owner : String
AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Owner
(AMF.Holders.Element (Value));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Version then
-- ManagedElement::version : String
AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Version
(AMF.Holders.Element (Value));
else
raise Program_Error;
end if;
end Utp_Managed_Element_Set;
-------------------------------
-- Utp_Read_Timer_Action_Set --
-------------------------------
procedure Utp_Read_Timer_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Read_Timer_Action_Base_Call_Operation_Action_A_Extension_Read_Timer_Action then
-- ReadTimerAction::base_CallOperationAction : CallOperationAction
AMF.Utp.Read_Timer_Actions.Utp_Read_Timer_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Call_Operation_Action
(AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Read_Timer_Action_Set;
-----------------
-- Utp_SUT_Set --
-----------------
procedure Utp_SUT_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_SUT_Base_Property_A_Extension_SUT then
-- SUT::base_Property : Property
AMF.Utp.SUTs.Utp_SUT_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Property
(AMF.UML.Properties.UML_Property_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_SUT_Set;
---------------------------------
-- Utp_Set_Timezone_Action_Set --
---------------------------------
procedure Utp_Set_Timezone_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Set_Timezone_Action_Base_Write_Structural_Feature_Action_A_Extension_Set_Timezone_Action then
-- SetTimezoneAction::base_WriteStructuralFeatureAction : WriteStructuralFeatureAction
AMF.Utp.Set_Timezone_Actions.Utp_Set_Timezone_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Write_Structural_Feature_Action
(AMF.UML.Write_Structural_Feature_Actions.UML_Write_Structural_Feature_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Set_Timezone_Action_Set;
--------------------------------
-- Utp_Start_Timer_Action_Set --
--------------------------------
procedure Utp_Start_Timer_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Start_Timer_Action_Base_Call_Operation_Action_A_Extension_Start_Timer_Action then
-- StartTimerAction::base_CallOperationAction : CallOperationAction
AMF.Utp.Start_Timer_Actions.Utp_Start_Timer_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Call_Operation_Action
(AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Start_Timer_Action_Set;
-------------------------------
-- Utp_Stop_Timer_Action_Set --
-------------------------------
procedure Utp_Stop_Timer_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Stop_Timer_Action_Base_Call_Operation_Action_A_Extension_Stop_Timer_Action then
-- StopTimerAction::base_CallOperationAction : CallOperationAction
AMF.Utp.Stop_Timer_Actions.Utp_Stop_Timer_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Call_Operation_Action
(AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Stop_Timer_Action_Set;
-----------------------
-- Utp_Test_Case_Set --
-----------------------
procedure Utp_Test_Case_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Case_Base_Behavior_A_Extension_Test_Case then
-- TestCase::base_Behavior : Behavior
AMF.Utp.Test_Cases.Utp_Test_Case_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Behavior
(AMF.UML.Behaviors.UML_Behavior_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Case_Base_Operation_A_Extension_Test_Case then
-- TestCase::base_Operation : Operation
AMF.Utp.Test_Cases.Utp_Test_Case_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Operation
(AMF.UML.Operations.UML_Operation_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Case_Priority then
-- TestCase::priority : String
AMF.Utp.Test_Cases.Utp_Test_Case_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Priority
(AMF.Holders.Element (Value));
else
raise Program_Error;
end if;
end Utp_Test_Case_Set;
----------------------------
-- Utp_Test_Component_Set --
----------------------------
procedure Utp_Test_Component_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Component_Base_Structured_Classifier_A_Extension_Test_Component then
-- TestComponent::base_StructuredClassifier : StructuredClassifier
AMF.Utp.Test_Components.Utp_Test_Component_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Structured_Classifier
(AMF.UML.Structured_Classifiers.UML_Structured_Classifier_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Test_Component_Set;
--------------------------
-- Utp_Test_Context_Set --
--------------------------
procedure Utp_Test_Context_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Context_Base_Behaviored_Classifier_A_Extension_Test_Context then
-- TestContext::base_BehavioredClassifier : BehavioredClassifier
AMF.Utp.Test_Contexts.Utp_Test_Context_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Behaviored_Classifier
(AMF.UML.Behaviored_Classifiers.UML_Behaviored_Classifier_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Context_Base_Structured_Classifier_A_Extension_Test_Context then
-- TestContext::base_StructuredClassifier : StructuredClassifier
AMF.Utp.Test_Contexts.Utp_Test_Context_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Structured_Classifier
(AMF.UML.Structured_Classifiers.UML_Structured_Classifier_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Context_Test_Level then
-- TestContext::testLevel : String
AMF.Utp.Test_Contexts.Utp_Test_Context_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Test_Level
(AMF.Holders.Element (Value));
else
raise Program_Error;
end if;
end Utp_Test_Context_Set;
----------------------
-- Utp_Test_Log_Set --
----------------------
procedure Utp_Test_Log_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Base_Behavior_A_Extension_Test_Log then
-- TestLog::base_Behavior : Behavior
AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Behavior
(AMF.UML.Behaviors.UML_Behavior_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Duration then
-- TestLog::duration : String
AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Duration
(AMF.Holders.Element (Value));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Executed_At then
-- TestLog::executedAt : String
AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Executed_At
(AMF.Holders.Element (Value));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Sut_Version then
-- TestLog::sutVersion : String
AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Sut_Version
(AMF.Holders.Element (Value));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Verdict then
-- TestLog::verdict : Verdict
AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Verdict
(AMF.Utp.Holders.Verdicts.Element (Value));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Verdict_Reason then
-- TestLog::verdictReason : String
AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Verdict_Reason
(AMF.Holders.Element (Value));
else
raise Program_Error;
end if;
end Utp_Test_Log_Set;
----------------------------------
-- Utp_Test_Log_Application_Set --
----------------------------------
procedure Utp_Test_Log_Application_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Application_Base_Dependency_A_Extension_Test_Log_Application then
-- TestLogApplication::base_Dependency : Dependency
AMF.Utp.Test_Log_Applications.Utp_Test_Log_Application_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Dependency
(AMF.UML.Dependencies.UML_Dependency_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Test_Log_Application_Set;
----------------------------
-- Utp_Test_Objective_Set --
----------------------------
procedure Utp_Test_Objective_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Objective_Base_Dependency_A_Extension_Test_Objective then
-- TestObjective::base_Dependency : Dependency
AMF.Utp.Test_Objectives.Utp_Test_Objective_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Dependency
(AMF.UML.Dependencies.UML_Dependency_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Objective_Priority then
-- TestObjective::priority : String
AMF.Utp.Test_Objectives.Utp_Test_Objective_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Priority
(AMF.Holders.Element (Value));
else
raise Program_Error;
end if;
end Utp_Test_Objective_Set;
------------------------
-- Utp_Test_Suite_Set --
------------------------
procedure Utp_Test_Suite_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Suite_Base_Behavior_A_Extension_Test_Suite then
-- TestSuite::base_Behavior : Behavior
AMF.Utp.Test_Suites.Utp_Test_Suite_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Behavior
(AMF.UML.Behaviors.UML_Behavior_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Suite_Priority then
-- TestSuite::priority : String
AMF.Utp.Test_Suites.Utp_Test_Suite_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Priority
(AMF.Holders.Element (Value));
else
raise Program_Error;
end if;
end Utp_Test_Suite_Set;
----------------------
-- Utp_Time_Out_Set --
----------------------
procedure Utp_Time_Out_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Time_Out_Base_Time_Event_A_Extension_Time_Out then
-- TimeOut::base_TimeEvent : TimeEvent
AMF.Utp.Time_Outs.Utp_Time_Out_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Time_Event
(AMF.UML.Time_Events.UML_Time_Event_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Time_Out_Set;
-----------------------------
-- Utp_Time_Out_Action_Set --
-----------------------------
procedure Utp_Time_Out_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Time_Out_Action_Base_Accept_Event_Action_A_Extension_Time_Out_Action then
-- TimeOutAction::base_AcceptEventAction : AcceptEventAction
AMF.Utp.Time_Out_Actions.Utp_Time_Out_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Accept_Event_Action
(AMF.UML.Accept_Event_Actions.UML_Accept_Event_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Time_Out_Action_Set;
------------------------------
-- Utp_Time_Out_Message_Set --
------------------------------
procedure Utp_Time_Out_Message_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Time_Out_Message_Base_Message_A_Extension_Time_Out_Message then
-- TimeOutMessage::base_Message : Message
AMF.Utp.Time_Out_Messages.Utp_Time_Out_Message_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Message
(AMF.UML.Messages.UML_Message_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Time_Out_Message_Set;
----------------------------------
-- Utp_Timer_Running_Action_Set --
----------------------------------
procedure Utp_Timer_Running_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Timer_Running_Action_Base_Read_Structural_Feature_Action_A_Extension_Timer_Running_Action then
-- TimerRunningAction::base_ReadStructuralFeatureAction : ReadStructuralFeatureAction
AMF.Utp.Timer_Running_Actions.Utp_Timer_Running_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Read_Structural_Feature_Action
(AMF.UML.Read_Structural_Feature_Actions.UML_Read_Structural_Feature_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Timer_Running_Action_Set;
-------------------------------
-- Utp_Validation_Action_Set --
-------------------------------
procedure Utp_Validation_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Validation_Action_Base_Call_Operation_Action_A_Extension_Validation_Action then
-- ValidationAction::base_CallOperationAction : CallOperationAction
AMF.Utp.Validation_Actions.Utp_Validation_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Call_Operation_Action
(AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Validation_Action_Set;
begin
case UTP_Element_Table.Table (Self).Kind is
when AMF.Internals.Tables.UTP_Types.E_None =>
raise Program_Error;
when AMF.Internals.Tables.UTP_Types.E_Utp_Coding_Rule =>
Utp_Coding_Rule_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Partition =>
Utp_Data_Partition_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Pool =>
Utp_Data_Pool_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Selector =>
Utp_Data_Selector_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Default =>
Utp_Default_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Default_Application =>
Utp_Default_Application_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Determ_Alt =>
Utp_Determ_Alt_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Finish_Action =>
Utp_Finish_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Get_Timezone_Action =>
Utp_Get_Timezone_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Literal_Any =>
Utp_Literal_Any_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Literal_Any_Or_Null =>
Utp_Literal_Any_Or_Null_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Log_Action =>
Utp_Log_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Managed_Element =>
Utp_Managed_Element_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Read_Timer_Action =>
Utp_Read_Timer_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_SUT =>
Utp_SUT_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Set_Timezone_Action =>
Utp_Set_Timezone_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Start_Timer_Action =>
Utp_Start_Timer_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Stop_Timer_Action =>
Utp_Stop_Timer_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Case =>
Utp_Test_Case_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Component =>
Utp_Test_Component_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Context =>
Utp_Test_Context_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Log =>
Utp_Test_Log_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Log_Application =>
Utp_Test_Log_Application_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Objective =>
Utp_Test_Objective_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Suite =>
Utp_Test_Suite_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out =>
Utp_Time_Out_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out_Action =>
Utp_Time_Out_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out_Message =>
Utp_Time_Out_Message_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Timer_Running_Action =>
Utp_Timer_Running_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Validation_Action =>
Utp_Validation_Action_Set;
end case;
end Set;
end AMF.Internals.Tables.UTP_Reflection;
|
23020
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Holders.Elements;
with AMF.Holders.Unlimited_Naturals;
with AMF.Internals.Helpers;
with AMF.Internals.Holders.UML_Holders;
with AMF.Internals.Tables.UTP_Element_Table;
with AMF.Internals.Tables.UTP_Types;
with AMF.Internals.Tables.Utp_Metamodel;
with AMF.String_Collections.Internals;
with AMF.UML.Accept_Event_Actions;
with AMF.UML.Behaviored_Classifiers;
with AMF.UML.Behaviors;
with AMF.UML.Call_Operation_Actions;
with AMF.UML.Classifiers;
with AMF.UML.Combined_Fragments;
with AMF.UML.Dependencies;
with AMF.UML.Elements;
with AMF.UML.Invocation_Actions;
with AMF.UML.Literal_Specifications;
with AMF.UML.Messages;
with AMF.UML.Namespaces;
with AMF.UML.Opaque_Actions;
with AMF.UML.Operations;
with AMF.UML.Properties;
with AMF.UML.Read_Structural_Feature_Actions;
with AMF.UML.Send_Object_Actions;
with AMF.UML.Structured_Classifiers;
with AMF.UML.Time_Events;
with AMF.UML.Value_Specifications;
with AMF.UML.Write_Structural_Feature_Actions;
with AMF.Utp.Coding_Rules;
with AMF.Utp.Data_Partitions;
with AMF.Utp.Data_Pools;
with AMF.Utp.Data_Selectors;
with AMF.Utp.Default_Applications;
with AMF.Utp.Defaults;
with AMF.Utp.Determ_Alts;
with AMF.Utp.Finish_Actions;
with AMF.Utp.Get_Timezone_Actions;
with AMF.Utp.Holders.Verdicts;
with AMF.Utp.Literal_Anies;
with AMF.Utp.Literal_Any_Or_Nulls;
with AMF.Utp.Log_Actions;
with AMF.Utp.Managed_Elements;
with AMF.Utp.Read_Timer_Actions;
with AMF.Utp.SUTs;
with AMF.Utp.Set_Timezone_Actions;
with AMF.Utp.Start_Timer_Actions;
with AMF.Utp.Stop_Timer_Actions;
with AMF.Utp.Test_Cases.Collections;
with AMF.Utp.Test_Components;
with AMF.Utp.Test_Contexts;
with AMF.Utp.Test_Log_Applications;
with AMF.Utp.Test_Logs;
with AMF.Utp.Test_Objectives;
with AMF.Utp.Test_Suites;
with AMF.Utp.Time_Out_Actions;
with AMF.Utp.Time_Out_Messages;
with AMF.Utp.Time_Outs;
with AMF.Utp.Timer_Running_Actions;
with AMF.Utp.Validation_Actions;
with League.Holders;
package body AMF.Internals.Tables.UTP_Reflection is
---------
-- Get --
---------
function Get
(Self : AMF.Internals.AMF_Element;
Property : CMOF_Element) return League.Holders.Holder
is
function Utp_Coding_Rule_Get return League.Holders.Holder;
-- Returns attribute's value of instance of CodingRule class.
function Utp_Data_Partition_Get return League.Holders.Holder;
-- Returns attribute's value of instance of DataPartition class.
function Utp_Data_Pool_Get return League.Holders.Holder;
-- Returns attribute's value of instance of DataPool class.
function Utp_Data_Selector_Get return League.Holders.Holder;
-- Returns attribute's value of instance of DataSelector class.
function Utp_Default_Get return League.Holders.Holder;
-- Returns attribute's value of instance of Default class.
function Utp_Default_Application_Get return League.Holders.Holder;
-- Returns attribute's value of instance of DefaultApplication class.
function Utp_Determ_Alt_Get return League.Holders.Holder;
-- Returns attribute's value of instance of DetermAlt class.
function Utp_Finish_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of FinishAction class.
function Utp_Get_Timezone_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of GetTimezoneAction class.
function Utp_Literal_Any_Get return League.Holders.Holder;
-- Returns attribute's value of instance of LiteralAny class.
function Utp_Literal_Any_Or_Null_Get return League.Holders.Holder;
-- Returns attribute's value of instance of LiteralAnyOrNull class.
function Utp_Log_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of LogAction class.
function Utp_Managed_Element_Get return League.Holders.Holder;
-- Returns attribute's value of instance of ManagedElement class.
function Utp_Read_Timer_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of ReadTimerAction class.
function Utp_SUT_Get return League.Holders.Holder;
-- Returns attribute's value of instance of SUT class.
function Utp_Set_Timezone_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of SetTimezoneAction class.
function Utp_Start_Timer_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of StartTimerAction class.
function Utp_Stop_Timer_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of StopTimerAction class.
function Utp_Test_Case_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TestCase class.
function Utp_Test_Component_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TestComponent class.
function Utp_Test_Context_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TestContext class.
function Utp_Test_Log_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TestLog class.
function Utp_Test_Log_Application_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TestLogApplication class.
function Utp_Test_Objective_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TestObjective class.
function Utp_Test_Suite_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TestSuite class.
function Utp_Time_Out_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TimeOut class.
function Utp_Time_Out_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TimeOutAction class.
function Utp_Time_Out_Message_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TimeOutMessage class.
function Utp_Timer_Running_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TimerRunningAction class.
function Utp_Validation_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of ValidationAction class.
-------------------------
-- Utp_Coding_Rule_Get --
-------------------------
function Utp_Coding_Rule_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Coding_Rule_Base_Namespace_A_Extension_Coding_Rule then
-- CodingRule::base_Namespace : Namespace
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Namespaces.UML_Namespace_Access'
(AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Namespace));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Coding_Rule_Base_Property_A_Extension_Coding_Rule then
-- CodingRule::base_Property : Property
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Properties.UML_Property_Access'
(AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Property));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Coding_Rule_Base_Value_Specification_A_Extension_Coding_Rule then
-- CodingRule::base_ValueSpecification : ValueSpecification
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Value_Specifications.UML_Value_Specification_Access'
(AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Value_Specification));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Coding_Rule_Coding then
-- CodingRule::coding : String
return
League.Holders.To_Holder
(AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Coding);
else
raise Program_Error;
end if;
end Utp_Coding_Rule_Get;
----------------------------
-- Utp_Data_Partition_Get --
----------------------------
function Utp_Data_Partition_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Data_Partition_Base_Classifier_A_Extension_Data_Partition then
-- DataPartition::base_Classifier : Classifier
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Classifiers.UML_Classifier_Access'
(AMF.Utp.Data_Partitions.Utp_Data_Partition_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Classifier));
else
raise Program_Error;
end if;
end Utp_Data_Partition_Get;
-----------------------
-- Utp_Data_Pool_Get --
-----------------------
function Utp_Data_Pool_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Data_Pool_Base_Classifier_A_Extension_Data_Pool then
-- DataPool::base_Classifier : Classifier
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Classifiers.UML_Classifier_Access'
(AMF.Utp.Data_Pools.Utp_Data_Pool_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Classifier));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Data_Pool_Base_Property_A_Extension_Data_Pool then
-- DataPool::base_Property : Property
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Properties.UML_Property_Access'
(AMF.Utp.Data_Pools.Utp_Data_Pool_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Property));
else
raise Program_Error;
end if;
end Utp_Data_Pool_Get;
---------------------------
-- Utp_Data_Selector_Get --
---------------------------
function Utp_Data_Selector_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Data_Selector_Base_Operation_A_Extension_Data_Selector then
-- DataSelector::base_Operation : Operation
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Operations.UML_Operation_Access'
(AMF.Utp.Data_Selectors.Utp_Data_Selector_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Operation));
else
raise Program_Error;
end if;
end Utp_Data_Selector_Get;
---------------------
-- Utp_Default_Get --
---------------------
function Utp_Default_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Default_Base_Behavior_A_Extension_Default then
-- Default::base_Behavior : Behavior
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Behaviors.UML_Behavior_Access'
(AMF.Utp.Defaults.Utp_Default_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Behavior));
else
raise Program_Error;
end if;
end Utp_Default_Get;
---------------------------------
-- Utp_Default_Application_Get --
---------------------------------
function Utp_Default_Application_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Default_Application_Base_Dependency_A_Extension_Default_Application then
-- DefaultApplication::base_Dependency : Dependency
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Dependencies.UML_Dependency_Access'
(AMF.Utp.Default_Applications.Utp_Default_Application_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Dependency));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Default_Application_Repetition then
-- DefaultApplication::repetition : UnlimitedNatural
return
AMF.Holders.Unlimited_Naturals.To_Holder
(AMF.Utp.Default_Applications.Utp_Default_Application_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Repetition);
else
raise Program_Error;
end if;
end Utp_Default_Application_Get;
------------------------
-- Utp_Determ_Alt_Get --
------------------------
function Utp_Determ_Alt_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Determ_Alt_Base_Combined_Fragment_A_Extension_Determ_Alt then
-- DetermAlt::base_CombinedFragment : CombinedFragment
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Combined_Fragments.UML_Combined_Fragment_Access'
(AMF.Utp.Determ_Alts.Utp_Determ_Alt_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Combined_Fragment));
else
raise Program_Error;
end if;
end Utp_Determ_Alt_Get;
---------------------------
-- Utp_Finish_Action_Get --
---------------------------
function Utp_Finish_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Finish_Action_Base_Invocation_Action_A_Extension_Finish_Action then
-- FinishAction::base_InvocationAction : InvocationAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Invocation_Actions.UML_Invocation_Action_Access'
(AMF.Utp.Finish_Actions.Utp_Finish_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Invocation_Action));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Finish_Action_Base_Opaque_Action_A_Extension_Finish_Action then
-- FinishAction::base_OpaqueAction : OpaqueAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Opaque_Actions.UML_Opaque_Action_Access'
(AMF.Utp.Finish_Actions.Utp_Finish_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Opaque_Action));
else
raise Program_Error;
end if;
end Utp_Finish_Action_Get;
---------------------------------
-- Utp_Get_Timezone_Action_Get --
---------------------------------
function Utp_Get_Timezone_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Get_Timezone_Action_Base_Read_Structural_Feature_Action_A_Extension_Get_Timezone_Action then
-- GetTimezoneAction::base_ReadStructuralFeatureAction : ReadStructuralFeatureAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Read_Structural_Feature_Actions.UML_Read_Structural_Feature_Action_Access'
(AMF.Utp.Get_Timezone_Actions.Utp_Get_Timezone_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Read_Structural_Feature_Action));
else
raise Program_Error;
end if;
end Utp_Get_Timezone_Action_Get;
-------------------------
-- Utp_Literal_Any_Get --
-------------------------
function Utp_Literal_Any_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Literal_Any_Base_Literal_Specification_A_Extension_Literal_Any then
-- LiteralAny::base_LiteralSpecification : LiteralSpecification
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Literal_Specifications.UML_Literal_Specification_Access'
(AMF.Utp.Literal_Anies.Utp_Literal_Any_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Literal_Specification));
else
raise Program_Error;
end if;
end Utp_Literal_Any_Get;
---------------------------------
-- Utp_Literal_Any_Or_Null_Get --
---------------------------------
function Utp_Literal_Any_Or_Null_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Literal_Any_Or_Null_Base_Literal_Specification_A_Extension_Literal_Any_Or_Null then
-- LiteralAnyOrNull::base_LiteralSpecification : LiteralSpecification
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Literal_Specifications.UML_Literal_Specification_Access'
(AMF.Utp.Literal_Any_Or_Nulls.Utp_Literal_Any_Or_Null_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Literal_Specification));
else
raise Program_Error;
end if;
end Utp_Literal_Any_Or_Null_Get;
------------------------
-- Utp_Log_Action_Get --
------------------------
function Utp_Log_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Log_Action_Base_Send_Object_Action_A_Extension_Log_Action then
-- LogAction::base_SendObjectAction : SendObjectAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Send_Object_Actions.UML_Send_Object_Action_Access'
(AMF.Utp.Log_Actions.Utp_Log_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Send_Object_Action));
else
raise Program_Error;
end if;
end Utp_Log_Action_Get;
-----------------------------
-- Utp_Managed_Element_Get --
-----------------------------
function Utp_Managed_Element_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Base_Element_A_Extension_Managed_Element then
-- ManagedElement::base_Element : Element
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Elements.UML_Element_Access'
(AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Element));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Criticality then
-- ManagedElement::criticality : String
return
AMF.Holders.To_Holder
(AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Criticality);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Description then
-- ManagedElement::description : String
return
AMF.Holders.To_Holder
(AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Description);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Owner then
-- ManagedElement::owner : String
return
AMF.Holders.To_Holder
(AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Owner);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Version then
-- ManagedElement::version : String
return
AMF.Holders.To_Holder
(AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Version);
else
raise Program_Error;
end if;
end Utp_Managed_Element_Get;
-------------------------------
-- Utp_Read_Timer_Action_Get --
-------------------------------
function Utp_Read_Timer_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Read_Timer_Action_Base_Call_Operation_Action_A_Extension_Read_Timer_Action then
-- ReadTimerAction::base_CallOperationAction : CallOperationAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access'
(AMF.Utp.Read_Timer_Actions.Utp_Read_Timer_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Call_Operation_Action));
else
raise Program_Error;
end if;
end Utp_Read_Timer_Action_Get;
-----------------
-- Utp_SUT_Get --
-----------------
function Utp_SUT_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_SUT_Base_Property_A_Extension_SUT then
-- SUT::base_Property : Property
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Properties.UML_Property_Access'
(AMF.Utp.SUTs.Utp_SUT_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Property));
else
raise Program_Error;
end if;
end Utp_SUT_Get;
---------------------------------
-- Utp_Set_Timezone_Action_Get --
---------------------------------
function Utp_Set_Timezone_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Set_Timezone_Action_Base_Write_Structural_Feature_Action_A_Extension_Set_Timezone_Action then
-- SetTimezoneAction::base_WriteStructuralFeatureAction : WriteStructuralFeatureAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Write_Structural_Feature_Actions.UML_Write_Structural_Feature_Action_Access'
(AMF.Utp.Set_Timezone_Actions.Utp_Set_Timezone_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Write_Structural_Feature_Action));
else
raise Program_Error;
end if;
end Utp_Set_Timezone_Action_Get;
--------------------------------
-- Utp_Start_Timer_Action_Get --
--------------------------------
function Utp_Start_Timer_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Start_Timer_Action_Base_Call_Operation_Action_A_Extension_Start_Timer_Action then
-- StartTimerAction::base_CallOperationAction : CallOperationAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access'
(AMF.Utp.Start_Timer_Actions.Utp_Start_Timer_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Call_Operation_Action));
else
raise Program_Error;
end if;
end Utp_Start_Timer_Action_Get;
-------------------------------
-- Utp_Stop_Timer_Action_Get --
-------------------------------
function Utp_Stop_Timer_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Stop_Timer_Action_Base_Call_Operation_Action_A_Extension_Stop_Timer_Action then
-- StopTimerAction::base_CallOperationAction : CallOperationAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access'
(AMF.Utp.Stop_Timer_Actions.Utp_Stop_Timer_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Call_Operation_Action));
else
raise Program_Error;
end if;
end Utp_Stop_Timer_Action_Get;
-----------------------
-- Utp_Test_Case_Get --
-----------------------
function Utp_Test_Case_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Case_Base_Behavior_A_Extension_Test_Case then
-- TestCase::base_Behavior : Behavior
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Behaviors.UML_Behavior_Access'
(AMF.Utp.Test_Cases.Utp_Test_Case_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Behavior));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Case_Base_Operation_A_Extension_Test_Case then
-- TestCase::base_Operation : Operation
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Operations.UML_Operation_Access'
(AMF.Utp.Test_Cases.Utp_Test_Case_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Operation));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Case_Compatible_SUT_Variant then
-- TestCase::compatibleSUTVariant : String
return
AMF.String_Collections.Internals.To_Holder
(AMF.Utp.Test_Cases.Utp_Test_Case_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Compatible_SUT_Variant);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Case_Compatible_SUT_Version then
-- TestCase::compatibleSUTVersion : String
return
AMF.String_Collections.Internals.To_Holder
(AMF.Utp.Test_Cases.Utp_Test_Case_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Compatible_SUT_Version);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Case_Priority then
-- TestCase::priority : String
return
AMF.Holders.To_Holder
(AMF.Utp.Test_Cases.Utp_Test_Case_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Priority);
else
raise Program_Error;
end if;
end Utp_Test_Case_Get;
----------------------------
-- Utp_Test_Component_Get --
----------------------------
function Utp_Test_Component_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Component_Base_Structured_Classifier_A_Extension_Test_Component then
-- TestComponent::base_StructuredClassifier : StructuredClassifier
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Structured_Classifiers.UML_Structured_Classifier_Access'
(AMF.Utp.Test_Components.Utp_Test_Component_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Structured_Classifier));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Component_Compatible_SUT_Variant then
-- TestComponent::compatibleSUTVariant : String
return
AMF.String_Collections.Internals.To_Holder
(AMF.Utp.Test_Components.Utp_Test_Component_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Compatible_SUT_Variant);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Component_Compatible_SUT_Version then
-- TestComponent::compatibleSUTVersion : String
return
AMF.String_Collections.Internals.To_Holder
(AMF.Utp.Test_Components.Utp_Test_Component_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Compatible_SUT_Version);
else
raise Program_Error;
end if;
end Utp_Test_Component_Get;
--------------------------
-- Utp_Test_Context_Get --
--------------------------
function Utp_Test_Context_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Context_Base_Behaviored_Classifier_A_Extension_Test_Context then
-- TestContext::base_BehavioredClassifier : BehavioredClassifier
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Behaviored_Classifiers.UML_Behaviored_Classifier_Access'
(AMF.Utp.Test_Contexts.Utp_Test_Context_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Behaviored_Classifier));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Context_Base_Structured_Classifier_A_Extension_Test_Context then
-- TestContext::base_StructuredClassifier : StructuredClassifier
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Structured_Classifiers.UML_Structured_Classifier_Access'
(AMF.Utp.Test_Contexts.Utp_Test_Context_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Structured_Classifier));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Context_Compatible_SUT_Variant then
-- TestContext::compatibleSUTVariant : String
return
AMF.String_Collections.Internals.To_Holder
(AMF.Utp.Test_Contexts.Utp_Test_Context_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Compatible_SUT_Variant);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Context_Compatible_SUT_Version then
-- TestContext::compatibleSUTVersion : String
return
AMF.String_Collections.Internals.To_Holder
(AMF.Utp.Test_Contexts.Utp_Test_Context_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Compatible_SUT_Version);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Context_Test_Level then
-- TestContext::testLevel : String
return
AMF.Holders.To_Holder
(AMF.Utp.Test_Contexts.Utp_Test_Context_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Test_Level);
else
raise Program_Error;
end if;
end Utp_Test_Context_Get;
----------------------
-- Utp_Test_Log_Get --
----------------------
function Utp_Test_Log_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Base_Behavior_A_Extension_Test_Log then
-- TestLog::base_Behavior : Behavior
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Behaviors.UML_Behavior_Access'
(AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Behavior));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Duration then
-- TestLog::duration : String
return
AMF.Holders.To_Holder
(AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Duration);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Executed_At then
-- TestLog::executedAt : String
return
AMF.Holders.To_Holder
(AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Executed_At);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Sut_Version then
-- TestLog::sutVersion : String
return
AMF.Holders.To_Holder
(AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Sut_Version);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Tester then
-- TestLog::tester : String
return
AMF.String_Collections.Internals.To_Holder
(AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Tester);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Verdict then
-- TestLog::verdict : Verdict
return
AMF.Utp.Holders.Verdicts.To_Holder
(AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Verdict);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Verdict_Reason then
-- TestLog::verdictReason : String
return
AMF.Holders.To_Holder
(AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Verdict_Reason);
else
raise Program_Error;
end if;
end Utp_Test_Log_Get;
----------------------------------
-- Utp_Test_Log_Application_Get --
----------------------------------
function Utp_Test_Log_Application_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Application_Base_Dependency_A_Extension_Test_Log_Application then
-- TestLogApplication::base_Dependency : Dependency
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Dependencies.UML_Dependency_Access'
(AMF.Utp.Test_Log_Applications.Utp_Test_Log_Application_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Dependency));
else
raise Program_Error;
end if;
end Utp_Test_Log_Application_Get;
----------------------------
-- Utp_Test_Objective_Get --
----------------------------
function Utp_Test_Objective_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Objective_Base_Dependency_A_Extension_Test_Objective then
-- TestObjective::base_Dependency : Dependency
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Dependencies.UML_Dependency_Access'
(AMF.Utp.Test_Objectives.Utp_Test_Objective_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Dependency));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Objective_Priority then
-- TestObjective::priority : String
return
AMF.Holders.To_Holder
(AMF.Utp.Test_Objectives.Utp_Test_Objective_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Priority);
else
raise Program_Error;
end if;
end Utp_Test_Objective_Get;
------------------------
-- Utp_Test_Suite_Get --
------------------------
function Utp_Test_Suite_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Suite_Base_Behavior_A_Extension_Test_Suite then
-- TestSuite::base_Behavior : Behavior
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Behaviors.UML_Behavior_Access'
(AMF.Utp.Test_Suites.Utp_Test_Suite_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Behavior));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Suite_Priority then
-- TestSuite::priority : String
return
AMF.Holders.To_Holder
(AMF.Utp.Test_Suites.Utp_Test_Suite_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Priority);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Suite_Test_Case then
-- TestSuite::testCase : TestCase
return
AMF.Utp.Test_Cases.Collections.Utp_Test_Case_Collections.Internals.To_Holder
(AMF.Utp.Test_Suites.Utp_Test_Suite_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Test_Case);
else
raise Program_Error;
end if;
end Utp_Test_Suite_Get;
----------------------
-- Utp_Time_Out_Get --
----------------------
function Utp_Time_Out_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Time_Out_Base_Time_Event_A_Extension_Time_Out then
-- TimeOut::base_TimeEvent : TimeEvent
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Time_Events.UML_Time_Event_Access'
(AMF.Utp.Time_Outs.Utp_Time_Out_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Time_Event));
else
raise Program_Error;
end if;
end Utp_Time_Out_Get;
-----------------------------
-- Utp_Time_Out_Action_Get --
-----------------------------
function Utp_Time_Out_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Time_Out_Action_Base_Accept_Event_Action_A_Extension_Time_Out_Action then
-- TimeOutAction::base_AcceptEventAction : AcceptEventAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Accept_Event_Actions.UML_Accept_Event_Action_Access'
(AMF.Utp.Time_Out_Actions.Utp_Time_Out_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Accept_Event_Action));
else
raise Program_Error;
end if;
end Utp_Time_Out_Action_Get;
------------------------------
-- Utp_Time_Out_Message_Get --
------------------------------
function Utp_Time_Out_Message_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Time_Out_Message_Base_Message_A_Extension_Time_Out_Message then
-- TimeOutMessage::base_Message : Message
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Messages.UML_Message_Access'
(AMF.Utp.Time_Out_Messages.Utp_Time_Out_Message_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Message));
else
raise Program_Error;
end if;
end Utp_Time_Out_Message_Get;
----------------------------------
-- Utp_Timer_Running_Action_Get --
----------------------------------
function Utp_Timer_Running_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Timer_Running_Action_Base_Read_Structural_Feature_Action_A_Extension_Timer_Running_Action then
-- TimerRunningAction::base_ReadStructuralFeatureAction : ReadStructuralFeatureAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Read_Structural_Feature_Actions.UML_Read_Structural_Feature_Action_Access'
(AMF.Utp.Timer_Running_Actions.Utp_Timer_Running_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Read_Structural_Feature_Action));
else
raise Program_Error;
end if;
end Utp_Timer_Running_Action_Get;
-------------------------------
-- Utp_Validation_Action_Get --
-------------------------------
function Utp_Validation_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Validation_Action_Base_Call_Operation_Action_A_Extension_Validation_Action then
-- ValidationAction::base_CallOperationAction : CallOperationAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access'
(AMF.Utp.Validation_Actions.Utp_Validation_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Call_Operation_Action));
else
raise Program_Error;
end if;
end Utp_Validation_Action_Get;
begin
case AMF.Internals.Tables.UTP_Element_Table.Table (Self).Kind is
when AMF.Internals.Tables.UTP_Types.E_None =>
raise Program_Error;
when AMF.Internals.Tables.UTP_Types.E_Utp_Coding_Rule =>
return Utp_Coding_Rule_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Partition =>
return Utp_Data_Partition_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Pool =>
return Utp_Data_Pool_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Selector =>
return Utp_Data_Selector_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Default =>
return Utp_Default_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Default_Application =>
return Utp_Default_Application_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Determ_Alt =>
return Utp_Determ_Alt_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Finish_Action =>
return Utp_Finish_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Get_Timezone_Action =>
return Utp_Get_Timezone_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Literal_Any =>
return Utp_Literal_Any_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Literal_Any_Or_Null =>
return Utp_Literal_Any_Or_Null_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Log_Action =>
return Utp_Log_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Managed_Element =>
return Utp_Managed_Element_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Read_Timer_Action =>
return Utp_Read_Timer_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_SUT =>
return Utp_SUT_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Set_Timezone_Action =>
return Utp_Set_Timezone_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Start_Timer_Action =>
return Utp_Start_Timer_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Stop_Timer_Action =>
return Utp_Stop_Timer_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Case =>
return Utp_Test_Case_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Component =>
return Utp_Test_Component_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Context =>
return Utp_Test_Context_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Log =>
return Utp_Test_Log_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Log_Application =>
return Utp_Test_Log_Application_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Objective =>
return Utp_Test_Objective_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Suite =>
return Utp_Test_Suite_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out =>
return Utp_Time_Out_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out_Action =>
return Utp_Time_Out_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out_Message =>
return Utp_Time_Out_Message_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Timer_Running_Action =>
return Utp_Timer_Running_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Validation_Action =>
return Utp_Validation_Action_Get;
end case;
end Get;
--------------------
-- Get_Meta_Class --
--------------------
function Get_Meta_Class
(Self : AMF.Internals.AMF_Element) return CMOF_Element is
begin
case UTP_Element_Table.Table (Self).Kind is
when AMF.Internals.Tables.UTP_Types.E_None =>
return 0;
when AMF.Internals.Tables.UTP_Types.E_Utp_Coding_Rule =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Coding_Rule;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Partition =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Data_Partition;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Pool =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Data_Pool;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Selector =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Data_Selector;
when AMF.Internals.Tables.UTP_Types.E_Utp_Default =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Default;
when AMF.Internals.Tables.UTP_Types.E_Utp_Default_Application =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Default_Application;
when AMF.Internals.Tables.UTP_Types.E_Utp_Determ_Alt =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Determ_Alt;
when AMF.Internals.Tables.UTP_Types.E_Utp_Finish_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Finish_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_Get_Timezone_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Get_Timezone_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_Literal_Any =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Literal_Any;
when AMF.Internals.Tables.UTP_Types.E_Utp_Literal_Any_Or_Null =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Literal_Any_Or_Null;
when AMF.Internals.Tables.UTP_Types.E_Utp_Log_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Log_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_Managed_Element =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Managed_Element;
when AMF.Internals.Tables.UTP_Types.E_Utp_Read_Timer_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Read_Timer_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_SUT =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_SUT;
when AMF.Internals.Tables.UTP_Types.E_Utp_Set_Timezone_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Set_Timezone_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_Start_Timer_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Start_Timer_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_Stop_Timer_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Stop_Timer_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Case =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Test_Case;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Component =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Test_Component;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Context =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Test_Context;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Log =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Test_Log;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Log_Application =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Test_Log_Application;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Objective =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Test_Objective;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Suite =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Test_Suite;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Time_Out;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Time_Out_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out_Message =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Time_Out_Message;
when AMF.Internals.Tables.UTP_Types.E_Utp_Timer_Running_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Timer_Running_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_Validation_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Validation_Action;
end case;
end Get_Meta_Class;
---------
-- Set --
---------
procedure Set
(Self : AMF.Internals.AMF_Element;
Property : CMOF_Element;
Value : League.Holders.Holder)
is
procedure Utp_Coding_Rule_Set;
-- Sets attribute's value of instance of CodingRule class.
procedure Utp_Data_Partition_Set;
-- Sets attribute's value of instance of DataPartition class.
procedure Utp_Data_Pool_Set;
-- Sets attribute's value of instance of DataPool class.
procedure Utp_Data_Selector_Set;
-- Sets attribute's value of instance of DataSelector class.
procedure Utp_Default_Set;
-- Sets attribute's value of instance of Default class.
procedure Utp_Default_Application_Set;
-- Sets attribute's value of instance of DefaultApplication class.
procedure Utp_Determ_Alt_Set;
-- Sets attribute's value of instance of DetermAlt class.
procedure Utp_Finish_Action_Set;
-- Sets attribute's value of instance of FinishAction class.
procedure Utp_Get_Timezone_Action_Set;
-- Sets attribute's value of instance of GetTimezoneAction class.
procedure Utp_Literal_Any_Set;
-- Sets attribute's value of instance of LiteralAny class.
procedure Utp_Literal_Any_Or_Null_Set;
-- Sets attribute's value of instance of LiteralAnyOrNull class.
procedure Utp_Log_Action_Set;
-- Sets attribute's value of instance of LogAction class.
procedure Utp_Managed_Element_Set;
-- Sets attribute's value of instance of ManagedElement class.
procedure Utp_Read_Timer_Action_Set;
-- Sets attribute's value of instance of ReadTimerAction class.
procedure Utp_SUT_Set;
-- Sets attribute's value of instance of SUT class.
procedure Utp_Set_Timezone_Action_Set;
-- Sets attribute's value of instance of SetTimezoneAction class.
procedure Utp_Start_Timer_Action_Set;
-- Sets attribute's value of instance of StartTimerAction class.
procedure Utp_Stop_Timer_Action_Set;
-- Sets attribute's value of instance of StopTimerAction class.
procedure Utp_Test_Case_Set;
-- Sets attribute's value of instance of TestCase class.
procedure Utp_Test_Component_Set;
-- Sets attribute's value of instance of TestComponent class.
procedure Utp_Test_Context_Set;
-- Sets attribute's value of instance of TestContext class.
procedure Utp_Test_Log_Set;
-- Sets attribute's value of instance of TestLog class.
procedure Utp_Test_Log_Application_Set;
-- Sets attribute's value of instance of TestLogApplication class.
procedure Utp_Test_Objective_Set;
-- Sets attribute's value of instance of TestObjective class.
procedure Utp_Test_Suite_Set;
-- Sets attribute's value of instance of TestSuite class.
procedure Utp_Time_Out_Set;
-- Sets attribute's value of instance of TimeOut class.
procedure Utp_Time_Out_Action_Set;
-- Sets attribute's value of instance of TimeOutAction class.
procedure Utp_Time_Out_Message_Set;
-- Sets attribute's value of instance of TimeOutMessage class.
procedure Utp_Timer_Running_Action_Set;
-- Sets attribute's value of instance of TimerRunningAction class.
procedure Utp_Validation_Action_Set;
-- Sets attribute's value of instance of ValidationAction class.
-------------------------
-- Utp_Coding_Rule_Set --
-------------------------
procedure Utp_Coding_Rule_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Coding_Rule_Base_Namespace_A_Extension_Coding_Rule then
-- CodingRule::base_Namespace : Namespace
AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Namespace
(AMF.UML.Namespaces.UML_Namespace_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Coding_Rule_Base_Property_A_Extension_Coding_Rule then
-- CodingRule::base_Property : Property
AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Property
(AMF.UML.Properties.UML_Property_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Coding_Rule_Base_Value_Specification_A_Extension_Coding_Rule then
-- CodingRule::base_ValueSpecification : ValueSpecification
AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Value_Specification
(AMF.UML.Value_Specifications.UML_Value_Specification_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Coding_Rule_Coding then
-- CodingRule::coding : String
AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Coding
(League.Holders.Element (Value));
else
raise Program_Error;
end if;
end Utp_Coding_Rule_Set;
----------------------------
-- Utp_Data_Partition_Set --
----------------------------
procedure Utp_Data_Partition_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Data_Partition_Base_Classifier_A_Extension_Data_Partition then
-- DataPartition::base_Classifier : Classifier
AMF.Utp.Data_Partitions.Utp_Data_Partition_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Classifier
(AMF.UML.Classifiers.UML_Classifier_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Data_Partition_Set;
-----------------------
-- Utp_Data_Pool_Set --
-----------------------
procedure Utp_Data_Pool_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Data_Pool_Base_Classifier_A_Extension_Data_Pool then
-- DataPool::base_Classifier : Classifier
AMF.Utp.Data_Pools.Utp_Data_Pool_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Classifier
(AMF.UML.Classifiers.UML_Classifier_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Data_Pool_Base_Property_A_Extension_Data_Pool then
-- DataPool::base_Property : Property
AMF.Utp.Data_Pools.Utp_Data_Pool_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Property
(AMF.UML.Properties.UML_Property_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Data_Pool_Set;
---------------------------
-- Utp_Data_Selector_Set --
---------------------------
procedure Utp_Data_Selector_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Data_Selector_Base_Operation_A_Extension_Data_Selector then
-- DataSelector::base_Operation : Operation
AMF.Utp.Data_Selectors.Utp_Data_Selector_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Operation
(AMF.UML.Operations.UML_Operation_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Data_Selector_Set;
---------------------
-- Utp_Default_Set --
---------------------
procedure Utp_Default_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Default_Base_Behavior_A_Extension_Default then
-- Default::base_Behavior : Behavior
AMF.Utp.Defaults.Utp_Default_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Behavior
(AMF.UML.Behaviors.UML_Behavior_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Default_Set;
---------------------------------
-- Utp_Default_Application_Set --
---------------------------------
procedure Utp_Default_Application_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Default_Application_Base_Dependency_A_Extension_Default_Application then
-- DefaultApplication::base_Dependency : Dependency
AMF.Utp.Default_Applications.Utp_Default_Application_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Dependency
(AMF.UML.Dependencies.UML_Dependency_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Default_Application_Repetition then
-- DefaultApplication::repetition : UnlimitedNatural
AMF.Utp.Default_Applications.Utp_Default_Application_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Repetition
(AMF.Holders.Unlimited_Naturals.Element (Value));
else
raise Program_Error;
end if;
end Utp_Default_Application_Set;
------------------------
-- Utp_Determ_Alt_Set --
------------------------
procedure Utp_Determ_Alt_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Determ_Alt_Base_Combined_Fragment_A_Extension_Determ_Alt then
-- DetermAlt::base_CombinedFragment : CombinedFragment
AMF.Utp.Determ_Alts.Utp_Determ_Alt_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Combined_Fragment
(AMF.UML.Combined_Fragments.UML_Combined_Fragment_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Determ_Alt_Set;
---------------------------
-- Utp_Finish_Action_Set --
---------------------------
procedure Utp_Finish_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Finish_Action_Base_Invocation_Action_A_Extension_Finish_Action then
-- FinishAction::base_InvocationAction : InvocationAction
AMF.Utp.Finish_Actions.Utp_Finish_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Invocation_Action
(AMF.UML.Invocation_Actions.UML_Invocation_Action_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Finish_Action_Base_Opaque_Action_A_Extension_Finish_Action then
-- FinishAction::base_OpaqueAction : OpaqueAction
AMF.Utp.Finish_Actions.Utp_Finish_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Opaque_Action
(AMF.UML.Opaque_Actions.UML_Opaque_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Finish_Action_Set;
---------------------------------
-- Utp_Get_Timezone_Action_Set --
---------------------------------
procedure Utp_Get_Timezone_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Get_Timezone_Action_Base_Read_Structural_Feature_Action_A_Extension_Get_Timezone_Action then
-- GetTimezoneAction::base_ReadStructuralFeatureAction : ReadStructuralFeatureAction
AMF.Utp.Get_Timezone_Actions.Utp_Get_Timezone_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Read_Structural_Feature_Action
(AMF.UML.Read_Structural_Feature_Actions.UML_Read_Structural_Feature_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Get_Timezone_Action_Set;
-------------------------
-- Utp_Literal_Any_Set --
-------------------------
procedure Utp_Literal_Any_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Literal_Any_Base_Literal_Specification_A_Extension_Literal_Any then
-- LiteralAny::base_LiteralSpecification : LiteralSpecification
AMF.Utp.Literal_Anies.Utp_Literal_Any_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Literal_Specification
(AMF.UML.Literal_Specifications.UML_Literal_Specification_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Literal_Any_Set;
---------------------------------
-- Utp_Literal_Any_Or_Null_Set --
---------------------------------
procedure Utp_Literal_Any_Or_Null_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Literal_Any_Or_Null_Base_Literal_Specification_A_Extension_Literal_Any_Or_Null then
-- LiteralAnyOrNull::base_LiteralSpecification : LiteralSpecification
AMF.Utp.Literal_Any_Or_Nulls.Utp_Literal_Any_Or_Null_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Literal_Specification
(AMF.UML.Literal_Specifications.UML_Literal_Specification_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Literal_Any_Or_Null_Set;
------------------------
-- Utp_Log_Action_Set --
------------------------
procedure Utp_Log_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Log_Action_Base_Send_Object_Action_A_Extension_Log_Action then
-- LogAction::base_SendObjectAction : SendObjectAction
AMF.Utp.Log_Actions.Utp_Log_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Send_Object_Action
(AMF.UML.Send_Object_Actions.UML_Send_Object_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Log_Action_Set;
-----------------------------
-- Utp_Managed_Element_Set --
-----------------------------
procedure Utp_Managed_Element_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Base_Element_A_Extension_Managed_Element then
-- ManagedElement::base_Element : Element
AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Element
(AMF.UML.Elements.UML_Element_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Criticality then
-- ManagedElement::criticality : String
AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Criticality
(AMF.Holders.Element (Value));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Description then
-- ManagedElement::description : String
AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Description
(AMF.Holders.Element (Value));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Owner then
-- ManagedElement::owner : String
AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Owner
(AMF.Holders.Element (Value));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Version then
-- ManagedElement::version : String
AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Version
(AMF.Holders.Element (Value));
else
raise Program_Error;
end if;
end Utp_Managed_Element_Set;
-------------------------------
-- Utp_Read_Timer_Action_Set --
-------------------------------
procedure Utp_Read_Timer_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Read_Timer_Action_Base_Call_Operation_Action_A_Extension_Read_Timer_Action then
-- ReadTimerAction::base_CallOperationAction : CallOperationAction
AMF.Utp.Read_Timer_Actions.Utp_Read_Timer_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Call_Operation_Action
(AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Read_Timer_Action_Set;
-----------------
-- Utp_SUT_Set --
-----------------
procedure Utp_SUT_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_SUT_Base_Property_A_Extension_SUT then
-- SUT::base_Property : Property
AMF.Utp.SUTs.Utp_SUT_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Property
(AMF.UML.Properties.UML_Property_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_SUT_Set;
---------------------------------
-- Utp_Set_Timezone_Action_Set --
---------------------------------
procedure Utp_Set_Timezone_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Set_Timezone_Action_Base_Write_Structural_Feature_Action_A_Extension_Set_Timezone_Action then
-- SetTimezoneAction::base_WriteStructuralFeatureAction : WriteStructuralFeatureAction
AMF.Utp.Set_Timezone_Actions.Utp_Set_Timezone_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Write_Structural_Feature_Action
(AMF.UML.Write_Structural_Feature_Actions.UML_Write_Structural_Feature_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Set_Timezone_Action_Set;
--------------------------------
-- Utp_Start_Timer_Action_Set --
--------------------------------
procedure Utp_Start_Timer_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Start_Timer_Action_Base_Call_Operation_Action_A_Extension_Start_Timer_Action then
-- StartTimerAction::base_CallOperationAction : CallOperationAction
AMF.Utp.Start_Timer_Actions.Utp_Start_Timer_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Call_Operation_Action
(AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Start_Timer_Action_Set;
-------------------------------
-- Utp_Stop_Timer_Action_Set --
-------------------------------
procedure Utp_Stop_Timer_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Stop_Timer_Action_Base_Call_Operation_Action_A_Extension_Stop_Timer_Action then
-- StopTimerAction::base_CallOperationAction : CallOperationAction
AMF.Utp.Stop_Timer_Actions.Utp_Stop_Timer_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Call_Operation_Action
(AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Stop_Timer_Action_Set;
-----------------------
-- Utp_Test_Case_Set --
-----------------------
procedure Utp_Test_Case_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Case_Base_Behavior_A_Extension_Test_Case then
-- TestCase::base_Behavior : Behavior
AMF.Utp.Test_Cases.Utp_Test_Case_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Behavior
(AMF.UML.Behaviors.UML_Behavior_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Case_Base_Operation_A_Extension_Test_Case then
-- TestCase::base_Operation : Operation
AMF.Utp.Test_Cases.Utp_Test_Case_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Operation
(AMF.UML.Operations.UML_Operation_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Case_Priority then
-- TestCase::priority : String
AMF.Utp.Test_Cases.Utp_Test_Case_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Priority
(AMF.Holders.Element (Value));
else
raise Program_Error;
end if;
end Utp_Test_Case_Set;
----------------------------
-- Utp_Test_Component_Set --
----------------------------
procedure Utp_Test_Component_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Component_Base_Structured_Classifier_A_Extension_Test_Component then
-- TestComponent::base_StructuredClassifier : StructuredClassifier
AMF.Utp.Test_Components.Utp_Test_Component_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Structured_Classifier
(AMF.UML.Structured_Classifiers.UML_Structured_Classifier_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Test_Component_Set;
--------------------------
-- Utp_Test_Context_Set --
--------------------------
procedure Utp_Test_Context_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Context_Base_Behaviored_Classifier_A_Extension_Test_Context then
-- TestContext::base_BehavioredClassifier : BehavioredClassifier
AMF.Utp.Test_Contexts.Utp_Test_Context_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Behaviored_Classifier
(AMF.UML.Behaviored_Classifiers.UML_Behaviored_Classifier_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Context_Base_Structured_Classifier_A_Extension_Test_Context then
-- TestContext::base_StructuredClassifier : StructuredClassifier
AMF.Utp.Test_Contexts.Utp_Test_Context_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Structured_Classifier
(AMF.UML.Structured_Classifiers.UML_Structured_Classifier_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Context_Test_Level then
-- TestContext::testLevel : String
AMF.Utp.Test_Contexts.Utp_Test_Context_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Test_Level
(AMF.Holders.Element (Value));
else
raise Program_Error;
end if;
end Utp_Test_Context_Set;
----------------------
-- Utp_Test_Log_Set --
----------------------
procedure Utp_Test_Log_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Base_Behavior_A_Extension_Test_Log then
-- TestLog::base_Behavior : Behavior
AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Behavior
(AMF.UML.Behaviors.UML_Behavior_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Duration then
-- TestLog::duration : String
AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Duration
(AMF.Holders.Element (Value));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Executed_At then
-- TestLog::executedAt : String
AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Executed_At
(AMF.Holders.Element (Value));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Sut_Version then
-- TestLog::sutVersion : String
AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Sut_Version
(AMF.Holders.Element (Value));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Verdict then
-- TestLog::verdict : Verdict
AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Verdict
(AMF.Utp.Holders.Verdicts.Element (Value));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Verdict_Reason then
-- TestLog::verdictReason : String
AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Verdict_Reason
(AMF.Holders.Element (Value));
else
raise Program_Error;
end if;
end Utp_Test_Log_Set;
----------------------------------
-- Utp_Test_Log_Application_Set --
----------------------------------
procedure Utp_Test_Log_Application_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Application_Base_Dependency_A_Extension_Test_Log_Application then
-- TestLogApplication::base_Dependency : Dependency
AMF.Utp.Test_Log_Applications.Utp_Test_Log_Application_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Dependency
(AMF.UML.Dependencies.UML_Dependency_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Test_Log_Application_Set;
----------------------------
-- Utp_Test_Objective_Set --
----------------------------
procedure Utp_Test_Objective_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Objective_Base_Dependency_A_Extension_Test_Objective then
-- TestObjective::base_Dependency : Dependency
AMF.Utp.Test_Objectives.Utp_Test_Objective_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Dependency
(AMF.UML.Dependencies.UML_Dependency_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Objective_Priority then
-- TestObjective::priority : String
AMF.Utp.Test_Objectives.Utp_Test_Objective_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Priority
(AMF.Holders.Element (Value));
else
raise Program_Error;
end if;
end Utp_Test_Objective_Set;
------------------------
-- Utp_Test_Suite_Set --
------------------------
procedure Utp_Test_Suite_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Suite_Base_Behavior_A_Extension_Test_Suite then
-- TestSuite::base_Behavior : Behavior
AMF.Utp.Test_Suites.Utp_Test_Suite_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Behavior
(AMF.UML.Behaviors.UML_Behavior_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Suite_Priority then
-- TestSuite::priority : String
AMF.Utp.Test_Suites.Utp_Test_Suite_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Priority
(AMF.Holders.Element (Value));
else
raise Program_Error;
end if;
end Utp_Test_Suite_Set;
----------------------
-- Utp_Time_Out_Set --
----------------------
procedure Utp_Time_Out_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Time_Out_Base_Time_Event_A_Extension_Time_Out then
-- TimeOut::base_TimeEvent : TimeEvent
AMF.Utp.Time_Outs.Utp_Time_Out_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Time_Event
(AMF.UML.Time_Events.UML_Time_Event_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Time_Out_Set;
-----------------------------
-- Utp_Time_Out_Action_Set --
-----------------------------
procedure Utp_Time_Out_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Time_Out_Action_Base_Accept_Event_Action_A_Extension_Time_Out_Action then
-- TimeOutAction::base_AcceptEventAction : AcceptEventAction
AMF.Utp.Time_Out_Actions.Utp_Time_Out_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Accept_Event_Action
(AMF.UML.Accept_Event_Actions.UML_Accept_Event_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Time_Out_Action_Set;
------------------------------
-- Utp_Time_Out_Message_Set --
------------------------------
procedure Utp_Time_Out_Message_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Time_Out_Message_Base_Message_A_Extension_Time_Out_Message then
-- TimeOutMessage::base_Message : Message
AMF.Utp.Time_Out_Messages.Utp_Time_Out_Message_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Message
(AMF.UML.Messages.UML_Message_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Time_Out_Message_Set;
----------------------------------
-- Utp_Timer_Running_Action_Set --
----------------------------------
procedure Utp_Timer_Running_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Timer_Running_Action_Base_Read_Structural_Feature_Action_A_Extension_Timer_Running_Action then
-- TimerRunningAction::base_ReadStructuralFeatureAction : ReadStructuralFeatureAction
AMF.Utp.Timer_Running_Actions.Utp_Timer_Running_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Read_Structural_Feature_Action
(AMF.UML.Read_Structural_Feature_Actions.UML_Read_Structural_Feature_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Timer_Running_Action_Set;
-------------------------------
-- Utp_Validation_Action_Set --
-------------------------------
procedure Utp_Validation_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Validation_Action_Base_Call_Operation_Action_A_Extension_Validation_Action then
-- ValidationAction::base_CallOperationAction : CallOperationAction
AMF.Utp.Validation_Actions.Utp_Validation_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Call_Operation_Action
(AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Validation_Action_Set;
begin
case UTP_Element_Table.Table (Self).Kind is
when AMF.Internals.Tables.UTP_Types.E_None =>
raise Program_Error;
when AMF.Internals.Tables.UTP_Types.E_Utp_Coding_Rule =>
Utp_Coding_Rule_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Partition =>
Utp_Data_Partition_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Pool =>
Utp_Data_Pool_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Selector =>
Utp_Data_Selector_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Default =>
Utp_Default_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Default_Application =>
Utp_Default_Application_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Determ_Alt =>
Utp_Determ_Alt_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Finish_Action =>
Utp_Finish_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Get_Timezone_Action =>
Utp_Get_Timezone_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Literal_Any =>
Utp_Literal_Any_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Literal_Any_Or_Null =>
Utp_Literal_Any_Or_Null_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Log_Action =>
Utp_Log_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Managed_Element =>
Utp_Managed_Element_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Read_Timer_Action =>
Utp_Read_Timer_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_SUT =>
Utp_SUT_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Set_Timezone_Action =>
Utp_Set_Timezone_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Start_Timer_Action =>
Utp_Start_Timer_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Stop_Timer_Action =>
Utp_Stop_Timer_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Case =>
Utp_Test_Case_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Component =>
Utp_Test_Component_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Context =>
Utp_Test_Context_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Log =>
Utp_Test_Log_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Log_Application =>
Utp_Test_Log_Application_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Objective =>
Utp_Test_Objective_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Suite =>
Utp_Test_Suite_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out =>
Utp_Time_Out_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out_Action =>
Utp_Time_Out_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out_Message =>
Utp_Time_Out_Message_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Timer_Running_Action =>
Utp_Timer_Running_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Validation_Action =>
Utp_Validation_Action_Set;
end case;
end Set;
end AMF.Internals.Tables.UTP_Reflection;
| true |
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Holders.Elements;
with AMF.Holders.Unlimited_Naturals;
with AMF.Internals.Helpers;
with AMF.Internals.Holders.UML_Holders;
with AMF.Internals.Tables.UTP_Element_Table;
with AMF.Internals.Tables.UTP_Types;
with AMF.Internals.Tables.Utp_Metamodel;
with AMF.String_Collections.Internals;
with AMF.UML.Accept_Event_Actions;
with AMF.UML.Behaviored_Classifiers;
with AMF.UML.Behaviors;
with AMF.UML.Call_Operation_Actions;
with AMF.UML.Classifiers;
with AMF.UML.Combined_Fragments;
with AMF.UML.Dependencies;
with AMF.UML.Elements;
with AMF.UML.Invocation_Actions;
with AMF.UML.Literal_Specifications;
with AMF.UML.Messages;
with AMF.UML.Namespaces;
with AMF.UML.Opaque_Actions;
with AMF.UML.Operations;
with AMF.UML.Properties;
with AMF.UML.Read_Structural_Feature_Actions;
with AMF.UML.Send_Object_Actions;
with AMF.UML.Structured_Classifiers;
with AMF.UML.Time_Events;
with AMF.UML.Value_Specifications;
with AMF.UML.Write_Structural_Feature_Actions;
with AMF.Utp.Coding_Rules;
with AMF.Utp.Data_Partitions;
with AMF.Utp.Data_Pools;
with AMF.Utp.Data_Selectors;
with AMF.Utp.Default_Applications;
with AMF.Utp.Defaults;
with AMF.Utp.Determ_Alts;
with AMF.Utp.Finish_Actions;
with AMF.Utp.Get_Timezone_Actions;
with AMF.Utp.Holders.Verdicts;
with AMF.Utp.Literal_Anies;
with AMF.Utp.Literal_Any_Or_Nulls;
with AMF.Utp.Log_Actions;
with AMF.Utp.Managed_Elements;
with AMF.Utp.Read_Timer_Actions;
with AMF.Utp.SUTs;
with AMF.Utp.Set_Timezone_Actions;
with AMF.Utp.Start_Timer_Actions;
with AMF.Utp.Stop_Timer_Actions;
with AMF.Utp.Test_Cases.Collections;
with AMF.Utp.Test_Components;
with AMF.Utp.Test_Contexts;
with AMF.Utp.Test_Log_Applications;
with AMF.Utp.Test_Logs;
with AMF.Utp.Test_Objectives;
with AMF.Utp.Test_Suites;
with AMF.Utp.Time_Out_Actions;
with AMF.Utp.Time_Out_Messages;
with AMF.Utp.Time_Outs;
with AMF.Utp.Timer_Running_Actions;
with AMF.Utp.Validation_Actions;
with League.Holders;
package body AMF.Internals.Tables.UTP_Reflection is
---------
-- Get --
---------
function Get
(Self : AMF.Internals.AMF_Element;
Property : CMOF_Element) return League.Holders.Holder
is
function Utp_Coding_Rule_Get return League.Holders.Holder;
-- Returns attribute's value of instance of CodingRule class.
function Utp_Data_Partition_Get return League.Holders.Holder;
-- Returns attribute's value of instance of DataPartition class.
function Utp_Data_Pool_Get return League.Holders.Holder;
-- Returns attribute's value of instance of DataPool class.
function Utp_Data_Selector_Get return League.Holders.Holder;
-- Returns attribute's value of instance of DataSelector class.
function Utp_Default_Get return League.Holders.Holder;
-- Returns attribute's value of instance of Default class.
function Utp_Default_Application_Get return League.Holders.Holder;
-- Returns attribute's value of instance of DefaultApplication class.
function Utp_Determ_Alt_Get return League.Holders.Holder;
-- Returns attribute's value of instance of DetermAlt class.
function Utp_Finish_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of FinishAction class.
function Utp_Get_Timezone_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of GetTimezoneAction class.
function Utp_Literal_Any_Get return League.Holders.Holder;
-- Returns attribute's value of instance of LiteralAny class.
function Utp_Literal_Any_Or_Null_Get return League.Holders.Holder;
-- Returns attribute's value of instance of LiteralAnyOrNull class.
function Utp_Log_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of LogAction class.
function Utp_Managed_Element_Get return League.Holders.Holder;
-- Returns attribute's value of instance of ManagedElement class.
function Utp_Read_Timer_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of ReadTimerAction class.
function Utp_SUT_Get return League.Holders.Holder;
-- Returns attribute's value of instance of SUT class.
function Utp_Set_Timezone_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of SetTimezoneAction class.
function Utp_Start_Timer_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of StartTimerAction class.
function Utp_Stop_Timer_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of StopTimerAction class.
function Utp_Test_Case_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TestCase class.
function Utp_Test_Component_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TestComponent class.
function Utp_Test_Context_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TestContext class.
function Utp_Test_Log_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TestLog class.
function Utp_Test_Log_Application_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TestLogApplication class.
function Utp_Test_Objective_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TestObjective class.
function Utp_Test_Suite_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TestSuite class.
function Utp_Time_Out_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TimeOut class.
function Utp_Time_Out_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TimeOutAction class.
function Utp_Time_Out_Message_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TimeOutMessage class.
function Utp_Timer_Running_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of TimerRunningAction class.
function Utp_Validation_Action_Get return League.Holders.Holder;
-- Returns attribute's value of instance of ValidationAction class.
-------------------------
-- Utp_Coding_Rule_Get --
-------------------------
function Utp_Coding_Rule_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Coding_Rule_Base_Namespace_A_Extension_Coding_Rule then
-- CodingRule::base_Namespace : Namespace
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Namespaces.UML_Namespace_Access'
(AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Namespace));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Coding_Rule_Base_Property_A_Extension_Coding_Rule then
-- CodingRule::base_Property : Property
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Properties.UML_Property_Access'
(AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Property));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Coding_Rule_Base_Value_Specification_A_Extension_Coding_Rule then
-- CodingRule::base_ValueSpecification : ValueSpecification
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Value_Specifications.UML_Value_Specification_Access'
(AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Value_Specification));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Coding_Rule_Coding then
-- CodingRule::coding : String
return
League.Holders.To_Holder
(AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Coding);
else
raise Program_Error;
end if;
end Utp_Coding_Rule_Get;
----------------------------
-- Utp_Data_Partition_Get --
----------------------------
function Utp_Data_Partition_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Data_Partition_Base_Classifier_A_Extension_Data_Partition then
-- DataPartition::base_Classifier : Classifier
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Classifiers.UML_Classifier_Access'
(AMF.Utp.Data_Partitions.Utp_Data_Partition_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Classifier));
else
raise Program_Error;
end if;
end Utp_Data_Partition_Get;
-----------------------
-- Utp_Data_Pool_Get --
-----------------------
function Utp_Data_Pool_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Data_Pool_Base_Classifier_A_Extension_Data_Pool then
-- DataPool::base_Classifier : Classifier
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Classifiers.UML_Classifier_Access'
(AMF.Utp.Data_Pools.Utp_Data_Pool_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Classifier));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Data_Pool_Base_Property_A_Extension_Data_Pool then
-- DataPool::base_Property : Property
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Properties.UML_Property_Access'
(AMF.Utp.Data_Pools.Utp_Data_Pool_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Property));
else
raise Program_Error;
end if;
end Utp_Data_Pool_Get;
---------------------------
-- Utp_Data_Selector_Get --
---------------------------
function Utp_Data_Selector_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Data_Selector_Base_Operation_A_Extension_Data_Selector then
-- DataSelector::base_Operation : Operation
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Operations.UML_Operation_Access'
(AMF.Utp.Data_Selectors.Utp_Data_Selector_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Operation));
else
raise Program_Error;
end if;
end Utp_Data_Selector_Get;
---------------------
-- Utp_Default_Get --
---------------------
function Utp_Default_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Default_Base_Behavior_A_Extension_Default then
-- Default::base_Behavior : Behavior
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Behaviors.UML_Behavior_Access'
(AMF.Utp.Defaults.Utp_Default_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Behavior));
else
raise Program_Error;
end if;
end Utp_Default_Get;
---------------------------------
-- Utp_Default_Application_Get --
---------------------------------
function Utp_Default_Application_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Default_Application_Base_Dependency_A_Extension_Default_Application then
-- DefaultApplication::base_Dependency : Dependency
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Dependencies.UML_Dependency_Access'
(AMF.Utp.Default_Applications.Utp_Default_Application_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Dependency));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Default_Application_Repetition then
-- DefaultApplication::repetition : UnlimitedNatural
return
AMF.Holders.Unlimited_Naturals.To_Holder
(AMF.Utp.Default_Applications.Utp_Default_Application_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Repetition);
else
raise Program_Error;
end if;
end Utp_Default_Application_Get;
------------------------
-- Utp_Determ_Alt_Get --
------------------------
function Utp_Determ_Alt_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Determ_Alt_Base_Combined_Fragment_A_Extension_Determ_Alt then
-- DetermAlt::base_CombinedFragment : CombinedFragment
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Combined_Fragments.UML_Combined_Fragment_Access'
(AMF.Utp.Determ_Alts.Utp_Determ_Alt_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Combined_Fragment));
else
raise Program_Error;
end if;
end Utp_Determ_Alt_Get;
---------------------------
-- Utp_Finish_Action_Get --
---------------------------
function Utp_Finish_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Finish_Action_Base_Invocation_Action_A_Extension_Finish_Action then
-- FinishAction::base_InvocationAction : InvocationAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Invocation_Actions.UML_Invocation_Action_Access'
(AMF.Utp.Finish_Actions.Utp_Finish_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Invocation_Action));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Finish_Action_Base_Opaque_Action_A_Extension_Finish_Action then
-- FinishAction::base_OpaqueAction : OpaqueAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Opaque_Actions.UML_Opaque_Action_Access'
(AMF.Utp.Finish_Actions.Utp_Finish_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Opaque_Action));
else
raise Program_Error;
end if;
end Utp_Finish_Action_Get;
---------------------------------
-- Utp_Get_Timezone_Action_Get --
---------------------------------
function Utp_Get_Timezone_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Get_Timezone_Action_Base_Read_Structural_Feature_Action_A_Extension_Get_Timezone_Action then
-- GetTimezoneAction::base_ReadStructuralFeatureAction : ReadStructuralFeatureAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Read_Structural_Feature_Actions.UML_Read_Structural_Feature_Action_Access'
(AMF.Utp.Get_Timezone_Actions.Utp_Get_Timezone_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Read_Structural_Feature_Action));
else
raise Program_Error;
end if;
end Utp_Get_Timezone_Action_Get;
-------------------------
-- Utp_Literal_Any_Get --
-------------------------
function Utp_Literal_Any_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Literal_Any_Base_Literal_Specification_A_Extension_Literal_Any then
-- LiteralAny::base_LiteralSpecification : LiteralSpecification
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Literal_Specifications.UML_Literal_Specification_Access'
(AMF.Utp.Literal_Anies.Utp_Literal_Any_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Literal_Specification));
else
raise Program_Error;
end if;
end Utp_Literal_Any_Get;
---------------------------------
-- Utp_Literal_Any_Or_Null_Get --
---------------------------------
function Utp_Literal_Any_Or_Null_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Literal_Any_Or_Null_Base_Literal_Specification_A_Extension_Literal_Any_Or_Null then
-- LiteralAnyOrNull::base_LiteralSpecification : LiteralSpecification
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Literal_Specifications.UML_Literal_Specification_Access'
(AMF.Utp.Literal_Any_Or_Nulls.Utp_Literal_Any_Or_Null_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Literal_Specification));
else
raise Program_Error;
end if;
end Utp_Literal_Any_Or_Null_Get;
------------------------
-- Utp_Log_Action_Get --
------------------------
function Utp_Log_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Log_Action_Base_Send_Object_Action_A_Extension_Log_Action then
-- LogAction::base_SendObjectAction : SendObjectAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Send_Object_Actions.UML_Send_Object_Action_Access'
(AMF.Utp.Log_Actions.Utp_Log_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Send_Object_Action));
else
raise Program_Error;
end if;
end Utp_Log_Action_Get;
-----------------------------
-- Utp_Managed_Element_Get --
-----------------------------
function Utp_Managed_Element_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Base_Element_A_Extension_Managed_Element then
-- ManagedElement::base_Element : Element
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Elements.UML_Element_Access'
(AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Element));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Criticality then
-- ManagedElement::criticality : String
return
AMF.Holders.To_Holder
(AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Criticality);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Description then
-- ManagedElement::description : String
return
AMF.Holders.To_Holder
(AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Description);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Owner then
-- ManagedElement::owner : String
return
AMF.Holders.To_Holder
(AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Owner);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Version then
-- ManagedElement::version : String
return
AMF.Holders.To_Holder
(AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Version);
else
raise Program_Error;
end if;
end Utp_Managed_Element_Get;
-------------------------------
-- Utp_Read_Timer_Action_Get --
-------------------------------
function Utp_Read_Timer_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Read_Timer_Action_Base_Call_Operation_Action_A_Extension_Read_Timer_Action then
-- ReadTimerAction::base_CallOperationAction : CallOperationAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access'
(AMF.Utp.Read_Timer_Actions.Utp_Read_Timer_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Call_Operation_Action));
else
raise Program_Error;
end if;
end Utp_Read_Timer_Action_Get;
-----------------
-- Utp_SUT_Get --
-----------------
function Utp_SUT_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_SUT_Base_Property_A_Extension_SUT then
-- SUT::base_Property : Property
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Properties.UML_Property_Access'
(AMF.Utp.SUTs.Utp_SUT_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Property));
else
raise Program_Error;
end if;
end Utp_SUT_Get;
---------------------------------
-- Utp_Set_Timezone_Action_Get --
---------------------------------
function Utp_Set_Timezone_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Set_Timezone_Action_Base_Write_Structural_Feature_Action_A_Extension_Set_Timezone_Action then
-- SetTimezoneAction::base_WriteStructuralFeatureAction : WriteStructuralFeatureAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Write_Structural_Feature_Actions.UML_Write_Structural_Feature_Action_Access'
(AMF.Utp.Set_Timezone_Actions.Utp_Set_Timezone_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Write_Structural_Feature_Action));
else
raise Program_Error;
end if;
end Utp_Set_Timezone_Action_Get;
--------------------------------
-- Utp_Start_Timer_Action_Get --
--------------------------------
function Utp_Start_Timer_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Start_Timer_Action_Base_Call_Operation_Action_A_Extension_Start_Timer_Action then
-- StartTimerAction::base_CallOperationAction : CallOperationAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access'
(AMF.Utp.Start_Timer_Actions.Utp_Start_Timer_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Call_Operation_Action));
else
raise Program_Error;
end if;
end Utp_Start_Timer_Action_Get;
-------------------------------
-- Utp_Stop_Timer_Action_Get --
-------------------------------
function Utp_Stop_Timer_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Stop_Timer_Action_Base_Call_Operation_Action_A_Extension_Stop_Timer_Action then
-- StopTimerAction::base_CallOperationAction : CallOperationAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access'
(AMF.Utp.Stop_Timer_Actions.Utp_Stop_Timer_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Call_Operation_Action));
else
raise Program_Error;
end if;
end Utp_Stop_Timer_Action_Get;
-----------------------
-- Utp_Test_Case_Get --
-----------------------
function Utp_Test_Case_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Case_Base_Behavior_A_Extension_Test_Case then
-- TestCase::base_Behavior : Behavior
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Behaviors.UML_Behavior_Access'
(AMF.Utp.Test_Cases.Utp_Test_Case_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Behavior));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Case_Base_Operation_A_Extension_Test_Case then
-- TestCase::base_Operation : Operation
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Operations.UML_Operation_Access'
(AMF.Utp.Test_Cases.Utp_Test_Case_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Operation));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Case_Compatible_SUT_Variant then
-- TestCase::compatibleSUTVariant : String
return
AMF.String_Collections.Internals.To_Holder
(AMF.Utp.Test_Cases.Utp_Test_Case_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Compatible_SUT_Variant);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Case_Compatible_SUT_Version then
-- TestCase::compatibleSUTVersion : String
return
AMF.String_Collections.Internals.To_Holder
(AMF.Utp.Test_Cases.Utp_Test_Case_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Compatible_SUT_Version);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Case_Priority then
-- TestCase::priority : String
return
AMF.Holders.To_Holder
(AMF.Utp.Test_Cases.Utp_Test_Case_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Priority);
else
raise Program_Error;
end if;
end Utp_Test_Case_Get;
----------------------------
-- Utp_Test_Component_Get --
----------------------------
function Utp_Test_Component_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Component_Base_Structured_Classifier_A_Extension_Test_Component then
-- TestComponent::base_StructuredClassifier : StructuredClassifier
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Structured_Classifiers.UML_Structured_Classifier_Access'
(AMF.Utp.Test_Components.Utp_Test_Component_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Structured_Classifier));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Component_Compatible_SUT_Variant then
-- TestComponent::compatibleSUTVariant : String
return
AMF.String_Collections.Internals.To_Holder
(AMF.Utp.Test_Components.Utp_Test_Component_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Compatible_SUT_Variant);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Component_Compatible_SUT_Version then
-- TestComponent::compatibleSUTVersion : String
return
AMF.String_Collections.Internals.To_Holder
(AMF.Utp.Test_Components.Utp_Test_Component_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Compatible_SUT_Version);
else
raise Program_Error;
end if;
end Utp_Test_Component_Get;
--------------------------
-- Utp_Test_Context_Get --
--------------------------
function Utp_Test_Context_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Context_Base_Behaviored_Classifier_A_Extension_Test_Context then
-- TestContext::base_BehavioredClassifier : BehavioredClassifier
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Behaviored_Classifiers.UML_Behaviored_Classifier_Access'
(AMF.Utp.Test_Contexts.Utp_Test_Context_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Behaviored_Classifier));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Context_Base_Structured_Classifier_A_Extension_Test_Context then
-- TestContext::base_StructuredClassifier : StructuredClassifier
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Structured_Classifiers.UML_Structured_Classifier_Access'
(AMF.Utp.Test_Contexts.Utp_Test_Context_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Structured_Classifier));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Context_Compatible_SUT_Variant then
-- TestContext::compatibleSUTVariant : String
return
AMF.String_Collections.Internals.To_Holder
(AMF.Utp.Test_Contexts.Utp_Test_Context_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Compatible_SUT_Variant);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Context_Compatible_SUT_Version then
-- TestContext::compatibleSUTVersion : String
return
AMF.String_Collections.Internals.To_Holder
(AMF.Utp.Test_Contexts.Utp_Test_Context_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Compatible_SUT_Version);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Context_Test_Level then
-- TestContext::testLevel : String
return
AMF.Holders.To_Holder
(AMF.Utp.Test_Contexts.Utp_Test_Context_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Test_Level);
else
raise Program_Error;
end if;
end Utp_Test_Context_Get;
----------------------
-- Utp_Test_Log_Get --
----------------------
function Utp_Test_Log_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Base_Behavior_A_Extension_Test_Log then
-- TestLog::base_Behavior : Behavior
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Behaviors.UML_Behavior_Access'
(AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Behavior));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Duration then
-- TestLog::duration : String
return
AMF.Holders.To_Holder
(AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Duration);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Executed_At then
-- TestLog::executedAt : String
return
AMF.Holders.To_Holder
(AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Executed_At);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Sut_Version then
-- TestLog::sutVersion : String
return
AMF.Holders.To_Holder
(AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Sut_Version);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Tester then
-- TestLog::tester : String
return
AMF.String_Collections.Internals.To_Holder
(AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Tester);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Verdict then
-- TestLog::verdict : Verdict
return
AMF.Utp.Holders.Verdicts.To_Holder
(AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Verdict);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Verdict_Reason then
-- TestLog::verdictReason : String
return
AMF.Holders.To_Holder
(AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Verdict_Reason);
else
raise Program_Error;
end if;
end Utp_Test_Log_Get;
----------------------------------
-- Utp_Test_Log_Application_Get --
----------------------------------
function Utp_Test_Log_Application_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Application_Base_Dependency_A_Extension_Test_Log_Application then
-- TestLogApplication::base_Dependency : Dependency
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Dependencies.UML_Dependency_Access'
(AMF.Utp.Test_Log_Applications.Utp_Test_Log_Application_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Dependency));
else
raise Program_Error;
end if;
end Utp_Test_Log_Application_Get;
----------------------------
-- Utp_Test_Objective_Get --
----------------------------
function Utp_Test_Objective_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Objective_Base_Dependency_A_Extension_Test_Objective then
-- TestObjective::base_Dependency : Dependency
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Dependencies.UML_Dependency_Access'
(AMF.Utp.Test_Objectives.Utp_Test_Objective_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Dependency));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Objective_Priority then
-- TestObjective::priority : String
return
AMF.Holders.To_Holder
(AMF.Utp.Test_Objectives.Utp_Test_Objective_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Priority);
else
raise Program_Error;
end if;
end Utp_Test_Objective_Get;
------------------------
-- Utp_Test_Suite_Get --
------------------------
function Utp_Test_Suite_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Suite_Base_Behavior_A_Extension_Test_Suite then
-- TestSuite::base_Behavior : Behavior
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Behaviors.UML_Behavior_Access'
(AMF.Utp.Test_Suites.Utp_Test_Suite_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Behavior));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Suite_Priority then
-- TestSuite::priority : String
return
AMF.Holders.To_Holder
(AMF.Utp.Test_Suites.Utp_Test_Suite_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Priority);
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Suite_Test_Case then
-- TestSuite::testCase : TestCase
return
AMF.Utp.Test_Cases.Collections.Utp_Test_Case_Collections.Internals.To_Holder
(AMF.Utp.Test_Suites.Utp_Test_Suite_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Test_Case);
else
raise Program_Error;
end if;
end Utp_Test_Suite_Get;
----------------------
-- Utp_Time_Out_Get --
----------------------
function Utp_Time_Out_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Time_Out_Base_Time_Event_A_Extension_Time_Out then
-- TimeOut::base_TimeEvent : TimeEvent
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Time_Events.UML_Time_Event_Access'
(AMF.Utp.Time_Outs.Utp_Time_Out_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Time_Event));
else
raise Program_Error;
end if;
end Utp_Time_Out_Get;
-----------------------------
-- Utp_Time_Out_Action_Get --
-----------------------------
function Utp_Time_Out_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Time_Out_Action_Base_Accept_Event_Action_A_Extension_Time_Out_Action then
-- TimeOutAction::base_AcceptEventAction : AcceptEventAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Accept_Event_Actions.UML_Accept_Event_Action_Access'
(AMF.Utp.Time_Out_Actions.Utp_Time_Out_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Accept_Event_Action));
else
raise Program_Error;
end if;
end Utp_Time_Out_Action_Get;
------------------------------
-- Utp_Time_Out_Message_Get --
------------------------------
function Utp_Time_Out_Message_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Time_Out_Message_Base_Message_A_Extension_Time_Out_Message then
-- TimeOutMessage::base_Message : Message
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Messages.UML_Message_Access'
(AMF.Utp.Time_Out_Messages.Utp_Time_Out_Message_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Message));
else
raise Program_Error;
end if;
end Utp_Time_Out_Message_Get;
----------------------------------
-- Utp_Timer_Running_Action_Get --
----------------------------------
function Utp_Timer_Running_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Timer_Running_Action_Base_Read_Structural_Feature_Action_A_Extension_Timer_Running_Action then
-- TimerRunningAction::base_ReadStructuralFeatureAction : ReadStructuralFeatureAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Read_Structural_Feature_Actions.UML_Read_Structural_Feature_Action_Access'
(AMF.Utp.Timer_Running_Actions.Utp_Timer_Running_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Read_Structural_Feature_Action));
else
raise Program_Error;
end if;
end Utp_Timer_Running_Action_Get;
-------------------------------
-- Utp_Validation_Action_Get --
-------------------------------
function Utp_Validation_Action_Get return League.Holders.Holder is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Validation_Action_Base_Call_Operation_Action_A_Extension_Validation_Action then
-- ValidationAction::base_CallOperationAction : CallOperationAction
return
AMF.Internals.Holders.UML_Holders.To_Holder
(AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access'
(AMF.Utp.Validation_Actions.Utp_Validation_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Get_Base_Call_Operation_Action));
else
raise Program_Error;
end if;
end Utp_Validation_Action_Get;
begin
case AMF.Internals.Tables.UTP_Element_Table.Table (Self).Kind is
when AMF.Internals.Tables.UTP_Types.E_None =>
raise Program_Error;
when AMF.Internals.Tables.UTP_Types.E_Utp_Coding_Rule =>
return Utp_Coding_Rule_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Partition =>
return Utp_Data_Partition_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Pool =>
return Utp_Data_Pool_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Selector =>
return Utp_Data_Selector_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Default =>
return Utp_Default_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Default_Application =>
return Utp_Default_Application_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Determ_Alt =>
return Utp_Determ_Alt_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Finish_Action =>
return Utp_Finish_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Get_Timezone_Action =>
return Utp_Get_Timezone_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Literal_Any =>
return Utp_Literal_Any_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Literal_Any_Or_Null =>
return Utp_Literal_Any_Or_Null_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Log_Action =>
return Utp_Log_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Managed_Element =>
return Utp_Managed_Element_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Read_Timer_Action =>
return Utp_Read_Timer_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_SUT =>
return Utp_SUT_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Set_Timezone_Action =>
return Utp_Set_Timezone_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Start_Timer_Action =>
return Utp_Start_Timer_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Stop_Timer_Action =>
return Utp_Stop_Timer_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Case =>
return Utp_Test_Case_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Component =>
return Utp_Test_Component_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Context =>
return Utp_Test_Context_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Log =>
return Utp_Test_Log_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Log_Application =>
return Utp_Test_Log_Application_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Objective =>
return Utp_Test_Objective_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Suite =>
return Utp_Test_Suite_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out =>
return Utp_Time_Out_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out_Action =>
return Utp_Time_Out_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out_Message =>
return Utp_Time_Out_Message_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Timer_Running_Action =>
return Utp_Timer_Running_Action_Get;
when AMF.Internals.Tables.UTP_Types.E_Utp_Validation_Action =>
return Utp_Validation_Action_Get;
end case;
end Get;
--------------------
-- Get_Meta_Class --
--------------------
function Get_Meta_Class
(Self : AMF.Internals.AMF_Element) return CMOF_Element is
begin
case UTP_Element_Table.Table (Self).Kind is
when AMF.Internals.Tables.UTP_Types.E_None =>
return 0;
when AMF.Internals.Tables.UTP_Types.E_Utp_Coding_Rule =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Coding_Rule;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Partition =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Data_Partition;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Pool =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Data_Pool;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Selector =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Data_Selector;
when AMF.Internals.Tables.UTP_Types.E_Utp_Default =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Default;
when AMF.Internals.Tables.UTP_Types.E_Utp_Default_Application =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Default_Application;
when AMF.Internals.Tables.UTP_Types.E_Utp_Determ_Alt =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Determ_Alt;
when AMF.Internals.Tables.UTP_Types.E_Utp_Finish_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Finish_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_Get_Timezone_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Get_Timezone_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_Literal_Any =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Literal_Any;
when AMF.Internals.Tables.UTP_Types.E_Utp_Literal_Any_Or_Null =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Literal_Any_Or_Null;
when AMF.Internals.Tables.UTP_Types.E_Utp_Log_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Log_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_Managed_Element =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Managed_Element;
when AMF.Internals.Tables.UTP_Types.E_Utp_Read_Timer_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Read_Timer_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_SUT =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_SUT;
when AMF.Internals.Tables.UTP_Types.E_Utp_Set_Timezone_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Set_Timezone_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_Start_Timer_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Start_Timer_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_Stop_Timer_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Stop_Timer_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Case =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Test_Case;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Component =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Test_Component;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Context =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Test_Context;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Log =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Test_Log;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Log_Application =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Test_Log_Application;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Objective =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Test_Objective;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Suite =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Test_Suite;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Time_Out;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Time_Out_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out_Message =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Time_Out_Message;
when AMF.Internals.Tables.UTP_Types.E_Utp_Timer_Running_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Timer_Running_Action;
when AMF.Internals.Tables.UTP_Types.E_Utp_Validation_Action =>
return AMF.Internals.Tables.Utp_Metamodel.MC_Utp_Validation_Action;
end case;
end Get_Meta_Class;
---------
-- Set --
---------
procedure Set
(Self : AMF.Internals.AMF_Element;
Property : CMOF_Element;
Value : League.Holders.Holder)
is
procedure Utp_Coding_Rule_Set;
-- Sets attribute's value of instance of CodingRule class.
procedure Utp_Data_Partition_Set;
-- Sets attribute's value of instance of DataPartition class.
procedure Utp_Data_Pool_Set;
-- Sets attribute's value of instance of DataPool class.
procedure Utp_Data_Selector_Set;
-- Sets attribute's value of instance of DataSelector class.
procedure Utp_Default_Set;
-- Sets attribute's value of instance of Default class.
procedure Utp_Default_Application_Set;
-- Sets attribute's value of instance of DefaultApplication class.
procedure Utp_Determ_Alt_Set;
-- Sets attribute's value of instance of DetermAlt class.
procedure Utp_Finish_Action_Set;
-- Sets attribute's value of instance of FinishAction class.
procedure Utp_Get_Timezone_Action_Set;
-- Sets attribute's value of instance of GetTimezoneAction class.
procedure Utp_Literal_Any_Set;
-- Sets attribute's value of instance of LiteralAny class.
procedure Utp_Literal_Any_Or_Null_Set;
-- Sets attribute's value of instance of LiteralAnyOrNull class.
procedure Utp_Log_Action_Set;
-- Sets attribute's value of instance of LogAction class.
procedure Utp_Managed_Element_Set;
-- Sets attribute's value of instance of ManagedElement class.
procedure Utp_Read_Timer_Action_Set;
-- Sets attribute's value of instance of ReadTimerAction class.
procedure Utp_SUT_Set;
-- Sets attribute's value of instance of SUT class.
procedure Utp_Set_Timezone_Action_Set;
-- Sets attribute's value of instance of SetTimezoneAction class.
procedure Utp_Start_Timer_Action_Set;
-- Sets attribute's value of instance of StartTimerAction class.
procedure Utp_Stop_Timer_Action_Set;
-- Sets attribute's value of instance of StopTimerAction class.
procedure Utp_Test_Case_Set;
-- Sets attribute's value of instance of TestCase class.
procedure Utp_Test_Component_Set;
-- Sets attribute's value of instance of TestComponent class.
procedure Utp_Test_Context_Set;
-- Sets attribute's value of instance of TestContext class.
procedure Utp_Test_Log_Set;
-- Sets attribute's value of instance of TestLog class.
procedure Utp_Test_Log_Application_Set;
-- Sets attribute's value of instance of TestLogApplication class.
procedure Utp_Test_Objective_Set;
-- Sets attribute's value of instance of TestObjective class.
procedure Utp_Test_Suite_Set;
-- Sets attribute's value of instance of TestSuite class.
procedure Utp_Time_Out_Set;
-- Sets attribute's value of instance of TimeOut class.
procedure Utp_Time_Out_Action_Set;
-- Sets attribute's value of instance of TimeOutAction class.
procedure Utp_Time_Out_Message_Set;
-- Sets attribute's value of instance of TimeOutMessage class.
procedure Utp_Timer_Running_Action_Set;
-- Sets attribute's value of instance of TimerRunningAction class.
procedure Utp_Validation_Action_Set;
-- Sets attribute's value of instance of ValidationAction class.
-------------------------
-- Utp_Coding_Rule_Set --
-------------------------
procedure Utp_Coding_Rule_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Coding_Rule_Base_Namespace_A_Extension_Coding_Rule then
-- CodingRule::base_Namespace : Namespace
AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Namespace
(AMF.UML.Namespaces.UML_Namespace_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Coding_Rule_Base_Property_A_Extension_Coding_Rule then
-- CodingRule::base_Property : Property
AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Property
(AMF.UML.Properties.UML_Property_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Coding_Rule_Base_Value_Specification_A_Extension_Coding_Rule then
-- CodingRule::base_ValueSpecification : ValueSpecification
AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Value_Specification
(AMF.UML.Value_Specifications.UML_Value_Specification_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Coding_Rule_Coding then
-- CodingRule::coding : String
AMF.Utp.Coding_Rules.Utp_Coding_Rule_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Coding
(League.Holders.Element (Value));
else
raise Program_Error;
end if;
end Utp_Coding_Rule_Set;
----------------------------
-- Utp_Data_Partition_Set --
----------------------------
procedure Utp_Data_Partition_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Data_Partition_Base_Classifier_A_Extension_Data_Partition then
-- DataPartition::base_Classifier : Classifier
AMF.Utp.Data_Partitions.Utp_Data_Partition_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Classifier
(AMF.UML.Classifiers.UML_Classifier_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Data_Partition_Set;
-----------------------
-- Utp_Data_Pool_Set --
-----------------------
procedure Utp_Data_Pool_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Data_Pool_Base_Classifier_A_Extension_Data_Pool then
-- DataPool::base_Classifier : Classifier
AMF.Utp.Data_Pools.Utp_Data_Pool_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Classifier
(AMF.UML.Classifiers.UML_Classifier_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Data_Pool_Base_Property_A_Extension_Data_Pool then
-- DataPool::base_Property : Property
AMF.Utp.Data_Pools.Utp_Data_Pool_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Property
(AMF.UML.Properties.UML_Property_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Data_Pool_Set;
---------------------------
-- Utp_Data_Selector_Set --
---------------------------
procedure Utp_Data_Selector_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Data_Selector_Base_Operation_A_Extension_Data_Selector then
-- DataSelector::base_Operation : Operation
AMF.Utp.Data_Selectors.Utp_Data_Selector_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Operation
(AMF.UML.Operations.UML_Operation_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Data_Selector_Set;
---------------------
-- Utp_Default_Set --
---------------------
procedure Utp_Default_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Default_Base_Behavior_A_Extension_Default then
-- Default::base_Behavior : Behavior
AMF.Utp.Defaults.Utp_Default_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Behavior
(AMF.UML.Behaviors.UML_Behavior_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Default_Set;
---------------------------------
-- Utp_Default_Application_Set --
---------------------------------
procedure Utp_Default_Application_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Default_Application_Base_Dependency_A_Extension_Default_Application then
-- DefaultApplication::base_Dependency : Dependency
AMF.Utp.Default_Applications.Utp_Default_Application_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Dependency
(AMF.UML.Dependencies.UML_Dependency_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Default_Application_Repetition then
-- DefaultApplication::repetition : UnlimitedNatural
AMF.Utp.Default_Applications.Utp_Default_Application_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Repetition
(AMF.Holders.Unlimited_Naturals.Element (Value));
else
raise Program_Error;
end if;
end Utp_Default_Application_Set;
------------------------
-- Utp_Determ_Alt_Set --
------------------------
procedure Utp_Determ_Alt_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Determ_Alt_Base_Combined_Fragment_A_Extension_Determ_Alt then
-- DetermAlt::base_CombinedFragment : CombinedFragment
AMF.Utp.Determ_Alts.Utp_Determ_Alt_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Combined_Fragment
(AMF.UML.Combined_Fragments.UML_Combined_Fragment_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Determ_Alt_Set;
---------------------------
-- Utp_Finish_Action_Set --
---------------------------
procedure Utp_Finish_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Finish_Action_Base_Invocation_Action_A_Extension_Finish_Action then
-- FinishAction::base_InvocationAction : InvocationAction
AMF.Utp.Finish_Actions.Utp_Finish_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Invocation_Action
(AMF.UML.Invocation_Actions.UML_Invocation_Action_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Finish_Action_Base_Opaque_Action_A_Extension_Finish_Action then
-- FinishAction::base_OpaqueAction : OpaqueAction
AMF.Utp.Finish_Actions.Utp_Finish_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Opaque_Action
(AMF.UML.Opaque_Actions.UML_Opaque_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Finish_Action_Set;
---------------------------------
-- Utp_Get_Timezone_Action_Set --
---------------------------------
procedure Utp_Get_Timezone_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Get_Timezone_Action_Base_Read_Structural_Feature_Action_A_Extension_Get_Timezone_Action then
-- GetTimezoneAction::base_ReadStructuralFeatureAction : ReadStructuralFeatureAction
AMF.Utp.Get_Timezone_Actions.Utp_Get_Timezone_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Read_Structural_Feature_Action
(AMF.UML.Read_Structural_Feature_Actions.UML_Read_Structural_Feature_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Get_Timezone_Action_Set;
-------------------------
-- Utp_Literal_Any_Set --
-------------------------
procedure Utp_Literal_Any_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Literal_Any_Base_Literal_Specification_A_Extension_Literal_Any then
-- LiteralAny::base_LiteralSpecification : LiteralSpecification
AMF.Utp.Literal_Anies.Utp_Literal_Any_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Literal_Specification
(AMF.UML.Literal_Specifications.UML_Literal_Specification_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Literal_Any_Set;
---------------------------------
-- Utp_Literal_Any_Or_Null_Set --
---------------------------------
procedure Utp_Literal_Any_Or_Null_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Literal_Any_Or_Null_Base_Literal_Specification_A_Extension_Literal_Any_Or_Null then
-- LiteralAnyOrNull::base_LiteralSpecification : LiteralSpecification
AMF.Utp.Literal_Any_Or_Nulls.Utp_Literal_Any_Or_Null_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Literal_Specification
(AMF.UML.Literal_Specifications.UML_Literal_Specification_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Literal_Any_Or_Null_Set;
------------------------
-- Utp_Log_Action_Set --
------------------------
procedure Utp_Log_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Log_Action_Base_Send_Object_Action_A_Extension_Log_Action then
-- LogAction::base_SendObjectAction : SendObjectAction
AMF.Utp.Log_Actions.Utp_Log_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Send_Object_Action
(AMF.UML.Send_Object_Actions.UML_Send_Object_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Log_Action_Set;
-----------------------------
-- Utp_Managed_Element_Set --
-----------------------------
procedure Utp_Managed_Element_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Base_Element_A_Extension_Managed_Element then
-- ManagedElement::base_Element : Element
AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Element
(AMF.UML.Elements.UML_Element_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Criticality then
-- ManagedElement::criticality : String
AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Criticality
(AMF.Holders.Element (Value));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Description then
-- ManagedElement::description : String
AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Description
(AMF.Holders.Element (Value));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Owner then
-- ManagedElement::owner : String
AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Owner
(AMF.Holders.Element (Value));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Managed_Element_Version then
-- ManagedElement::version : String
AMF.Utp.Managed_Elements.Utp_Managed_Element_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Version
(AMF.Holders.Element (Value));
else
raise Program_Error;
end if;
end Utp_Managed_Element_Set;
-------------------------------
-- Utp_Read_Timer_Action_Set --
-------------------------------
procedure Utp_Read_Timer_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Read_Timer_Action_Base_Call_Operation_Action_A_Extension_Read_Timer_Action then
-- ReadTimerAction::base_CallOperationAction : CallOperationAction
AMF.Utp.Read_Timer_Actions.Utp_Read_Timer_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Call_Operation_Action
(AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Read_Timer_Action_Set;
-----------------
-- Utp_SUT_Set --
-----------------
procedure Utp_SUT_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_SUT_Base_Property_A_Extension_SUT then
-- SUT::base_Property : Property
AMF.Utp.SUTs.Utp_SUT_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Property
(AMF.UML.Properties.UML_Property_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_SUT_Set;
---------------------------------
-- Utp_Set_Timezone_Action_Set --
---------------------------------
procedure Utp_Set_Timezone_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Set_Timezone_Action_Base_Write_Structural_Feature_Action_A_Extension_Set_Timezone_Action then
-- SetTimezoneAction::base_WriteStructuralFeatureAction : WriteStructuralFeatureAction
AMF.Utp.Set_Timezone_Actions.Utp_Set_Timezone_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Write_Structural_Feature_Action
(AMF.UML.Write_Structural_Feature_Actions.UML_Write_Structural_Feature_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Set_Timezone_Action_Set;
--------------------------------
-- Utp_Start_Timer_Action_Set --
--------------------------------
procedure Utp_Start_Timer_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Start_Timer_Action_Base_Call_Operation_Action_A_Extension_Start_Timer_Action then
-- StartTimerAction::base_CallOperationAction : CallOperationAction
AMF.Utp.Start_Timer_Actions.Utp_Start_Timer_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Call_Operation_Action
(AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Start_Timer_Action_Set;
-------------------------------
-- Utp_Stop_Timer_Action_Set --
-------------------------------
procedure Utp_Stop_Timer_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Stop_Timer_Action_Base_Call_Operation_Action_A_Extension_Stop_Timer_Action then
-- StopTimerAction::base_CallOperationAction : CallOperationAction
AMF.Utp.Stop_Timer_Actions.Utp_Stop_Timer_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Call_Operation_Action
(AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Stop_Timer_Action_Set;
-----------------------
-- Utp_Test_Case_Set --
-----------------------
procedure Utp_Test_Case_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Case_Base_Behavior_A_Extension_Test_Case then
-- TestCase::base_Behavior : Behavior
AMF.Utp.Test_Cases.Utp_Test_Case_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Behavior
(AMF.UML.Behaviors.UML_Behavior_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Case_Base_Operation_A_Extension_Test_Case then
-- TestCase::base_Operation : Operation
AMF.Utp.Test_Cases.Utp_Test_Case_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Operation
(AMF.UML.Operations.UML_Operation_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Case_Priority then
-- TestCase::priority : String
AMF.Utp.Test_Cases.Utp_Test_Case_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Priority
(AMF.Holders.Element (Value));
else
raise Program_Error;
end if;
end Utp_Test_Case_Set;
----------------------------
-- Utp_Test_Component_Set --
----------------------------
procedure Utp_Test_Component_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Component_Base_Structured_Classifier_A_Extension_Test_Component then
-- TestComponent::base_StructuredClassifier : StructuredClassifier
AMF.Utp.Test_Components.Utp_Test_Component_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Structured_Classifier
(AMF.UML.Structured_Classifiers.UML_Structured_Classifier_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Test_Component_Set;
--------------------------
-- Utp_Test_Context_Set --
--------------------------
procedure Utp_Test_Context_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Context_Base_Behaviored_Classifier_A_Extension_Test_Context then
-- TestContext::base_BehavioredClassifier : BehavioredClassifier
AMF.Utp.Test_Contexts.Utp_Test_Context_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Behaviored_Classifier
(AMF.UML.Behaviored_Classifiers.UML_Behaviored_Classifier_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Context_Base_Structured_Classifier_A_Extension_Test_Context then
-- TestContext::base_StructuredClassifier : StructuredClassifier
AMF.Utp.Test_Contexts.Utp_Test_Context_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Structured_Classifier
(AMF.UML.Structured_Classifiers.UML_Structured_Classifier_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Context_Test_Level then
-- TestContext::testLevel : String
AMF.Utp.Test_Contexts.Utp_Test_Context_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Test_Level
(AMF.Holders.Element (Value));
else
raise Program_Error;
end if;
end Utp_Test_Context_Set;
----------------------
-- Utp_Test_Log_Set --
----------------------
procedure Utp_Test_Log_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Base_Behavior_A_Extension_Test_Log then
-- TestLog::base_Behavior : Behavior
AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Behavior
(AMF.UML.Behaviors.UML_Behavior_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Duration then
-- TestLog::duration : String
AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Duration
(AMF.Holders.Element (Value));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Executed_At then
-- TestLog::executedAt : String
AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Executed_At
(AMF.Holders.Element (Value));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Sut_Version then
-- TestLog::sutVersion : String
AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Sut_Version
(AMF.Holders.Element (Value));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Verdict then
-- TestLog::verdict : Verdict
AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Verdict
(AMF.Utp.Holders.Verdicts.Element (Value));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Verdict_Reason then
-- TestLog::verdictReason : String
AMF.Utp.Test_Logs.Utp_Test_Log_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Verdict_Reason
(AMF.Holders.Element (Value));
else
raise Program_Error;
end if;
end Utp_Test_Log_Set;
----------------------------------
-- Utp_Test_Log_Application_Set --
----------------------------------
procedure Utp_Test_Log_Application_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Log_Application_Base_Dependency_A_Extension_Test_Log_Application then
-- TestLogApplication::base_Dependency : Dependency
AMF.Utp.Test_Log_Applications.Utp_Test_Log_Application_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Dependency
(AMF.UML.Dependencies.UML_Dependency_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Test_Log_Application_Set;
----------------------------
-- Utp_Test_Objective_Set --
----------------------------
procedure Utp_Test_Objective_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Objective_Base_Dependency_A_Extension_Test_Objective then
-- TestObjective::base_Dependency : Dependency
AMF.Utp.Test_Objectives.Utp_Test_Objective_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Dependency
(AMF.UML.Dependencies.UML_Dependency_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Objective_Priority then
-- TestObjective::priority : String
AMF.Utp.Test_Objectives.Utp_Test_Objective_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Priority
(AMF.Holders.Element (Value));
else
raise Program_Error;
end if;
end Utp_Test_Objective_Set;
------------------------
-- Utp_Test_Suite_Set --
------------------------
procedure Utp_Test_Suite_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Suite_Base_Behavior_A_Extension_Test_Suite then
-- TestSuite::base_Behavior : Behavior
AMF.Utp.Test_Suites.Utp_Test_Suite_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Behavior
(AMF.UML.Behaviors.UML_Behavior_Access (AMF.Holders.Elements.Element (Value)));
elsif Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Test_Suite_Priority then
-- TestSuite::priority : String
AMF.Utp.Test_Suites.Utp_Test_Suite_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Priority
(AMF.Holders.Element (Value));
else
raise Program_Error;
end if;
end Utp_Test_Suite_Set;
----------------------
-- Utp_Time_Out_Set --
----------------------
procedure Utp_Time_Out_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Time_Out_Base_Time_Event_A_Extension_Time_Out then
-- TimeOut::base_TimeEvent : TimeEvent
AMF.Utp.Time_Outs.Utp_Time_Out_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Time_Event
(AMF.UML.Time_Events.UML_Time_Event_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Time_Out_Set;
-----------------------------
-- Utp_Time_Out_Action_Set --
-----------------------------
procedure Utp_Time_Out_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Time_Out_Action_Base_Accept_Event_Action_A_Extension_Time_Out_Action then
-- TimeOutAction::base_AcceptEventAction : AcceptEventAction
AMF.Utp.Time_Out_Actions.Utp_Time_Out_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Accept_Event_Action
(AMF.UML.Accept_Event_Actions.UML_Accept_Event_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Time_Out_Action_Set;
------------------------------
-- Utp_Time_Out_Message_Set --
------------------------------
procedure Utp_Time_Out_Message_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Time_Out_Message_Base_Message_A_Extension_Time_Out_Message then
-- TimeOutMessage::base_Message : Message
AMF.Utp.Time_Out_Messages.Utp_Time_Out_Message_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Message
(AMF.UML.Messages.UML_Message_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Time_Out_Message_Set;
----------------------------------
-- Utp_Timer_Running_Action_Set --
----------------------------------
procedure Utp_Timer_Running_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Timer_Running_Action_Base_Read_Structural_Feature_Action_A_Extension_Timer_Running_Action then
-- TimerRunningAction::base_ReadStructuralFeatureAction : ReadStructuralFeatureAction
AMF.Utp.Timer_Running_Actions.Utp_Timer_Running_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Read_Structural_Feature_Action
(AMF.UML.Read_Structural_Feature_Actions.UML_Read_Structural_Feature_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Timer_Running_Action_Set;
-------------------------------
-- Utp_Validation_Action_Set --
-------------------------------
procedure Utp_Validation_Action_Set is
begin
if Property = AMF.Internals.Tables.Utp_Metamodel.MP_Utp_Validation_Action_Base_Call_Operation_Action_A_Extension_Validation_Action then
-- ValidationAction::base_CallOperationAction : CallOperationAction
AMF.Utp.Validation_Actions.Utp_Validation_Action_Access
(AMF.Internals.Helpers.To_Element (Self)).Set_Base_Call_Operation_Action
(AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access (AMF.Holders.Elements.Element (Value)));
else
raise Program_Error;
end if;
end Utp_Validation_Action_Set;
begin
case UTP_Element_Table.Table (Self).Kind is
when AMF.Internals.Tables.UTP_Types.E_None =>
raise Program_Error;
when AMF.Internals.Tables.UTP_Types.E_Utp_Coding_Rule =>
Utp_Coding_Rule_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Partition =>
Utp_Data_Partition_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Pool =>
Utp_Data_Pool_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Data_Selector =>
Utp_Data_Selector_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Default =>
Utp_Default_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Default_Application =>
Utp_Default_Application_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Determ_Alt =>
Utp_Determ_Alt_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Finish_Action =>
Utp_Finish_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Get_Timezone_Action =>
Utp_Get_Timezone_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Literal_Any =>
Utp_Literal_Any_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Literal_Any_Or_Null =>
Utp_Literal_Any_Or_Null_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Log_Action =>
Utp_Log_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Managed_Element =>
Utp_Managed_Element_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Read_Timer_Action =>
Utp_Read_Timer_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_SUT =>
Utp_SUT_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Set_Timezone_Action =>
Utp_Set_Timezone_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Start_Timer_Action =>
Utp_Start_Timer_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Stop_Timer_Action =>
Utp_Stop_Timer_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Case =>
Utp_Test_Case_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Component =>
Utp_Test_Component_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Context =>
Utp_Test_Context_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Log =>
Utp_Test_Log_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Log_Application =>
Utp_Test_Log_Application_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Objective =>
Utp_Test_Objective_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Test_Suite =>
Utp_Test_Suite_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out =>
Utp_Time_Out_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out_Action =>
Utp_Time_Out_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Time_Out_Message =>
Utp_Time_Out_Message_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Timer_Running_Action =>
Utp_Timer_Running_Action_Set;
when AMF.Internals.Tables.UTP_Types.E_Utp_Validation_Action =>
Utp_Validation_Action_Set;
end case;
end Set;
end AMF.Internals.Tables.UTP_Reflection;
|
[
{
"context": "-- Copyright 2015,2016,2017 Steven Stewart-Gallus\n--\n-- Licensed under the Apache License, Version ",
"end": 49,
"score": 0.9956892728805542,
"start": 28,
"tag": "NAME",
"value": "Steven Stewart-Gallus"
}
] |
src/ada-core/src/linted-io_pool.ads
|
mstewartgallus/linted
| 0 |
-- Copyright 2015,2016,2017 Steven Stewart-Gallus
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-- implied. See the License for the specific language governing
-- permissions and limitations under the License.
with Ada.Real_Time;
with Interfaces.C;
with System;
private with Linted.Channels;
with Linted.Errors;
with Linted.KOs;
with Linted.Triggers;
with Linted.Wait_Lists;
pragma Elaborate_All (Linted.Wait_Lists);
package Linted.IO_Pool with
Spark_Mode,
Initializes => (State => Wait_Lists.State),
Abstract_State => (State with External) is
pragma Elaborate_Body;
use type Interfaces.C.int;
type Writer_Event is record
Bytes_Written : Interfaces.C.size_t := 0;
Err : Errors.Error;
end record;
type Reader_Event is record
Bytes_Read : Interfaces.C.size_t := 0;
Err : Errors.Error;
end record;
type Poller_Event_Type is (Readable, Writable);
type Poller_Event_Set is array (Poller_Event_Type) of Boolean with
Pack;
type Poller_Event is record
Events : Poller_Event_Set :=
(Poller_Event_Type'First .. Poller_Event_Type'Last => False);
Err : Errors.Error;
end record;
type Remind_Me_Event is record
Dummy : Natural := 0;
end record;
type Read_Future is limited private with
Preelaborable_Initialization;
function Read_Future_Is_Live (Future : Read_Future) return Boolean with
Ghost,
Global => null,
Depends => (Read_Future_Is_Live'Result => Future);
procedure Read
(Object : KOs.KO;
Buf : System.Address;
Count : Interfaces.C.size_t;
Signaller : Triggers.Signaller;
Future : out Read_Future) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(State =>+ (Buf, Count, Object, Signaller, Wait_Lists.State),
Future => State,
Wait_Lists.State =>+ (Buf, Count, State, Object, Signaller)),
Post => Read_Future_Is_Live (Future);
procedure Read_Wait
(Future : in out Read_Future;
Event : out Reader_Event) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future => null,
Event => (State, Future),
State =>+ (Future, Wait_Lists.State),
Wait_Lists.State =>+ (Future, State)),
Pre => Read_Future_Is_Live (Future),
Post => not Read_Future_Is_Live (Future);
procedure Read_Poll
(Future : in out Read_Future;
Event : out Reader_Event;
Init : out Boolean) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future =>+ State,
Event => (State, Future),
Init => (State, Future),
State =>+ (Future, Wait_Lists.State),
Wait_Lists.State =>+ (Future, State)),
Pre => Read_Future_Is_Live (Future),
Post =>
(if Init then not Read_Future_Is_Live (Future)
else Read_Future_Is_Live (Future));
type Write_Future is limited private with
Preelaborable_Initialization;
function Write_Future_Is_Live (Future : Write_Future) return Boolean with
Ghost,
Global => null,
Depends => (Write_Future_Is_Live'Result => Future);
procedure Write
(Object : KOs.KO;
Buf : System.Address;
Count : Interfaces.C.size_t;
Signaller : Triggers.Signaller;
Future : out Write_Future) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future => State,
State =>+ (Buf, Count, Object, Signaller, Wait_Lists.State),
Wait_Lists.State =>+ (Buf, Count, State, Object, Signaller)),
Post => Write_Future_Is_Live (Future);
procedure Write_Wait
(Future : in out Write_Future;
Event : out Writer_Event) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future => null,
Event => (State, Future),
State =>+ (Future, Wait_Lists.State),
Wait_Lists.State =>+ (Future, State)),
Pre => Write_Future_Is_Live (Future),
Post => not Write_Future_Is_Live (Future);
procedure Write_Poll
(Future : in out Write_Future;
Event : out Writer_Event;
Init : out Boolean) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future =>+ State,
Event => (State, Future),
Init => (State, Future),
State =>+ (Future, State, Wait_Lists.State),
Wait_Lists.State =>+ (Future, State)),
Pre => Write_Future_Is_Live (Future),
Post =>
(if Init then not Write_Future_Is_Live (Future)
else Write_Future_Is_Live (Future));
type Poll_Future is limited private with
Preelaborable_Initialization;
function Poll_Future_Is_Live (Future : Poll_Future) return Boolean with
Ghost,
Global => null,
Depends => (Poll_Future_Is_Live'Result => Future);
procedure Poll
(Object : KOs.KO;
Events : Poller_Event_Set;
Signaller : Triggers.Signaller;
Future : out Poll_Future) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future => State,
State =>+ (Events, State, Object, Signaller, Wait_Lists.State),
Wait_Lists.State =>+ (Events, State, Object, Signaller)),
Post => Poll_Future_Is_Live (Future);
procedure Poll_Wait
(Future : in out Poll_Future;
Event : out Poller_Event) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future => null,
Event => (State, Future),
State =>+ (Future, Wait_Lists.State),
Wait_Lists.State =>+ (Future, State)),
Pre => Poll_Future_Is_Live (Future),
Post => not Poll_Future_Is_Live (Future);
procedure Poll_Poll
(Future : in out Poll_Future;
Event : out Poller_Event;
Init : out Boolean) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future =>+ State,
Event => (State, Future),
Init => (State, Future),
State =>+ (Future, Wait_Lists.State),
Wait_Lists.State =>+ (Future, State)),
Pre => Poll_Future_Is_Live (Future),
Post =>
(if Init then not Poll_Future_Is_Live (Future)
else Poll_Future_Is_Live (Future));
type Remind_Me_Future is limited private with
Preelaborable_Initialization;
function Remind_Me_Future_Is_Live
(Future : Remind_Me_Future) return Boolean with
Ghost,
Global => null,
Depends => (Remind_Me_Future_Is_Live'Result => Future);
procedure Remind_Me
(Time : Ada.Real_Time.Time;
Signaller : Triggers.Signaller;
Future : out Remind_Me_Future) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future => State,
State =>+ (Signaller, Time, Wait_Lists.State),
Wait_Lists.State =>+ (State, Signaller, Time)),
Post => Remind_Me_Future_Is_Live (Future);
procedure Remind_Me_Wait
(Future : in out Remind_Me_Future;
Event : out Remind_Me_Event) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future => null,
Event => (Future, State),
State =>+ (Future, Wait_Lists.State),
Wait_Lists.State =>+ (Future, State)),
Pre => Remind_Me_Future_Is_Live (Future),
Post => not Remind_Me_Future_Is_Live (Future);
procedure Remind_Me_Poll
(Future : in out Remind_Me_Future;
Event : out Remind_Me_Event;
Init : out Boolean) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future =>+ State,
Event => (Future, State),
Init => (State, Future),
State =>+ (Future, Wait_Lists.State),
Wait_Lists.State =>+ (Future, State)),
Pre => Remind_Me_Future_Is_Live (Future),
Post =>
(if Init then not Remind_Me_Future_Is_Live (Future)
else Remind_Me_Future_Is_Live (Future));
private
Max_Read_Futures : constant := 10;
Max_Write_Futures : constant := 10;
Max_Poll_Futures : constant := 10;
Max_Remind_Me_Futures : constant := 10;
Max_Command_Queue_Capacity : constant := 10;
type Read_Future is mod Max_Read_Futures + 1 with
Default_Value => 0;
type Write_Future is mod Max_Write_Futures + 1 with
Default_Value => 0;
type Poll_Future is mod Max_Poll_Futures + 1 with
Default_Value => 0;
type Remind_Me_Future is mod Max_Remind_Me_Futures + 1 with
Default_Value => 0;
package Writer_Event_Channels is new Channels (Writer_Event);
package Reader_Event_Channels is new Channels (Reader_Event);
package Poller_Event_Channels is new Channels (Poller_Event);
package Remind_Me_Event_Channels is new Channels (Remind_Me_Event);
end Linted.IO_Pool;
|
15947
|
-- Copyright 2015,2016,2017 <NAME>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-- implied. See the License for the specific language governing
-- permissions and limitations under the License.
with Ada.Real_Time;
with Interfaces.C;
with System;
private with Linted.Channels;
with Linted.Errors;
with Linted.KOs;
with Linted.Triggers;
with Linted.Wait_Lists;
pragma Elaborate_All (Linted.Wait_Lists);
package Linted.IO_Pool with
Spark_Mode,
Initializes => (State => Wait_Lists.State),
Abstract_State => (State with External) is
pragma Elaborate_Body;
use type Interfaces.C.int;
type Writer_Event is record
Bytes_Written : Interfaces.C.size_t := 0;
Err : Errors.Error;
end record;
type Reader_Event is record
Bytes_Read : Interfaces.C.size_t := 0;
Err : Errors.Error;
end record;
type Poller_Event_Type is (Readable, Writable);
type Poller_Event_Set is array (Poller_Event_Type) of Boolean with
Pack;
type Poller_Event is record
Events : Poller_Event_Set :=
(Poller_Event_Type'First .. Poller_Event_Type'Last => False);
Err : Errors.Error;
end record;
type Remind_Me_Event is record
Dummy : Natural := 0;
end record;
type Read_Future is limited private with
Preelaborable_Initialization;
function Read_Future_Is_Live (Future : Read_Future) return Boolean with
Ghost,
Global => null,
Depends => (Read_Future_Is_Live'Result => Future);
procedure Read
(Object : KOs.KO;
Buf : System.Address;
Count : Interfaces.C.size_t;
Signaller : Triggers.Signaller;
Future : out Read_Future) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(State =>+ (Buf, Count, Object, Signaller, Wait_Lists.State),
Future => State,
Wait_Lists.State =>+ (Buf, Count, State, Object, Signaller)),
Post => Read_Future_Is_Live (Future);
procedure Read_Wait
(Future : in out Read_Future;
Event : out Reader_Event) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future => null,
Event => (State, Future),
State =>+ (Future, Wait_Lists.State),
Wait_Lists.State =>+ (Future, State)),
Pre => Read_Future_Is_Live (Future),
Post => not Read_Future_Is_Live (Future);
procedure Read_Poll
(Future : in out Read_Future;
Event : out Reader_Event;
Init : out Boolean) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future =>+ State,
Event => (State, Future),
Init => (State, Future),
State =>+ (Future, Wait_Lists.State),
Wait_Lists.State =>+ (Future, State)),
Pre => Read_Future_Is_Live (Future),
Post =>
(if Init then not Read_Future_Is_Live (Future)
else Read_Future_Is_Live (Future));
type Write_Future is limited private with
Preelaborable_Initialization;
function Write_Future_Is_Live (Future : Write_Future) return Boolean with
Ghost,
Global => null,
Depends => (Write_Future_Is_Live'Result => Future);
procedure Write
(Object : KOs.KO;
Buf : System.Address;
Count : Interfaces.C.size_t;
Signaller : Triggers.Signaller;
Future : out Write_Future) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future => State,
State =>+ (Buf, Count, Object, Signaller, Wait_Lists.State),
Wait_Lists.State =>+ (Buf, Count, State, Object, Signaller)),
Post => Write_Future_Is_Live (Future);
procedure Write_Wait
(Future : in out Write_Future;
Event : out Writer_Event) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future => null,
Event => (State, Future),
State =>+ (Future, Wait_Lists.State),
Wait_Lists.State =>+ (Future, State)),
Pre => Write_Future_Is_Live (Future),
Post => not Write_Future_Is_Live (Future);
procedure Write_Poll
(Future : in out Write_Future;
Event : out Writer_Event;
Init : out Boolean) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future =>+ State,
Event => (State, Future),
Init => (State, Future),
State =>+ (Future, State, Wait_Lists.State),
Wait_Lists.State =>+ (Future, State)),
Pre => Write_Future_Is_Live (Future),
Post =>
(if Init then not Write_Future_Is_Live (Future)
else Write_Future_Is_Live (Future));
type Poll_Future is limited private with
Preelaborable_Initialization;
function Poll_Future_Is_Live (Future : Poll_Future) return Boolean with
Ghost,
Global => null,
Depends => (Poll_Future_Is_Live'Result => Future);
procedure Poll
(Object : KOs.KO;
Events : Poller_Event_Set;
Signaller : Triggers.Signaller;
Future : out Poll_Future) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future => State,
State =>+ (Events, State, Object, Signaller, Wait_Lists.State),
Wait_Lists.State =>+ (Events, State, Object, Signaller)),
Post => Poll_Future_Is_Live (Future);
procedure Poll_Wait
(Future : in out Poll_Future;
Event : out Poller_Event) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future => null,
Event => (State, Future),
State =>+ (Future, Wait_Lists.State),
Wait_Lists.State =>+ (Future, State)),
Pre => Poll_Future_Is_Live (Future),
Post => not Poll_Future_Is_Live (Future);
procedure Poll_Poll
(Future : in out Poll_Future;
Event : out Poller_Event;
Init : out Boolean) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future =>+ State,
Event => (State, Future),
Init => (State, Future),
State =>+ (Future, Wait_Lists.State),
Wait_Lists.State =>+ (Future, State)),
Pre => Poll_Future_Is_Live (Future),
Post =>
(if Init then not Poll_Future_Is_Live (Future)
else Poll_Future_Is_Live (Future));
type Remind_Me_Future is limited private with
Preelaborable_Initialization;
function Remind_Me_Future_Is_Live
(Future : Remind_Me_Future) return Boolean with
Ghost,
Global => null,
Depends => (Remind_Me_Future_Is_Live'Result => Future);
procedure Remind_Me
(Time : Ada.Real_Time.Time;
Signaller : Triggers.Signaller;
Future : out Remind_Me_Future) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future => State,
State =>+ (Signaller, Time, Wait_Lists.State),
Wait_Lists.State =>+ (State, Signaller, Time)),
Post => Remind_Me_Future_Is_Live (Future);
procedure Remind_Me_Wait
(Future : in out Remind_Me_Future;
Event : out Remind_Me_Event) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future => null,
Event => (Future, State),
State =>+ (Future, Wait_Lists.State),
Wait_Lists.State =>+ (Future, State)),
Pre => Remind_Me_Future_Is_Live (Future),
Post => not Remind_Me_Future_Is_Live (Future);
procedure Remind_Me_Poll
(Future : in out Remind_Me_Future;
Event : out Remind_Me_Event;
Init : out Boolean) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future =>+ State,
Event => (Future, State),
Init => (State, Future),
State =>+ (Future, Wait_Lists.State),
Wait_Lists.State =>+ (Future, State)),
Pre => Remind_Me_Future_Is_Live (Future),
Post =>
(if Init then not Remind_Me_Future_Is_Live (Future)
else Remind_Me_Future_Is_Live (Future));
private
Max_Read_Futures : constant := 10;
Max_Write_Futures : constant := 10;
Max_Poll_Futures : constant := 10;
Max_Remind_Me_Futures : constant := 10;
Max_Command_Queue_Capacity : constant := 10;
type Read_Future is mod Max_Read_Futures + 1 with
Default_Value => 0;
type Write_Future is mod Max_Write_Futures + 1 with
Default_Value => 0;
type Poll_Future is mod Max_Poll_Futures + 1 with
Default_Value => 0;
type Remind_Me_Future is mod Max_Remind_Me_Futures + 1 with
Default_Value => 0;
package Writer_Event_Channels is new Channels (Writer_Event);
package Reader_Event_Channels is new Channels (Reader_Event);
package Poller_Event_Channels is new Channels (Poller_Event);
package Remind_Me_Event_Channels is new Channels (Remind_Me_Event);
end Linted.IO_Pool;
| true |
-- Copyright 2015,2016,2017 PI:NAME:<NAME>END_PI
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-- implied. See the License for the specific language governing
-- permissions and limitations under the License.
with Ada.Real_Time;
with Interfaces.C;
with System;
private with Linted.Channels;
with Linted.Errors;
with Linted.KOs;
with Linted.Triggers;
with Linted.Wait_Lists;
pragma Elaborate_All (Linted.Wait_Lists);
package Linted.IO_Pool with
Spark_Mode,
Initializes => (State => Wait_Lists.State),
Abstract_State => (State with External) is
pragma Elaborate_Body;
use type Interfaces.C.int;
type Writer_Event is record
Bytes_Written : Interfaces.C.size_t := 0;
Err : Errors.Error;
end record;
type Reader_Event is record
Bytes_Read : Interfaces.C.size_t := 0;
Err : Errors.Error;
end record;
type Poller_Event_Type is (Readable, Writable);
type Poller_Event_Set is array (Poller_Event_Type) of Boolean with
Pack;
type Poller_Event is record
Events : Poller_Event_Set :=
(Poller_Event_Type'First .. Poller_Event_Type'Last => False);
Err : Errors.Error;
end record;
type Remind_Me_Event is record
Dummy : Natural := 0;
end record;
type Read_Future is limited private with
Preelaborable_Initialization;
function Read_Future_Is_Live (Future : Read_Future) return Boolean with
Ghost,
Global => null,
Depends => (Read_Future_Is_Live'Result => Future);
procedure Read
(Object : KOs.KO;
Buf : System.Address;
Count : Interfaces.C.size_t;
Signaller : Triggers.Signaller;
Future : out Read_Future) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(State =>+ (Buf, Count, Object, Signaller, Wait_Lists.State),
Future => State,
Wait_Lists.State =>+ (Buf, Count, State, Object, Signaller)),
Post => Read_Future_Is_Live (Future);
procedure Read_Wait
(Future : in out Read_Future;
Event : out Reader_Event) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future => null,
Event => (State, Future),
State =>+ (Future, Wait_Lists.State),
Wait_Lists.State =>+ (Future, State)),
Pre => Read_Future_Is_Live (Future),
Post => not Read_Future_Is_Live (Future);
procedure Read_Poll
(Future : in out Read_Future;
Event : out Reader_Event;
Init : out Boolean) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future =>+ State,
Event => (State, Future),
Init => (State, Future),
State =>+ (Future, Wait_Lists.State),
Wait_Lists.State =>+ (Future, State)),
Pre => Read_Future_Is_Live (Future),
Post =>
(if Init then not Read_Future_Is_Live (Future)
else Read_Future_Is_Live (Future));
type Write_Future is limited private with
Preelaborable_Initialization;
function Write_Future_Is_Live (Future : Write_Future) return Boolean with
Ghost,
Global => null,
Depends => (Write_Future_Is_Live'Result => Future);
procedure Write
(Object : KOs.KO;
Buf : System.Address;
Count : Interfaces.C.size_t;
Signaller : Triggers.Signaller;
Future : out Write_Future) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future => State,
State =>+ (Buf, Count, Object, Signaller, Wait_Lists.State),
Wait_Lists.State =>+ (Buf, Count, State, Object, Signaller)),
Post => Write_Future_Is_Live (Future);
procedure Write_Wait
(Future : in out Write_Future;
Event : out Writer_Event) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future => null,
Event => (State, Future),
State =>+ (Future, Wait_Lists.State),
Wait_Lists.State =>+ (Future, State)),
Pre => Write_Future_Is_Live (Future),
Post => not Write_Future_Is_Live (Future);
procedure Write_Poll
(Future : in out Write_Future;
Event : out Writer_Event;
Init : out Boolean) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future =>+ State,
Event => (State, Future),
Init => (State, Future),
State =>+ (Future, State, Wait_Lists.State),
Wait_Lists.State =>+ (Future, State)),
Pre => Write_Future_Is_Live (Future),
Post =>
(if Init then not Write_Future_Is_Live (Future)
else Write_Future_Is_Live (Future));
type Poll_Future is limited private with
Preelaborable_Initialization;
function Poll_Future_Is_Live (Future : Poll_Future) return Boolean with
Ghost,
Global => null,
Depends => (Poll_Future_Is_Live'Result => Future);
procedure Poll
(Object : KOs.KO;
Events : Poller_Event_Set;
Signaller : Triggers.Signaller;
Future : out Poll_Future) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future => State,
State =>+ (Events, State, Object, Signaller, Wait_Lists.State),
Wait_Lists.State =>+ (Events, State, Object, Signaller)),
Post => Poll_Future_Is_Live (Future);
procedure Poll_Wait
(Future : in out Poll_Future;
Event : out Poller_Event) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future => null,
Event => (State, Future),
State =>+ (Future, Wait_Lists.State),
Wait_Lists.State =>+ (Future, State)),
Pre => Poll_Future_Is_Live (Future),
Post => not Poll_Future_Is_Live (Future);
procedure Poll_Poll
(Future : in out Poll_Future;
Event : out Poller_Event;
Init : out Boolean) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future =>+ State,
Event => (State, Future),
Init => (State, Future),
State =>+ (Future, Wait_Lists.State),
Wait_Lists.State =>+ (Future, State)),
Pre => Poll_Future_Is_Live (Future),
Post =>
(if Init then not Poll_Future_Is_Live (Future)
else Poll_Future_Is_Live (Future));
type Remind_Me_Future is limited private with
Preelaborable_Initialization;
function Remind_Me_Future_Is_Live
(Future : Remind_Me_Future) return Boolean with
Ghost,
Global => null,
Depends => (Remind_Me_Future_Is_Live'Result => Future);
procedure Remind_Me
(Time : Ada.Real_Time.Time;
Signaller : Triggers.Signaller;
Future : out Remind_Me_Future) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future => State,
State =>+ (Signaller, Time, Wait_Lists.State),
Wait_Lists.State =>+ (State, Signaller, Time)),
Post => Remind_Me_Future_Is_Live (Future);
procedure Remind_Me_Wait
(Future : in out Remind_Me_Future;
Event : out Remind_Me_Event) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future => null,
Event => (Future, State),
State =>+ (Future, Wait_Lists.State),
Wait_Lists.State =>+ (Future, State)),
Pre => Remind_Me_Future_Is_Live (Future),
Post => not Remind_Me_Future_Is_Live (Future);
procedure Remind_Me_Poll
(Future : in out Remind_Me_Future;
Event : out Remind_Me_Event;
Init : out Boolean) with
Global => (In_Out => (State, Wait_Lists.State)),
Depends =>
(Future =>+ State,
Event => (Future, State),
Init => (State, Future),
State =>+ (Future, Wait_Lists.State),
Wait_Lists.State =>+ (Future, State)),
Pre => Remind_Me_Future_Is_Live (Future),
Post =>
(if Init then not Remind_Me_Future_Is_Live (Future)
else Remind_Me_Future_Is_Live (Future));
private
Max_Read_Futures : constant := 10;
Max_Write_Futures : constant := 10;
Max_Poll_Futures : constant := 10;
Max_Remind_Me_Futures : constant := 10;
Max_Command_Queue_Capacity : constant := 10;
type Read_Future is mod Max_Read_Futures + 1 with
Default_Value => 0;
type Write_Future is mod Max_Write_Futures + 1 with
Default_Value => 0;
type Poll_Future is mod Max_Poll_Futures + 1 with
Default_Value => 0;
type Remind_Me_Future is mod Max_Remind_Me_Futures + 1 with
Default_Value => 0;
package Writer_Event_Channels is new Channels (Writer_Event);
package Reader_Event_Channels is new Channels (Reader_Event);
package Poller_Event_Channels is new Channels (Poller_Event);
package Remind_Me_Event_Channels is new Channels (Remind_Me_Event);
end Linted.IO_Pool;
|
[
{
"context": "-- part of OpenGLAda, (c) 2017 Felix Krause\n-- released under the terms of the MIT license, ",
"end": 44,
"score": 0.9998437166213989,
"start": 32,
"tag": "NAME",
"value": "Felix Krause"
}
] |
src/gl/generated/gl-api-uints.ads
|
Roldak/OpenGLAda
| 79 |
-- part of OpenGLAda, (c) 2017 Felix Krause
-- released under the terms of the MIT license, see the file "COPYING"
-- Autogenerated by Generate, do not edit
package GL.API.UInts is
pragma Preelaborate;
Uniform1 : T51;
Uniform1v : T52;
Uniform2 : T53;
Uniform2v : T54;
Uniform3 : T55;
Uniform3v : T56;
Uniform4 : T57;
Uniform4v : T58;
Uniform_Matrix2 : T59;
Uniform_Matrix3 : T60;
Uniform_Matrix4 : T61;
Vertex_Attrib1 : T62;
Vertex_Attrib2 : T63;
Vertex_Attrib2v : T64;
Vertex_Attrib3 : T65;
Vertex_Attrib3v : T66;
Vertex_Attrib4 : T67;
Vertex_Attrib4v : T68;
end GL.API.UInts;
|
13476
|
-- part of OpenGLAda, (c) 2017 <NAME>
-- released under the terms of the MIT license, see the file "COPYING"
-- Autogenerated by Generate, do not edit
package GL.API.UInts is
pragma Preelaborate;
Uniform1 : T51;
Uniform1v : T52;
Uniform2 : T53;
Uniform2v : T54;
Uniform3 : T55;
Uniform3v : T56;
Uniform4 : T57;
Uniform4v : T58;
Uniform_Matrix2 : T59;
Uniform_Matrix3 : T60;
Uniform_Matrix4 : T61;
Vertex_Attrib1 : T62;
Vertex_Attrib2 : T63;
Vertex_Attrib2v : T64;
Vertex_Attrib3 : T65;
Vertex_Attrib3v : T66;
Vertex_Attrib4 : T67;
Vertex_Attrib4v : T68;
end GL.API.UInts;
| true |
-- part of OpenGLAda, (c) 2017 PI:NAME:<NAME>END_PI
-- released under the terms of the MIT license, see the file "COPYING"
-- Autogenerated by Generate, do not edit
package GL.API.UInts is
pragma Preelaborate;
Uniform1 : T51;
Uniform1v : T52;
Uniform2 : T53;
Uniform2v : T54;
Uniform3 : T55;
Uniform3v : T56;
Uniform4 : T57;
Uniform4v : T58;
Uniform_Matrix2 : T59;
Uniform_Matrix3 : T60;
Uniform_Matrix4 : T61;
Vertex_Attrib1 : T62;
Vertex_Attrib2 : T63;
Vertex_Attrib2v : T64;
Vertex_Attrib3 : T65;
Vertex_Attrib3v : T66;
Vertex_Attrib4 : T67;
Vertex_Attrib4v : T68;
end GL.API.UInts;
|
[
{
"context": "-- SPDX-FileCopyrightText: 2019 Max Reznik <[email protected]>\n--\n-- SPDX-License-Identifi",
"end": 43,
"score": 0.9998579025268555,
"start": 33,
"tag": "NAME",
"value": "Max Reznik"
},
{
"context": "-- SPDX-FileCopyrightText: 2019 Max Reznik <[email protected]>\n--\n-- SPDX-License-Identifier: MIT\n------------",
"end": 63,
"score": 0.9999314546585083,
"start": 45,
"tag": "EMAIL",
"value": "[email protected]"
}
] |
source/nodes/program-nodes-accept_statements.adb
|
reznikmm/gela
| 0 |
-- SPDX-FileCopyrightText: 2019 Max Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
package body Program.Nodes.Accept_Statements is
function Create
(Accept_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Entry_Name : not null Program.Elements.Identifiers
.Identifier_Access;
Left_Bracket_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Entry_Index : Program.Elements.Expressions.Expression_Access;
Right_Bracket_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Left_Bracket_Token_2 : Program.Lexical_Elements
.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token_2 : Program.Lexical_Elements
.Lexical_Element_Access;
Do_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Statements : Program.Element_Vectors.Element_Vector_Access;
Exception_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Exception_Handlers : Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access;
End_Token : Program.Lexical_Elements
.Lexical_Element_Access;
End_Statement_Identifier : Program.Elements.Identifiers.Identifier_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return Accept_Statement is
begin
return Result : Accept_Statement :=
(Accept_Token => Accept_Token, Entry_Name => Entry_Name,
Left_Bracket_Token => Left_Bracket_Token, Entry_Index => Entry_Index,
Right_Bracket_Token => Right_Bracket_Token,
Left_Bracket_Token_2 => Left_Bracket_Token_2,
Parameters => Parameters,
Right_Bracket_Token_2 => Right_Bracket_Token_2, Do_Token => Do_Token,
Statements => Statements, Exception_Token => Exception_Token,
Exception_Handlers => Exception_Handlers, End_Token => End_Token,
End_Statement_Identifier => End_Statement_Identifier,
Semicolon_Token => Semicolon_Token, Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
function Create
(Entry_Name : not null Program.Elements.Identifiers
.Identifier_Access;
Entry_Index : Program.Elements.Expressions.Expression_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Statements : Program.Element_Vectors.Element_Vector_Access;
Exception_Handlers : Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access;
End_Statement_Identifier : Program.Elements.Identifiers.Identifier_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Accept_Statement is
begin
return Result : Implicit_Accept_Statement :=
(Entry_Name => Entry_Name, Entry_Index => Entry_Index,
Parameters => Parameters, Statements => Statements,
Exception_Handlers => Exception_Handlers,
End_Statement_Identifier => End_Statement_Identifier,
Is_Part_Of_Implicit => Is_Part_Of_Implicit,
Is_Part_Of_Inherited => Is_Part_Of_Inherited,
Is_Part_Of_Instance => Is_Part_Of_Instance, Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
overriding function Entry_Name
(Self : Base_Accept_Statement)
return not null Program.Elements.Identifiers.Identifier_Access is
begin
return Self.Entry_Name;
end Entry_Name;
overriding function Entry_Index
(Self : Base_Accept_Statement)
return Program.Elements.Expressions.Expression_Access is
begin
return Self.Entry_Index;
end Entry_Index;
overriding function Parameters
(Self : Base_Accept_Statement)
return Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access is
begin
return Self.Parameters;
end Parameters;
overriding function Statements
(Self : Base_Accept_Statement)
return Program.Element_Vectors.Element_Vector_Access is
begin
return Self.Statements;
end Statements;
overriding function Exception_Handlers
(Self : Base_Accept_Statement)
return Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access is
begin
return Self.Exception_Handlers;
end Exception_Handlers;
overriding function End_Statement_Identifier
(Self : Base_Accept_Statement)
return Program.Elements.Identifiers.Identifier_Access is
begin
return Self.End_Statement_Identifier;
end End_Statement_Identifier;
overriding function Accept_Token
(Self : Accept_Statement)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Accept_Token;
end Accept_Token;
overriding function Left_Bracket_Token
(Self : Accept_Statement)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Left_Bracket_Token;
end Left_Bracket_Token;
overriding function Right_Bracket_Token
(Self : Accept_Statement)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Right_Bracket_Token;
end Right_Bracket_Token;
overriding function Left_Bracket_Token_2
(Self : Accept_Statement)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Left_Bracket_Token_2;
end Left_Bracket_Token_2;
overriding function Right_Bracket_Token_2
(Self : Accept_Statement)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Right_Bracket_Token_2;
end Right_Bracket_Token_2;
overriding function Do_Token
(Self : Accept_Statement)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Do_Token;
end Do_Token;
overriding function Exception_Token
(Self : Accept_Statement)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Exception_Token;
end Exception_Token;
overriding function End_Token
(Self : Accept_Statement)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.End_Token;
end End_Token;
overriding function Semicolon_Token
(Self : Accept_Statement)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Semicolon_Token;
end Semicolon_Token;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Accept_Statement)
return Boolean is
begin
return Self.Is_Part_Of_Implicit;
end Is_Part_Of_Implicit;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Accept_Statement)
return Boolean is
begin
return Self.Is_Part_Of_Inherited;
end Is_Part_Of_Inherited;
overriding function Is_Part_Of_Instance
(Self : Implicit_Accept_Statement)
return Boolean is
begin
return Self.Is_Part_Of_Instance;
end Is_Part_Of_Instance;
procedure Initialize (Self : in out Base_Accept_Statement'Class) is
begin
Set_Enclosing_Element (Self.Entry_Name, Self'Unchecked_Access);
if Self.Entry_Index.Assigned then
Set_Enclosing_Element (Self.Entry_Index, Self'Unchecked_Access);
end if;
for Item in Self.Parameters.Each_Element loop
Set_Enclosing_Element (Item.Element, Self'Unchecked_Access);
end loop;
for Item in Self.Statements.Each_Element loop
Set_Enclosing_Element (Item.Element, Self'Unchecked_Access);
end loop;
for Item in Self.Exception_Handlers.Each_Element loop
Set_Enclosing_Element (Item.Element, Self'Unchecked_Access);
end loop;
if Self.End_Statement_Identifier.Assigned then
Set_Enclosing_Element
(Self.End_Statement_Identifier, Self'Unchecked_Access);
end if;
null;
end Initialize;
overriding function Is_Accept_Statement
(Self : Base_Accept_Statement)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Accept_Statement;
overriding function Is_Statement
(Self : Base_Accept_Statement)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Statement;
overriding procedure Visit
(Self : not null access Base_Accept_Statement;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is
begin
Visitor.Accept_Statement (Self);
end Visit;
overriding function To_Accept_Statement_Text
(Self : in out Accept_Statement)
return Program.Elements.Accept_Statements.Accept_Statement_Text_Access is
begin
return Self'Unchecked_Access;
end To_Accept_Statement_Text;
overriding function To_Accept_Statement_Text
(Self : in out Implicit_Accept_Statement)
return Program.Elements.Accept_Statements.Accept_Statement_Text_Access is
pragma Unreferenced (Self);
begin
return null;
end To_Accept_Statement_Text;
end Program.Nodes.Accept_Statements;
|
7205
|
-- SPDX-FileCopyrightText: 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
package body Program.Nodes.Accept_Statements is
function Create
(Accept_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Entry_Name : not null Program.Elements.Identifiers
.Identifier_Access;
Left_Bracket_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Entry_Index : Program.Elements.Expressions.Expression_Access;
Right_Bracket_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Left_Bracket_Token_2 : Program.Lexical_Elements
.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token_2 : Program.Lexical_Elements
.Lexical_Element_Access;
Do_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Statements : Program.Element_Vectors.Element_Vector_Access;
Exception_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Exception_Handlers : Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access;
End_Token : Program.Lexical_Elements
.Lexical_Element_Access;
End_Statement_Identifier : Program.Elements.Identifiers.Identifier_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return Accept_Statement is
begin
return Result : Accept_Statement :=
(Accept_Token => Accept_Token, Entry_Name => Entry_Name,
Left_Bracket_Token => Left_Bracket_Token, Entry_Index => Entry_Index,
Right_Bracket_Token => Right_Bracket_Token,
Left_Bracket_Token_2 => Left_Bracket_Token_2,
Parameters => Parameters,
Right_Bracket_Token_2 => Right_Bracket_Token_2, Do_Token => Do_Token,
Statements => Statements, Exception_Token => Exception_Token,
Exception_Handlers => Exception_Handlers, End_Token => End_Token,
End_Statement_Identifier => End_Statement_Identifier,
Semicolon_Token => Semicolon_Token, Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
function Create
(Entry_Name : not null Program.Elements.Identifiers
.Identifier_Access;
Entry_Index : Program.Elements.Expressions.Expression_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Statements : Program.Element_Vectors.Element_Vector_Access;
Exception_Handlers : Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access;
End_Statement_Identifier : Program.Elements.Identifiers.Identifier_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Accept_Statement is
begin
return Result : Implicit_Accept_Statement :=
(Entry_Name => Entry_Name, Entry_Index => Entry_Index,
Parameters => Parameters, Statements => Statements,
Exception_Handlers => Exception_Handlers,
End_Statement_Identifier => End_Statement_Identifier,
Is_Part_Of_Implicit => Is_Part_Of_Implicit,
Is_Part_Of_Inherited => Is_Part_Of_Inherited,
Is_Part_Of_Instance => Is_Part_Of_Instance, Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
overriding function Entry_Name
(Self : Base_Accept_Statement)
return not null Program.Elements.Identifiers.Identifier_Access is
begin
return Self.Entry_Name;
end Entry_Name;
overriding function Entry_Index
(Self : Base_Accept_Statement)
return Program.Elements.Expressions.Expression_Access is
begin
return Self.Entry_Index;
end Entry_Index;
overriding function Parameters
(Self : Base_Accept_Statement)
return Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access is
begin
return Self.Parameters;
end Parameters;
overriding function Statements
(Self : Base_Accept_Statement)
return Program.Element_Vectors.Element_Vector_Access is
begin
return Self.Statements;
end Statements;
overriding function Exception_Handlers
(Self : Base_Accept_Statement)
return Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access is
begin
return Self.Exception_Handlers;
end Exception_Handlers;
overriding function End_Statement_Identifier
(Self : Base_Accept_Statement)
return Program.Elements.Identifiers.Identifier_Access is
begin
return Self.End_Statement_Identifier;
end End_Statement_Identifier;
overriding function Accept_Token
(Self : Accept_Statement)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Accept_Token;
end Accept_Token;
overriding function Left_Bracket_Token
(Self : Accept_Statement)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Left_Bracket_Token;
end Left_Bracket_Token;
overriding function Right_Bracket_Token
(Self : Accept_Statement)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Right_Bracket_Token;
end Right_Bracket_Token;
overriding function Left_Bracket_Token_2
(Self : Accept_Statement)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Left_Bracket_Token_2;
end Left_Bracket_Token_2;
overriding function Right_Bracket_Token_2
(Self : Accept_Statement)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Right_Bracket_Token_2;
end Right_Bracket_Token_2;
overriding function Do_Token
(Self : Accept_Statement)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Do_Token;
end Do_Token;
overriding function Exception_Token
(Self : Accept_Statement)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Exception_Token;
end Exception_Token;
overriding function End_Token
(Self : Accept_Statement)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.End_Token;
end End_Token;
overriding function Semicolon_Token
(Self : Accept_Statement)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Semicolon_Token;
end Semicolon_Token;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Accept_Statement)
return Boolean is
begin
return Self.Is_Part_Of_Implicit;
end Is_Part_Of_Implicit;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Accept_Statement)
return Boolean is
begin
return Self.Is_Part_Of_Inherited;
end Is_Part_Of_Inherited;
overriding function Is_Part_Of_Instance
(Self : Implicit_Accept_Statement)
return Boolean is
begin
return Self.Is_Part_Of_Instance;
end Is_Part_Of_Instance;
procedure Initialize (Self : in out Base_Accept_Statement'Class) is
begin
Set_Enclosing_Element (Self.Entry_Name, Self'Unchecked_Access);
if Self.Entry_Index.Assigned then
Set_Enclosing_Element (Self.Entry_Index, Self'Unchecked_Access);
end if;
for Item in Self.Parameters.Each_Element loop
Set_Enclosing_Element (Item.Element, Self'Unchecked_Access);
end loop;
for Item in Self.Statements.Each_Element loop
Set_Enclosing_Element (Item.Element, Self'Unchecked_Access);
end loop;
for Item in Self.Exception_Handlers.Each_Element loop
Set_Enclosing_Element (Item.Element, Self'Unchecked_Access);
end loop;
if Self.End_Statement_Identifier.Assigned then
Set_Enclosing_Element
(Self.End_Statement_Identifier, Self'Unchecked_Access);
end if;
null;
end Initialize;
overriding function Is_Accept_Statement
(Self : Base_Accept_Statement)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Accept_Statement;
overriding function Is_Statement
(Self : Base_Accept_Statement)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Statement;
overriding procedure Visit
(Self : not null access Base_Accept_Statement;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is
begin
Visitor.Accept_Statement (Self);
end Visit;
overriding function To_Accept_Statement_Text
(Self : in out Accept_Statement)
return Program.Elements.Accept_Statements.Accept_Statement_Text_Access is
begin
return Self'Unchecked_Access;
end To_Accept_Statement_Text;
overriding function To_Accept_Statement_Text
(Self : in out Implicit_Accept_Statement)
return Program.Elements.Accept_Statements.Accept_Statement_Text_Access is
pragma Unreferenced (Self);
begin
return null;
end To_Accept_Statement_Text;
end Program.Nodes.Accept_Statements;
| true |
-- SPDX-FileCopyrightText: 2019 PI:NAME:<NAME>END_PI <PI:EMAIL:<EMAIL>END_PI>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
package body Program.Nodes.Accept_Statements is
function Create
(Accept_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Entry_Name : not null Program.Elements.Identifiers
.Identifier_Access;
Left_Bracket_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Entry_Index : Program.Elements.Expressions.Expression_Access;
Right_Bracket_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Left_Bracket_Token_2 : Program.Lexical_Elements
.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token_2 : Program.Lexical_Elements
.Lexical_Element_Access;
Do_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Statements : Program.Element_Vectors.Element_Vector_Access;
Exception_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Exception_Handlers : Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access;
End_Token : Program.Lexical_Elements
.Lexical_Element_Access;
End_Statement_Identifier : Program.Elements.Identifiers.Identifier_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return Accept_Statement is
begin
return Result : Accept_Statement :=
(Accept_Token => Accept_Token, Entry_Name => Entry_Name,
Left_Bracket_Token => Left_Bracket_Token, Entry_Index => Entry_Index,
Right_Bracket_Token => Right_Bracket_Token,
Left_Bracket_Token_2 => Left_Bracket_Token_2,
Parameters => Parameters,
Right_Bracket_Token_2 => Right_Bracket_Token_2, Do_Token => Do_Token,
Statements => Statements, Exception_Token => Exception_Token,
Exception_Handlers => Exception_Handlers, End_Token => End_Token,
End_Statement_Identifier => End_Statement_Identifier,
Semicolon_Token => Semicolon_Token, Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
function Create
(Entry_Name : not null Program.Elements.Identifiers
.Identifier_Access;
Entry_Index : Program.Elements.Expressions.Expression_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Statements : Program.Element_Vectors.Element_Vector_Access;
Exception_Handlers : Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access;
End_Statement_Identifier : Program.Elements.Identifiers.Identifier_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Accept_Statement is
begin
return Result : Implicit_Accept_Statement :=
(Entry_Name => Entry_Name, Entry_Index => Entry_Index,
Parameters => Parameters, Statements => Statements,
Exception_Handlers => Exception_Handlers,
End_Statement_Identifier => End_Statement_Identifier,
Is_Part_Of_Implicit => Is_Part_Of_Implicit,
Is_Part_Of_Inherited => Is_Part_Of_Inherited,
Is_Part_Of_Instance => Is_Part_Of_Instance, Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
overriding function Entry_Name
(Self : Base_Accept_Statement)
return not null Program.Elements.Identifiers.Identifier_Access is
begin
return Self.Entry_Name;
end Entry_Name;
overriding function Entry_Index
(Self : Base_Accept_Statement)
return Program.Elements.Expressions.Expression_Access is
begin
return Self.Entry_Index;
end Entry_Index;
overriding function Parameters
(Self : Base_Accept_Statement)
return Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access is
begin
return Self.Parameters;
end Parameters;
overriding function Statements
(Self : Base_Accept_Statement)
return Program.Element_Vectors.Element_Vector_Access is
begin
return Self.Statements;
end Statements;
overriding function Exception_Handlers
(Self : Base_Accept_Statement)
return Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access is
begin
return Self.Exception_Handlers;
end Exception_Handlers;
overriding function End_Statement_Identifier
(Self : Base_Accept_Statement)
return Program.Elements.Identifiers.Identifier_Access is
begin
return Self.End_Statement_Identifier;
end End_Statement_Identifier;
overriding function Accept_Token
(Self : Accept_Statement)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Accept_Token;
end Accept_Token;
overriding function Left_Bracket_Token
(Self : Accept_Statement)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Left_Bracket_Token;
end Left_Bracket_Token;
overriding function Right_Bracket_Token
(Self : Accept_Statement)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Right_Bracket_Token;
end Right_Bracket_Token;
overriding function Left_Bracket_Token_2
(Self : Accept_Statement)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Left_Bracket_Token_2;
end Left_Bracket_Token_2;
overriding function Right_Bracket_Token_2
(Self : Accept_Statement)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Right_Bracket_Token_2;
end Right_Bracket_Token_2;
overriding function Do_Token
(Self : Accept_Statement)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Do_Token;
end Do_Token;
overriding function Exception_Token
(Self : Accept_Statement)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Exception_Token;
end Exception_Token;
overriding function End_Token
(Self : Accept_Statement)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.End_Token;
end End_Token;
overriding function Semicolon_Token
(Self : Accept_Statement)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Semicolon_Token;
end Semicolon_Token;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Accept_Statement)
return Boolean is
begin
return Self.Is_Part_Of_Implicit;
end Is_Part_Of_Implicit;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Accept_Statement)
return Boolean is
begin
return Self.Is_Part_Of_Inherited;
end Is_Part_Of_Inherited;
overriding function Is_Part_Of_Instance
(Self : Implicit_Accept_Statement)
return Boolean is
begin
return Self.Is_Part_Of_Instance;
end Is_Part_Of_Instance;
procedure Initialize (Self : in out Base_Accept_Statement'Class) is
begin
Set_Enclosing_Element (Self.Entry_Name, Self'Unchecked_Access);
if Self.Entry_Index.Assigned then
Set_Enclosing_Element (Self.Entry_Index, Self'Unchecked_Access);
end if;
for Item in Self.Parameters.Each_Element loop
Set_Enclosing_Element (Item.Element, Self'Unchecked_Access);
end loop;
for Item in Self.Statements.Each_Element loop
Set_Enclosing_Element (Item.Element, Self'Unchecked_Access);
end loop;
for Item in Self.Exception_Handlers.Each_Element loop
Set_Enclosing_Element (Item.Element, Self'Unchecked_Access);
end loop;
if Self.End_Statement_Identifier.Assigned then
Set_Enclosing_Element
(Self.End_Statement_Identifier, Self'Unchecked_Access);
end if;
null;
end Initialize;
overriding function Is_Accept_Statement
(Self : Base_Accept_Statement)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Accept_Statement;
overriding function Is_Statement
(Self : Base_Accept_Statement)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Statement;
overriding procedure Visit
(Self : not null access Base_Accept_Statement;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is
begin
Visitor.Accept_Statement (Self);
end Visit;
overriding function To_Accept_Statement_Text
(Self : in out Accept_Statement)
return Program.Elements.Accept_Statements.Accept_Statement_Text_Access is
begin
return Self'Unchecked_Access;
end To_Accept_Statement_Text;
overriding function To_Accept_Statement_Text
(Self : in out Implicit_Accept_Statement)
return Program.Elements.Accept_Statements.Accept_Statement_Text_Access is
pragma Unreferenced (Self);
begin
return null;
end To_Accept_Statement_Text;
end Program.Nodes.Accept_Statements;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.