text
stringlengths
0
234
is
begin
First := +to_String (the_Range.Child (1).Text);
Last := +to_String (the_Range.Child (3).Text);
end parse_Range;
procedure parse_subtype_Indication (Node : in LAL.Subtype_Indication;
new_Indication : out AdaM.subtype_Indication.item'Class)
is
index_Type : constant String := to_String (Node.F_Name.Text);
Constraint : constant LAL.Range_Constraint := LAL.Range_Constraint (Node.Child (3));
begin
Depth := Depth + 1;
log ("parse_subtype_Indication");
-- Parse children.
--
new_Indication.main_Type_is (Environ.find (Identifier (index_Type)));
if Constraint /= null
then
if Constraint.Child (1).Kind = LAL.Ada_Bin_Op
then
new_Indication.is_Constrained (True);
declare
the_Range : constant LAL.Bin_Op := LAL.Bin_Op (Constraint.Child (1));
First : Text;
Last : Text;
begin
parse_Range (the_Range, First, Last);
new_Indication.First_is (+First);
new_Indication.Last_is (+Last);
Function Definition: procedure run_Tests is new AUnit.Run.Test_Runner(GStreamer.tests.Rtsp_Suit.Suit);
Function Body: begin
Run_Tests (Reporter);
Function Definition: function Convert is new Ada.Unchecked_Conversion (Source => GcharPtr , Target => Interfaces.C.Strings.Chars_Ptr);
Function Body: function To_Ada ( C : access constant Glib.Gchar) return String is
begin
return (if C /= null
then
Interfaces.C.Strings.Value (Convert (C.all'Unrestricted_Access))
else
"");
Function Definition: procedure Simple_Producer is
Function Body: Config : Kafka.Config_Type;
Handle : Kafka.Handle_Type;
Topic : Kafka.Topic_Type;
package CommandTopic is new GetCommandArgument ("-t:", "--topic:", "Topic name to use");
begin
Ada.Text_IO.Put_Line("Kafka version: " & Kafka.Version);
-- Create a new config object
Config := Kafka.Config.Create;
-- Configure your properties
Kafka.Config.Set(Config, "client.id", GNAT.Sockets.Host_name);
Kafka.Config.Set(Config, "bootstrap.servers", "localhost:9092");
-- Create handle
Handle := Kafka.Create_Handle(Kafka.RD_KAFKA_PRODUCER, Config);
-- Create topic handle
Topic := Kafka.Topic.Create_Topic_Handle(Handle,
CommandTopic.Parse_Command_Line("test_topic")); -- topic must already exist
-- Producing a String
Kafka.Produce(Topic,
Kafka.RD_KAFKA_PARTITION_UA,
"World", -- payload
"Hello", -- key
System.Null_Address);
-- Producing binary data
declare
type Some_Message is record
A : Interfaces.Unsigned_32;
B : Interfaces.Unsigned_64;
C : Interfaces.Unsigned_8;
end record
with Convention => C;
for Some_Message use record
A at 0 range 0 .. 31;
B at 4 range 0 .. 63;
C at 12 range 0 .. 7;
end record;
for Some_Message'Bit_Order use System.High_Order_First;