text stringlengths 0 234 |
|---|
Function Body: new Ada.Unchecked_Conversion (Octets_2, Unsigned_16); |
function Unchecked_To_Unsigned_32 is |
new Ada.Unchecked_Conversion (Octets_4, Unsigned_32); |
function Unchecked_To_Octets_2 is |
new Ada.Unchecked_Conversion (Unsigned_16, Octets_2); |
function Unchecked_To_Octets_4 is |
new Ada.Unchecked_Conversion (Unsigned_32, Octets_4); |
function Swap_Bus (X : Unsigned_16) return Unsigned_16 |
is |
O : Octets_2 with |
Address => X'Address, Alignment => Unsigned_16'Alignment; |
begin |
if System.Default_Bit_Order = System.Low_Order_First then |
return X; |
else |
return Unchecked_To_Unsigned_16 ((O (1), O (0))); |
end if; |
end Swap_Bus; |
function Swap_Bus (X : Unsigned_32) return Unsigned_32 |
is |
O : Octets_4 with |
Address => X'Address, Alignment => Unsigned_32'Alignment; |
begin |
if System.Default_Bit_Order = System.Low_Order_First then |
return X; |
else |
return Unchecked_To_Unsigned_32 ((O (3), O (2), O (1), O (0))); |
end if; |
end Swap_Bus; |
function Swap_Bus (X : Octets_2) return Unsigned_16 |
is |
begin |
if System.Default_Bit_Order = System.Low_Order_First then |
return Unchecked_To_Unsigned_16 (X); |
else |
return Unchecked_To_Unsigned_16 ((X (1), X (0))); |
end if; |
end Swap_Bus; |
function Swap_Bus (X : Octets_4) return Unsigned_32 |
is |
begin |
if System.Default_Bit_Order = System.Low_Order_First then |
return Unchecked_To_Unsigned_32 (X); |
else |
return Unchecked_To_Unsigned_32 ((X (3), X (2), X (1), X (0))); |
end if; |
end Swap_Bus; |
function Swap_Bus (X : Unsigned_16) return Octets_2 |
is |
begin |
if System.Default_Bit_Order = System.Low_Order_First then |
return Unchecked_To_Octets_2 (X); |
else |
declare |
O : constant Octets_2 := Unchecked_To_Octets_2 (X); |
begin |
return (O (1), O (0)); |
Function Definition: function Object_Exist |
Function Body: (This : Object_Dictionary'Class; |
Index : Object_Index) return Boolean |
is (This.Index_Map (Index) /= No_Index); |
function Entry_Exist |
(This : Object_Dictionary'Class; |
Index : Object_Index; |
Subindex : Object_Subindex) return Boolean |
is |
Arr_Idx : constant Index_Type := This.Index_Map (Index); |
begin |
return Arr_Idx /= No_Index and then |
Subindex in This.Objects (Arr_Idx).Entries'Range; |
end Entry_Exist; |
function Maximum_Nof_Entries |
(This : Object_Dictionary; |
Index : Object_Index) |
return Natural |
is (This.Object (Index).Entries'Length); |
function Is_Entry_Compatible |
(This : Object_Dictionary; |
An_Entry : Entry_Base'Class; |
Index : Object_Index; |
Subindex : Object_Subindex) |
return Boolean |
is |
use type Ada.Tags.Tag; |
OD_Entry : constant Entry_Ref := This.Object (Index).Entries (Subindex); |
begin |
return OD_Entry'Tag = An_Entry'Tag; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.